-
- delete config_props;
-
- if (!_explicitGps) {
- SG_LOG(SG_INSTR, SG_INFO, "creating default GPS instrument");
- SGPropertyNode_ptr nd(new SGPropertyNode);
- nd->setStringValue("name", "gps");
- nd->setIntValue("number", 0);
- set_subsystem("gps[0]", new GPS(nd));
- }
-}
-
-FGInstrumentMgr::~FGInstrumentMgr ()
-{
+ } catch (const sg_exception& e) {
+ SG_LOG(SG_COCKPIT, SG_ALERT, "Failed to load instrumentation system model: "
+ << config.str() << ":" << e.getFormattedMessage() );
+ }
+
+
+ if (!_explicitGps) {
+ SG_LOG(SG_INSTR, SG_INFO, "creating default GPS instrument");
+ SGPropertyNode_ptr nd(new SGPropertyNode);
+ nd->setStringValue("name", "gps");
+ nd->setIntValue("number", 0);
+ _instruments.push_back("gps[0]");
+ set_subsystem("gps[0]", new GPS(nd));
+ }
+
+ // bind() created instruments before init.
+ for (unsigned int i=0; i<_instruments.size(); ++i) {
+ const std::string& nm(_instruments[i]);
+ SGSubsystem* instr = get_subsystem(nm);
+ instr->bind();
+ }
+
+ SGSubsystemGroup::init();