It is currently May 7th, 2024, 8:47 am

Weather satellite imagery skin?

Get help with creating, editing & fixing problems with skins
Kyremi
Posts: 41
Joined: September 22nd, 2011, 1:03 pm

Re: Weather satellite imagery skin?

Post by Kyremi »

That's terrific... so the Counter is some sort of function, and it's implicitly linked to the Update rate in [Rainmeter]? What other options are there for Formula?

So, an ever-looping picture of clouds is pretty fun, but what if I want some control, like a 'play/pause' control? It'd also be nice to add in a button for each picture (like the glowing dots in Enigma's Reader) to be able to go to any picture immediately... from what I can tell from the Reader code, that's associated with a property called Active for each of the reader lists, so maybe I'd say something like, 'picture X is active when Counter is currently at number X', which would make the adequate dot light up...?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather satellite imagery skin?

Post by jsmorley »

Kyremi wrote:That's terrific... so the Counter is some sort of function, and it's implicitly linked to the Update rate in [Rainmeter]? What other options are there for Formula?

So, an ever-looping picture of clouds is pretty fun, but what if I want some control, like a 'play/pause' control? It'd also be nice to add in a button for each picture (like the glowing dots in Enigma's Reader) to be able to go to any picture immediately... from what I can tell from the Reader code, that's associated with a property called Active for each of the reader lists, so maybe I'd say something like, 'picture X is active when Counter is currently at number X', which would make the adequate dot light up...?
What can be done with a Calc measure is here: http://rainmeter.net/cms/Measures-Calc.

As to the rest, I'll let Kaelri or others weigh in. It's all doable in one way or another, but will take some fairly complicated Calc and !SetOption and other logic. It would be nice not to have to end up with 24 Image meters and using !Hide / !Show, but it's a bit bigger project than I can take on right at this second...
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather satellite imagery skin?

Post by jsmorley »

Code: Select all

[MeasureImageRotate]
Measure=Calc
Formula=Counter % 24

[ImageStyle]
ImageName=#CURRENTPATH#DownloadFile\[MeasureImageRotate].jpg

[MeterImage0]
Meter=Image
MeterStyle=ImageStyle
X=0
Y=0
W=400
H=300
DynamicVariables=1

[MeterStart]
Meter=Image
SolidColor=0,255,0,255
W=15
H=15
X=0
Y=302
LeftMouseUpAction=!Execute [!SetOption MeterImage0 ImageName ""][!EnableMeasure MeasureImageRotate]

[MeterDot0]
Meter=Image
SolidColor=0,0,255,255
W=15
H=15
X=2R
Y=302
LeftMouseUpAction=!Execute [!SetOption MeterImage0 ImageName "#CURRENTPATH#DownloadFile\0.jpg"][!DisableMeasure MeasureImageRotate]

[MeterDot1]
Meter=Image
SolidColor=0,0,255,255
W=15
H=15
X=2R
Y=302
LeftMouseUpAction=!Execute [!SetOption MeterImage0 ImageName "#CURRENTPATH#DownloadFile\1.jpg"][!DisableMeasure MeasureImageRotate]
Something like that actually works to jump to any of the 24 images (you will need to duplicate [MeterDot1] 22 more times...) and causes the "rotation" to stop on the image you select. Then that [MeterStart] meter starts up the rotation again.

Notice the MeterStyle [ImageStyle] and its use in the our old friend [MeterImage0]. That is so we can have the [MeterDotX) meters set the image name to the image we select using !SetOption, and set it back to using whatever is in [MeasureImageRotate] by just using a value of "" with !SetOption on the [MeterStart] meter.

Now the trick is to get the color of the dots to change based on the current value of [MeasureImageRotate], so the current image's "dot" is highlighted as it moves through the rotation. I'm not sure how best to approach this. My temptation is to jump out to a Lua script, but maybe someone has a native Rainmeter way that isn't too ugly.

Note: I just used SolidColor and a W and H to create the "dots" for simplicity's sake. You will probably want to get or create some nice image of a "dot" and then use ImageTint to change the color once we figure out the best way to attack this.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather satellite imagery skin?

Post by jsmorley »

Unless someone comes up with an easy clean way to do it in native Rainmeter, here is a version of the skin using a Lua script to have the current image highlighted, and to allow selecting any image and control things properly.
RotateRadar.rmskin
10-2-2011 1-43-18 PM.jpg
The green button is to start the normal rotation again after you select an image. The other buttons correspond to the images with the current one highlighted. You can click on any of them to jump to that image.

You can look at the .ini and the .lua to see what I am doing, glad to answer any questions.

http://rainmeter.net/cms/Plugins-WebParser
http://rainmeter.net/cms/Meters-Image
http://rainmeter.net/cms/Bangs
http://rainmeter.net/cms/LuaScripting
You do not have the required permissions to view the files attached to this post.
Kyremi
Posts: 41
Joined: September 22nd, 2011, 1:03 pm

Re: Weather satellite imagery skin?

Post by Kyremi »

That's pretty much exactly what I was going for :)

I'm a bit confused about what exactly happens when you click on a circle... "!Execute [!SetOption MeterImage0 ImageName "#CURRENTPATH#DownloadFile\23.jpg"][!DisableMeasure MeasureImageRotate][!SetVariable Selected 23]", what exactly's going on?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather satellite imagery skin?

Post by jsmorley »

Kyremi wrote:That's pretty much exactly what I was going for :)

I'm a bit confused about what exactly happens when you click on a circle... "!Execute [!SetOption MeterImage0 ImageName "#CURRENTPATH#DownloadFile\23.jpg"][!DisableMeasure MeasureImageRotate][!SetVariable Selected 23]", what exactly's going on?
What it is doing is:

1. Setting the "ImageName" option for the meter "MeterImage0" to be hard coded as the name of the image (23.jpg in this case).
2. Stopping the "rotation" by disabling the Calc measure "MeasureImageRotate"
3. Setting the variable "Selected" to "23", which the Lua script reads and thus can know which image is selected.

When you click that "start" button (the green one) it sorta undoes all this, by setting the ImageName value for MeterImage0" back to what is in that MeterStyle it is using, turns back on the rotation by enabling MeasureImageRotate, and setting the variable Selected to "None".
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Weather satellite imagery skin?

Post by smurfier »

This should work without lua. It should also play from the selected image instead of starting over.

Code: Select all

[Variables]
Image=-1

[cCounter]
Measure=Calc
Formula=#Image#>=0?#Image#:(cCounter+1)%24
DynamicVariables=1

[MeterImage0]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
MeasureName=cCounter
ImageName=%1.jpg
X=0
Y=0
W=400
H=300

[MeterStart]
Meter=Image
SolidColor=0,255,0,255
W=15
H=15
X=0
Y=302
LeftMouseUpAction=SetVariable Image -1

[MeterDot0]
Meter=Image
SolidColor=0,0,255,255
W=15
H=15
X=2R
Y=302
LeftMouseUpAction=!SetVariable Image 0

[MeterDot1]
Meter=Image
SolidColor=0,0,255,255
W=15
H=15
X=2R
Y=302
LeftMouseUpAction=!SetVariable Image 1
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Weather satellite imagery skin?

Post by Mordasius »

Kaelri wrote:That page is actually set up beautifully for downloading with WebParser.
You are certainly right about that Kaelri.....

I was finding it tricky to download a sequence of weather images from the JMA because the filenames and source are not given on the Webpage. Then it occurred to me that filenames for the hourly updates from the UK Met Office are very similar to those from the JMA (201110040400.jpg Vs. 201110040400-00.png) so it was simply a case of modifying the RegExp and the URL's pointing to the images.

Code: Select all

[Variables]
GetImage=map.FrameElement\[.*\] = "(.*).jpg".*
ImageSite=http://www.jma.go.jp/en/gms/imgs_c/6/infrared/1/
;________________________________________________________
;	MEASURES

[MeasureImages]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=http://www.metoffice.gov.uk/satpics/latest_IR.html
RegExp="(?siU)#GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage##GetImage#"

[MeasureImage0]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=#ImageSite#[MeasureImages]-00.png
StringIndex=1
Download=1
DownloadFile=0.png

[MeasureImage1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=#ImageSite#[MeasureImages]-00.png
StringIndex=2
Download=1
DownloadFile=1.png

..... etc. down to [MeasureImage23]

[cCycleImages]
Measure=Calc
Formula=Counter % 24

;________________________________________________________
;	METERS
[ShowImage]
Meter=Image
ImageName=#CURRENTPATH#DownloadFile\[cCycleImages].png
X=0
Y=0
W=400
H=406
DynamicVariables=1  
So there we have it... use file names from the UK Met Office to display images compiled by the Japan Meteorological Agency and watch tropical cyclones sweeping across the Pacific.

P.S. I started out with a LUA script to use the system time to generate the Year|Month|Day|Hour image filenames but kept running up against the brick wall of using SetOption or SetVariable with plugins. Guess I could have used the LUA script to change values in 24 separate calcs feeding the 24 MeasureImages but that seemed a little bit of an overkill.
You do not have the required permissions to view the files attached to this post.
Kyremi
Posts: 41
Joined: September 22nd, 2011, 1:03 pm

Re: Weather satellite imagery skin?

Post by Kyremi »

So now I have a great little satellite viewer... Now that I have that, I've been looking at what other regular weather sites I use and this one http://www.sheffieldweather.co.uk/Live%20Weather.htm is right up the top. However it seems all the data is being passed through a .swf object to be shown in its 'pretty' form... I've looked at the page code but not been able to find an .xml file or any such thing which provides data... so I guess my first question is, is there any visible way to extract data from this page?