]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/clock.hxx
Roy Vegard Ovesen:
[flightgear.git] / src / Instrumentation / clock.hxx
1 // clock.hxx.
2 // Written by Melchior FRANZ, started 2003.
3 //
4 // This file is in the Public Domain and comes with no warranty.
5 //
6 // $Id$
7
8
9 #ifndef __INSTRUMENTS_CLOCK_HXX
10 #define __INSTRUMENTS_CLOCK_HXX 1
11
12 #ifndef __cplusplus
13 # error This library requires C++
14 #endif
15
16 #include <simgear/props/props.hxx>
17 #include <simgear/structure/subsystem_mgr.hxx>
18
19
20 /**
21  * Model a clock.
22  *
23  * Input properties:
24  *
25  * /instrumentation/clock/serviceable
26  * /instrumentation/clock/offset-sec
27  *
28  * Output properties:
29  *
30  * /instrumentation/clock/indicated-sec
31  * /instrumentation/clock/indicated-string
32  */
33 class Clock : public SGSubsystem
34 {
35
36 public:
37
38     Clock ( SGPropertyNode *node );
39     Clock ();
40     virtual ~Clock ();
41
42     virtual void init ();
43     virtual void update (double dt);
44
45 private:
46
47     bool _is_serviceable;
48     long _gmt_time_sec;
49     long _offset_sec;
50     long _indicated_sec;
51     char _indicated_string[16];
52     long _standstill_offset;
53
54     string name;
55     int num;
56
57     SGPropertyNode_ptr _serviceable_node;
58     SGPropertyNode_ptr _offset_node;
59     SGPropertyNode_ptr _sec_node;
60     SGPropertyNode_ptr _string_node;
61
62 };
63
64 #endif // __INSTRUMENTS_CLOCK_HXX