It is currently May 3rd, 2024, 5:34 pm

Multiple locations for weather skin.

Get help with creating, editing & fixing problems with skins
sgtevmckay

Multiple locations for weather skin.

Post by sgtevmckay »

I have been racking my brain, and although I think I am close to an answer, I keep missing something, apparently something vital :?

I want to be able to add multiple locations to my weather skin ( http://forum.rainmeter.net/viewtopic.php?p=41316#p41316 ), but I am seriously stumped on this one :confused:
What I do not want to see happen is that a lot of information is downloaded from Weather.com's XML all at once, rather the skin would be refreshed (via a Bang) with the new location/destination.
This will avoid a massive, multi-URL server download all at once. :thumbup:
Very frustrating, any thoughts????? :oops:
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Multiple locations for weather skin.

Post by jsmorley »

Since a plugin like WebParser can't use DynamicVariables, you are going to be pretty limited on solutions. !RainmeterWriteKeyValue and a skin refresh is one option, or multiple WebParser main measures that use different urls and you use !RainmeterDisableMeasure / !RainmeterEnableMeasure to manage what gets used when.
sgtevmckay

Re: Multiple locations for weather skin.

Post by sgtevmckay »

That is way off from what I was considering.
I need to take a closer look at what you have suggested and make a small skin with an example of this.
Never used these functions before O.O
I bit lost, but hey....not unusual ;)
sgtevmckay

Re: Multiple locations for weather skin.

Post by sgtevmckay »

The more I read the suggestions.....The more hair pulling I do.
  Maybe an explanation of what I envision  
As many will know the code for Visions+ weather is fairly standard
The area of concern would be for URL's which are listed as destinations as follows:

Weather

Code: Select all

[Variables]
;--------------Weather.com Location and Image set selection-------------------

;Replace your location code of Weather.com below, e.g: New York is USNY0996.
;You can check it on Weather.com or Google weather for local code. 
;Code will be shown in URL Address (ie. Address Board).

;define Fahrenheit/US system = f 
;or 
;Celsius/Metric system = m
;After the equals ( = ) Sign:
SCALE=f

;Place your location code below, and after the "=" sign
dest=87505
Moon Phase:

Code: Select all

;---------------------Set Time Zone for Moon Phase-------------------------

; Enter your zone below. CET is Central European Time. Others are
; "PST" = Pacific Standard Time
; "MST" = Mountain Standard Time
; "CST" = Central Standard Time
; "EST" = Eastern Standard Time
; "UT"  = Universal Time
; "GMT" = Greenwich Mean Time
; You can find yours here: http://www.timeanddate.com/worldclock/
; To find your correct TimeZone you need to know your timezone difference from
; GMT. For CET it is +1 (GMT +1), so TimeZone=+1 like below.
; PST = (GMT -8)
; EST = (GMT -5)
; etc.
; If your location use Summer Time (or Daylight time, whatever you call it), 
; you will have to use a slightly differnt URL. You can save that below, and 
; then comment out the one you are not using: Normal time or Summer time.
;
; Simply add 1 to your normal time (above) and you have found your daylight 
; time :)
;
;Remember to make the necessary change as you fluxuate in and out of Daylight Savings time
;
;Example:
;zone="CEST" 
;TimeZone=+2

zone="MTN"
TimeZone=-7
What I would like to do is in the following:

Code: Select all

[Variables]
;======================Location Variables=====================================

;--------------Weather.com Location and Image set selection-------------------

;Replace your location code of Weather.com below, e.g: New York is USNY0996.
;You can check it on Weather.com or Google weather for local code. 
;Code will be shown in URL Address (ie. Address Board).

;define Fahrenheit/US system = f 
;or 
;Celsius/Metric system = m
;After the equals ( = ) Sign:
SCALE1=f

;Place your location code below, and after the "=" sign
dest1=87505

;Location 2
SCALE2=f
dest2=87507

;Location 3
SCALE3=f
dest3=87501

;Location 4
SCALE4=f
dest4=87121

Code: Select all

;---------------------Set Time Zone for Moon Phase-------------------------

; Enter your zone below. CET is Central European Time. Others are
; "PST" = Pacific Standard Time
; "MST" = Mountain Standard Time
; "CST" = Central Standard Time
; "EST" = Eastern Standard Time
; "UT"  = Universal Time
; "GMT" = Greenwich Mean Time
; You can find yours here: http://www.timeanddate.com/worldclock/
; To find your correct TimeZone you need to know your timezone difference from
; GMT. For CET it is +1 (GMT +1), so TimeZone=+1 like below.
; PST = (GMT -8)
; EST = (GMT -5)
; etc.
; If your location use Summer Time (or Daylight time, whatever you call it), 
; you will have to use a slightly differnt URL. You can save that below, and 
; then comment out the one you are not using: Normal time or Summer time.
;
; Simply add 1 to your normal time (above) and you have found your daylight 
; time :)
;
;Remember to make the necessary change as you fluxuate in and out of Daylight Savings time
;
;Example:
;zone="CEST" 
;TimeZone=+2

zone1="MTN"
TimeZone1=-7


zone2="CNT"
TimeZone2=-6

zone3="JAP"
TimeZone3=+4

zone4="ATL"
TimeZone4=-8
This information would need entered appropriately here:

Code: Select all

[MeasureCurrent]
Measure=Plugin
Plugin=Plugins\WebParser.dll
; updated weather ~22.5 minute
UpdateRate=670
Url=http://xml.weather.com/weather/local/#dest#?cc=*&unit=#SCALE#&dayf=10
I will be adding additional URL parse for Wunder as well, in order to complete the skins mash up.

All I need do is iron out how to trigger the additional locations, to the same parse that is in place.

The triggers would be placed in the UI
something like the following:


I hope I am making sense, as I am at a point where my brain hurts
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Multiple locations for weather skin.

Post by dragonmage »

Here's a test skin showing your destination switching system Sarge.

Code: Select all

[Rainmeter]

[Variables]
dest1=12345
scale1=f
dest2=23456
scale2=c
dest3=34567
scale3=f
dest4=45678
scale4=c
zone1="est"
TimeZone1=-6
zone2="pst"
TimeZone2=-9
zone3="mst"
TimeZone3=-8
zone4="emct"
TimeZone4=2

CurrentDest=1

dest=#dest1#
scale=#scale1#
zone=#zone1#
TimeZone=#TimeZone1#

[ActiveDest]
Measure=CALC
Formula=#CurrentDest#
Substitute="4":"0"
DynamicVariables=1

[NextDest]
Measure=CALC
Formula=([ActiveDest] +1)
DynamicVariables=1

[Button]
Meter=IMAGE
SolidColor=0,0,0,255
H=40
W=40
LeftMouseDownAction=!Execute [!RainmeterWriteKeyValue Variables dest "#dest[NextDest]#"][!RainmeterWriteKeyValue Variables scale "#scale[NextDest]#"][!RainmeterWriteKeyValue Variables zone "#zone[NextDest]#"][!RainmeterWriteKeyValue Variables TimeZone "#TimeZone[NextDest]#"]
LeftMouseUpAction=!Execute [!RainmeterWriteKeyValue Variables CurrentDest [NextDest]][!RainmeterRefresh]
DynamicVariables=1

[DestString]
Meter=String
Text=#dest#
Y=5R
DynamicVariables=1

[ScaleString]
Meter=String
Text=#scale#
Y=5R
DynamicVariables=1

[TimeString]
Meter=STRING
Text=#zone#
Y=5R
DynamicVariables=1

[TimeZoneString]
Meter=STRING
Text=#TimeZone#
Y=5R
DynamicVariables=1
You should be able to drop this part

Code: Select all

CurrentDest=1

dest=#dest1#
scale=#scale1#
zone=#zone1#
TimeZone=#TimeZone1#

[ActiveDest]
Measure=CALC
Formula=#CurrentDest#
Substitute="4":"0"
DynamicVariables=1

[NextDest]
Measure=CALC
Formula=([ActiveDest] +1)
DynamicVariables=1
into your skin, then add this part

Code: Select all

LeftMouseDownAction=!Execute [!RainmeterWriteKeyValue Variables dest "#dest[NextDest]#"][!RainmeterWriteKeyValue Variables scale "#scale[NextDest]#"][!RainmeterWriteKeyValue Variables zone "#zone[NextDest]#"][!RainmeterWriteKeyValue Variables TimeZone "#TimeZone[NextDest]#"]
LeftMouseUpAction=!Execute [!RainmeterWriteKeyValue Variables CurrentDest [NextDest]][!RainmeterRefresh]
DynamicVariables=1
to the button that you want to do the switch...

Making separate buttons would actually not require the two calcs, only changing the MouseDown !Executes to specific numbers rather than using the [NextDest] to set to the next. You could also use another calc to create a PreviousDest button if you don't want to have the individual buttons.
sgtevmckay

Re: Multiple locations for weather skin.

Post by sgtevmckay »

I had to do some serious fiddling to get the Dynamic Variables to play nice with "CurrentDest=", but I got it down.....I think :oops:
This much I know for certain; My weather skins now support multiple locations :great:

Thanks to DragonMage and JSMorley :rosegift:

I now need to do 2 things further.
1.) Integrate these Dynamic Variables so folks can select different Weather Image Icon sets, Moon images, Moon over images, and the like, per selected location.
2.) Set up the location indicator.

#2 I have figured; ASSUMING you can add "IfEqual=" to "CurrentDest="
Is this possible?
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Multiple locations for weather skin.

Post by dragonmage »

I'd probably use a cascading set of variables based on CurrentDest=. I haven't fully thought it out yet but I'll get back to you as soon as I can.
sgtevmckay

Re: Multiple locations for weather skin.

Post by sgtevmckay »

I got it :thumbup:

Please note the addition of the "UpdateRate="
As this skin updates every 2 second, the Calc added a 2% to 3% -/+ additional systems load to the processor every 2 seconds, by leaving the update rate, since there is no "Read Once" option. These will up update and show a number identifier every 22.5 minutes, same time the skin naturally updates any ways, and reduces the systems load back to normal levels :great:

Code: Select all

[IdentLoc1]
UpdateRate=670
Measure=CALC
Formula=#CurrentDest#
IfEqualValue=1
IfEqualAction=!execute [!RainmeterHideMeter DestSwitch1][!RainmeterShowMeter DestSwitch1R][!RainmeterShowMeter DestSwitch2][!RainmeterHideMeter DestSwitch2R][!RainmeterShowMeter DestSwitch3][!RainmeterHideMeter DestSwitch3R][!RainmeterShowMeter DestSwitch4][!RainmeterHideMeter DestSwitch4R]

[IdentLoc2]
UpdateRate=670
Measure=CALC
Formula=#CurrentDest#
IfEqualValue=2
IfEqualAction=!execute [!RainmeterShowMeter DestSwitch1][!RainmeterHideMeter DestSwitch1R][!RainmeterHideMeter DestSwitch2][!RainmeterShowMeter DestSwitch2R][!RainmeterShowMeter DestSwitch3][!RainmeterHideMeter DestSwitch3R][!RainmeterShowMeter DestSwitch4][!RainmeterHideMeter DestSwitch4R]

[IdentLoc3]
UpdateRate=670
Measure=CALC
Formula=#CurrentDest#
IfEqualValue=3
IfEqualAction=!execute [!RainmeterShowMeter DestSwitch1][!RainmeterHideMeter DestSwitch1R][!RainmeterShowMeter DestSwitch2][!RainmeterHideMeter DestSwitch2R][!RainmeterHideMeter DestSwitch3][!RainmeterShowMeter DestSwitch3R][!RainmeterShowMeter DestSwitch4][!RainmeterHideMeter DestSwitch4R]

[IdentLoc4]
UpdateRate=670
Measure=CALC
Formula=#CurrentDest#
IfEqualValue=4
IfEqualAction=!execute [!RainmeterShowMeter DestSwitch1][!RainmeterHideMeter DestSwitch1R][!RainmeterShowMeter DestSwitch2][!RainmeterHideMeter DestSwitch2R][!RainmeterShowMeter DestSwitch3][!RainmeterHideMeter DestSwitch3R][!RainmeterHideMeter DestSwitch4][!RainmeterShowMeter DestSwitch4R]
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Multiple locations for weather skin.

Post by dragonmage »

I meant for the iconsets.
sgtevmckay

Re: Multiple locations for weather skin.

Post by sgtevmckay »

Ah.....I see

I am hammering this issue now as well.
I am going through the Occam's razor theories now......but my experiences and usage of all the new goodies in Rainmeter is very limited :(