It is currently April 26th, 2024, 1:27 am

How do measures/meters update?

Get help with creating, editing & fixing problems with skins
User avatar
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am
Location: Canada

How do measures/meters update?

Post by qwerky »

First, excepting certain cases such as WebMeasures, do all measures and meters update in the order that they appear in the skin; and, as each measure updates, does it complete all of its IfActions, etc. before moving on to the next measure/meter?

Second, in the example:

Code: Select all

[Variables]
TestVar=1

[msrTestToggle]
Measure=Calc
UpdateDivider=-1
DynamicVariables=1
Formula=-1
IfConditionMode=1
IfCondition=msrTestToggle>=0
IfTrueAction=[!SetVariable TestVar "(#TestVar# = 1 ? 0 : 1)"]
IfCondition2=1
IfTrueAction2=[!SetOption msrTestToggle Formula "#TestVar#"]

[mtrTestToggle]
Meter=String
Text="Just something to click on."
LeftMouseUpAction=[!UpdateMeasure msrTestToggle]
where the measure is updated by clicking on the meter, what is the sequence of events? I am attempting to create a measure which does nothing on refresh, but only updates and executes its IfActions when updated manually.
User avatar
GTI.H
Posts: 75
Joined: December 15th, 2018, 3:35 am

Re: How do measures/meters update?

Post by GTI.H »

I also have this doubt, sometimes I think I know, I test and I continue without a certainty.
I've read the help many times.

A good way to know the sequence of events is to add [!Log "Some text"] in strategic places and check the clocks in About/Register.


--
Regards
GTI
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How do measures/meters update?

Post by Yincognito »

qwerky wrote: March 5th, 2019, 10:16 pmFirst, excepting certain cases such as WebMeasures, do all measures and meters update in the order that they appear in the skin; and, as each measure updates, does it complete all of its IfActions, etc. before moving on to the next measure/meter?
Yes, to both questions.
qwerky wrote: March 5th, 2019, 10:16 pmSecond, in the example {below}, where the measure is updated by clicking on the meter, what is the sequence of events?
Sequence of events, as far as I can tell (if you think I'm mistaken, please correct):
- TestVar is made 1 in [Variables]
- msrTestToggle is made -1 in its Formula option, on the first (and only, if nothing else happens) measure update
- IfCondition is not executed, since msrTestToggle is less than 0
- IfCondition2 will be always executed when msrTestToggle is updated, since IfCondition2=1 basically means "if true then..."; within IfCondition2, the Formula option of msrTestToggle is made 1 ... BUT the measure itself is not yet updated, since its UpdateDivider=-1 (so when used in a bang, for example, its value will still be -1, despite DynamicVariables=1 being set on the measure - which actually does nothing in particular in this case, apart from allowing you to use the most current value of TestVar)
- the meter is drawn on the skin, and when left clicked, it updates msrTestToggle the second time, finally making it store 1 as its number value, then setting TestVar to 0 in IfCondition (since TestVar was 1), followed by setting the measure's Formula option to 0 (i.e. the current value of TestVar) in IfCondition2. Again, since it's not updated after the !SetOption from IfCondition2, msrTestToggle will be 1 when used in a bang and such.
qwerky wrote: March 5th, 2019, 10:16 pmI am attempting to create a measure which does nothing on refresh, but only updates and executes its IfActions when updated manually.
Well, congratulations, you just created it, LOL.

NOTE: Yes, you can use the log, both by messaging to it as GTI.H wrote, or simply by choosing About/Skins/[Your Skin] in Rainmeter. The latter, of course, will only show you the final result. You can test if I was correct in my interpretation in the log as well, by the way. As far as I see, I was.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How do measures/meters update?

Post by Yincognito »

qwerky wrote: March 5th, 2019, 10:16 pmI am attempting to create a measure which does nothing on refresh, but only updates and executes its IfActions when updated manually.
By the way, if by the above you meant I am attempting to create a measure which does nothing but updates itself on refresh, and executes its IfActions only when updated manually. (meaning that it should not execute its IfActions on automatic updates), then you should consider creating a variable called, say, LeftClicked=0 in [Variables], write a [!SetVariable LeftClicked 1] as the first bang in the LeftMouseUpAction of the meter, then write your IfConditions like IfConditionN=(#LeftClicked#=1), and take care to make LeftClicked 0 again by using a [!SetVariable LeftClicked 0] bang in the last IfConditionN from the measure (in case you want it to "reset" the clicked status before subsequent clicks, that is). This will work even if you don't set UpdateDivider=-1 on the measure, hence the left click "reset" thingy.

Of course, if you keep UpdateDivider=-1 on the measure and you know you won't update it more than once, then the click reset thing is not needed.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
GTI.H
Posts: 75
Joined: December 15th, 2018, 3:35 am

Re: How do measures/meters update?

Post by GTI.H »

qwerky wrote: March 5th, 2019, 10:16 pm I am attempting to create a measure which does nothing on refresh, but only updates and executes its IfActions when updated manually.
I've done a lot like this, I use Disable=1 to bypass the Measure on Refresh and [!EnableMeasure Measure] along with [!UpdateMeasure Measure] to continue updating when you want.
User avatar
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: How do measures/meters update?

Post by qwerky »

Yincognito wrote: March 6th, 2019, 1:01 am Yes, to both questions.
Glad to have that confirmed.
Sequence of events, as far as I can tell (if you think I'm mistaken, please correct):
- TestVar is made 1 in [Variables]
- msrTestToggle is made -1 in its Formula option, on the first (and only, if nothing else happens) measure update
- IfCondition is not executed, since msrTestToggle is less than 0
- IfCondition2 will be always executed when msrTestToggle is updated, since IfCondition2=1 basically means "if true then..."; within IfCondition2, the Formula option of msrTestToggle is made 1 ... BUT the measure itself is not yet updated, since its UpdateDivider=-1 (so when used in a bang, for example, its value will still be -1, despite DynamicVariables=1 being set on the measure - which actually does nothing in particular in this case, apart from allowing you to use the most current value of TestVar)
- the meter is drawn on the skin, and when left clicked, it updates msrTestToggle the second time, finally making it store 1 as its number value, then setting TestVar to 0 in IfCondition (since TestVar was 1), followed by setting the measure's Formula option to 0 (i.e. the current value of TestVar) in IfCondition2. Again, since it's not updated after the !SetOption from IfCondition2, msrTestToggle will be 1 when used in a bang and such.
Thanks, this is very helpful. :thumbup:

Yes, this was intentional, so that it would not execute the first IfAction upon refresh, but thereafter would update the measure/formula to the value of the variable.

And this explains why, in About|Skins, the value of the measure and the value of the variable are opposite, rather than being in sync![/quote]
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How do measures/meters update?

Post by Yincognito »

GTI.H wrote: March 6th, 2019, 1:48 am I've done a lot like this, I use Disable=1 to bypass the Measure on Refresh and [!EnableMeasure Measure] along with [!UpdateMeasure Measure] to continue updating when you want.
I've done it too quite heavily, but for performance reasons. Disabled=1 on refresh it's fine if you do it, but care should be taken when disabling things with a !DisableMeasure bang at runtime, since it resets numerical values to 0, as far as I'm aware of. In such a case, a !PauseMeasure bang would be recommended, since it "remembers" the last value of the measure.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: How do measures/meters update?

Post by qwerky »

GTI.H wrote: March 6th, 2019, 1:48 am I've done a lot like this, I use Disable=1 to bypass the Measure on Refresh and [!EnableMeasure Measure] along with [!UpdateMeasure Measure] to continue updating when you want.
Yes, I also tried this method, but in my experience, as soon as [!EnableMeasure Measure] was applied, the measure updated, just as it would when the skin was loaded/refreshed had it not had Disable=1 on it. :confused:
User avatar
Yincognito
Rainmeter Sage
Posts: 7164
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How do measures/meters update?

Post by Yincognito »

qwerky wrote: March 6th, 2019, 1:54 am Glad to have that confirmed.

Thanks, this is very helpful. :thumbup:

Yes, this was intentional, so that it would not execute the first IfAction upon refresh, but thereafter would update the measure/formula to the value of the variable.

And this explains why, in About|Skins, the value of the measure and the value of the variable are opposite, rather than being in sync!
I suspected that was intentional, actually... :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
GTI.H
Posts: 75
Joined: December 15th, 2018, 3:35 am

Re: How do measures/meters update?

Post by GTI.H »

qwerky wrote: March 6th, 2019, 1:58 am Yes, I also tried this method, but in my experience, as soon as [!EnableMeasure Measure] was applied, the measure updated, just as it would when the skin was loaded/refreshed had it not had Disable=1 on it. :confused:
The idea is to work just like that :confused: , so [!EnableMeasure Measure] goes along with [!UpdateMeasure Measure].

You apply this only when you want to update.