diff --git a/src/Systems/electrical.cxx b/src/Systems/electrical.cxx index 025a46ae3..0f0439556 100644 --- a/src/Systems/electrical.cxx +++ b/src/Systems/electrical.cxx @@ -333,30 +333,11 @@ bool FGElectricalConnector::get_state() { FGElectricalSystem::FGElectricalSystem ( SGPropertyNode *node ) : - name("electrical"), - num(0), - path(""), + name(node->getStringValue("name", "electrical")), + num(node->getIntValue("number", 0)), + path(node->getStringValue("path")), enabled(false) { - 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 if ( cname == "path" ) { - path = cval; - } else { - SG_LOG( SG_SYSTEMS, SG_WARN, - "Error in electrical system config logic" ); - if ( name.length() ) { - SG_LOG( SG_SYSTEMS, SG_WARN, "Section = " << name ); - } - } - } } @@ -392,8 +373,8 @@ void FGElectricalSystem::init () { config.append( path ); // load an obsolete xml configuration - SG_LOG( SG_ALL, SG_ALERT, - "Reading xml electrical system model from " + SG_LOG( SG_ALL, SG_WARN, + "Reading deprecated xml electrical system model from\n " << config.str() ); try { readProperties( config.str(), config_props ); diff --git a/src/Systems/vacuum.cxx b/src/Systems/vacuum.cxx index cab464404..9303073b2 100644 --- a/src/Systems/vacuum.cxx +++ b/src/Systems/vacuum.cxx @@ -17,20 +17,10 @@ VacuumSystem::VacuumSystem ( SGPropertyNode *node ) _num(node->getIntValue("number", 0)), _scale(node->getDoubleValue("scale", 1.0)) { - _rpms.clear(); - int i; - for ( i = 0; i < node->nChildren(); ++i ) { + for ( int i = 0; i < node->nChildren(); ++i ) { SGPropertyNode *child = node->getChild(i); - string cname = child->getName(); - string cval = child->getStringValue(); - if ( cname == "rpm" ) { - _rpms.push_back(cval); - } else { - SG_LOG( SG_SYSTEMS, SG_WARN, "Error in vacuum config logic" ); - if ( _name.length() ) { - SG_LOG( SG_SYSTEMS, SG_WARN, "Section = " << _name ); - } - } + if (!strcmp(child->getName(), "rpm")) + _rpms.push_back(child->getStringValue()); } }