2002-09-28 20:48:53 +00:00
|
|
|
// airspeed_indicator.hxx - a regular VSI tied to the static port.
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INSTRUMENTS_AIRSPEED_INDICATOR_HXX
|
|
|
|
#define __INSTRUMENTS_AIRSPEED_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-28 20:48:53 +00:00
|
|
|
|
2010-03-24 14:57:48 +00:00
|
|
|
// forward decls
|
|
|
|
class FGEnvironmentMgr;
|
2002-09-28 20:48:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Model an airspeed indicator tied to the pitot and static ports.
|
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/serviceable
|
|
|
|
* "pitot_port"/total-pressure-inhg
|
|
|
|
* "static_port"/pressure-inhg
|
2003-03-12 20:28:54 +00:00
|
|
|
* /environment/density-slugft3
|
2002-09-28 20:48:53 +00:00
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/indicated-speed-kt
|
2002-09-28 20:48:53 +00:00
|
|
|
*/
|
2003-09-24 17:20:55 +00:00
|
|
|
class AirspeedIndicator : public SGSubsystem
|
2002-09-28 20:48:53 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-10-16 12:37:39 +00:00
|
|
|
AirspeedIndicator ( SGPropertyNode *node );
|
2002-09-28 20:48:53 +00:00
|
|
|
virtual ~AirspeedIndicator ();
|
|
|
|
|
|
|
|
virtual void init ();
|
|
|
|
virtual void update (double dt);
|
|
|
|
|
|
|
|
private:
|
2010-03-24 14:57:48 +00:00
|
|
|
void computeMach(double ias);
|
2002-09-28 20:48:53 +00:00
|
|
|
|
2006-12-06 22:11:43 +00:00
|
|
|
string _name;
|
|
|
|
unsigned int _num;
|
|
|
|
string _total_pressure;
|
|
|
|
string _static_pressure;
|
2010-03-11 09:45:48 +00:00
|
|
|
bool _has_overspeed;
|
2010-03-18 00:05:26 +00:00
|
|
|
string _pressure_alt_source;
|
|
|
|
double _ias_limit;
|
|
|
|
double _mach_limit;
|
|
|
|
double _alt_threshold;
|
|
|
|
|
2010-03-09 11:11:07 +00:00
|
|
|
SGPropertyNode_ptr _ias_limit_node;
|
|
|
|
SGPropertyNode_ptr _mach_limit_node;
|
|
|
|
SGPropertyNode_ptr _alt_threshold_node;
|
2002-09-28 20:48:53 +00:00
|
|
|
SGPropertyNode_ptr _serviceable_node;
|
|
|
|
SGPropertyNode_ptr _total_pressure_node;
|
|
|
|
SGPropertyNode_ptr _static_pressure_node;
|
2003-03-12 20:28:54 +00:00
|
|
|
SGPropertyNode_ptr _density_node;
|
2002-09-28 20:48:53 +00:00
|
|
|
SGPropertyNode_ptr _speed_node;
|
2010-03-09 11:11:07 +00:00
|
|
|
SGPropertyNode_ptr _airspeed_limit;
|
|
|
|
SGPropertyNode_ptr _pressure_alt;
|
2010-03-24 14:57:48 +00:00
|
|
|
SGPropertyNode_ptr _mach_node;
|
|
|
|
SGPropertyNode_ptr _tas_node;
|
|
|
|
|
|
|
|
FGEnvironmentMgr* _environmentManager;
|
2002-09-28 20:48:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_AIRSPEED_INDICATOR_HXX
|