2002-09-27 22:03:48 +00:00
|
|
|
// heading_indicator.hxx - a vacuum-powered heading indicator.
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INSTRUMENTS_HEADING_INDICATOR_HXX
|
|
|
|
#define __INSTRUMENTS_HEADING_INDICATOR_HXX 1
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
# error This library requires C++
|
|
|
|
#endif
|
|
|
|
|
2003-05-06 23:46:24 +00:00
|
|
|
#include <simgear/props/props.hxx>
|
2003-09-24 17:20:55 +00:00
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
2002-09-27 22:03:48 +00:00
|
|
|
|
2003-01-25 19:49:27 +00:00
|
|
|
#include "gyro.hxx"
|
|
|
|
|
2002-09-27 22:03:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Model a vacuum-powered heading indicator.
|
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/serviceable
|
|
|
|
* /instrumentation/"name"/spin
|
|
|
|
* /instrumentation/"name"/offset-deg
|
2002-09-27 22:03:48 +00:00
|
|
|
* /orientation/heading-deg
|
2004-10-16 12:37:39 +00:00
|
|
|
* "vacuum_system"/suction-inhg
|
2002-09-27 22:03:48 +00:00
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/indicated-heading-deg
|
2002-09-27 22:03:48 +00:00
|
|
|
*/
|
2003-09-24 17:20:55 +00:00
|
|
|
class HeadingIndicator : public SGSubsystem
|
2002-09-27 22:03:48 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-10-16 12:37:39 +00:00
|
|
|
HeadingIndicator ( SGPropertyNode *node );
|
2002-09-27 22:03:48 +00:00
|
|
|
HeadingIndicator ();
|
|
|
|
virtual ~HeadingIndicator ();
|
|
|
|
|
|
|
|
virtual void init ();
|
|
|
|
virtual void bind ();
|
|
|
|
virtual void unbind ();
|
|
|
|
virtual void update (double dt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2003-01-25 19:49:27 +00:00
|
|
|
Gyro _gyro;
|
2002-09-27 22:03:48 +00:00
|
|
|
double _last_heading_deg;
|
|
|
|
|
2006-12-06 22:11:43 +00:00
|
|
|
string _name;
|
|
|
|
int _num;
|
|
|
|
string _suction;
|
2004-10-16 12:37:39 +00:00
|
|
|
|
2002-09-27 22:03:48 +00:00
|
|
|
SGPropertyNode_ptr _offset_node;
|
|
|
|
SGPropertyNode_ptr _heading_in_node;
|
|
|
|
SGPropertyNode_ptr _suction_node;
|
|
|
|
SGPropertyNode_ptr _heading_out_node;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_HEADING_INDICATOR_HXX
|