It is currently April 27th, 2024, 10:07 pm

Measures not running on update cycles

Get help with creating, editing & fixing problems with skins
Thompson820
Posts: 13
Joined: October 20th, 2011, 10:57 am

Measures not running on update cycles

Post by Thompson820 »

When the following code runs in the latest stable (2.2.0.0) it works flawlessly for infinite update cycles, in the latest beta (2.3.0.1406) it all works for the initial update cycle then breaks on following updates. What seems to happen is this:

1. WeatherCheck updates the first time as expected.
2. LastCheck is enabled.
3. LastCheck returns 1 from the formula, activating the IfEqualAction.
4. LastCheck executes the IfEqualAction, replacing the variables with the current time and disabling itself.
5. 15 minutes passes and WeatherCheck runs again.
6. LastCheck is enabled again.
7. LastCheck returns 1 from the formula, theoretically activating the IfEqualAction.
8. LastCheck fails to execute the IfEqualAction.
9. Subsequently, LastCheck remains enabled indefinitely without actually achieving anything.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Country=Australia
City=Melbourne
APIKey=My API Key
WeatherCheckHour=99
WeatherCheckMinute=99

[TH]
Measure=Time
Format=%H

[TM]
Measure=Time
Format=%M

[WeatherCheck]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=900
Url=http://api.wunderground.com/api/#APIKey#/conditions/forecast/q/#Country#/#City#.xml
RegExp="(?siU).*<temp_f>(.*)</temp_f>.*<temp_c>(.*)</temp_c>.*<icon>(.*)</icon>.*<high>.*<fahrenheit>(.*)</fahrenheit>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<fahrenheit>(.*)</fahrenheit>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>"
FinishAction=!EnableMeasure LastCheck
DynamicVariables=1

[LastCheck]
Measure=calc
Formula=(1+1=2) ? 1:0
IfEqualValue=1
IfEqualAction=!Execute [!SetVariable WeatherCheckHour [TH]] [!SetVariable WeatherCheckMinute [TM]] [!DisableMeasure LastCheck]
DynamicVariables=1
Disabled=1
I can only assume this is to do with the changes to how Measures update on cycles, however I am unsure how to proceed if this is the case.
Any help would be greatly appreciated!
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Measures not running on update cycles

Post by poiru »

Why do you need [LastCheck] at all? From the provided snippet, it seems you could simply set the variables in FinishAction.

That said, this does indeed sound like a regression. We'll take a look and see if something can be done about it.
Thompson820
Posts: 13
Joined: October 20th, 2011, 10:57 am

Re: Measures not running on update cycles

Post by Thompson820 »

poiru wrote:Why do you need [LastCheck] at all? From the provided snippet, it seems you could simply set the variables in FinishAction.

That said, this does indeed sound like a regression. We'll take a look and see if something can be done about it.
That occurred to me as well, however when I try to set those variables with the FinishAction they simply get set to 0. I couldn't begin to guess why.
Thanks for looking into it.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Measures not running on update cycles

Post by jsmorley »

Setting the variables directly from the WebParser measure won't work, as you can't use DynamicVariables with WebParser, so [!SetVariable WeatherCheckHour [TH]] will just set WeatherCheckHour to zero.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Measures not running on update cycles

Post by poiru »

jsmorley wrote:Setting the variables directly from the WebParser measure won't work, as you can't use DynamicVariables with WebParser, so [!SetVariable WeatherCheckHour [TH]] will just set WeatherCheckHour to zero.
Ah, that's another bug then. Actions should be dynamic (for [measures]) everywhere. I figured FinishAction was, too, but apparently not. I'll fix this later today.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Measures not running on update cycles

Post by poiru »

Thompson820, both issues have been fixed in this test build. You can get rid of [LastCheck] and simply use FinishAction now.
Thompson820
Posts: 13
Joined: October 20th, 2011, 10:57 am

Re: Measures not running on update cycles

Post by Thompson820 »

poiru wrote:Thompson820, both issues have been fixed in this test build. You can get rid of [LastCheck] and simply use FinishAction now.
:o Thanks, it seems to work perfectly!