- degrade electrical XML SG_ALERT to SG_WARN. The reason why this is output
at all is that this method is meant to be deprecated. But if it doesn't say that, and there's no generic replacement at all, then it's rather pointless. - simplify parameter initialization (The old code copied from Instrumentation/ but has been simplified there in the same manner a few months ago The new method is less picky about additional nodes ane outputs less pointless alerts. If there shall really be a check for that, then this should be a separate function. But it's nowhere else done in fgfs.
This commit is contained in:
parent
a4fde6c4d8
commit
71cdd8c59a
2 changed files with 8 additions and 37 deletions
|
@ -333,30 +333,11 @@ bool FGElectricalConnector::get_state() {
|
||||||
|
|
||||||
|
|
||||||
FGElectricalSystem::FGElectricalSystem ( SGPropertyNode *node ) :
|
FGElectricalSystem::FGElectricalSystem ( SGPropertyNode *node ) :
|
||||||
name("electrical"),
|
name(node->getStringValue("name", "electrical")),
|
||||||
num(0),
|
num(node->getIntValue("number", 0)),
|
||||||
path(""),
|
path(node->getStringValue("path")),
|
||||||
enabled(false)
|
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 );
|
config.append( path );
|
||||||
|
|
||||||
// load an obsolete xml configuration
|
// load an obsolete xml configuration
|
||||||
SG_LOG( SG_ALL, SG_ALERT,
|
SG_LOG( SG_ALL, SG_WARN,
|
||||||
"Reading xml electrical system model from "
|
"Reading deprecated xml electrical system model from\n "
|
||||||
<< config.str() );
|
<< config.str() );
|
||||||
try {
|
try {
|
||||||
readProperties( config.str(), config_props );
|
readProperties( config.str(), config_props );
|
||||||
|
|
|
@ -17,20 +17,10 @@ VacuumSystem::VacuumSystem ( SGPropertyNode *node )
|
||||||
_num(node->getIntValue("number", 0)),
|
_num(node->getIntValue("number", 0)),
|
||||||
_scale(node->getDoubleValue("scale", 1.0))
|
_scale(node->getDoubleValue("scale", 1.0))
|
||||||
{
|
{
|
||||||
_rpms.clear();
|
for ( int i = 0; i < node->nChildren(); ++i ) {
|
||||||
int i;
|
|
||||||
for ( i = 0; i < node->nChildren(); ++i ) {
|
|
||||||
SGPropertyNode *child = node->getChild(i);
|
SGPropertyNode *child = node->getChild(i);
|
||||||
string cname = child->getName();
|
if (!strcmp(child->getName(), "rpm"))
|
||||||
string cval = child->getStringValue();
|
_rpms.push_back(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 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue