It is currently May 21st, 2024, 5:31 pm
Get help with creating, editing & fixing problems with skins
naljubes
Posts: 8 Joined: September 17th, 2012, 3:06 am
Post
by naljubes » September 19th, 2012, 1:29 am
I have a skin that shows the cumulative netin and netout. I can reset this meter by clicking the skin so the counter resets to zero. It is not reset using !ResetStats This works by taking the value of NetIn and storing it into a variable which is then subtracted from the current value of NetIn.
I am wondering if I can have a timer that shows the amount of time since this value was zeroed. Perhaps the time / date could be stored as a value then subtracted from the current time /date value to give the uptime of the meter.
Here is an example of the code for this skin.
Code: Select all
[Variables]
ValStore=0
[meterBackground]
Meter=Image
ImageName=...
MiddleMouseUpAction=[!WriteKeyValue Variables VarStore [MeasureNetInTotal]][!Refresh]
[MeasureNetInTotal]
Measure=NetIn
Cumulative=1
[MeasureNetInSinceMANUALRefresh]
Measure=Calc
Formula=MeasureNetInTotal - #VarStore#
[MeterNetworkInTotalMANUAL]
Meter=String
DynamicVariables=1
MeasureName=MeasureNetInSinceMANUALRefresh
Text="DL: %1"
Thanks everyone
smurfier
Moderator
Posts: 1931 Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN
Post
by smurfier » September 19th, 2012, 8:27 am
Something like this should work:
Code: Select all
[Variables]
ValStore=0
ValStamp=0
[Time]
Measure=Time
[meterBackground]
Meter=Image
ImageName=...
MiddleMouseUpAction=[!WriteKeyValue Variables VarStore [MeasureNetInTotal]][!WriteKeyValue Variables ValStamp [Time]][!Refresh]
[MeasureNetInTotal]
Measure=NetIn
Cumulative=1
[MeasureNetInSinceMANUALRefresh]
Measure=Calc
Formula=MeasureNetInTotal - #VarStore#
[MeasureHour]
Measure=Calc
Formula=TRUNC((MeasureTime-#ValStamp#)/3600)
[MeasureMinute]
Measure=Calc
Formula=TRUNC((((MeasureTime-#ValStamp#)%3600)/60)
[MeasureSecond]
Measure=Calc
Formula=(MeasureTime-#ValStamp#)%60
[MeterNetworkInTotalMANUAL]
Meter=String
DynamicVariables=1
MeasureName=MeasureNetInSinceMANUALRefresh
Text="DL: %1"
GitHub |
DeviantArt |
Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
naljubes
Posts: 8 Joined: September 17th, 2012, 3:06 am
Post
by naljubes » September 20th, 2012, 4:29 am
Thanks so much for the help : ) I had to change a few things to make it work, but it works now.
Would give a value like "22:18:45"
we needed a value without the : symbols in it so I did
Code: Select all
[MeasureTime]
Measure=Calc
Formula=MeasureTime2
[MeasureTime2]
Measure=Time
Now, ValStamp is given a value like "12992567017" an can now be subtracted from to zero the timer.
Here is the code I used to display the uptime.
Code: Select all
[ResetTimerLabel]
Meter=STRING
MeasureName=MeasureHour
MeasureName2=MeasureMinute
MeasureName3=MeasureSecond
Text="%1:%2:%3"
smurfier
Moderator
Posts: 1931 Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN
Post
by smurfier » September 21st, 2012, 12:58 am
There's an easier solution using Rainmeter 2.4 beta.
By adding a colon at the end of the [Time] dynamic variable we will use the number value of the measure instead.
Code: Select all
[meterBackground]
Meter=Image
ImageName=...
MiddleMouseUpAction=[!WriteKeyValue Variables VarStore [MeasureNetInTotal]][!WriteKeyValue Variables ValStamp [Time:]][!Refresh]
DynamicVariables=1
GitHub |
DeviantArt |
Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
eclectic-tech
Rainmeter Sage
Posts: 5415 Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Post
by eclectic-tech » September 21st, 2012, 3:23 pm
smurfier wrote: There's an easier solution using Rainmeter 2.4 beta.
By adding a colon at the end of the [Time] dynamic variable we will use the number value of the measure instead.
Code: Select all
[meterBackground]
Meter=Image
ImageName=...
MiddleMouseUpAction=[!WriteKeyValue Variables VarStore [MeasureNetInTotal]][!WriteKeyValue Variables ValStamp [Time:]][!Refresh]
DynamicVariables=1
Learning a new trick everyday!
Maybe this tip should be added to the TIME MEASURE section of the manual...
Kaelri
Developer
Posts: 1721 Joined: July 25th, 2009, 4:47 am
Post
by Kaelri » September 21st, 2012, 3:26 pm
eclectic-tech wrote: Maybe this tip should be added to the TIME MEASURE section of the manual...
This is part of a broader feature called "section variables," which is documented in the beta manual
here .
eclectic-tech
Rainmeter Sage
Posts: 5415 Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Post
by eclectic-tech » September 21st, 2012, 3:36 pm
Kaelri wrote:
This is part of a broader feature called "section variables," which is documented in the beta manual
here .
I looked at the measures and did not see anything related...
Maybe a note or link could be added to the meter and measure info pages to raise awareness of the section variables feature?
Just wondering out loud again
Kaelri
Developer
Posts: 1721 Joined: July 25th, 2009, 4:47 am
Post
by Kaelri » September 21st, 2012, 3:49 pm
We are working on a major revision to the manual that should (among other things) make these features easier to discover. :)