It is currently April 24th, 2024, 1:43 am

is updating meters without measures possible?

Get help with creating, editing & fixing problems with skins
derLeon
Posts: 13
Joined: April 19th, 2019, 4:38 pm

is updating meters without measures possible?

Post by derLeon »

Hi guys!

I want to have a countdown for a alarm through rainmeter.
is there a way to update >really only the meter<?
every time it redraws the meter group it activates the measures.

i could save a timestamp of the moment i started the countdown and compare the time (with additional time) to check if the time has passed...
but this seems too dirty

is there a way to only update just the meters without the measures?
  if not... is there a simple way to add save and calculate time (maybe in seconds?)  
my work till now:

Code: Select all

[Rainmeter]
Group=RefreshMeter
Update=1000
BackgroundMode=2
DynamicWindowSize=1
MouseScrollUpAction=[!Redraw RefreshMeter]
MouseScrollDownAction=[!Redraw RefreshMeter]

[Variables]
DynamicVariables=1

;determines colors for the skin. free to choose 255,105,180
vMainColorBright=127,0,0,255
vMainColorDark=31,0,0,255
vMainColor=#vMainColorBright#
vSolidColorBright=31,0,0,255
vSolidColorDark=0,0,0,255
vSolidColor=#vSolidColorBright#

;recommended is "Segoe UI Symbol"
vFontFace=Segoe UI Symbol
vFontSize=32

;names of your drives
vDisk1=C:
vDisk2=X:
vDisk3=F:
vMaxPerc=100
vDiv10=10

;magic numbers and text
vWidth=1080
vHeight=1920

;clock
[MeasureTime]
Measure=Time
Format=%T
[MeterTime]
Group=RefreshMeter
Meter=String
MeasureName=MeasureTime
Text=%1
W=#vWidth#
X=(#vWidth#)/2
StringAlign=Center
AntiAlias=1
DynamicVariables=1
FontFace=#vFontFace#
FontColor=#vMainColor#
FontSize=(#vFontSize#)*2
SolidColor=#vSolidColor#

;allow clicks
[MeasureCharLockthis]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Lockthis.html
RegExp=(.*)
StringIndex=1
DecodeCharacterReference=1
DynamicVariables=1

[MeasureCharUnlockthis]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Unlockthis.html
RegExp=(.*)
StringIndex=1
DecodeCharacterReference=1
DynamicVariables=1

[MeterSkinLockthis]
Group=RefreshMeter
Meter=String
MeasureName=MeasureCharLockthis
MeasureName2=MeasureCharUnlockthis
Text=%2
Y=20
X=#vWidth#
StringAlign=Right
MouseScrollUpAction=[!DisableMouseActionGroup * Lockable][!SetOption MeterSkinLockthis Text "%1"][!UpdateGroup RefreshMeter]
MouseScrollDownAction=[!EnableMouseActionGroup * Lockable][!SetOption MeterSkinLockthis Text "%2"][!UpdateGroup RefreshMeter]
AntiAlias=1
DynamicVariables=1
FontFace=#vFontFace#
FontColor=#vMainColor#
FontSize=(#vFontSize#)*1.5
SolidColor=#vSolidColor#

;change color set
[MeasureCharBrightness]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Brightness.html
RegExp=(.*)
StringIndex=1
DecodeCharacterReference=1
DynamicVariables=1

[MeterSkinBrightness]
Group=RefreshMeter
MeasureName=MeasureCharBrightness
Meter=String
Text=%1
FontFace=#vFontFace#
FontColor=#vMainColor#
FontSize=(#vFontSize#)*2
AntiAlias=1
Y=0
X=0
DynamicVariables=1
SolidColor=#vSolidColor#
MouseScrollDownAction=[!SetVariable vMainColor #vMainColorDark#][!SetVariable vSolidColor #vSolidColorDark#][!UpdateGroup RefreshMeter]
MouseScrollUpAction=[!SetVariable vMainColor #vMainColorBright#][!SetVariable vSolidColor #vSolidColorBright#][!UpdateGroup RefreshMeter]

;decoration line below time
[MeterLineTime]
Group=RefreshMeter
Meter=Shape
Shape=Line 0,0,#vWidth#,0 | Stroke Color #vMainColor#
Y=R
SolidColor=#vSolidColor#

;date
[MeasureDate]
Measure=Time
Format=Week %V, %a%n%d. %B %Y
DynamicVariables=1

[MeterDate]
Group=RefreshMeter
Meter=String
MeasureName=MeasureDate
Text=%1
Y=R
W=#vWidth#
X=(#vWidth#)/2
StringAlign=Center
FontFace=#vFontFace#
FontColor=#vMainColor#
FontSize=#vFontSize#
AntiAlias=1
DynamicVariables=1
SolidColor=#vSolidColor#

;open things and stuff
[MeterIconsBar]
Group=RefreshMeter
Meter=String
Text="."
FontFace=#vFontFace#
FontColor=#vMainColor#
FontSize=#vFontSize#
AntiAlias=1
Y=R
X=0
W=#vWidth#
DynamicVariables=1
SolidColor=#vSolidColor#

[MeasureCharSettings]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Settings.html
RegExp=(.*)
StringIndex=1
DecodeCharacterReference=1
DynamicVariables=1

[MeterSettings]
Group=Lockable | RefreshMeter
Meter=String
MeasureName=MeasureCharSettings
Text=%1
Y=r
X=0
LeftMouseDoubleClickAction=[ms-settings:]
AntiAlias=1
DynamicVariables=1
FontFace=#vFontFace#
FontColor=#vMainColor#
FontSize=#vFontSize#
SolidColor=#vSolidColor#

[MeasureCharAntivir]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Antivir.html
RegExp=(.*)
StringIndex=1
DecodeCharacterReference=1
DynamicVariables=1

[MeterSkinAntivir]
Group=Lockable | RefreshMeter
Meter=String
MeasureName=MeasureCharAntivir
Text=%1
Y=r
X=R
LeftMouseDoubleClickAction=[X:\Programme\Malwarebytes\Anti-Malware\mbam.exe]
AntiAlias=1
DynamicVariables=1
FontFace=#vFontFace#
FontColor=#vMainColor#
FontSize=(#vFontSize#)-2
SolidColor=#vSolidColor#

;first attemt for countdown ticker TODO: how to NOT UPDATE this on mouseaction, but let it count each Update=1000
[MeasureCountDown]
Measure=Calc
Formula=MeasureCountDown+1
DynamicVariables=1

[MeasureCountDownSeconds]
Measure=Calc
Formula=(MeasureCountDown % 60) / 100
Substitute="0.":""
DynamicVariables=1

[MeasureCountDownMinutes]
Measure=Calc
Formula=Floor(MeasureCountDown / 60) % 60 / 100
Substitute="0.":""
DynamicVariables=1
NumOfDecimals=0

[MeterTextTime]
Group=RefreshMeter
Meter=String
MeasureName=MeasureCountDownSeconds
MeasureName2=MeasureCountDownMinutes
Text=%2:%1
AntiAlias=1
DynamicVariables=1
FontFace=#vFontFace#
FontColor=#vMainColor#
FontSize=#vFontSize#
SolidColor=#vSolidColor#
NumOfDecimals=2

Y=r
X=R
EDIT: wrong code version. i am an idiot.
EDIT2: removed the unused code and added comments
Last edited by derLeon on February 5th, 2021, 2:08 am, edited 6 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: is updating meters without measures possible?

Post by balala »

derLeon wrote: February 3rd, 2021, 3:55 pm is there a way to only update just the meters without the measures?
Actually there is: add an UpdateDivider=-1 option to every measure you don't want to regularly update. If you want to update these measures you have to either create a [!UpdateMeasure "Measure1"][!UpdateMeasure "Measure2"]... list of bangs, or a simpler solution, include all those measures into a group, by adding a Group=MyGroup option to each of them (name it as you want), then update them by a [!UpdateMeasureGroup "MyGroup"] bang.
However I'm not sure what would you like to achieve: when I load the skin containing the posted code, the skin starts to count the time, but then what? Additionally note that the [MeasureCountDownH] measure is missing.
derLeon
Posts: 13
Joined: April 19th, 2019, 4:38 pm

Re: is updating meters without measures possible?

Post by derLeon »

balala wrote: February 3rd, 2021, 4:47 pm Actually there is: add an UpdateDivider=-1 option to every measure you don't want to regularly update. If you want to update these measures you have to either create a [!UpdateMeasure "Measure1"][!UpdateMeasure "Measure2"]... list of bangs, or a simpler solution, include all those measures into a group, by adding a Group=MyGroup option to each of them (name it as you want), then update them by a [!UpdateMeasureGroup "MyGroup"] bang.
However I'm not sure what would you like to achieve: when I load the skin containing the posted code, the skin starts to count the time, but then what? Additionally note that the [MeasureCountDownH] measure is missing.
seems i explained it wrong. and yes. the countdown isn't finished. the part of setting the start time isn't written now. i should not be able to change the value of the counter at this state

this timer and the manual update is the problem. hover with the mouse above the brightness- (changes colors) or lock-symbol(locks the icons on the bottom). and then use the mousewheel a few times. happens each time and the timer gets 1+.

what [MeasureCountDown] does:
  • counting [rainmeter] update=1000 and
  • count [!RefreshGroup RefreshMeter] (mouseaction, line 6,7,82,83,114,115)
what [MeasureCountDown] should do:
  • count [rainmeter] update=1000 and
  • ignore [!RefreshGroup RefreshMeter] (mouseaction, line 6,7,82,83,114,115)
what the rest should do:
  • update each second
  • update when i "lower the brightness" or "lock the icons" to allow mouseaction or change colors instantly (line 6,7,82,83,114,115)




EDIT: i uploaded the wrong code. oops. corrected it (and the correct lines in this post)
coding is super confusing for me, i don't even remember correct wich version is working and which not *slams head on the desk*
Last edited by derLeon on February 4th, 2021, 3:34 am, edited 1 time in total.
derLeon
Posts: 13
Joined: April 19th, 2019, 4:38 pm

Re: is updating meters without measures possible?

Post by derLeon »

and sorry for the multiple edits. ;(
tried to make it more readable for you
derLeon
Posts: 13
Joined: April 19th, 2019, 4:38 pm

Re: is updating meters without measures possible?

Post by derLeon »

Good news, everybody
Image

after long time of research and testing i understoof how timestamp works and found a solution.
doesn't solve the topic here, but it solves the problem.

for google and search funktion i leave my counter-code here (nothing is more frustrating than only finding unanswered threads)

such a beauty. i am proud of my work :D

Code: Select all

[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1

[Variables]
DynamicVariables=1
;variable for "setting time when counting started"
vTimeStarted=[TimeClockGet:Timestamp]

;Get time
[TimeClockGet]
Measure=Time
Format=%#I:%M:%S %p

;Calculates the time since it started
[CalcTimeSinceStart]
Measure=Calc
Formula=([TimeClockGet:Timestamp]-#vTimeStarted#)
DynamicVariables=1

;extrastep for display later in HH:MM:SS
[CalcStopwatchSeconds]
Measure=Calc
Formula=(CalcTimeSinceStart%60)/100
Substitute="0.":""
[CalcStopwatchMinutes]
Measure=Calc
Formula=Floor(CalcTimeSinceStart/60)/100
Substitute="0.":""
[CalcStopwatchHours]
Measure=Calc
Formula=Floor(CalcTimeSinceStart/3600)/100
Substitute="0.":""

;debugdisplay
[MeterOne]
DynamicVariables=1
LeftMouseUpAction=[!SetVariable vTimeStarted [TimeClockGet:Timestamp]][!Update]
Meter=String
MeasureName=TimeClockGet
MeasureName2=CalcTimeSinceStart
MeasureName3=CalcStopwatchSeconds
MeasureName4=CalcStopwatchMinutes
MeasureName5=CalcStopwatchHours
Text=Started: #vTimeStarted##CRLF#Clock: %1#CRLF#SinceStart: %2#CRLF#%5:%4:%3
SolidColor=127,127,127,255
FontSize=30
NumOfDecimals=2
not bad for a coding-handicapped amateur, hm? :D

nevertheless: because this is a workaround i leave the thread open. i am sure i need the problem solved for later projects. :Whistle i hope thats ok
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: is updating meters without measures possible?

Post by balala »

derLeon wrote: February 4th, 2021, 3:34 am after long time of research and testing i understoof how timestamp works and found a solution.
doesn't solve the topic here, but it solves the problem.

for google and search funktion i leave my counter-code here (nothing is more frustrating than only finding unanswered threads)

such a beauty. i am proud of my work :D
Alright, congrats if you succeeded achieving the goal by yourself. As far as i can tell, the skin is working, so is there anything else you want to ask?
derLeon
Posts: 13
Joined: April 19th, 2019, 4:38 pm

Re: is updating meters without measures possible?

Post by derLeon »

balala wrote: February 4th, 2021, 4:33 pm Alright, congrats if you succeeded achieving the goal by yourself. As far as i can tell, the skin is working, so is there anything else you want to ask?
i am still not sure how to update measures and meters without activating a single "loop" manually.
it seems i dont understand the syntax...

i thought about it. i will ask again later if i have the problem again. (maybe i have a better example then)
/closed
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: is updating meters without measures possible?

Post by balala »

Not sure what you mean by
derLeon wrote: February 5th, 2021, 2:07 am without activating a single "loop" manually.