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>
|
2012-02-13 22:25:30 +01:00
|
|
|
#include <simgear/props/tiedpropertylist.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:
|
|
|
|
|
2013-05-11 18:35:54 +01:00
|
|
|
Altimeter (SGPropertyNode *node, const std::string& aDefaultName, double quantum = 0);
|
2002-09-27 18:27:58 +00:00
|
|
|
virtual ~Altimeter ();
|
|
|
|
|
|
|
|
virtual void init ();
|
2012-09-17 00:12:29 +02:00
|
|
|
virtual void reinit ();
|
2002-09-27 18:27:58 +00:00
|
|
|
virtual void update (double dt);
|
2012-02-13 22:25:30 +01:00
|
|
|
virtual void bind();
|
|
|
|
virtual void unbind();
|
2002-09-27 18:27:58 +00:00
|
|
|
|
2012-02-13 22:25:30 +01:00
|
|
|
double getSettingInHg() const;
|
|
|
|
void setSettingInHg( double value );
|
2014-12-30 16:04:33 +01:00
|
|
|
int getSettingHPa() const;
|
|
|
|
void setSettingHPa( int value );
|
2002-09-27 18:27:58 +00:00
|
|
|
|
2012-02-13 22:25:30 +01:00
|
|
|
private:
|
2013-05-11 18:35:54 +01:00
|
|
|
std::string _name;
|
|
|
|
int _num;
|
2012-02-13 22:25:30 +01:00
|
|
|
SGPropertyNode_ptr _rootNode;
|
2013-06-27 09:37:06 +01:00
|
|
|
std::string _static_pressure;
|
2007-03-31 09:36:19 +00:00
|
|
|
double _tau;
|
|
|
|
double _quantum;
|
|
|
|
double _kollsman;
|
2012-09-17 00:12:29 +02:00
|
|
|
double _raw_PA;
|
2012-02-13 22:25:30 +01:00
|
|
|
double _settingInHg;
|
2013-05-08 17:34:20 +02:00
|
|
|
bool _encodeModeC;
|
|
|
|
bool _encodeModeS;
|
|
|
|
|
2002-09-27 18:27:58 +00:00
|
|
|
SGPropertyNode_ptr _serviceable_node;
|
|
|
|
SGPropertyNode_ptr _pressure_node;
|
2007-03-31 09:36:19 +00:00
|
|
|
SGPropertyNode_ptr _press_alt_node;
|
|
|
|
SGPropertyNode_ptr _mode_c_node;
|
2013-05-08 17:34:20 +02:00
|
|
|
SGPropertyNode_ptr _mode_s_node;
|
|
|
|
SGPropertyNode_ptr _transponder_node;
|
2002-09-27 18:27:58 +00:00
|
|
|
SGPropertyNode_ptr _altitude_node;
|
|
|
|
|
2007-03-31 09:36:19 +00:00
|
|
|
FGAltimeter _altimeter;
|
2012-02-13 22:25:30 +01:00
|
|
|
|
|
|
|
simgear::TiedPropertyList _tiedProperties;
|
2002-09-27 18:27:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_ALTIMETER_HXX
|