It is currently September 20th, 2019, 9:15 pm

Interlinked if or the way not to run a mesure

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 8631
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Interlinked if or the way not to run a mesure

balala » April 15th, 2019, 4:43 pm

Yincognito wrote:
April 15th, 2019, 4:30 pm
Obviously, having an UpdateDivider=-1 on that measure makes it run only on demand.
Note that in a such case the measure is running once, when the skin is refreshed.
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: Interlinked if or the way not to run a mesure

Yincognito » April 15th, 2019, 4:52 pm

RNestaM wrote:
April 15th, 2019, 4:41 pm
Yeah i've done it ;)
I am on mobile currently, so I couldn't notice it. :D
RNestaM wrote:
April 15th, 2019, 4:41 pm
I asking myself why i did'nt tought about it :???:
Yeah, sometimes we tend to overcomplicate things...
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: Interlinked if or the way not to run a mesure

Yincognito » April 15th, 2019, 4:54 pm

balala wrote:
April 15th, 2019, 4:43 pm
Note that in a such case the measure is running once, when the skin is refreshed.
But not if the measure is disabled from the start, am I right?
User avatar
balala
Rainmeter Sage
Posts: 8631
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Interlinked if or the way not to run a mesure

balala » April 15th, 2019, 4:58 pm

Yincognito wrote:
April 15th, 2019, 4:54 pm
But not if the measure is disabled from the start, am I right?
Yeah, completely. I meant it is ran once if it's not disabled and has added the UpdateDivider=-1 option. If it's disabled (with the added Disabled=1 option), obviously it doesn't run at all.
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: Interlinked if or the way not to run a mesure

Yincognito » April 15th, 2019, 5:02 pm

balala wrote:
April 15th, 2019, 4:58 pm
Yeah, completely. I meant it is ran once if it's not disabled and has added the UpdateDivider=-1 option. If it's disabled (with the added Disabled=1 option), obviously it doesn't run at all.
Yep, indeed. ;-)
User avatar
qwerky
Posts: 181
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Interlinked if or the way not to run a mesure

qwerky » April 15th, 2019, 6:35 pm

balala wrote:
April 15th, 2019, 4:58 pm
Yeah, completely. I meant it is ran once if it's not disabled and has added the UpdateDivider=-1 option. If it's disabled (with the added Disabled=1 option), obviously it doesn't run at all.
But note that when it becomes enabled (eg. with a bang), it will run that one time, just as it would have at refresh, had it been enabled then.
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: Interlinked if or the way not to run a mesure

Yincognito » April 15th, 2019, 6:47 pm

qwerky wrote:
April 15th, 2019, 6:35 pm
But note that when it becomes enabled (eg. with a bang), it will run that one time, just as it would have at refresh, had it been enabled then.
A bit related to that, from your experience (I'm including balala here), is it enough to enable the measure to make it run, or you also have to !UpdateMeasure it? I've come across such a situation and I had to also update it in order for the measure to run (although not expecting that, I found the behavior logical after a while).

Now, of course, maybe the particularities of the measure where I encountered that behavior played a part (the same row bangs issue we talked about in the past), that's why I would be interested in finding out if any of you guys experienced the same behavior.
User avatar
balala
Rainmeter Sage
Posts: 8631
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Interlinked if or the way not to run a mesure

balala » April 15th, 2019, 6:52 pm

qwerky wrote:
April 15th, 2019, 6:35 pm
But note that when it becomes enabled (eg. with a bang), it will run that one time, just as it would have at refresh, had it been enabled then.
Yincognito wrote:
April 15th, 2019, 6:47 pm
A bit related to that, from your experience (I'm including balala here), is it enough to enable the measure to make it run, or you also have to !UpdateMeasure it? I've come across such a situation and I had to also update it in order for the measure to run (although not expecting that, I found the behavior logical after a while).

Now, of course, maybe the particularities of the measure where I encountered that behavior played a part (the same row bangs issue we talked about in the past), that's why I would be interested in finding out if any of you guys experienced the same behavior.
qwerky, unfortunately, as Yincognito said, you're not completely right. Take the following sample code:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[Timer]
Measure=Calc
Formula=5
Disabled=1
UpdateDivider=-1

[StringStyle]
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=15,5,15,5
AntiAlias=1

[MeterTest]
Meter=String
MeterStyle=StringStyle
MeasureName=Timer
Text=Measure: %1
DynamicVariables=1

[MeterEnable]
Meter=String
MeterStyle=StringStyle
X=0r
Y=5R
Text=Enable
DynamicVariables=1
LeftMouseUpAction=[!EnableMeasure "Timer"]

[MeterUpdate]
Meter=String
MeterStyle=StringStyle
X=0r
Y=5R
Text=Update
DynamicVariables=1
LeftMouseUpAction=[!UpdateMeasure "Timer"][!Redraw]
The [Timer] measure has set both options (UpdateDivider=-1, as well as Disabled=1). You can enable it clicking Enable and can update it with Update.
Now if you refresh (load) the skin, it shows 0 (as probably expected). Now the surprise: if you click Enable (enabling this way the [Timer] measure), the string is still kept on 0. To get its value (5), you have to update it, clicking the Update string.
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: Interlinked if or the way not to run a mesure

Yincognito » April 15th, 2019, 7:02 pm

balala wrote:
April 15th, 2019, 6:52 pm
qwerky, unfortunately, as Yincognito said, you're not completely right.
Yep, I was worried that in the code I posted for the OP, the bangs from the last meter would update twice the DeleteCaseGroup:

Code: Select all

[DeleteSelected]
Meter=IMAGE
ImageName=#@#Images\Delete.png
x=5R
y=7
LeftMouseUpAction=[!EnableMeasureGroup "DeleteCaseGroup"][!UpdateMeasureGroup "DeleteCaseGroup"][!Refresh]
DynamicVariables=1
Fortunately, it isn't the case, since you confirmed the behavior I noticed when working on my own skins.
User avatar
qwerky
Posts: 181
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Interlinked if or the way not to run a mesure

qwerky » April 15th, 2019, 7:06 pm

But if that measure, balala, had some actions on it (which was the scenario I was dealing with, when I came across this issue), I believe those actions would execute when the measure was enabled--though I haven't tested this on your example.