Telescope Control Library

Dependents:   PushToGo-F429

Committer:
caoyu@caoyuan9642-desktop.MIT.EDU
Date:
Mon Sep 24 19:36:48 2018 -0400
Revision:
19:fd854309cb4c
Parent:
18:3ea58b079adc
Fix bug in nudging with small speeds mentioned in the last commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
caoyuan9642 0:6cb2eaf8b133 1 #include <time.h>
caoyuan9642 0:6cb2eaf8b133 2
caoyuan9642 0:6cb2eaf8b133 3 #ifndef UTCCLOCK_H_
caoyuan9642 0:6cb2eaf8b133 4 #define UTCCLOCK_H_
caoyuan9642 0:6cb2eaf8b133 5 /**
caoyuan9642 0:6cb2eaf8b133 6 * This class provides an interface to a general clock that provides information about the current time.
caoyuan9642 0:6cb2eaf8b133 7 * In most systems, this class is implemented by RTCClock to read time from the RTC.
caoyuan9642 0:6cb2eaf8b133 8 */
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 9 class UTCClock {
caoyuan9642 0:6cb2eaf8b133 10 public:
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 11 UTCClock() {
caoyuan9642 0:6cb2eaf8b133 12 }
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 13 virtual ~UTCClock() {
caoyuan9642 0:6cb2eaf8b133 14 }
caoyuan9642 0:6cb2eaf8b133 15
caoyuan9642 5:2ee2c36f4d87 16 /** @return current UTC time in Unix timestamp format
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 17 */
caoyuan9642 0:6cb2eaf8b133 18 virtual time_t getTime() = 0;
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 19
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 20 /** @return current UTC time in high resolution (fraction of seconds)
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 21 */
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 22 virtual double getTimeHighResolution() {
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 23 return (double) getTime();
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 24 }
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 25
caoyuan9642 5:2ee2c36f4d87 26 /** Set system time
caoyu@caoyuan9642-desktop.MIT.EDU 18:3ea58b079adc 27 */
caoyuan9642 0:6cb2eaf8b133 28 virtual void setTime(time_t time) = 0;
caoyuan9642 0:6cb2eaf8b133 29
caoyuan9642 0:6cb2eaf8b133 30 };
caoyuan9642 0:6cb2eaf8b133 31
caoyuan9642 0:6cb2eaf8b133 32 #endif /*UTCCLOCK_H_*/
caoyuan9642 0:6cb2eaf8b133 33