It is currently April 25th, 2024, 3:34 am

Help me create a "different" clock

Get help with creating, editing & fixing problems with skins
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Help me create a "different" clock

Post by h3103 »

Hello People
im pretty new to Rainmeter and was looking for a way to create a clock with a 2.5 hour turntime meaning it is unsynced from the realtime. I found a quite easy way to creat the clock itself but I am completly lost when it comes to how to make the pointer turn at the correct time.
It would be a huge huge to me if someone with sufficent knowledge could help me out here.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

The
h3103 wrote:clock with a 2.5 hour turntime
means you'd like a clock with a hand which makes a complete turn in 2.5 hours?
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

that is correct
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

h3103 wrote:that is correct
Ok. Download the example skin of the clock, posted on the Help page of the Rotator meter. Install it. If you did, you have a "normal" clock, with three hands: a hour, a minute and a second hand.
To get the second hand (for example) to makes a complete turn in 2.5 hours, just replace the ValueRemainder option of the [MeterSecondsHand] with 9000 (which is the number of seconds into 2.5 hours: 2.5*3600 = 9000): ValueRemainder=9000.
Obviously you can completely remove the [MeterHoursHand] and the [MeterMinutesHand] meters, because leaving them there, make the clock to look at least weird.
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

My main problem with the thing, as i probably didnt express properly, is that i need the hand to meet the highest point at a certain time and run from there by setting like a fixpoint since it cant really be connected to the real time because it will unsync by one hour a day. I really hope what i am writing here is kind of understandable.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

h3103 wrote:My main problem with the thing, as i probably didnt express properly, is that i need the hand to meet the highest point at a certain time and run from there by setting like a fixpoint since it cant really be connected to the real time because it will unsync by one hour a day. I really hope what i am writing here is kind of understandable.
Second try: replace the code of the example skin (given on the help page of the Rotattor meter), with the following one:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Per=9000

[MeasureTime]
Measure=Calc
Formula=(( MeasureTime + 1 ) % ( #Per# + 1 ))
IfCondition=(#CURRENTSECTION#=#Per#)
IfTrueAction=[!DisableMeasure "MeasureTime"]
MinValue=0
MaxValue=#Per#
Disabled=1

[MeterClockFace]
Meter=Image
ImageName=#@#Images\ClockFace.png
SolidColor=0,0,0,1
W=110
H=116
LeftMouseUpAction=[!EnableMeasure "MeasureTime"]

[MeterSecondsHand]
Meter=ROUNDLINE
MeasureName=MeasureTime
X=0
Y=0
W=110
H=116
LineLength=52
LineColor=247,220,129,255
LineWidth=2
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
The Per variable (within the [Variables] section) represents the amount of the time needed for a complete rotation of the only existing hand.
Initially the hand is in the highest point and the rotation is disabled. If you click anywhere on the clock, the hand will start rotating (with the Per=9000 value of the variable, it has a period of 2.5 hours). When the time is passing and a complete rotation was made, the hand stops again and wait for a new click, to start rotating once again.
I'm not sure I completely understood your need. Please let me know if something is different from what you wanted.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help me create a "different" clock

Post by eclectic-tech »

I feel timing skins should be based on a Time measure for accuracy; ones based on the default Update rate of Rainmeter can be inaccurate if a skin takes longer than a second to update. The previous skin will work, but can be inaccurate (sorry balala :( )

Here is a modified version of a countdown pie. It uses a Time measure that counts the number of seconds and is not based on the skin update rate. It will countdown 9000 seconds by default, but the number of seconds can be set to any desired time. Double-Left-Click to start the timer action. It has an optional text display. To have a pointer dial instead of a pie, set 'Solid=0' in the [MeterSecondhand] rotator meter.

Code: Select all

[Metadata]
Name=Pie Chart Countdown Timer
Author=Eclectic Tech
Information=A skin to show a pie chart countdown timer (default is 2.5 hour or 9000 seconds). Based on actual seconds of time, delays in Rainmeter update processes will not alter. Set the value of your timer as 'CountSeconds' (in seconds) in the [Variables] section. Double-click the skin to start the timer.
License=CC-SA-BY 3
Version=1.2018.01.20a

[Rainmeter]
ContextTitle=Show Seconds
ContextAction=[!SetOption MeterSecondsText Hidden 0][!UpdateMeter MeterSecondsText][!Redraw]
ContextTitle2=Hide Seconds
ContextAction2=[!SetOption MeterSecondsText Hidden 1][!UpdateMeter MeterSecondsText][!Redraw]

[Variables]
CountSeconds=9000
Period=0

; Returns the number of second of the current time
; Disabled to start, is enabled by mouse action
; Compares current time to 'PERIOD' variable
; That variable was set to #CountSeconds# seconds from the current time when the mouse action enables
[MeasureTime]
Measure=Time
IfCondition=(#CurrentSection# = #Period#)
IfTrueAction=[!DisableMeasureGroup Time][!SetVariable Period 0]
DynamicVariables=1
Disabled=1
Group=Time

; Calculates the remaining seconds
[MeasureRemaining]
Measure=Calc
Formula=#Period# - [MeasureTime:Timestamp]
DynamicVariables=1
Disabled=1
Group=Time

[MeterClockFace]
Meter=Image
ImageName=#@#Images\ClockFace25.png
SolidColor=0,0,0,1
W=110
H=116
; Double-click enables the Timer measure, updates it, and sets the finish time variable 'PERIOD' to #CountSeconds# seconds from current time 
LeftMouseDoubleClickAction=[!EnableMeasureGroup "Time"][!UpdateMeasure MeasureTime][!SetVariable "Period" "([MeasureTime:Timestamp] + #CountSeconds#)"]

; Displays a shrinking pie of time remaining
[MeterSecondsHand]
Meter=ROUNDLINE
MeasureName=MeasureRemaining
X=0
Y=0
W=110
H=116
LineLength=50
LineColor=247,220,129,200
LineWidth=2
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
; To have a pointer dial instead of a pie, set 'Solid=0'
Solid=1
ValueRemainder=#CountSeconds#

; Optional text display of remaining seconds; set 'Hidden=0' to view
[MeterSecondsText]
Meter=String
Text=[MeasureRemaining]
X=55
Y=70
FontColor=247,22,29,255
FontSize=8
StringAlign=Center
DynamicVariables=1
Hidden=1
cdpie.png
You do not have the required permissions to view the files attached to this post.
Last edited by eclectic-tech on January 20th, 2018, 6:12 pm, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help me create a "different" clock

Post by jsmorley »

Formula in a Time measure?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help me create a "different" clock

Post by eclectic-tech »

Yeah, I use that all the TIME ;-)

Can you offer me an alternate approach?
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

jsmorley wrote:Formula in a Time measure?
I wanted to ask the same thing. As far as I know, it's not a valid option. Am I wrong?