# include <config.h>
#endif
+#include <cstdlib>
#include <cstring>
#include <simgear/structure/exception.hxx>
if ( path.length() ) {
SGPath config = globals->resolve_aircraft_path(path);
-
+#if defined(ENABLE_DEV_WARNINGS)
// load an obsolete xml configuration
SG_LOG( SG_SYSTEMS, SG_WARN,
"Reading deprecated xml electrical system model from\n "
<< config.str() );
+#endif
try {
readProperties( config.str(), config_props );
if ( build(config_props) ) {
enabled = true;
} else {
- SG_LOG( SG_SYSTEMS, SG_ALERT,
- "Detected a logic error in the electrical system ");
- SG_LOG( SG_SYSTEMS, SG_ALERT,
- "specification file. See earlier errors for " );
- SG_LOG( SG_SYSTEMS, SG_ALERT,
- "details.");
- exit(-1);
+ throw sg_exception("Logic error in electrical system file.");
}
} catch (const sg_exception&) {
SG_LOG( SG_SYSTEMS, SG_ALERT,
}
// cout << s << " input_volts = " << volts << endl;
} else {
- SG_LOG( SG_SYSTEMS, SG_ALERT, "unkown node type" );
+ SG_LOG( SG_SYSTEMS, SG_ALERT, "unknown node type" );
}
int i;