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.
It is currently May 2nd, 2024, 8:16 am
Change the background image of the skin at sunrise and sunse
-
- Posts: 112
- Joined: August 18th, 2012, 5:19 pm
-
- Posts: 52
- Joined: June 15th, 2011, 7:23 pm
- Location: Bulgaria, Varna
Re: Change the background image of the skin at sunrise and s
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]
-
- Posts: 112
- Joined: August 18th, 2012, 5:19 pm
Re: Change the background image of the skin at sunrise and s
Many thanks I will try it soon and let you know how I went!
-
- Posts: 112
- Joined: August 18th, 2012, 5:19 pm
Re: Change the background image of the skin at sunrise and s
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/
And this is the result of your help!!!
And this is the result of your help!!!
You do not have the required permissions to view the files attached to this post.
-
- Posts: 112
- Joined: August 18th, 2012, 5:19 pm
Re: Change the background image of the skin at sunrise and s
Currently I create a weather skin.haibusa2005 wrote:Here is some of the code of the suite I am currently developing. It handles exactly the same matter
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?
You do not have the required permissions to view the files attached to this post.
-
- Posts: 52
- Joined: June 15th, 2011, 7:23 pm
- Location: Bulgaria, Varna
Re: Change the background image of the skin at sunrise and s
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]
[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]
-
- Posts: 112
- Joined: August 18th, 2012, 5:19 pm
Re: Change the background image of the skin at sunrise and s
Exactly my point is that with the help of your formula to get the display order: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
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.