It is currently March 28th, 2024, 10:18 pm
Get help with creating, editing & fixing problems with skins
deltarho
Posts: 12 Joined: May 6th, 2018, 3:40 pm
Post
by deltarho » May 6th, 2018, 3:53 pm
The following two measures are working fine
Code: Select all
[MeasurePageUsed]
Measure=Calc
Formula=MeasureSwapUsed - MeasurePhysicalUsed
[MeasurePagePercent]
Measure=Calc
Formula=MeasurePageUsed / MeasurePageTotal
However the next three are not.
Code: Select all
[MeasurePeak]
Measure=Calc
Formula=0
[MeasurePeakUsed]
IfCondition=MeasurePageUsed > MeasurePeak
IfTrueAction=[!SetOption MeasurePeak Value MeasurePageUsed]
[MeasurePeakPercent]
Measure=Calc
Formula=MeasurePeak / MeasurePageTotal
I am getting 0% for MeasurePeakPercent
I should add that I am a newbie to Rainmeter skinning so the learning curve is a tad steep at the moment.
balala
Rainmeter Sage
Posts: 16110 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » May 6th, 2018, 4:13 pm
deltarho wrote: I am getting 0% for MeasurePeakPercent
Obviously. [MeasurePeak], according to its
Formula=0 option, is always 0. This divided with [MeasurePageTotal] always gives 0 (at least while [MeasurePageTotal] is different then 0). Everything seem ok, at least from the posted measures.
ikarus1969
Posts: 571 Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria
Post
by ikarus1969 » May 6th, 2018, 4:34 pm
I would move the "
IfCondition " and "
IfTrueAction " to the "MeasurePeak" measure and change the "Value" from the "IfTrueAction" to "Formula" (because there's no "Value" but a "Formula" property of the Calc measure). Now you can delete the remaining "
MeasurePeakUsed " measure.
then it should work
Code: Select all
[MeasurePeak]
Measure=Calc
Formula=0
IfCondition=MeasurePageUsed > MeasurePeak
IfTrueAction=[!SetOption MeasurePeak Formula MeasurePageUsed]
[MeasurePeakPercent]
Measure=Calc
Formula=MeasurePeak / MeasurePageTotal
balala
Rainmeter Sage
Posts: 16110 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » May 6th, 2018, 5:20 pm
ikarus1969 wrote: change the "Value" from the "IfTrueAction" to "Formula" (because there's no "Value" but a "Formula" property of the Calc measure).]
Very good, I didn't realize this mistake, when I initially looked to the original piece of code.
deltarho
Posts: 12 Joined: May 6th, 2018, 3:40 pm
Post
by deltarho » May 6th, 2018, 6:31 pm
Thank you, but not quite there yet.
Suppose I have Usage=7 and Peak=7 and I open an application such that Usage=9. Peak will follow that with Peak=9.
However, if I then close the application and Usage=7 again then Peak follows it. I want Peak to remain at 9.
My original logic was flawed by having Formula=0 so it got reset on every pass. I changed that to Formula=MeasurePeak thinking that Formula would use the last MeasurePeak. However, Peak is still following Usage.
balala
Rainmeter Sage
Posts: 16110 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » May 6th, 2018, 6:54 pm
deltarho wrote: Suppose I have Usage=7 and Peak=7 and I open an application such that Usage=9. Peak will follow that with Peak=9.
However, if I then close the application and Usage=7 again then Peak follows it. I want Peak to remain at 9.
Not sure I can follow you. You would like to have the Peak at the largest value achieved so far by Usage?
deltarho
Posts: 12 Joined: May 6th, 2018, 3:40 pm
Post
by deltarho » May 6th, 2018, 6:58 pm
balala wrote: You would like to have the Peak at the largest value achieved so far by Usage?
Yes.
balala
Rainmeter Sage
Posts: 16110 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » May 6th, 2018, 7:03 pm
deltarho wrote: Yes.
Ok, the following Calc measure returns the largest value achieved so far by the [MeasurePageUsed] measure:
Code: Select all
[MeasurePeak]
Measure=Calc
Formula=( Max ( MeasurePeak, MeasurePageUsed ))
deltarho
Posts: 12 Joined: May 6th, 2018, 3:40 pm
Post
by deltarho » May 6th, 2018, 7:21 pm
Wow! Thanks balala. Had not seen Max with my readings so far. Need to spend sometime checking out the Formulas page.
Thanks again.
balala
Rainmeter Sage
Posts: 16110 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » May 6th, 2018, 7:31 pm
deltarho wrote: Need to spend sometime checking out the Formulas page.
Definitely.
I'm glad if you got it working.