Not so complex, actually. Rainmeter gets the system time as a number of seconds, and there are 86,400 seconds in a day (60 seconds x 60 minutes x 24 hours). Every 86,400th second indicates the start of a new day. So all you need to do is take the "total" seconds, divide by 1 day, and use the remainder (%) as a proportion of 1 day.VasTex wrote:Would it be possible to use a Bar (or RoundLine for the fancy folk) to measure something like the SystemTime or perhaps the more complicated idea of current weather?
What I was thinking for SystemTime was to use an upper limit similar to the one we used for the RecycleBin, but this time we would use something like 24hours for the limit. That way at 12:00pm the bar would be 50% full and at 11:59pm it would be almost 100% full. Once it hits 12:00am the bar would reset to 0% and repeat. I realize that doing this would require somewhat more complex coding, but I'm very curious about its feasibility.
Code: Select all
[MeasureTime]
Measure=Time
[MeasureTimeBar]
Measure=Calc
Formula=MeasureTime % 86400
MaxValue=86400
This involves basically the same principles. The question is what you want to use as your scale. Some weather feeds provide the day's "high" and "low" temperatures, so you might want to show the current temperature within this range. For example (this assumes you have the high, low and current temperatures available as other measures):VasTex wrote:As for doing this for the Weather I can't imagine that it would be any easier. Most likely harder seeing as how you would need to move values from an RSS feed into a different dynamic set of variables...or something like that.
Code: Select all
[MeasureWeatherBar]
Measure=Calc
Formula=(MeasureCurrentTemp - MeasureLowTemp) / (MeasureHighTemp - MeasureLowTemp
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=0,0,0,128
DynamicWindowSize=1
[Variables]
CurrentCode=44418
Unit=f
;-----------------------
; MEASURES
[MeasureTime]
Measure=Time
[MeasureTimeBar]
Measure=Calc
Formula=MeasureTime % 86400
MaxValue=86400
[MeasureCurrentTemp]
Measure=Plugin
Plugin=WebParser
UpdateRate=1800
Url=http://weather.yahooapis.com/forecastrss?w=#CurrentCode#&u=#Unit#
RegExp=(?siU)<.*yweather:condition.*temp=\"(.*)\".*yweather:forecast.*low=\"(.*)\".*high=\"(.*)\"
StringIndex=1
FinishAction=!EnableMeasure MeasureWeatherBar
[MeasureLowTemp]
Measure=Plugin
Plugin=WebParser
URL=[MeasureCurrentTemp]
StringIndex=2
[MeasureHighTemp]
Measure=Plugin
Plugin=WebParser
URL=[MeasureCurrentTemp]
StringIndex=3
[MeasureWeatherBar]
Measure=Calc
Formula=(MeasureCurrentTemp - MeasureLowTemp) / (MeasureHighTemp - MeasureLowTemp)
Disabled=1
;-----------------------
; STYLES
[StyleLabel]
X=10
Y=20R
W=210
H=20
FontSize=12
FontColor=192,192,192
FontFace=Segoe UI
AntiAlias=1
[StyleText]
X=10
Y=R
W=210
H=32
FontSize=16
FontColor=255,255,255
FontFace=Segoe UI
AntiAlias=1
[StyleBar]
X=10
Y=R
H=12
W=200
BarColor=0,128,192
SolidColor=33,33,33
BarOrientation=Horizontal
;-----------------------
; METERS
[TimeLabel]
Meter=String
MeterStyle=StyleLabel
Text=Time:
[TimeText]
Meter=String
MeterStyle=StyleText
MeasureName=MeasureTime
[TimeBar]
Meter=Bar
MeterStyle=StyleBar
MeasureName=MeasureTimeBar
[WeatherLabel]
Meter=String
MeterStyle=StyleLabel
Text=Temperature:
[WeatherText]
Meter=String
MeterStyle=StyleText
MeasureName=MeasureCurrentTemp
Postfix=° F
[WeatherBar]
Meter=Bar
MeterStyle=StyleBar
MeasureName=MeasureWeatherBar
[Spacer]
Meter=Image
Y=R
H=20
W=1