Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 8:30 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Creating one hand clock
PostPosted: January 10th, 2012, 9:46 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
I am making a one hand clock as a present fo a friend of mine.
It's not very difficult but it should be nice if the clock automaticly
set itself in the right position.
It needs a script to set the arm in the right position

For those who don't know a one hand clock, there is only one hand
that goes in one hour from let's say 3 to 4, and so on.
It takes 43200 seconds for the arm to make 12 hours.

Who can help me with a script that sets the arm in the right position depending
on the system time.

Thanks,

Ad


You do not have the required permissions to view the files attached to this post.

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Creating one hand clock
PostPosted: January 12th, 2012, 9:38 am 
Offline

Joined: December 29th, 2004, 12:00 pm
Posts: 230
Location: Auckland NZ
Opus: v 7.04
OS: xp & win7
It's so long ago I can't even remember how I did it but the hour hand in this imp should give you the 12 hour clock...
good luck!


You do not have the required permissions to view the files attached to this post.

_________________
Opus Pro 7.04 - win10


For this message mac has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating one hand clock
PostPosted: January 16th, 2012, 8:43 am 
Offline

Joined: December 29th, 2004, 12:00 pm
Posts: 230
Location: Auckland NZ
Opus: v 7.04
OS: xp & win7
I revisited this to remind myself what I did...

the hour hand is in the top half of a frame called hours (Which is itself inside a fixed frame called 'clockface')
On page show a script runs to establish current time and sets the angle of hours to display the current hour.
On show frame hours is set to rotate once every 43200 secs.
script for setting time is:
-----------------------------------------------
var myDate = new Date()
var currHour = myDate.getHours()
var currMins = myDate.getMinutes()
var currSecs = myDate.getSeconds()
minangle=currMins*6
secangle=currSecs*60
if (currHour > 12)
{currHour = currHour-12
}
currHour = currHour+(currMins/60)
hourangle=currHour*30
hours.Rotate(hourangle,0.0)
minutes.Rotate(minangle,0.0)
seconds.Rotate(secangle,0.0)
------------------------------------
(these variables also control minutes and seconds obviously)

The on show action to rotate the hour frame is rotate 360 degrees continuously for duration 43200 secs (i.e. once every 12 hours)

hope this helps... :D

_________________
Opus Pro 7.04 - win10


For this message mac has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Creating one hand clock
PostPosted: January 18th, 2012, 3:43 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Thanks man, let's give it a try



Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group