It is currently April 27th, 2024, 11:45 am

help with time counter

Get help with creating, editing & fixing problems with skins
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: help with time counter

Post by CarlotaN »

I have been able to insert

Code: Select all

[IsStopped]
...
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!HideMeter "MeterSeconds"][!HideMeter "TimeMeter"][!HideMeter "StopButton"][!Redraw]
IfFalseAction=[!ShowMeter "MeterSeconds"][!ShowMeter "TimeMeter"][!ShowMeter "StopButton"][!Redraw]
DynamicVariables=1

[IsPaused]
...
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "ContinueButton"]
IfFalseAction=[!ShowMeter "ContinueButton"]
DynamicVariables=1

[IsStarted]
...
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "PauseButton"]
IfFalseAction=[!ShowMeter "PauseButton"]
DynamicVariables=1
But it must include DynamicVariables=1 obviously, I have removed them from the buttons.

I still can't get it to work

Code: Select all

Fórmula = (( MeasureBar = 0 ) ? 599 : ( MeasureBar - 1 ))
It would be possible to achieve the effect of

Code: Select all

[MeasureBar]
Measure=Calc
Formula=(TimeLeft % 59) / 60
This would hide the delay or advance of each minute.

Thank you
Image
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: help with time counter

Post by Yincognito »

CarlotaN wrote: February 25th, 2024, 5:20 am A thousand thanks to both of you.
I'm going to try the code that Balala offers me and I'll tell you.



If you use HA, the roundline goes faster, a little faster than the seconds, but if you don't use it, it slows down much faster than the seconds. That's where the real problem is. After a few minutes, for example 07:30, the wheel is at 06:50 minutes. :(

I repeat, thank you very much and I will respond as soon as I can. :rosegift:
Oh, no need to thank me (at least, not yet), I was just asking the question being curious about what you meant. Your description clarifies it, but as you could notice in one of your replies, HA only alleviated the problem, so it looks like there's something else in the code which is the culprit for this.

Personally, in such a skin I wouldn't use plain Rainmeter for any kind of precision (i.e. under 1 second) timing, instead I would exclusively use the Lua script for this. I already have my own such script that does everything in that regard and will be included in a Timer skin in the next update of my skin suite, but I'm not sure how suited it would be for your case, so I think it's better to wait for balala's opinion and advice on it, for the time being.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: help with time counter

Post by Yincognito »

balala wrote: February 25th, 2024, 6:56 am Not really, even if he has offered a description after your post, which sounds weird in my opinion, but who knows. However what I wrote about the hardware acceleration, IS MY OPINION! I really believe HA might be useful in some cases, but just as well might be a problem in others. Over time I saw few examples of both cases. Don't want to offend anyone, however this is really my opinion.
End of this story, from my part...
I see. No need to get defensive about it, I know it's always your opinion, and nobody has been offended by anything - in this case, I was simply curious whether you were aware of some other issue with HA that I didn't know about, and wondered how it could affect a skin that should typically not be affected by it, that's all. Please, carry on, I wasn't disagreeing with your general opinion on HA, quite the contrary - sorry for the misunderstanding. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: help with time counter

Post by CarlotaN »

Code: Select all

Personally, in such a skin I wouldn't use plain Rainmeter for any kind of precision (i.e. under 1 second) timing, instead I would exclusively use the Lua script for this. I already have my own such script that does everything in that regard and will be included in a Timer skin in the next update of my skin suite, but I'm not sure how suited it would be for your case, so I think it's better to wait for balala's opinion and advice on it, for the time being.
Fantastic! I will gladly wait for him to publish the Skin.
What I can't understand is that if it is used as a watch, it works exactly... Anyway, c'est la vie

Thanks in advance
Image
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: help with time counter

Post by Yincognito »

CarlotaN wrote: February 25th, 2024, 2:06 pm

Code: Select all

Personally, in such a skin I wouldn't use plain Rainmeter for any kind of precision (i.e. under 1 second) timing, instead I would exclusively use the Lua script for this. I already have my own such script that does everything in that regard and will be included in a Timer skin in the next update of my skin suite, but I'm not sure how suited it would be for your case, so I think it's better to wait for balala's opinion and advice on it, for the time being.
Fantastic! I will gladly wait for him to publish the Skin.
What I can't understand is that if it is used as a watch, it works exactly... Anyway, c'est la vie

Thanks in advance
"Him" being balala, right? Cause you might have to wait a long time till I publish mine, I'm not in a hurry...

If eventually needed, I could post my script later on, but let's just wait for what balala has to say, maybe he'll provide a solution that would make posting my script unnecessary.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: help with time counter

Post by CarlotaN »

I'm very sure that Balala will have a remedy ;) He already helped me once and I have faith that he will know what to do. But I will continue to pay attention to that timer that will be born one day.

There is another person who needs help, about a Euro converter... could someone help him?

Thanks a lot
Image
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: help with time counter

Post by Yincognito »

CarlotaN wrote: February 25th, 2024, 2:26 pm There is another person who needs help, about a Euro converter... could someone help him?
Just did. Thanks for the info!
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help with time counter

Post by balala »

CarlotaN wrote: February 25th, 2024, 7:21 am
  • [!DisableMeasure MeasureBar] => Disabled=1 => OK!!!
:thumbup:

CarlotaN wrote: February 25th, 2024, 7:21 am
  • Fórmula = (( MeasureBar = 0 ) ? 599 : ( MeasureBar - 1 )) => Does not show the round line
Make sure you're using the correct form of the option, not the one posted above. The correct form is Formula=(( MeasureBar = 0 ) ? 599 : ( MeasureBar - 1 )), but you have posted Fórmula = (( MeasureBar = 0 ) ? 599 : ( MeasureBar - 1 )). I am pretty sure you've did this mistake, because when I copied the code posted by you and replaced the Formula option of the [MeasureBar] measure with the correctly written option, the skin did work. So, make sure to use the not-miswritten option.
And there is one more thing to be taken into account. But this thing were present on the original version of the skin as well and was not altered by my. Namely I1m talking about the fact that the roundline becomes visible ONLY if the PauseTime variable is set to -1. But when ran, the skin rewrites this variable through the @Resources\Scripts\Timer.lua script file and it never goes back to -1. Accordingly after the first run of the skin (in fact after the first run of the script file), the roundline is never visible once again. But this was like this even on the original skin. Don't know what the intention of the author was, but this is another thing you should have to take care of, to get the roundline visible. Manually replacing the variable and refreshing the skin, fixes this issue (assuming the above described Formula issue is fixed as well).

CarlotaN wrote: February 25th, 2024, 7:21 am
  • DynamicVariables=1 => In the cases [MeterSeconds], [TimeMeter] => it works. But it doesn't work for buttons.
Not sure I can follow what you mean by this.

CarlotaN wrote: February 25th, 2024, 7:21 am
  • And finally it does not work

Code: Select all

[IsStopped]
...
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!HideMeter "MeterSeconds"][!HideMeter "TimeMeter"][!HideMeter "StopButton"][!Redraw]
IfFalseAction=[!ShowMeter "MeterSeconds"][!ShowMeter "TimeMeter"][!ShowMeter "StopButton"][!Redraw]
...

[IsPaused]
...
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "ContinueButton"]
IfFalseAction=[!ShowMeter "ContinueButton"]
...

[IsStarted]
...
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "PauseButton"]
IfFalseAction=[!ShowMeter "PauseButton"]
...
Add the DynamicVariables=1 option to all of the above three measures ([IsStopped], [IsPaused] and [IsStarted]). Apply the bangs as described on my previous reply.

Just to make sure you don't have any mistake, here is the working code. Beside the described things, I did a few other small adjustments as well. Please give a try to this and let me know if it is working:

Code: Select all

[Rainmeter]
Update=60
AccurateText=1
Background=#@#Images\cronos.png
MiddleMouseDownAction=!Refresh
OnRefreshAction=[!ShowMeter "StartButton"][!HideMeter "PauseButton"]

;-------------------------------------------------------------

[Metadata]
Name=SweepSeconds + Timer Monterey
Author=JSMorley, Creewick... y más que no me acuerdo... y algo de mi.
Information=Cronómetro. Basado en SweepSeconds y Timer Monterey
License=Creative Commons Share-Alike NC 4

;-------------------------------------------------------------

[Variables]

StartTime=-1
EndTime  =-1
PauseTime=-1

ActionPlay=[!EnableMeasure MeasureTimeDelta][!EnableMeasure MeasureElapsedTime][!EnableMeasure MeasureBar][!UnpauseMeasure MeasureBar][!UnpauseMeasure TimeLeft][!ShowMeter "StopButton"][!ShowMeter "PauseButton"][!Redraw]
ActionPause=[!DisableMeasure MeasureTimeDelta][!PauseMeasure MeasureBar][!PauseMeasure TimeLeft][!ShowMeter "StartButton"][!HideMeter "PauseButton"][!Redraw]

[TextStyle]
FontFace=Garamond
FontColor=644b40
FontSize=16
StringEffect=Shadow
FontEffectColor=fdfceb
StringStyle=Bold
StringAlign=CenterCenter
AntiAlias=1
X=70

[sController]
W=24
H=24
MouseOverAction=[!SetOption "#CurrentSection#" ImageTint DDDDDD][!UpdateMeter #CurrentSection#][!Redraw]
MouseLeaveAction=[!SetOption "#CurrentSection#" ImageTint ""][!UpdateMeter #CurrentSection#][!Redraw]

;-------------------------------------------------------------
;[MEDIDORES Y SCRIPT]
;-------------------------------------------------------------

[Lua]
Measure=Script
ScriptFile=#@#Scripts\Timer.lua

[IsStopped]
Group=Measures
Measure=Calc
Formula=(#StartTime# = -1)
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!DisableMeasure "TimeLeft"][!HideMeter "MeterSeconds"][!HideMeter "TimeMeter"][!HideMeter "StopButton"][!Redraw]
IfFalseAction=[!EnableMeasure "TimeLeft"][!ShowMeter "MeterSeconds"][!ShowMeter "TimeMeter"][!ShowMeter "StopButton"][!Redraw]
DynamicVariables=1

[IsPaused]
Group=Measures
Measure=Calc
Formula=(#PauseTime# <> -1)
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "ContinueButton"]
IfFalseAction=[!ShowMeter "ContinueButton"]
DynamicVariables=1

[IsStarted]
Group=Measures
Measure=Calc
Formula=(#StartTime# <> -1) && (#PauseTime# = -1)
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "PauseButton"]
IfFalseAction=[!ShowMeter "PauseButton"]
DynamicVariables=1

[TrueNow]
Measure=Time
UpdateDivider=1

[TheClock]
Group=Measures
Measure=Time
Format=🔔 %H:%M

;-------------------------------------------------------------
;[ELIPSE PERCENTUAL]
;-------------------------------------------------------------

[TimeMeterBase]
Meter=Shape
Shape=Ellipse 0,0,56,56 | Fill Color 00000000 | StrokeWidth 4 | Stroke Color 2C2C2C
X=70
Y=70

[TimeLeft]
Group=Measures
Measure=Time
Format=%#S
;Disabled=([IsStopped] = 1) 

[MeasureBar]
Measure=Calc
Formula=(( MeasureBar = 0 ) ? 599 : ( MeasureBar - 1 ))
;Formula=(( MeasureBar + 1 ) % 600 )
MinValue=0
MaxValue=600
Disabled=1

;-------------------------------------------------------------
;[LINEA DE TIEMPO]
;-------------------------------------------------------------

[MeterSeconds]
Group=Meters
Meter=Roundline
MeasureName=MeasureBar
X=r
Y=r
StartAngle=(-PI/2)
RotationAngle=(2*PI)
LineStart=54
LineLength=58
LineColor=f9932e
Solid=1
AntiAlias=1
;Hidden=([IsStopped] = 1)
UpdateDivider=1

;-------------------------------------------------------------
;[CONTADORES DE TIEMPO]
;-------------------------------------------------------------

[MeasureCurrentTime]
Group=Measures
Measure=Time

[MeasureTimeDelta]
Group=Measures
Measure=Calc
Formula=(MeasureTimeDelta = 0 ? (MeasureCurrentTime - MeasureElapsedTime / 10) : MeasureTimeDelta)
Disabled=1

[MeasureElapsedTime]
Group=Measures
Measure=Calc
Formula=(MeasureTimeDelta = 0 ? MeasureElapsedTime : (MeasureCurrentTime - MeasureTimeDelta) * 10)

[CalcElapsedHours]
Group=Meters
Measure=Calc
Formula=Floor(MeasureElapsedTime / 10 / 3600) % 24
RegExpSubstitute=1
Substitute="^(\d)$":"0\1"

[CalcElapsedMinutes]
Group=Meters
Measure=Calc
Formula=Floor(MeasureElapsedTime / 10 / 60) % 60
RegExpSubstitute=1
Substitute="^(\d)$":"0\1"

[CalcElapsedSeconds]
Group=Meters
Measure=Calc
Formula=Floor(MeasureElapsedTime / 10) % 60
RegExpSubstitute=1
Substitute="^(\d)$":"0\1"

;-------------------------------------------------------------
;[TIEMPO]
;-------------------------------------------------------------

[VisibleTime]
Group=Measures
Meter=String
MeasureName=CalcElapsedHours
MeasureName2=CalcElapsedMinutes
MeasureName3=CalcElapsedSeconds
MeterStyle=TextStyle
NumOfDecimals=0
Y=60
Text="%1:%2:%3"

;-------------------------------------------------------------
;[RELOJ]
;-------------------------------------------------------------

[ClockMeter]
Group=Meters
MeasureName=TheClock
Meter=String
MeterStyle=TextStyle
FontSize=9
Text=
Y=80

;-------------------------------------------------------------
;[BOTONES]
;-------------------------------------------------------------

[StopButton]
Meter=Image
Group=Meters
ImageName=#@#Images\istop.png
MeterStyle=sController
X=59
Y=25
LeftMouseUpAction=[&Lua:stop()][!Redraw]
Hidden=1

[StartButton]
Group=Meters
Meter=Image
ImageName=#@#Images\iplay.png
MeterStyle=sController
X=r
Y=90
LeftMouseUpAction=[&Lua:continue()][!Delay "0"]#ActionPlay#
;Hidden=([IsStopped] = 0)
;DynamicVariables=1

[PauseButton]
Group=Meters
Meter=Image
ImageName=#@#Images\ipause.png
MeterStyle=sController
X=r
Y=r
LeftMouseUpAction=[&Lua:pause()]#ActionPause#
;Hidden=([IsStarted] = 0)
;DynamicVariables=1

[ContinueButton]
Group=Meters
Meter=Image
ImageName=#@#Images\iplay.png
MeterStyle=sController
X=r
Y=r
LeftMouseUpAction=[&Lua:continue()][!Delay "0"]#ActionPlay#
;Hidden=([IsPaused] = 0)
;DynamicVariables=1
See that I commented out the Formula=(( MeasureBar + 1 ) % 600 ) form of the Formula option of the [MeasureBar] and used instead Formula=(( MeasureBar = 0 ) ? 599 : ( MeasureBar - 1 )). Since the previous version of the option is just commented out, you can easily replace it back with the original form, as you wish.
CarlotaN wrote: February 25th, 2024, 2:26 pm There is another person who needs help, about a Euro converter... could someone help him?
What Euro converter is? Am I missing something???
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: help with time counter

Post by Yincognito »

balala wrote: February 25th, 2024, 4:36 pmWhat Euro converter is? Am I missing something???
That was in reference to this post, where an "European" number format was desired. It's actually used by more than just Europe, but it originated there, hence the name.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: help with time counter

Post by CarlotaN »

I am pretty sure you've did this mistake, because when I copied the code posted by you and replaced the Formula option of the [MeasureBar] measure with the correctly written option, the skin did work. So, make sure to use the not-miswritten option.
Ohhh!!! Absolutely right!!! To understand I have to activate the translator and it changed Formula to Fórmula
Add the DynamicVariables=1 option to all of the above three measures ([IsStopped], [IsPaused] and [IsStarted]). Apply the bangs as described on my previous reply.
Yes, I had already done it. I had already reported it in a post, and it actually works!
What Euro converter is? Am I missing something???
:lol: Someone asked and I didn't know what to answer. I already had a teacher by my side and no one answered him

Everything works OK!
Lastly, any solution to the round line time mismatch?
Image