15
15
// A higher number means more responsive.
16
16
#define RESPONSIVENESS 50.0
19
AirspeedIndicator::AirspeedIndicator ()
18
AirspeedIndicator::AirspeedIndicator ( SGPropertyNode *node )
20
name("airspeed-indicator"),
22
pitot_port("/systems/pitot"),
23
static_port("/systems/static")
26
for ( i = 0; i < node->nChildren(); ++i ) {
27
SGPropertyNode *child = node->getChild(i);
28
string cname = child->getName();
29
string cval = child->getStringValue();
30
if ( cname == "name" ) {
32
} else if ( cname == "number" ) {
33
num = child->getIntValue();
34
} else if ( cname == "pitot-port" ) {
36
} else if ( cname == "static-port" ) {
39
SG_LOG( SG_INSTR, SG_WARN, "Error in aispeed-indicator config logic" );
40
if ( name.length() ) {
41
SG_LOG( SG_INSTR, SG_WARN, "Section = " << name );
48
AirspeedIndicator::AirspeedIndicator ( int i )
50
name("airspeed-indicator"),
52
pitot_port("/systems/pitot"),
53
static_port("/systems/static")
23
58
AirspeedIndicator::~AirspeedIndicator ()
28
63
AirspeedIndicator::init ()
31
fgGetNode("/instrumentation/airspeed-indicator/serviceable",
33
_total_pressure_node =
34
fgGetNode("/systems/pitot/total-pressure-inhg", true);
35
_static_pressure_node =
36
fgGetNode("/systems/static/pressure-inhg", true);
66
branch = "/instrumentation/" + name;
67
pitot_port += "/total-pressure-inhg";
68
static_port += "/pressure-inhg";
70
SGPropertyNode *node = fgGetNode(branch.c_str(), num, true );
71
_serviceable_node = node->getChild("serviceable", 0, true);
72
_total_pressure_node = fgGetNode(pitot_port.c_str(), true);
73
_static_pressure_node = fgGetNode(static_port.c_str(), true);
37
74
_density_node = fgGetNode("/environment/density-slugft3", true);
39
fgGetNode("/instrumentation/airspeed-indicator/indicated-speed-kt",
75
_speed_node = node->getChild("indicated-speed-kt", 0, true);