Please dvo, do a complet restart of Rainmeter. The skin uses the WebParser plugin and with the skins using it, many times a restart of Rainmeter can help.dvo wrote:for me it's not import .... just tested both doesn't seem to work 4 me :P
It is currently April 26th, 2024, 8:52 am
Deduct Minutes from a time
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Deduct Minutes from a time
-
- Posts: 54
- Joined: May 17th, 2017, 8:43 am
Re: Deduct Minutes from a time
You are trying to download a satellite image from the future 2017-05-31 00:00. That can't work
And yes, I believe that is the DST problem. Try the attached package and set the DST=1.
I have created another package and in the variables you can set the DST=1 if you have daylight savings time. That will deduct an additional hour from the actual time.
And yes, I believe that is the DST problem. Try the attached package and set the DST=1.
I have created another package and in the variables you can set the DST=1 if you have daylight savings time. That will deduct an additional hour from the actual time.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 54
- Joined: May 17th, 2017, 8:43 am
-
- Developer
- Posts: 22630
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Deduct Minutes from a time
Just FYI, there is a way to get the state of DST automatically...Matth wrote:You are trying to download a satellite image from the future 2017-05-31 00:00. That can't work
And yes, I believe that is the DST problem. Try the attached package and set the DST=1.
I have created another package and in the variables you can set the DST=1 if you have daylight savings time. That will deduct an additional hour from the actual time.
HKG Satellite_1.1.rmskin
Code: Select all
[MeasureDSTActive]
Measure=Plugin
Plugin=SysInfo
SysInfoType=TIMEZONE_ISDST
-
- Posts: 54
- Joined: May 17th, 2017, 8:43 am
Re: Deduct Minutes from a time
Thanks. The next version will have that included. I already adjusted it here, but I plan some more changes...
-
- Posts: 54
- Joined: May 17th, 2017, 8:43 am
Re: Deduct Minutes from a time
Just figured out myself what I was asking. Not relevant...
-
- Posts: 54
- Joined: May 17th, 2017, 8:43 am
Re: Deduct Minutes from a time
While the code now works nicely (at least on my PC) I am still puzzled about one feature that just doesn't seem right.
The measure to retrieve the image should actually only be triggered once every ten minutes, when the time changes to the next rounded 10 minutes.
Here I combine the UTC time and compare it in the IfCondition with a variable that was set the previous 10 minutes. If the current time [MeasureNTUTC] is not equal to the variable #pBSUTC# then the IfTrueAction should trigger. Here I set the variables #pBSUTC# and rURL. After that I trigger a CommandMeasure to update the [RadarMeasure].
No this measure downloads the variable #rURL# set in the previous measure and then starts the animation. There is no other CommandMeasure calling this measure and yet, it is triggered more or less exactly every 2:30 minutes. I can understand the 2:30 minutes as it comes from the default 600 milliseconds from the WebParser plugin and the Update=250 of the skin. But then I thought the UpdateDivider=-1 would prevent any automatic update and only fetch the URL if it is loaded or refreshed (or called with the CommandMeasure I would believe). What do I need to add to ONLY get it once every 10 minutes?
The measure to retrieve the image should actually only be triggered once every ten minutes, when the time changes to the next rounded 10 minutes.
Code: Select all
[MeasureNTUTC]
Measure=String
String=[MeasureDateUTC][MeasureHourUTC][MeasureMinUTC]
DynamicVariables=1
;If the time changes (next 10 minutes) update the URL and trigger the download for a new file
IfConditionMode=1
IfCondition=([MeasureNTUTC] <> #pBSUTC#)
IfTrueAction=[!SetVariable pBSUTC "[MeasureNTUTC]"][!SetVariable rURL "http://www.weather.gov.hk/wxinfo/intersat/satellite/image/e_infrared/[&MeasureNTHKG]+[&MeasureNTUTC]H08.nb_x8M--L1B.H08_IR1_coast.png"][!CommandMeasure "RadarMeasure" "Update"]
Code: Select all
[RadarMeasure]
;Downloads the image every 10 minutes
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#rURL#
Download=1
UpdateDivider=-1
DynamicVariables=1
DownloadFile="infrared\radar[MeasureHour][MeasureMin].png"
;Start displaying the images
FinishAction=[!EnableMeasureGroup "Images"][!UpdateMeasureGroup "Images"][!EnableMeasure "MeasureTimer"][!ShowMeterGroup "ImgDat"][!CommandMeasure "MeaFolder" "Update"]
-
- Posts: 54
- Joined: May 17th, 2017, 8:43 am
Re: Deduct Minutes from a time
Ok, so it seems if UpdateDivider=-1 is set, then even the CommandMeasure does not trigger a new download.
I now added UpdateRate=2400 and it seems to work as it should. It now downloads the image only every 10 minutes.
I now added UpdateRate=2400 and it seems to work as it should. It now downloads the image only every 10 minutes.
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Deduct Minutes from a time
Now if you've figured out what's happening, I'd have one more recommendation: you should replace the [MeasureNTUTC] string measure, with a Calc measure. You should do this because the IfCondition is working with numeric values, but even if the value of the [MeasureNTUTC] measure is composed by digits, it being a string measure, its value in fact is a string. It's true you're converting it to number (using the brackets), but a much more elegant solution would be to use a Calc measure:
You should do the same with the [MeasureNTHKG] and [MeasureBaseTime] string measures.
Code: Select all
[MeasureNTUTC]
Measure=Calc
Formula=( 10000 * [MeasureDateUTC] + 100 * [MeasureHourUTC] + [MeasureMinUTC] )
DynamicVariables=1
;If the time changes (next 10 minutes) update the URL and trigger the download for a new file
IfConditionMode=1
IfCondition=(MeasureNTUTC <> #pBSUTC#)
IfTrueAction=[!SetVariable pBSUTC "[MeasureNTUTC]"][!SetVariable rURL "http://www.weather.gov.hk/wxinfo/intersat/satellite/image/e_infrared/[&MeasureNTHKG]+[&MeasureNTUTC]H08.nb_x8M--L1B.H08_IR1_coast.png"][!CommandMeasure "RadarMeasure" "Update"]
-
- Posts: 54
- Joined: May 17th, 2017, 8:43 am
Re: Deduct Minutes from a time
It might be more elegant but it strips off the leading zero on the date. This is required and if I change it it'll fail to download the images.