It is currently September 29th, 2022, 4:59 pm

[Bug] Histogram doesn't work if measure's MinValue is not 0

Report bugs with the Rainmeter application and suggest features.
User avatar
Brian
Developer
Posts: 2512
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug] Histogram doesn't work if measure's MinValue is not 0

Post by Brian »

killall-q wrote: September 18th, 2022, 3:07 pm Everything passes now. A last couple tests that I don't even know what the result should be:

Code: Select all

Formula=-40
MinValue=0
MaxValue=-50

Code: Select all

Formula=40
MinValue=50
MaxValue=0
For these, every meter returns nothing (equivalent to no measure value), except line meter displays results as if min and max value weren't swapped.
Yeah, even the Rainmeter version prior to these changes displayed some odd results for these cases.

I will look into it. But to be honest, I probably won't spend too much time with it since having the MaxValue lower than the MinValue really doesn't make any sense. Maybe a simple log message will do in this case.

-Brian
User avatar
balala
Rainmeter Sage
Posts: 14565
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug] Histogram doesn't work if measure's MinValue is not 0

Post by balala »

Brian wrote: September 18th, 2022, 8:55 am With the previous "test" build, it should show the histogram okay, but not the line meter (it just stays at the bottom of the meter). Remember that the initial value of the measure is 0, so when the meter (both Histogram and Line) are initialized, it fills the "drawing" buffer with 0's. Then the Histogram and Line draw where 0 would be located on the graph before filling the drawing buffer with the measures value over time (for both test cases, this value is -40). Hopefully that makes sense.
Definitely makes. My bad, I missed that test release, that's why I posted my comment, which in this context doesn't make sense.
My bad, apologizing...
User avatar
killall-q
Posts: 299
Joined: August 14th, 2009, 8:04 am

Re: [Bug] Histogram doesn't work if measure's MinValue is not 0

Post by killall-q »

IMO, for MaxValue < MinValue, the latest test release behavior of displaying nothing is ideal, for the use case of these options being dynamically set. For that, only line meter needs to be brought into line.
User avatar
Brian
Developer
Posts: 2512
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug] Histogram doesn't work if measure's MinValue is not 0

Post by Brian »

killall-q wrote: September 18th, 2022, 6:16 pm IMO, for MaxValue < MinValue, the latest test release behavior of displaying nothing is ideal, for the use case of these options being dynamically set. For that, only line meter needs to be brought into line.
I agree, "nothing" is ideal.

I think I fixed all the issues. There was also another issue if the MinValue was equal to MaxValue, where the Histogram and Line meters didn't match.

So, all the "graph" type meters (Bar, Roundline, Histogram, Line), should all now draw similarly with the same inputs and similar meter options.

This will be available in the next release.

-Brian

PS - I added a warning message when the MinValue is equal to or greater than MaxValue. While it is a warning message, it only appears while in "Debug mode".