2003-01-25 19:49:27 +00:00
|
|
|
// turn_indicator.hxx - an electric-powered turn indicator.
|
|
|
|
// Written by David Megginson, started 2003.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INSTRUMENTS_TURN_INDICATOR_HXX
|
|
|
|
#define __INSTRUMENTS_TURN_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>
|
2003-01-25 19:49:27 +00:00
|
|
|
|
|
|
|
#include "gyro.hxx"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Model an electric-powered turn indicator.
|
|
|
|
*
|
|
|
|
* This class does not model the slip/skid ball; that is properly
|
|
|
|
* a separate instrument.
|
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/serviceable
|
|
|
|
* /instrumentation/"name"/spin
|
2003-01-25 19:49:27 +00:00
|
|
|
* /orientation/roll-rate-degps
|
|
|
|
* /orientation/yaw-rate-degps
|
|
|
|
* /systems/electrical/outputs/turn-coordinator
|
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/indicated-turn-rate
|
2003-01-25 19:49:27 +00:00
|
|
|
*/
|
2003-09-24 17:20:55 +00:00
|
|
|
class TurnIndicator : public SGSubsystem
|
2003-01-25 19:49:27 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-10-16 12:37:39 +00:00
|
|
|
TurnIndicator ( SGPropertyNode *node );
|
2003-01-25 19:49:27 +00:00
|
|
|
virtual ~TurnIndicator ();
|
|
|
|
|
|
|
|
virtual void init ();
|
|
|
|
virtual void bind ();
|
|
|
|
virtual void unbind ();
|
|
|
|
virtual void update (double dt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Gyro _gyro;
|
|
|
|
double _last_rate;
|
|
|
|
|
2006-12-06 22:11:43 +00:00
|
|
|
string _name;
|
|
|
|
int _num;
|
2004-10-16 12:37:39 +00:00
|
|
|
|
2003-01-25 19:49:27 +00:00
|
|
|
SGPropertyNode_ptr _roll_rate_node;
|
|
|
|
SGPropertyNode_ptr _yaw_rate_node;
|
|
|
|
SGPropertyNode_ptr _electric_current_node;
|
|
|
|
SGPropertyNode_ptr _rate_out_node;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_TURN_INDICATOR_HXX
|