Code: Select all
;Fahrenheit calculation
[MeasureColorF]
Measure=String
DynamicVariables=1
IfCondition=MeasureTemp >= 115
IfTrueAction=[!SetOption MeasureColorF String "176,0,0"]
IfCondition2=(MeasureTemp > 73.5) && (MeasureTemp < 115)
IfTrueAction2=[!SetOption MeasureColorF String "255,(ROUND(((115-[MeasureTemp])/41.5)*255)),0"]
IfCondition3=(MeasureTemp > 32) && (MeasureTemp <= 73.5)
IfTrueAction3=[!SetOption MeasureColorF String "(ROUND((([MeasureTemp]-32)/41.5)*255)),255,(ROUND(((73.5-[MeasureTemp])/41.5)*255))"]
IfCondition4=MeasureTemp = 32
IfTrueAction4=[!SetOption MeasureColorF String "0,255,255"]
IfCondition5=(MeasureTemp > -51) && (MeasureTemp < 32)
IfTrueAction5=[!SetOption MeasureColorF String "0,(ROUND((([*MeasureTemp*]+51)/83)*255)),255"]
IfCondition6=MeasureTemp <= -51
IfTrueAction6=[!SetOption MeasureColorF String "0,0,144"]
IfConditionMode=1
;Celsius calculation
[MeasureColorC]
Measure=String
DynamicVariables=1
IfCondition=MeasureTemp >= 46
IfTrueAction=[!SetOption MeasureColorC String "176,0,0"]
IfCondition2=(MeasureTemp > 23) && (MeasureTemp < 46)
IfTrueAction2=[!SetOption MeasureColorC String "255,(ROUND(((46-[MeasureTemp])/23)*255)),0"]
IfCondition3=(MeasureTemp > 0) && (MeasureTemp <= 23)
IfTrueAction3=[!SetOption MeasureColorC String "(ROUND(([MeasureTemp]/23)*255)),255,(ROUND(((23-[MeasureTemp])/23)*255))"]
IfCondition4=MeasureTemp = 0
IfTrueAction4=[!SetOption MeasureColorC String "0,255,255"]
IfCondition5=(MeasureTemp > -46) && (MeasureTemp < 0)
IfTrueAction5=[!SetOption MeasureColorC String "0,(ROUND(((46+[MeasureTemp])/46)*255)),255"]
IfCondition6=MeasureTemp <= -46
IfTrueAction6=[!SetOption MeasureColorC String "0,0,144"]
IfConditionMode=1
[MeterCurrentTemp]
Meter=String
MeasureName=@CurrentTemperature
X=0
Y=0
FontColor=[MeasureColor[&@UnitsTemperature]]
FontFace=Arial Bold
FontSize=28
StringAlign=Left
StringEffect=Border
FontEffectColor=0,0,0
AntiAlias=1
DynamicVariables=1
Text=%1#Degrees#
One issue I haven't been able to work out -
When run as it is in the attached skin where there are two measures each for both temperature types/scales (MeasureColorFCalc, MeasureColorF, MeasureColorCCalc, MeasureColorC), the degree symbol will load in blue and then it is replaced with the temperature and degree symbol in the correct color. If I comment out the measures MeasureColorF and MeasureColorC and then rename the measures MeasureColorFCalc and MeasureColorCCalc to MeasureColorF and MeasureColorC, respectively (as it is shown above and which would be my preferred method as everything is contained in a single measure for each temperature type/scale), the degree symbol will load in white and then it is replaced with the temperature and degree symbol in the same blue color as before, then finally it is replaced with the temperature and degree symbol in the correct color. This only occurs on initial load or a skin refresh. Once loaded, the color changes on the update cycle directly from the previous color to the new color without any interim white or blue. The blue I am assuming is the RGB value associated with zero degrees for either temperature type/scale. I can't figure out how to pause the display of the temperature and degree symbol on initial load and/or refresh until the actual RGB value for the temperature is resolved. I have tried making the measures and/or the meter a disabled group and enabling the group after @CurrentTemperature is parsed in @CurrentConditionsParent (from WeatherComJSONMeasures3Day.inc), but that doesn't seem to work. I've also tried !PauseMeasure and that didn't seem to work either.