It is currently March 28th, 2024, 7:47 pm

Downloading and updating satelite images

General topics related to Rainmeter.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Downloading and updating satelite images

Post by balala »

Matth wrote:I changed it now to an IfEqualValue=0 and IfAboveValue=0 but for some reason it only works once. It changes the #Item# variable from %H00 to %H10, but after that, the variable no longer gets changed. It basically is stuck at 1410 (or 1510, 1610, etc.) for the rest of the hour.

Why is the check IfAboveValue=0 not triggering the !SetVariable Item ... anymore?
Because when the value of the [MeasureMin] measure changes eg. from 10 to 20, the same IfAboveValue condition remains true. But the appropriate action would be executed only if the measure would get first to 0 then would go again above 0 (switching from one condition to the other then back).
The IfConditions are much better then the IfActions. The IfActions always can be replaced by the IfConditions, but vice-versa not always (this also because of the fact that the IfConditions are newer options). One great advantage of IfConditions is their property that can be made to execute the appropriate action on every update of the measure, no matter how is changing its value, or even if it's not changing.
So, in this case, the [MeasureMin] measure, using the IfConditions, would be:

Code: Select all

[MeasureMin]
Measure=Calc
Formula=(Floor([MeasureMinute]/10)*10)
Group=Imgs
DynamicVariables=1
IfCondition=(MeasureMin=0)
IfTrueAction=[!SetVariable Item "<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>"]
IfFalseAction=[!SetVariable Item "<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>"]
Now to make the measure working well, you have to add two more options to the above measure:

Code: Select all

[MeasureMin]
...
IfConditionMode=1
OnChangeAction=[!CommandMeasure "MeasureData" "Update"]
The result of the IfConditionMode=1 option is that the appropriate IfFalseAction is executed every time the measure updates, so even if the measure changes from 10 to 20, from 20 to 30 and so on, not just when it changes from 0 to 10, switching from true to false.
The OnChangeAction will make the [MeasureData] measure to be updated, each time the value of the [MeasureMin] measure changes.
Please try these new options and let me know if they helped.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Downloading and updating satelite images

Post by Matth »

Awesome, that did the trick exactly.

And many thanks for the detailed explanation. It works now like a charm.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Downloading and updating satelite images

Post by balala »

Glad to help.