FlightGear next
altimeter.hxx
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: CC0-1.0
3 *
4 * altimeter.hxx - an altimeter tied to the static port.
5 * Written by David Megginson, started 2002.
6 * Updated by John Denker to match changes in altimeter.cxx in 2007
7 *
8 * This file is in the Public Domain and comes with no warranty.
9*/
10
11#pragma once
12
13#include <simgear/props/props.hxx>
14#include <simgear/props/tiedpropertylist.hxx>
15#include <simgear/structure/subsystem_mgr.hxx>
17
18
32class Altimeter : public SGSubsystem
33{
34public:
35 Altimeter (SGPropertyNode *node, const std::string& aDefaultName, double quantum = 0);
36 virtual ~Altimeter ();
37
38 // Subsystem API.
39 void bind() override;
40 void init() override;
41 void reinit() override;
42 void unbind() override;
43 void update(double dt) override;
44
45 // Subsystem identification.
46 static const char* staticSubsystemClassId() { return "altimeter"; }
47
48 double getSettingInHg() const;
49 void setSettingInHg( double value );
50 double getSettingHPa() const;
51 void setSettingHPa( double value );
52
53private:
54 std::string _name;
55 int _num;
56 SGPropertyNode_ptr _rootNode;
57 std::string _static_pressure;
58 double _tau;
59 double _quantum;
60 double _kollsman;
61 double _raw_PA;
62 double _settingInHg;
63 bool _encodeModeC;
64 bool _encodeModeS;
65
66 SGPropertyNode_ptr _serviceable_node;
67 SGPropertyNode_ptr _pressure_node;
68 SGPropertyNode_ptr _press_alt_node;
69 SGPropertyNode_ptr _mode_c_node;
70 SGPropertyNode_ptr _mode_s_node;
71 SGPropertyNode_ptr _transponder_node;
72 SGPropertyNode_ptr _altitude_node;
73
74 FGAltimeter _altimeter;
75
76 simgear::TiedPropertyList _tiedProperties;
77};
Altimeter(SGPropertyNode *node, const std::string &aDefaultName, double quantum=0)
Definition altimeter.cxx:33
void reinit() override
Definition altimeter.cxx:97
void update(double dt) override
void init() override
Definition altimeter.cxx:78
void setSettingHPa(double value)
Definition altimeter.cxx:71
double getSettingInHg() const
Definition altimeter.cxx:53
virtual ~Altimeter()
Definition altimeter.cxx:49
void unbind() override
void bind() override
void setSettingInHg(double value)
Definition altimeter.cxx:59
double getSettingHPa() const
Definition altimeter.cxx:65
static const char * staticSubsystemClassId()
Definition altimeter.hxx:46