It is currently May 2nd, 2024, 9:24 am
Clock Second Update Rate
-
- Posts: 31
- Joined: August 1st, 2012, 2:14 am
- Location: Elyria, OH
Clock Second Update Rate
I am making a clock meter and would like to know if instead of it actually ticking 60 times around in a circle, if it would be possible to have this effect smoothed out as if you were looking at the second hand of a Rolex watch which just seamlessly rotates around the circle with no ticking effect. I would think it would be easy enough as to just divide the 60 sections that are there by 4 to create 240 sections instead. But I could be way off on this. Thanks for taking the time to read and respond!
Do unto others as you would have them do unto you...said the rapist
Main Rig: i7 4770k | ASRock Z97E-ITX/ac | 16GB DDR3-1600 | 500GB Samsung 840 EVO | EVGA GTX 780 | Nexus 5000
Main Rig: i7 4770k | ASRock Z97E-ITX/ac | 16GB DDR3-1600 | 500GB Samsung 840 EVO | EVGA GTX 780 | Nexus 5000
-
- Rainmeter Sage
- Posts: 889
- Joined: September 6th, 2011, 6:34 am
Re: Clock Second Update Rate
I believe the absolute time stamp you get as a numerical value from a Time measure only has second resolution. Therefore you'll have to create the smooth transitions between the seconds yourself. Jsmorley suggested in another thread for a similar problem, to use AverageSize for this. This basically smoothes the values of a measure by returning the average of the last values the measure would have returned without the AverageSize setting.
Of course for a smooth operation of the second hand you'll need a high Update value. I suggest using Update=100 and using AverageSize=10 for a start. Update*AverageSize should always equal 1000 because otherwise you are averaging over more than one second, giving inaccurate results. AverageSize already gives inaccurate results by its nature, but if you limit it to one second it shouldn't be noticeable.
Example:
I don't know if Format=%s will return the second fractions correctly. Probably not. In that case you need to use some math to figure out the second value from the actual number value of the Time measure ([MeasureTime:]). Or perhaps using ValueRemainder on a rotator or roundline will do this automatically.
Of course for a smooth operation of the second hand you'll need a high Update value. I suggest using Update=100 and using AverageSize=10 for a start. Update*AverageSize should always equal 1000 because otherwise you are averaging over more than one second, giving inaccurate results. AverageSize already gives inaccurate results by its nature, but if you limit it to one second it shouldn't be noticeable.
Example:
Code: Select all
[Rainmeter]
Update=100
[MeasureTime]
Measure=Time
AverageSize=10
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
-
- Posts: 31
- Joined: August 1st, 2012, 2:14 am
- Location: Elyria, OH
Re: Clock Second Update Rate
Thanks for the reply, I just about have it working properly. I am how ever, running into one issue. The second hand rotate around the clock smoothly along with the circle arc. Once it has rotated all the way around, instead of resetting itself, it backtracks really fast all the way around the clock in the opposite direction. Is there a way to stop it from doing this? I'll post my code below so it is easier to see and understand.
Code: Select all
[Rainmeter]
Update=100
Author=Xi.Cynx
[MeasureTime]
Measure=Time
[MeasureSecond]
Measure=Time
Format=%S
AverageSize=10
MinValue=0
MaxValue=60
[MeterCircleSecond]
Meter=RoundLine
MeasureName=MeasureTime
W=#ClockWidth#
H=#ClockHeight#
StartAngle=#CircleTimeStartAngle#
RotationAngle=#CircleTimeRotationAngle#
LineLength=65
LineStart=60
LineColor=#CircleSecondColor#
AntiAlias=1
Solid=1
[MeterSecond]
Meter=Roundline
MeasureName=MeasureSecond
W=#ClockWidth#
H=#ClockHeight#
StartAngle=#FillTimeStartAngle#
RotationAngle=#FillTimeRotationAngle#
LineLength=65
LineStart=60
LineColor=#FillSecondColor#
Solid=1
AntiAlias=1
[MeterSecondHand]
Meter=RoundLine
MeasureName=MeasureSecond
W=#ClockWidth#
H=#ClockHeight#
StartAngle=#HandStartAngle#
LineWidth=1
LineLength=65
LineColor=#SecondHandColor#
AntiAlias=1
Do unto others as you would have them do unto you...said the rapist
Main Rig: i7 4770k | ASRock Z97E-ITX/ac | 16GB DDR3-1600 | 500GB Samsung 840 EVO | EVGA GTX 780 | Nexus 5000
Main Rig: i7 4770k | ASRock Z97E-ITX/ac | 16GB DDR3-1600 | 500GB Samsung 840 EVO | EVGA GTX 780 | Nexus 5000
Re: Clock Second Update Rate
actually you are doing it "wrong". not really wrong though, i like what you did here. its like a retrograde clock.
what you want to achieve is probably something like this:
what you want to achieve is probably something like this:
Code: Select all
[Rainmeter]
Update=100
Author=Xi.Cynx
[MeasureTime]
Measure=Time
AverageSize=10
[MeasureSecond]
Measure=Calc
Formula=MeasureTime * 10
[MeterCircleSecond]
Meter=RoundLine
MeasureName=MeasureTime
W=#ClockWidth#
H=#ClockHeight#
StartAngle=#CircleTimeStartAngle#
RotationAngle=#CircleTimeRotationAngle#
LineLength=65
LineStart=60
LineColor=#CircleSecondColor#
AntiAlias=1
Solid=1
[MeterSecond]
Meter=Roundline
MeasureName=MeasureSecond
W=#ClockWidth#
H=#ClockHeight#
StartAngle=#FillTimeStartAngle#
RotationAngle=#FillTimeRotationAngle#
LineLength=65
LineStart=60
LineColor=#FillSecondColor#
Solid=1
AntiAlias=1
ValueRemainder=600
[MeterSecondHand]
Meter=RoundLine
MeasureName=MeasureSecond
W=#ClockWidth#
H=#ClockHeight#
StartAngle=#HandStartAngle#
LineWidth=1
LineLength=65
LineColor=#SecondHandColor#
AntiAlias=1
ValueRemainder=600
-
- Posts: 31
- Joined: August 1st, 2012, 2:14 am
- Location: Elyria, OH
Re: Clock Second Update Rate
Alex Becherer wrote:actually you are doing it "wrong". not really wrong though, i like what you did here. its like a retrograde clock.
what you want to achieve is probably something like this:
I went ahead and substituted your formulas and code for what I had but it went back to ticking like a normal clock instead of keeping that smooth transition. I had high hope for what you had working as it did makes sense to me. But unfortunately it took a step in the wrong direction.
Do unto others as you would have them do unto you...said the rapist
Main Rig: i7 4770k | ASRock Z97E-ITX/ac | 16GB DDR3-1600 | 500GB Samsung 840 EVO | EVGA GTX 780 | Nexus 5000
Main Rig: i7 4770k | ASRock Z97E-ITX/ac | 16GB DDR3-1600 | 500GB Samsung 840 EVO | EVGA GTX 780 | Nexus 5000
Re: Clock Second Update Rate
nah,
my code works.
just substitute the whole thing.
my code works.
just substitute the whole thing.
-
- Posts: 1173
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Clock Second Update Rate
Alex's code certainly works. Just substitute the whole thing and then define the variables and add a few little bits and pieces to the X's, Y's, W's and H's to make it display properly ( on a dark background )Alex Becherer wrote:my code works.
just substitute the whole thing.
Code: Select all
[Rainmeter]
Update=100
Author=Xi.Cynx
[Variables]
ClockWidth=60
ClockHeight=60
CircleTimeStartAngle=4.7124
CircleTimeRotationAngle=6.2832
CircleSecondColor=ffffff22
FillTimeStartAngle=4.7124
FillTimeRotationAngle=6.2832
FillSecondColor=ffffff88
HandStartAngle=4.7124
SecondHandColor=ffffff
[MeasureTime]
Measure=Time
AverageSize=10
[MeasureSecond]
Measure=Calc
Formula=MeasureTime * 10
[MeterCircleSecond]
Meter=RoundLine
MeasureName=MeasureTime
W=130
H=130
StartAngle=#CircleTimeStartAngle#
RotationAngle=#CircleTimeRotationAngle#
LineStart=60
LineLength=65
LineColor=#CircleSecondColor#
AntiAlias=1
Solid=1
[MeterSecond]
Meter=Roundline
MeasureName=MeasureSecond
X=((#ClockWidth#/2)+5)
Y=((#ClockHeight#/2)+5)
W=#ClockWidth#
H=#ClockHeight#
StartAngle=#FillTimeStartAngle#
RotationAngle=#FillTimeRotationAngle#
LineLength=65
LineStart=60
LineColor=#FillSecondColor#
Solid=1
AntiAlias=1
ValueRemainder=600
[MeterSecondHand]
Meter=RoundLine
MeasureName=MeasureSecond
X=((#ClockWidth#/2)+5)
Y=((#ClockHeight#/2)+5)
W=#ClockWidth#
H=#ClockHeight#
StartAngle=#HandStartAngle#
LineWidth=1
LineLength=65
LineColor=#SecondHandColor#
AntiAlias=1
ValueRemainder=600
-
- Posts: 31
- Joined: August 1st, 2012, 2:14 am
- Location: Elyria, OH
Re: Clock Second Update Rate
I understand now. I does seem to work properly and as intended. This is great! I really appreciate it guys. One thing I am still wondering though is... What exactly does this formula do over my initial one? The numbers add up, but I'm not exactly sure of what the base behind it is.
Do unto others as you would have them do unto you...said the rapist
Main Rig: i7 4770k | ASRock Z97E-ITX/ac | 16GB DDR3-1600 | 500GB Samsung 840 EVO | EVGA GTX 780 | Nexus 5000
Main Rig: i7 4770k | ASRock Z97E-ITX/ac | 16GB DDR3-1600 | 500GB Samsung 840 EVO | EVGA GTX 780 | Nexus 5000
Re: Clock Second Update Rate
because of the Average setting.
while normally time is always getting bigger, your Measure with min and max value at the end calculates an average of 58, 59, 60, 0, 1, 2, ...
math was wrong btw., should be max value of 59.
while normally time is always getting bigger, your Measure with min and max value at the end calculates an average of 58, 59, 60, 0, 1, 2, ...
math was wrong btw., should be max value of 59.