12 hour Analog clock

Request New Features here.
Guy
Posts: 15
Joined: Mon Jun 17, 2013 9:48 am

12 hour Analog clock

Post by Guy » Mon Feb 23, 2015 6:54 am

Hi
I have been asked to provide a 12 h analog clock, with hours , minutes and second hands on a PV780 screen.
Has this been done with the RTC ? & could it be added as a widget?
The request is also for an 'ornate' needle; is this practical or will a thin rotating image pixelate too much ?
thanks
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: 12 hour Analog clock

Post by stalley » Mon Feb 23, 2015 9:39 am

Hello Guy,

I am sending a sample config that might be helpful. Since you are using a PV780, you hopefully have some space if you want to put numbers on the face, maybe.

This example has three rotary gauges overlaid, so there is a hand for hour, min and seconds.

Clock.zip
(716.34 KiB) Downloaded 40 times
Sara Talley
Software Engineer
Enovation Controls
Guy
Posts: 15
Joined: Mon Jun 17, 2013 9:48 am

Re: 12 hour Analog clock

Post by Guy » Tue Feb 24, 2015 4:22 am

Thanks Sara,
That is as far as I got , and I change it with the standard '780 user settings'page ......but the hour hand reads wrong ; 9:55 looks like 8:55 etc. as the hand jumps in 1/12 steps. :?
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: 12 hour Analog clock

Post by ksaenz » Tue Feb 24, 2015 7:44 am

Hello Guy,

You could create a new variable that gets its value from this calculation event every minute:

Code: Select all

mod( RealTimeClock_Hour * 60 + RealTimeClock_Minute, 720 )
You also need to adjust the range of the hour hand's rotary gauge to 0-720.


If you also want the minute hand to move smoothly you can create another variable with this calculation event fired every second:

Code: Select all

mod( RealTimeClock_Minute * 60 + RealTimeClock_Second, 3600 )
And set its gauge's range to 0-3600.

Regards,
ksaenz
Guy
Posts: 15
Joined: Mon Jun 17, 2013 9:48 am

Re: 12 hour Analog clock

Post by Guy » Tue Feb 24, 2015 8:32 am

That's great. Thanks for your help