It is currently May 2nd, 2024, 8:16 am

Change the background image of the skin at sunrise and sunse

Get help with creating, editing & fixing problems with skins
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Change the background image of the skin at sunrise and sunse

Post by wiedzmawiedzma »

I would like to use WebParser.dll in such a way that the address

Url = http://xml.weather.com/weather/local/ # Location #? Cc = * & unit = # Unit # & dayf = 1

be able to adapt the skin in such a way that the sun background changed to "night" and the sunrise changed to "daily" and here the request - jsmorley - or other controllers have trouble with the aid of the following ways -

[MeasureCurrent]
RegExp =
StringIndex =

[MeterSunriseSunsetCurrent]
Meter = IMAGE

If it is possible to ask for ready example that you can copy and paste to the skin and enter the path to the images and their position in advance thanks and best regards.
User avatar
haibusa2005
Posts: 52
Joined: June 15th, 2011, 7:23 pm
Location: Bulgaria, Varna

Re: Change the background image of the skin at sunrise and s

Post by haibusa2005 »

Here is some of the code of the suite I am currently developing. It handles exactly the same matter :)

Code: Select all

[Variables]
@Include=localization/bg.inc

;Weather locale. Replace location with your own location and metric with letter of the system you preffer - m  for metric, i for imperial
Location=BUXX0001
Metric=m

[RegExpWeather]
UpdateRate=1
UpdateDivider=300
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://xml.weather.com/weather/local/#Location#?cc=*&unit=#Metric#&dayf=2
RegExp="(?siU).* <sunr>(.*):(.*)\s.*</sunr>.*<suns>(.*):(.*)\s.*</suns>"

[GetSunriseHours]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RegExpWeather]
StringIndex=01

[GetSunriseMinutes]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RegExpWeather]
StringIndex=02

[GetSunsetHours]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RegExpWeather]
StringIndex=03

[GetSunsetMinutes]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RegExpWeather]
StringIndex=04

[GetWeatherHours]
Measure=Time
Format=%H

[GetWeatherMinutes]
Measure=Time
Format=%M

[SunriseMinutesAfterMidnight]
Measure=Calc
Formula=(GetSunriseHours*60)+GetSunriseMinutes

[SunsetMinutesAfterMidnight]
Measure=Calc
Formula=(GetSunsetHours*60)+GetSunsetMinutes+720

[CurrentMinutesAfterMidnight]
Measure=Calc
Formula=(GetWeatherHours*60)+GetWeatherMinutes

[DisplayWeatherIcon]
Measure=Calc
;111 -> sun icon, 222 -> moon icon
Formula=CurrentMinutesAfterMidnight<=SunriseMinutesAfterMidnight?222:(CurrentMinutesAfterMidnight>=SunsetMinutesAfterMidnight?222:111)
IfAboveValue=150
IfAboveAction=!Execute [!HideMeterGroup WeatherIcons] [!ShowMeter WeatherMoonIcon]
IfBelowValue=140
IfBelowAction=!Execute [!HideMeterGroup WeatherIcons] [!ShowMeter WeatherSunIcon]

User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: Change the background image of the skin at sunrise and s

Post by wiedzmawiedzma »

Many thanks I will try it soon and let you know how I went!
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: Change the background image of the skin at sunrise and s

Post by wiedzmawiedzma »

It works perfectly and it was once again thank you for your support and invite you to visit my gallery on DeviantArt http://wiedzmawiedzma.deviantart.com/ :welcome:

And this is the result of your help!!!
You do not have the required permissions to view the files attached to this post.
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: Change the background image of the skin at sunrise and s

Post by wiedzmawiedzma »

haibusa2005 wrote:Here is some of the code of the suite I am currently developing. It handles exactly the same matter :)
Currently I create a weather skin.
I am in the background instead of the weather icons in it applied your solution.
Do you have any idea to ten minutes before sunrise and sunset appeared PNG sunrise or sunset and then the night or day according to your solution? :welcome:
You do not have the required permissions to view the files attached to this post.
User avatar
haibusa2005
Posts: 52
Joined: June 15th, 2011, 7:23 pm
Location: Bulgaria, Varna

Re: Change the background image of the skin at sunrise and s

Post by haibusa2005 »

Sure. If I understood correctly, you want to display an image during the actual sunrise/sunset. Here is the code for sunrise, I guess you could modify it to work for sunset also


[DisplaySunrise]
Measure=Calc
;111 -> display nothing, 222 -> display sunrise icon
Formula=CurrentMinutesAfterMidnight>=SunriseMinutesAfterMidnight-10?(CurrentMinutesAfterMidnight<=SunriseMinutesAfterMidnight?222:111):111
IfAboveValue=150
IfAboveAction=[!ShowMeter SunriseIcon]
IfBelowValue=140
IfBelowAction=[!HideMeter SunriseIcon]
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: Change the background image of the skin at sunrise and s

Post by wiedzmawiedzma »

haibusa2005 wrote:Sure. If I understood correctly, you want to display an image during the actual sunrise/sunset. Here is the code for sunrise, I guess you could modify it to work for sunset also
Exactly my point is that with the help of your formula to get the display order:
Sunset. png - display time "10 minutes"
Night. png - display time "to sunrise"
Sunrise. png - display time "10 minutes"
Day. png - display time "to sunset"
Thanks for the answer!
Tomorrow, check your formula and I know that well understood. :bow: