2003-06-27 08:46:57 +00:00
|
|
|
// clock.hxx.
|
|
|
|
// Written by Melchior FRANZ, started 2003.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INSTRUMENTS_CLOCK_HXX
|
|
|
|
#define __INSTRUMENTS_CLOCK_HXX 1
|
|
|
|
|
|
|
|
#include <simgear/props/props.hxx>
|
2003-09-24 17:20:55 +00:00
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
2003-06-27 08:46:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Model a clock.
|
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
|
|
|
* /instrumentation/clock/serviceable
|
|
|
|
* /instrumentation/clock/offset-sec
|
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
|
|
|
* /instrumentation/clock/indicated-sec
|
|
|
|
* /instrumentation/clock/indicated-string
|
|
|
|
*/
|
2006-10-26 15:06:12 +00:00
|
|
|
class Clock : public SGSubsystem {
|
2003-06-27 08:46:57 +00:00
|
|
|
public:
|
2006-10-26 15:06:12 +00:00
|
|
|
Clock(SGPropertyNode *node);
|
|
|
|
virtual ~Clock();
|
2003-06-27 08:46:57 +00:00
|
|
|
|
2006-10-26 15:06:12 +00:00
|
|
|
virtual void init();
|
|
|
|
virtual void update(double dt);
|
2003-06-27 08:46:57 +00:00
|
|
|
|
|
|
|
private:
|
2006-10-26 15:06:12 +00:00
|
|
|
string _name;
|
|
|
|
unsigned int _num;
|
2003-06-27 08:46:57 +00:00
|
|
|
|
|
|
|
bool _is_serviceable;
|
|
|
|
long _gmt_time_sec;
|
|
|
|
long _offset_sec;
|
|
|
|
long _indicated_sec;
|
2005-08-03 19:58:42 +00:00
|
|
|
long _indicated_min;
|
|
|
|
long _indicated_hour;
|
2005-11-17 22:07:27 +00:00
|
|
|
long _local_hour;
|
2003-06-27 08:46:57 +00:00
|
|
|
char _indicated_string[16];
|
2005-08-03 19:58:42 +00:00
|
|
|
char _indicated_short_string[16];
|
2005-11-17 22:07:27 +00:00
|
|
|
char _local_short_string[16];
|
2003-06-27 08:46:57 +00:00
|
|
|
long _standstill_offset;
|
|
|
|
|
|
|
|
SGPropertyNode_ptr _serviceable_node;
|
|
|
|
SGPropertyNode_ptr _offset_node;
|
|
|
|
SGPropertyNode_ptr _sec_node;
|
2005-08-03 19:58:42 +00:00
|
|
|
SGPropertyNode_ptr _hour_node;
|
2005-11-17 22:07:27 +00:00
|
|
|
SGPropertyNode_ptr _lhour_node;
|
2005-08-03 19:58:42 +00:00
|
|
|
SGPropertyNode_ptr _min_node;
|
2003-06-27 08:46:57 +00:00
|
|
|
SGPropertyNode_ptr _string_node;
|
2005-08-03 19:58:42 +00:00
|
|
|
SGPropertyNode_ptr _string_node1;
|
2005-11-17 22:07:27 +00:00
|
|
|
SGPropertyNode_ptr _string_node2;
|
2003-06-27 08:46:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_CLOCK_HXX
|