If your code has changed, perhaps the full skin being posted, as code in the code block, or an rmskin file.
That way we can track your progress, and perhaps find the errant code where your results should be coming from properly.
It is currently April 25th, 2024, 3:28 pm
Calc measure conditional, meter not showing value
-
- Posts: 1366
- Joined: September 7th, 2020, 2:24 pm
- Location: QLD, Australia
Re: Calc measure conditional, meter not showing value
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
-
- Rainmeter Sage
- Posts: 16169
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Calc measure conditional, meter not showing value
-
- Rainmeter Sage
- Posts: 16169
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Calc measure conditional, meter not showing value
First let's start with something obvious: the MaxValue of the [measureCore01LowValue] measure has to be different in the two cases (when the [measureCore01Sum] is below or above 100):
- When the condition is true the measureCPU[&measureCore01Low]/measureCore01Sum formula has to be applied. The largest value of the measureCPU0/measureCore01Sum or measureCPU1/measureCore01Sum has to be 1, so in this case MaxValue has to be set to MaxValue=1.
- When the condition is false the measureCPU[&measureCore01Low] has to be applied. But in this case the largest value of the measureCPU0 or measureCPU1 measure is 100, so in this case MaxValue has to be MaxValue=100.
-
- Posts: 24
- Joined: March 30th, 2022, 5:31 pm
- Location: Sweden
Re: Calc measure conditional, meter not showing value
Aaaah! Silly me! Thank you!balala wrote: ↑April 22nd, 2022, 6:32 am First let's start with something obvious: the MaxValue of the [measureCore01LowValue] measure has to be different in the two cases (when the [measureCore01Sum] is below or above 100):So on first step replace the MaxValue option of the [measureCore01LowValue] measure with the following one: MaxValue=([measureCore01Sum]>100?1:100)
- When the condition is true the measureCPU[&measureCore01Low]/measureCore01Sum formula has to be applied. The largest value of the measureCPU0/measureCore01Sum or measureCPU1/measureCore01Sum has to be 1, so in this case MaxValue has to be set to MaxValue=1.
- When the condition is false the measureCPU[&measureCore01Low] has to be applied. But in this case the largest value of the measureCPU0 or measureCPU1 measure is 100, so in this case MaxValue has to be MaxValue=100.
30 / 130 may be 23%, but it's also just 0.23. Not 23 which the bar meter sort of expects and which would make any sense in trying to display on a 27 pixel tall bar.
I mean it probably technically worked. It's just that it's drawing a tiny little gray bar that effectively can't be seen.
I ended up adjusting the formula instead by multiplying it by 100 to get a value similar to the pure value from the CPU measures.
Code: Select all
[measureCore01LowValue]
Measure=Calc
Formula=(measureCore01Sum>100?measureCPU[&measureCore01Low]/measureCore01Sum*100:measureCPU[&measureCore01Low])
MinValue=0
MaxValue=100
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 16169
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Calc measure conditional, meter not showing value
Exactly.
Yep, this is another solution, beside what I proposed with manipulating the MaxValue. Good job!
Did you finally got the skin working as expected?
-
- Posts: 24
- Joined: March 30th, 2022, 5:31 pm
- Location: Sweden
-
- Posts: 1366
- Joined: September 7th, 2020, 2:24 pm
- Location: QLD, Australia
Re: Calc measure conditional, meter not showing value
Right. I carried that functionality to the bar meter - incorrectly it seems.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
-
- Rainmeter Sage
- Posts: 16169
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Calc measure conditional, meter not showing value
I'm glad!
Don't worry, it happens sometimes...