It is currently May 24th, 2024, 3:28 am

Conditional formatting of weather

Get help with creating, editing & fixing problems with skins
User avatar
Raikuga
Posts: 12
Joined: May 20th, 2010, 11:00 pm

Conditional formatting of weather

Post by Raikuga »

I have a simple problem to solve..

My weather skin works fine, but when the wind measure reads "calm", the skin says "calmmph CALM" because it still displays the other measures. How do I make it so that when the wind strength measure reads "calm", it displays only that instead of the normal information? I've tried IfEqualMeasure="calm" and it didn't quite work.

I don't really think a code snippet is necessary for this, but here's the meter:

Code: Select all

[LabelCurrentWind]
Meter=String
MeasureName=CurrentWind
MeasureName2=CurrentWindDir
Meterstyle=DescStyle
Text="Wind: %1mph %2"
X=r
Y=R
W=20
H=20
when the measure CurrentWind reads "calm", I want it to instead be:

Code: Select all

[LabelCurrentWind]
Meter=String
MeasureName=CurrentWind
MeasureName2=CurrentWindDir
Meterstyle=DescStyle
Text="Wind: %1"
X=r
Y=R
W=20
H=20
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Conditional formatting of weather

Post by Chewtoy »

You have to look at the measures.
Substitute="Calm":""

Add that to the where the wind i measured.
To not run in to a problem with having the speedunit, I have my skin set up so it shows "0km/h" instead of "Calmkm/h calm". It seems easier.
I don't think, therefore I'm not.
User avatar
Raikuga
Posts: 12
Joined: May 20th, 2010, 11:00 pm

Re: Conditional formatting of weather

Post by Raikuga »

I guess that would be an easier solution than complicating everything with conditionals...

Thanks for your help.
User avatar
maminscris
Posts: 509
Joined: April 24th, 2009, 3:17 pm
Location: Bucharest, Romania Lat 44,43° Lon 26,1°

Re: Conditional formatting of weather

Post by maminscris »

here is what i have

Code: Select all

[MeasureWind]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureVreme]
StringIndex=8
IfEqualValue=0
IfEqualAction=!execute [!RainmeterHideMeter MeterWind]
IfAboveValue=0
IfAboveAction=!execute [!RainmeterShowMeter MeterWind]

[MeasureWindDirection]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureVreme]
StringIndex=9
Substitute="":"Calm"

[MeterWind]
MeasureName=MeasureWind
Meter=String
X=16r
Y=r
StringStyle=#Style#
StringAlign=Left
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
Antialias=1
Text=%1 m/s
NumOfDecimals=1

[MeterWindDirection]
MeasureName=MeasureWindDirection
Meter=String
X=R
Y=0r
StringStyle=#Style#
StringAlign=Left
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
Antialias=1
Text=- %1
Zero at programing, zero at writing codes, so far 2 at making images
But I'm good at copy/paste, and I not always like this
Image