It is currently May 3rd, 2024, 6:59 pm

Updated Image of Spinning Earth

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16197
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Updated Image of Spinning Earth

Post by balala »

ikarus1969 wrote: December 17th, 2018, 8:33 pm It's not better, just different. Maybe i want to keep the downloaded file and not be deleted (because it's in a temporary folder).
I don't completely agree. If we're using ImageName option, the shown image is bound to the DownloadFile option of the WebParser measure which downloads it, but with MeasureName even if DownloadFile is changed, the Image meter still will show the downloaded image, without having to update the appropriate option of the Image meter, accordingly. Usually MeasureName seems a much simpler option in cases when the image is downloaded by a WebParser measure.
But obviously you can use any of these option though...
User avatar
GTI.H
Posts: 75
Joined: December 15th, 2018, 3:35 am

Re: Updated Image of Spinning Earth

Post by GTI.H »

balala wrote: December 17th, 2018, 9:03 pm I don't completely agree. If we're using ImageName option, the shown image is bound to the DownloadFile option of the WebParser measure which downloads it, but with MeasureName even if DownloadFile is changed, the Image meter still will show the downloaded image, without having to update the appropriate option of the Image meter, accordingly. Usually MeasureName seems a much simpler option in cases when the image is downloaded by a WebParser measure.
But obviously you can use any of these option though...
A few years ago I discovered that in my case, using MeasureName option met my needs, I just can not remember the reason, maybe this is what balala said.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Updated Image of Spinning Earth

Post by jsmorley »

ikarus1969 wrote: December 17th, 2018, 8:33 pm It's not better, just different. Maybe i want to keep the downloaded file and not be deleted (because it's in a temporary folder).
It still won't be deleted if you use Download=1 and DownloadFile=FileName.jpg. It will be kept in the ..DownloadFile\ folder under the skin folder and won't be deleted. It is still accessible via MeasureName on the meter though.
User avatar
balala
Rainmeter Sage
Posts: 16197
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Updated Image of Spinning Earth

Post by balala »

GTI.H wrote: December 17th, 2018, 9:22 pm A few years ago I discovered that in my case, using MeasureName option met my needs, I just can not remember the reason, maybe this is what balala said.
A problem with using ImageName instead of MeasureName is that you have to set on the dynamic variables. For example in ikarus1969's last code, if a DynamicVariables=1 option is added to the [Meter_PIC] meter, it works much better. Without this option, when the skin is loaded for the first time (and has never been loaded before, to have an already downloaded image), it shows up nothing, just after a new refresh. Adding the DynamicVariables=1 (as described above) avoid this and the skin shows up the image, immediately when it is downloaded.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Updated Image of Spinning Earth

Post by ikarus1969 »

balala wrote: December 17th, 2018, 9:57 pm For example in ikarus1969's last code, if a DynamicVariables=1 option is added to the [Meter_PIC] meter, it works much better. Without this option, when the skin is loaded for the first time (and has never been loaded before, to have an already downloaded image), it shows up nothing, just after a new refresh.
For this i have the "UpdateMeter" in the "FinishAction" of the WebParser measure.
User avatar
balala
Rainmeter Sage
Posts: 16197
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Updated Image of Spinning Earth

Post by balala »

ikarus1969 wrote: December 18th, 2018, 5:09 am For this i have the "UpdateMeter" in the "FinishAction" of the WebParser measure.
Yes, you have it, however doesn't really help, because the Update of the whole skin is set to Update=1000, which means the [Meter_PIC] meter is anyway updated with at most one second after the [Measure_PIC] measure downloads the image. However IF THE IMAGE HAS NEVER BEEN DOWNLOADED BEFORE, the image doesn't appear when the measure gets the image for the very first time. I repeat: if the image has been already downloaded and cached and it exist in the specified place (DownloadFile\Earth.jpg), it is shown up immediately. But if hasn't been, well in this case I have to load the skin which downloads the image which doesn't appear, then have to refresh the skin and after this the image is shown properly.
All this can be easily avoided either adding a DyanmicVariables=1 option to the [Meter_PIC] meter, either using a MeasureName option instead of ImageName on the Image meter. Me personally always would prefere to use MeasureName instead of ImageName, but it's not mandatory.
I think when you first tried out the code, you didn't notice the thing that the image doesn't appear at first time, than later, when you worked with the skin, the previously downloaded image already existed and was used and this is why you didn't notice the problem. Don't misunderstand me, your code is indeed great and finding that source was a useful step (probably for both GTI.H and me and probably for many others). I just noticed this mistake and wanted to fix it. :great:
And one more: !UpdateMeter without !Redraw is completely useless. These two bangs have to be used together, because if at a given moment you're updating a meter but you don't redraw it, you anyway won't see anything, just after the next update cycle, when a redrawn is done anyway. So, the FinishAction=[!UpdateMeter "Meter_PIC"] option in fact should have to be FinishAction=[!UpdateMeter "Meter_PIC"][!Redraw].
User avatar
GTI.H
Posts: 75
Joined: December 15th, 2018, 3:35 am

Re: Updated Image of Spinning Earth

Post by GTI.H »

I implemented this code on my Skin but I'm updating problems.

Code: Select all

[MSEarthPic]
Measure=WebParser
UpdateRate=#UpdateEarthPic#
; Url="http://fourmilab.ch/cgi-bin/Earth?img=NASAmMM-l.evif&imgsize=320&dynimg=y&gamma=1.32&opt=-p&lat=&lon=&alt=&tle=&date=0&utc=&jd="
Url="http://fourmilab.ch/cgi-bin/Earth?img=NASAmMM-l.evif&imgsize=196&dynimg=y&gamma=1.32&opt=-l&lat=48.2&ns=North&lon=16.37&ew=East&alt=35785&tle=&date=0&utc=&jd="
Download=1
DownloadFile=.\\Earth.jpg
UserAgent=Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
DynamicVariables=1
FinishAction=[!UpdateMeter MTEarth][!Redraw]

[MTEarth]
; Group=NowPicText | MButtonsOnOff
Meter=Rotator
MeasureName=MSSun
ImageName=.\\DownloadFile\Earth.jpg
Antialias=1
; UpdateDivider=-1
StartAngle=(Rad(-180))
RotationAngle=(Rad(360))
OffsetX=(196 / 2)
OffsetY=(196 / 2)
X=r
Y=r
W=230
H=230
; Hidden=#Earth Pic#
The Earth.jpg image only refreshes when the Skin is Refreshed (! Refresh), not when it is updated automatically.

Could someone help me and tell me what I am doing wrong?
User avatar
balala
Rainmeter Sage
Posts: 16197
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Updated Image of Spinning Earth

Post by balala »

GTI.H wrote: December 18th, 2018, 2:34 pm The Earth.jpg image only refreshes when the Skin is Refreshed (! Refresh), not when it is updated automatically.

Could someone help me and tell me what I am doing wrong?
Are you sure you need a Rotator meter? An Image wouldn't be good? How does look the [MSSun] measure?
First thing you should have to try is to add a DynamicVariables=1 option to the [MTEarth] meter. Although this isn't related to Rotator meters, but to Image, read the Note here. I think the same can be applied to a Rotator meter, too.
User avatar
GTI.H
Posts: 75
Joined: December 15th, 2018, 3:35 am

Re: Updated Image of Spinning Earth

Post by GTI.H »

balala wrote: December 18th, 2018, 2:52 pm Are you sure you need a Rotator meter? An Image wouldn't be good? How does look the [MSSun] measure?
First thing you should have to try is to add a DynamicVariables=1 option to the [MTEarth] meter. Although this isn't related to Rotator meters, but to Image, read the Note here. I think the same can be applied to a Rotator meter, too.
Yeah, I really need Rotator.

[MSSun] is a Calc that returns me an angle from -180 to 0 to 180 ° and works great.
I already tried DynamicVariables=1 and it did not work.
User avatar
balala
Rainmeter Sage
Posts: 16197
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Updated Image of Spinning Earth

Post by balala »

GTI.H wrote: December 18th, 2018, 3:05 pm Yeah, I really need Rotator.

[MSSun] is a Calc that returns me an angle from -180 to 0 to 180 ° and works great.
I already tried DynamicVariables=1 and it did not work.
Ok, post please the whole code, because it isn't complete.