FlightGear next
airspeed_indicator.hxx
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: CC0-1.0
3 *
4 * airspeed_indicator.hxx - a regular ASI tied to the static port.
5 * Written by David Megginson, started 2002.
6 * Last modified by Eric van den Berg, 24 Nov 2012
7 *
8 * This file is in the Public Domain and comes with no warranty.
9*/
10
11#pragma once
12
13#ifndef __cplusplus
14# error This library requires C++
15#endif
16
17#include <simgear/props/props.hxx>
18#include <simgear/structure/subsystem_mgr.hxx>
19
20// forward decls
22
39class AirspeedIndicator : public SGSubsystem
40{
41public:
42 AirspeedIndicator ( SGPropertyNode *node );
43 virtual ~AirspeedIndicator ();
44
45 // Subsystem API.
46 void init() override;
47 void reinit() override;
48 void update(double dt) override;
49
50 // Subsystem identification.
51 static const char* staticSubsystemClassId() { return "airspeed-indicator"; }
52
53private:
54 void computeMach();
55
56 std::string _name;
57 unsigned int _num;
58 std::string _total_pressure;
59 std::string _static_pressure;
60 bool _has_overspeed;
61 std::string _pressure_alt_source;
62 double _ias_limit;
63 double _mach_limit;
64 double _alt_threshold;
65
66 SGPropertyNode_ptr _ias_limit_node;
67 SGPropertyNode_ptr _mach_limit_node;
68 SGPropertyNode_ptr _alt_threshold_node;
69 SGPropertyNode_ptr _serviceable_node;
70 SGPropertyNode_ptr _total_pressure_node;
71 SGPropertyNode_ptr _static_pressure_node;
72 SGPropertyNode_ptr _density_node;
73 SGPropertyNode_ptr _speed_node;
74 SGPropertyNode_ptr _airspeed_limit;
75 SGPropertyNode_ptr _pressure_alt;
76 SGPropertyNode_ptr _mach_node;
77 SGPropertyNode_ptr _tas_node;
78
79 FGEnvironmentMgr* _environmentManager;
80};
static const char * staticSubsystemClassId()
void update(double dt) override
AirspeedIndicator(SGPropertyNode *node)
Manage environment information.