- set_subsystem( "electrical", new FGElectricalSystem );
- set_subsystem( "pitot", new PitotSystem );
- set_subsystem( "static", new StaticSystem );
- set_subsystem( "vacuum-l", new VacuumSystem(0) );
- set_subsystem( "vacuum-r", new VacuumSystem(1) );
+ SGPropertyNode_ptr config_props = new SGPropertyNode;
+
+ SGPropertyNode *path_n = fgGetNode("/sim/systems/path");
+
+ if (path_n) {
+ SGPath config( globals->get_fg_root() );
+ config.append( path_n->getStringValue() );
+
+ SG_LOG( SG_ALL, SG_INFO, "Reading systems from "
+ << config.str() );
+ try {
+ readProperties( config.str(), config_props );
+
+ if ( build(config_props) ) {
+ enabled = true;
+ } else {
+ SG_LOG( SG_ALL, SG_ALERT,
+ "Detected an internal inconsistency in the systems");
+ SG_LOG( SG_ALL, SG_ALERT,
+ " system specification file. See earlier errors for" );
+ SG_LOG( SG_ALL, SG_ALERT,
+ " details.");
+ exit(-1);
+ }
+ } catch (const sg_exception&) {
+ SG_LOG( SG_ALL, SG_ALERT, "Failed to load systems system model: "
+ << config.str() );
+ }
+
+ } else {
+ SG_LOG( SG_ALL, SG_WARN,
+ "No systems model specified for this model!");
+ }
+