It is currently March 28th, 2024, 9:34 am

Deduct Minutes from a time

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

Re: Deduct Minutes from a time

Post by balala »

Matth wrote:Attached is a skin file with the complete code and also a few images. The "dev" is a version I am working on and might have some different code, but the HKGSat.ini should work. There are two times (10:50/22:50 HKG time 02:40/12:40 UTC) when there seems to be no image.
Neither this code doesn't work for me. I simply can't get it to work. I tried to use the values returned by the [MeasureNTHKG] and the [MeasureNTUTC] measures, to manually check the URL used by the [RadarMeasure] measure, but if I copy those values and put them manually into the Url variable (set by the IfTrueAction option of the [MeasureNTUTC] measure), then trying to open the location into my browser, I don't get anything, just an error message. Maybe the URL is inaccessible outside of HK? Not sure, but this is my impression. If I'm right, I can't help.
However, I saw one more thing: you should replace the names of the [MeasureNTHKG] and [MeasureNTUTC] measures, into the !SetVariable bang of the IfTrueAction option of the [MeasureNTUTC] measure: [!SetVariable rURL "http://www.weather.gov.hk/wxinfo/intersat/satellite/image/e_infrared/[[color=#FF0000]&[/color]MeasureNTHKG]+[[color=#FF0000]&[/color]MeasureNTUTC]H08.nb_x8M--L1B.H08_IR1_coast.png"] (read the last paragraph here).
So, not being sure why don't work, I have no idea what else to say.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Deduct Minutes from a time

Post by Matth »

Hmm, that's a shame. I would suspect, that it does not work as you are in a different time zone, although with the TimeZone=+8 option I would assume it should return the same time, no?

Just to make sure that you can get the image, here is a current image as of 21:40 HKG time (It is here 22:27 now). So rounded down to the previous 10 minutes that's 22:20, less the 40 minutes results in the latest image being available (21:40 on the 2017-05-28). That's the first part of the string that I insert into the URL. The second part seems to be the equivalent UTC time less 10 minutes. So it's an 8:10 hour difference resulting in the second string being 28th (date) at 13:30.

http://www.weather.gov.hk/wxinfo/intersat/satellite/image/e_infrared/201705282140+281330H08.nb_x8M--L1B.H08_IR1_coast.png

Maybe you can check with this if you get different values in the strings and that's why it doesn't work? If the two values don't correspond, I also get an error message an no image here.

I changed the measures into [&MeasureNTHKG] and [&MeasureNTUTC] though I'm not sure what that changes.

BTW, is it possible to have in the same Measure an IfMatch and an IfCondition at the same time?
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Deduct Minutes from a time

Post by Matth »

To stop the animation for a few seconds at the current image, I had to introduce a second and identical Measure [MeaCIXX] for the File, so that I can set an IfMatch and the !SetVariable if it's true. Is there a way to avoid having an additional measure and do the IfMatch at the same time in the Measure [MeaCXX]?

Code: Select all

[MeaC1]
Measure=Plugin
Plugin=FileView
Path=[MeaFolder]
Type=FileName
DynamicVariables=1
Index=1
Group=Images
Disabled=1
;Checks if the filename is empty, then set the variable to 0, otherwise to 1 (should the file/measure be shown or not)
IfMatch=^$
IfMatchAction=[!SetVariable MeaC1 "0"]
IfNotMatchAction=[!SetVariable MeaC1 "1"]


;This one checks if this image is the current image or not. If it is, it sets the variable so that the animation stops for a few seconds (Change TCounter=30 for longer or shorter stops)
[MeaCI1]
Measure=Plugin
Plugin=FileView
Path=[MeaFolder]
Type=FileName
DynamicVariables=1
Index=1
Group=Images
Disabled=1
;IfMatchMode=1
IfMatch=[MeasureBaseTime]
IfMatchAction=[!SetVariable CurImage "1"]
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Deduct Minutes from a time

Post by balala »

Still the same problem: the value of the rURL variable should be an URL of a downloadable image, but it isn't: the URL I get for example right now is http://www.weather.gov.hk/wxinfo/intersat/satellite/image/e_infrared/201705290240+281830H08.nb_x8M--L1B.H08_IR1_coast.png, but this doesn't get an image, just an error message.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Deduct Minutes from a time

Post by balala »

dvo wrote:the link you have is one for 29-05-2017 :-(
Yeah, but in Hong Kong, where Matth lives, it's already May 29.
But does the posted skin works for you?
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Deduct Minutes from a time

Post by Matth »

balala wrote:Still the same problem: the value of the rURL variable should be an URL of a downloadable image, but it isn't: the URL I get for example right now is http://www.weather.gov.hk/wxinfo/intersat/satellite/image/e_infrared/201705290240+281830H08.nb_x8M--L1B.H08_IR1_coast.png, but this doesn't get an image, just an error message.
You posted this at 2:29 AM from what I can see here. The link is for a time at 02:40. That is 20 minutes ahead of time, when at that moment you should rather have the image of 01:40. Your generated link is one hour too early for some reason :???:

Is it possible that your daylight savings time somehow messes with it? In HKG we do not have DST.
Last edited by Matth on May 29th, 2017, 12:59 am, edited 1 time in total.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Deduct Minutes from a time

Post by Matth »

Here's a bit a simpler variant. Hopefully this one will work.

https://forum.rainmeter.net/viewtopic.php?f=27&t=26108
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Deduct Minutes from a time

Post by balala »

Matth wrote:Is it possible that your daylight savings time somehow messes with it? In HKG we do not have DST.
Probably, because we do use DST.
Matth wrote:Here's a bit a simpler variant. Hopefully this one will work.
Yeah, this works now.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Deduct Minutes from a time

Post by Matth »

Do you have any error message or something in the log?
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Deduct Minutes from a time

Post by Matth »

What is the URL that it tries to import the image that is shown in the log?

Please also state your time when you check the log, as I assume, it might have a problem with the daylight savings time.
Post Reply