It is currently May 2nd, 2024, 10:54 am

Using Bars for a RecycleBin Manager

Get help with creating, editing & fixing problems with skins
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Using Bars for a RecycleBin Manager

Post by Kaelri »

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.
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.

Code: Select all

[MeasureTime]
Measure=Time

[MeasureTimeBar]
Measure=Calc
Formula=MeasureTime % 86400
MaxValue=86400

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.
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):

Code: Select all

[MeasureWeatherBar]
Measure=Calc
Formula=(MeasureCurrentTemp - MeasureLowTemp) / (MeasureHighTemp - MeasureLowTemp
Here's a basic skin demonstrating both of these:

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
Screenshot56.png
You do not have the required permissions to view the files attached to this post.
User avatar
VasTex
Posts: 407
Joined: September 20th, 2012, 3:17 pm
Location: USA - Montana

Re: Using Bars for a RecycleBin Manager

Post by VasTex »

@Eclectic-Tech,

Much appreciated! I will definitely give his code a few looks and see if it has anything nifty that I haven't figured out yet and then see if I can replicate what looks useful. Thanks again!

@Kaelri,

Well, I didn't know that that was how Rainmeter interpreted SystemTime. That being said I take back my 'this might be complicated' thing haha. The code you gave looks substantially more simple than I would have thought, but it also looks very effective. I'll try implementing something like that once I finalize the RecycleBin Design.

As for the WeatherBar I do have a skin I made at the moment that displays the days High and Low and they are in their own, separate measures. But the design that I have in mind would have a Vertical Bar which begins at 0f at the bottom and goes up to about 120f at the very top. With those bounds in mind I was thinking of just having the current temperature be used for the height of the Bar and the High and Low temps as milemarkers so to speak [I've uploaded a rough sketch I just did for a better idea of what I'm thinking, keep in mind that that concept is very much a work in progress]

P.S. Thank you very much for the example skin. I just managed to get something similar to that working on my end, but the code wasn't nearly as clean haha. Now I just need to clean up my code and my design!

Thanks a lot you guys, you're helping me out a ton here!
You do not have the required permissions to view the files attached to this post.
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011