X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSystems%2Fpitot.cxx;h=535caa09db89e5af9d2e40e0e9ccb7af8659f27f;hb=ed30b0c9a3818d5b8a306827184ac3525a1d8bdf;hp=136533f1b3f1371f26b998c63a29a532929f5b92;hpb=98cd4a9086740b2ff7779fa9502ef07554ffa9fa;p=flightgear.git diff --git a/src/Systems/pitot.cxx b/src/Systems/pitot.cxx index 136533f1b..535caa09d 100644 --- a/src/Systems/pitot.cxx +++ b/src/Systems/pitot.cxx @@ -13,31 +13,9 @@ PitotSystem::PitotSystem ( SGPropertyNode *node ) : - num(0), - name("pitot") + _name(node->getStringValue("name", "pitot")), + _num(node->getIntValue("number", 0)) { - int i; - for ( i = 0; i < node->nChildren(); ++i ) { - SGPropertyNode *child = node->getChild(i); - string cname = child->getName(); - string cval = child->getStringValue(); - if ( cname == "name" ) { - name = cval; - } else if ( cname == "number" ) { - num = child->getIntValue(); - } else { - SG_LOG( SG_SYSTEMS, SG_WARN, "Error in systems config logic" ); - if ( name.length() ) { - SG_LOG( SG_SYSTEMS, SG_WARN, "Section = " << name ); - } - } - } -} - -PitotSystem::PitotSystem ( int i ) -{ - num = i; - name = "pitot"; } PitotSystem::~PitotSystem () @@ -48,9 +26,9 @@ void PitotSystem::init () { string branch; - branch = "/systems/" + name; + branch = "/systems/" + _name; - SGPropertyNode *node = fgGetNode(branch.c_str(), num, true ); + SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); _serviceable_node = node->getChild("serviceable", 0, true); _pressure_node = fgGetNode("/environment/pressure-inhg", true); _density_node = fgGetNode("/environment/density-slugft3", true);