2002-09-27 18:27:58 +00:00
|
|
|
// altimeter.hxx - an altimeter tied to the static port.
|
|
|
|
// Written by David Megginson, started 2002.
|
2007-03-31 09:36:19 +00:00
|
|
|
// Updated by John Denker to match changes in altimeter.cxx in 2007
|
2002-09-27 18:27:58 +00:00
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INSTRUMENTS_ALTIMETER_HXX
|
|
|
|
#define __INSTRUMENTS_ALTIMETER_HXX 1
|
|
|
|
|
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>
|
2007-03-31 09:36:19 +00:00
|
|
|
#include <Environment/atmosphere.hxx>
|
2002-09-27 18:27:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Model a barometric altimeter tied to the static port.
|
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
2006-12-06 22:11:43 +00:00
|
|
|
* /instrumentation/<name>/serviceable
|
|
|
|
* /instrumentation/<name>/setting-inhg
|
|
|
|
* <static_pressure>
|
2002-09-27 18:27:58 +00:00
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
2006-12-06 22:11:43 +00:00
|
|
|
* /instrumentation/<name>/indicated-altitude-ft
|
2002-09-27 18:27:58 +00:00
|
|
|
*/
|
2003-09-24 17:20:55 +00:00
|
|
|
class Altimeter : public SGSubsystem
|
2002-09-27 18:27:58 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2007-03-31 09:36:19 +00:00
|
|
|
Altimeter (SGPropertyNode *node, double quantum = 0);
|
2002-09-27 18:27:58 +00:00
|
|
|
virtual ~Altimeter ();
|
|
|
|
|
|
|
|
virtual void init ();
|
|
|
|
virtual void update (double dt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2006-12-06 22:11:43 +00:00
|
|
|
string _name;
|
|
|
|
int _num;
|
|
|
|
string _static_pressure;
|
2007-03-31 09:36:19 +00:00
|
|
|
double _tau;
|
|
|
|
double _quantum;
|
|
|
|
double _kollsman;
|
|
|
|
double raw_PA;
|
2004-10-16 12:37:39 +00:00
|
|
|
|
2002-09-27 18:27:58 +00:00
|
|
|
SGPropertyNode_ptr _serviceable_node;
|
|
|
|
SGPropertyNode_ptr _setting_node;
|
|
|
|
SGPropertyNode_ptr _pressure_node;
|
2007-03-31 09:36:19 +00:00
|
|
|
SGPropertyNode_ptr _press_alt_node;
|
|
|
|
SGPropertyNode_ptr _mode_c_node;
|
2002-09-27 18:27:58 +00:00
|
|
|
SGPropertyNode_ptr _altitude_node;
|
|
|
|
|
2007-03-31 09:36:19 +00:00
|
|
|
FGAltimeter _altimeter;
|
2002-09-27 18:27:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_ALTIMETER_HXX
|