It is currently April 25th, 2024, 3:28 pm

Calc measure conditional, meter not showing value

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Calc measure conditional, meter not showing value

Post by CodeCode »

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.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Calc measure conditional, meter not showing value

Post by balala »

CodeCode wrote: April 21st, 2022, 12:45 am AutyoScale would then go in the bar meter.
InterClaw wrote: April 21st, 2022, 5:40 pm Did this, but it doesn't seem to help. :/ Still no gray bar when above 100% total for the core.
Useless. AutoScale can't be used on Bar meter. It has to be used most frequently on String, but also can on Line and on Histogram meters. It does different things on these types of meters, but at least it can be used. But not on Bar meters.
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Calc measure conditional, meter not showing value

Post by balala »

InterClaw wrote: April 20th, 2022, 9:48 pm So the gray bar should not be drawing 30%, it should be drawing 23%. This is what I'm trying to achieve with the main formula:
Formula=(measureCore01Sum>100?measureCPU[&measureCore01Low]/measureCore01Sum:measureCPU[&measureCore01Low])
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.
So on first step replace the MaxValue option of the [measureCore01LowValue] measure with the following one: MaxValue=([measureCore01Sum]>100?1:100)
User avatar
InterClaw
Posts: 24
Joined: March 30th, 2022, 5:31 pm
Location: Sweden

Re: Calc measure conditional, meter not showing value

Post by InterClaw »

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):
  • 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.
So on first step replace the MaxValue option of the [measureCore01LowValue] measure with the following one: MaxValue=([measureCore01Sum]>100?1:100)
Aaaah! Silly me! :? Thank you!

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
Thanks again for the help! :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Calc measure conditional, meter not showing value

Post by balala »

InterClaw wrote: April 22nd, 2022, 6:07 pm It's just that it's drawing a tiny little gray bar that effectively can't be seen. :)
Exactly.
InterClaw wrote: April 22nd, 2022, 6:07 pm 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.
Yep, this is another solution, beside what I proposed with manipulating the MaxValue. Good job!

Did you finally got the skin working as expected?
User avatar
InterClaw
Posts: 24
Joined: March 30th, 2022, 5:31 pm
Location: Sweden

Re: Calc measure conditional, meter not showing value

Post by InterClaw »

balala wrote: April 22nd, 2022, 6:18 pm Did you finally got the skin working as expected?
I sure did, thanks a lot! Liking my CPU bars now. :)
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Calc measure conditional, meter not showing value

Post by CodeCode »

balala wrote: April 22nd, 2022, 6:15 am Useless. AutoScale can't be used on Bar meter. It has to be used most frequently on String, but also can on Line and on Histogram meters. It does different things on these types of meters, but at least it can be used. But not on Bar meters.
Right. I carried that functionality to the bar meter - incorrectly it seems.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Calc measure conditional, meter not showing value

Post by balala »

InterClaw wrote: April 22nd, 2022, 9:06 pm I sure did, thanks a lot! Liking my CPU bars now. :)
I'm glad! :great:
CodeCode wrote: April 23rd, 2022, 2:38 am Right. I carried that functionality to the bar meter - incorrectly it seems.
Don't worry, it happens sometimes...