Re: Animated GIF issue
Posted: June 24th, 2020, 6:18 pm
Thanks to all of you for making it work stable...
I kind of realized that some time ago, haha!
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
BackgroundColor=0,0,0,50
BackgroundColor2=0,0,0,160
UpdateInterval=1000
UpdateWebParser=600
Delay=0
---Measures WebParser---
[MeasureImage]
Measure=WebParser
URL=https://image.buienradar.nl/2.0/image/animation/RadarMapRainNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=6&skip=1
Download=1
DownloadFile=current.gif
ForceReload=1
UpdateRate=1
UpdateDivider=(#UpdateWebParser#*1000/#UpdateInterval#)
FinishAction=[!Log "DL Rain"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]
OnConnectErrorAction=[!Log "Connection Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]
OnDownloadErrorAction=[!Log "Download Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]
DynamicVariables=1
---Measures RunCommand---
[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
State=Hide
OutputType=ANSI
Timeout=5000
FinishAction=[!Log "Ext Rain"][!EnableMeasure MeasureImageLight][!CommandMeasure MeasureImageLight "Run"]
DynamicVariables=1
[MeasureImageLight]
Measure=WebParser
URL=https://image.buienradar.nl/2.0/image/animation/RadarMapLightningNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=6&skip=1
Download=1
DownloadFile=current.gif
ForceReload=1
UpdateRate=1
UpdateDivider=(#UpdateWebParser#*1000/#UpdateInterval#)
FinishAction=[!Log "DL Light"][!Delay #Delay#][!EnableMeasure MeasureExtractLight][!CommandMeasure MeasureExtractLight "Run"]
OnConnectErrorAction=[!Log "Connection Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtractLight "Run"]
OnDownloadErrorAction=[!Log "Download Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtractLight "Run"]
DynamicVariables=1
Disabled=1
---Measures RunCommand---
[MeasureExtractLight]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
State=Hide
OutputType=ANSI
Timeout=5000
FinishAction=[!Log "Ext Light"][!Delay 1000][!DisableMeasure MeasureImageLight][!DisableMeasure MeasureExtractLight][!UnpauseMeasure MeasureAnimLoop]
DynamicVariables=1
Disabled=1
---Measures Rainmeter---
[MeasureAnimLoop]
Paused=1
Measure=Calc
Formula=((MeasureAnimLoop%9)+1)
RegExpSubstitute=1
Substitute="^(.*)$":"0000\1","^.*(.{5})$":"\1"
DynamicVariables=1
---Meters---
[MeterBackground]
Meter=Shape
Shape=Rectangle 0,0,236,236,5 | Fill Color #Backgroundcolor2# | StrokeWidth 1.5 | Stroke Color #Backgroundcolor#
X=315
Y=596
[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
ImageName=current[MeasureAnimLoop].png
PreserveAspectRatio=1
;SolidColor=0,0,0,160
Imagetint=255,255,255,155
X=2r
Y=2r
W=232
H=232
DynamicVariables=1
Just tested your skin and while I did experience a "stuck moment" at the 4th frame on the first update (where the last 2 operations didn't complete, probably due to some of the measure disable operations interfering), I got no errors and everything worked fine afterwards. As usual when testing / debugging your skin, I set up the UpdateWebParser to 60 (i.e. 1 minute) to speed up the process and not stay for hours staring at the display waiting for some visual indicatiion of what's happening - I just say that so you can read the screenshot below and the timings properly, I'm not implying that you should do the same: I'll take a look at the code tomorrow, but in the meantime I have some things that don't seem that clear to me:JamX wrote: ↑June 28th, 2020, 5:53 pm Hello Guy's
I've seen in the coding of buienradar that there is also a animated gif with lightning history which you can use.
In Stead of the original Rain forecast URL
https://image.buienradar.nl/2.0/image/animation/RadarMapRainNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=6&skip=1
You can use the Lightning URL:
https://image.buienradar.nl/2.0/image/animation/RadarMapLightningNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=0&skip=1
The intension is to make a code that ;
1] downloads the GIF with 9 frames (3 history and 6 forecast) of the Rain animation
2] extracts the 9 frames with gif2frames
3] downloads the GIF with 3 frames (3 history and 0 forecast) of the Lightning animation (there is no forecast for lightning) in the same folder as the Rain download
4] extracts the 3 frames with gif2frames (first 3 frames (from point 2 ) of the rain animation will be overwritten by the Lightning frames and files.
5] Display the animation with the 9 frames (3 history with Lightning and 6 with Rain forecasting)
This is the skin I have made:
Radar_plus_.rmskin
When I load the skin All seems to be OK and functional but at the first update the code gets stuck!
Example of running code after loading skin:
Running.mp4
Example of stuck code during 1st update skin:
Pause.mp4
Resulting in sometimes an error but also the sequence at the update time is NOK:
Capture.JPG
Could you have a look what I did wrong?