From d27919cd16e18e828b4d09abf9d9cae96b205653 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Thu, 17 Oct 2013 11:48:01 +0200 Subject: [PATCH] More logging for FGNasalModelData. --- src/Scripting/NasalModelData.cxx | 33 +++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/Scripting/NasalModelData.cxx b/src/Scripting/NasalModelData.cxx index 2afd9c87d..02e4d0ad5 100644 --- a/src/Scripting/NasalModelData.cxx +++ b/src/Scripting/NasalModelData.cxx @@ -79,12 +79,26 @@ FGNasalModelData::FGNasalModelData( SGPropertyNode *root, _module_id( _max_module_id++ ) { _loaded_models.push_back(this); + + SG_LOG + ( + SG_NASAL, + SG_INFO, + "New model with attached script(s) (branch = " << branch << ")" + ); } //------------------------------------------------------------------------------ FGNasalModelData::~FGNasalModelData() { _loaded_models.remove(this); + + SG_LOG + ( + SG_NASAL, + SG_INFO, + "Removed model with script(s) (branch = " << _branch << ")" + ); } //------------------------------------------------------------------------------ @@ -180,13 +194,6 @@ void FGNasalModelDataProxy::modelLoaded( const std::string& path, SGPropertyNode *prop, osg::Node *branch ) { - FGNasalSys* nasalSys = (FGNasalSys*) globals->get_subsystem("nasal"); - if(!nasalSys) { - SG_LOG(SG_NASAL, SG_WARN, "Trying to run a script " - "without Nasal subsystem present."); - return; - } - if(!prop) return; @@ -194,6 +201,18 @@ void FGNasalModelDataProxy::modelLoaded( const std::string& path, if(!nasal) return; + FGNasalSys* nasalSys = (FGNasalSys*) globals->get_subsystem("nasal"); + if(!nasalSys) + { + SG_LOG + ( + SG_NASAL, + SG_WARN, + "Can not load model script(s) (Nasal subsystem not available)." + ); + return; + } + SGPropertyNode* load = nasal->getNode("load"); SGPropertyNode* unload = nasal->getNode("unload"); -- 2.39.5