From eb539707686a72a0c91d50628b14d693fd822939 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Thu, 4 Jul 2013 14:29:18 +0200 Subject: [PATCH] FGSystemMgr: Do not quit on unknown system. Showing a warning should be enough... --- src/Systems/system_mgr.cxx | 30 ++++++++++-------------------- src/Systems/system_mgr.hxx | 3 --- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/Systems/system_mgr.cxx b/src/Systems/system_mgr.cxx index 252ce5438..4661b3388 100644 --- a/src/Systems/system_mgr.cxx +++ b/src/Systems/system_mgr.cxx @@ -39,23 +39,15 @@ FGSystemMgr::FGSystemMgr () SG_LOG( SG_SYSTEMS, SG_INFO, "Reading systems from " << config.str() ); - try { - readProperties( config.str(), config_props ); - - if ( build(config_props) ) { - enabled = true; - } else { - SG_LOG( SG_SYSTEMS, SG_ALERT, - "Detected an internal inconsistency in the systems"); - SG_LOG( SG_SYSTEMS, SG_ALERT, - " system specification file. See earlier errors for" ); - SG_LOG( SG_SYSTEMS, SG_ALERT, - " details."); - exit(-1); - } - } catch (const sg_exception&) { - SG_LOG( SG_SYSTEMS, SG_ALERT, "Failed to load systems system model: " - << config.str() ); + try + { + readProperties( config.str(), config_props ); + build(config_props); + } + catch( const sg_exception& ) + { + SG_LOG( SG_SYSTEMS, SG_ALERT, "Failed to load systems system model: " + << config.str() ); } } else { @@ -93,9 +85,7 @@ bool FGSystemMgr::build (SGPropertyNode* config_props) set_subsystem( "system" + temp.str(), new VacuumSystem( node ) ); } else { - SG_LOG( SG_SYSTEMS, SG_ALERT, "Unknown top level section: " - << name ); - return false; + SG_LOG(SG_SYSTEMS, SG_ALERT, "Ignoring unknown system: " << name); } } return true; diff --git a/src/Systems/system_mgr.hxx b/src/Systems/system_mgr.hxx index a6260a531..ca5d64fa3 100644 --- a/src/Systems/system_mgr.hxx +++ b/src/Systems/system_mgr.hxx @@ -33,9 +33,6 @@ public: virtual ~FGSystemMgr (); bool build (SGPropertyNode* config_props); -private: - bool enabled; - }; #endif // __SYSTEM_MGR_HXX -- 2.39.5