Welcome, Guest
Please Login or Register.    Lost Password?

IfBetweenValue...?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: IfBetweenValue...?
#9109
IfBetweenValue...? 5 Years, 7 Months ago  
Just trying to hack about with my first skin (a modified version of Rainy's Tranquil Weather), doing something I thought would be nice and simple... I'm using webparse to get the current temperature from a website, then if it is below zero, I wanted to change font to blue, or change it to red when above 30, otherwise just show it black (I use 3 different instances of my skin to monitor temps in Dubai, Ottawa, and Sydney, so all three ranges are frequently used).

After trying various different approaches to control the fontcolor with more and more obtuse logic, I am now at the following stage...

I have 2 Calc type measures for LowTemp, and HighTemp, both looking at the webparsed value. LowTemp uses IfBelowValue=0; HighTemp uses IfAboveValue=30. I'll get to what each one does in a minute...

I then have 3 string type meters. MeterNorm looks directly at the webparsed value and prints it in black (hidden=0). MeterLow looks at the LowTemp measure and displays it blue, but is hidden at startup. Similarly, MeterHigh looks at the HighTemp measure and displays it red, but is also hidden at startup.

The IfBelowAction for LowTemp is to hide all 3 meters, and then to show MeterLow.
The IfAboveAction for HighTemp is to hide all 3 meters, and then to show MeterHigh.

Code:

[LowTemp]
Measure=Calc
Formula=MeasureWeather
IfBelowValue=1
IfBelowAction=!execute #HideAllTemps#[!RainmeterShowMeter MeterLowTemp]

[HighTemp]
Measure=Calc
Formula=MeasureWeather
IfAboveValue=30
IfAboveAction=!execute #HideAllTemps#[!RainmeterShowMeter MeterHighTemp]

[MeterNormalTemp]
MeasureName=MeasureWeather
Meter=STRING
X=170
Y=15
FontColor=0, 0, 0
StringStyle=BOLD
FontSize=24
StringAlign=RIGHT
FontFace=Arial
Postfix="C"
Antialias=1
Hidden=0

[MeterLowTemp]
MeasureName=LowTemp
Meter=STRING
X=170
Y=15
FontColor=0, 0, 255
StringStyle=BOLD
FontSize=24
StringAlign=RIGHT
FontFace=Arial
Postfix="C"
Antialias=1
Hidden=1

[MeterHighTemp]
MeasureName=HighTemp
Meter=STRING
X=170
Y=15
FontColor=255, 0, 0
StringStyle=BOLD
FontSize=24
StringAlign=RIGHT
FontFace=Arial
Postfix="C"
Antialias=1
Hidden=1



Regardless of the actual temperature, the display is always the same colour (which with the arrangement described above, is blue, though it is 26C in Sydney today...). By changing the order of the various meters and measures, I can also get the temperature to display black (all the time), though I haven't yet managed to achieve the same with red..?

I'm beginning to wonder if I need an IfBetweenValue and Action to control my middle temperature range!! I assume you can't have multiple IfAboves and IfBelows in the same measure?

Anybody got any ideas what I'm doing wrong?
Cheers
Grumby
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2009/03/01 22:28 By Grumby.Reason: Added Code
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop