]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/input_output/FGScript.cpp
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / input_output / FGScript.cpp
old mode 100755 (executable)
new mode 100644 (file)
index bd940bb..e20e8c1
@@ -54,7 +54,7 @@ using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id: FGScript.cpp,v 1.41 2010/07/08 11:36:28 jberndt Exp $";
+static const char *IdSrc = "$Id: FGScript.cpp,v 1.43 2011/01/16 15:27:34 jberndt Exp $";
 static const char *IdHdr = ID_FGSCRIPT;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -266,8 +266,9 @@ bool FGScript::LoadScript(string script, double deltaT)
         } else {
           cout << endl << fgred << "  Could not find the property named "
                << notifyPropertyName << " in script" << endl << "  \""
-               << ScriptName << "\". This unknown property will not be "
-               << "echoed for notification." << reset << endl;
+               << ScriptName << "\". Execution is aborted. Please recheck "
+               << "your input files and scripts." << reset << endl;
+          return false;
         }
         notify_property_element = notify_element->FindNextElement("property");
       }
@@ -376,7 +377,9 @@ bool FGScript::RunScript(void)
       Events[ev_ctr].Triggered = true;
 
     } else if (Events[ev_ctr].Persistent) { // If the event is persistent, reset the trigger.
-
+      Events[ev_ctr].Triggered = false; // Reset the trigger for persistent events
+      Events[ev_ctr].Notified = false;  // Also reset the notification flag
+    } else if (Events[ev_ctr].Continuous) { // If the event is continuous, reset the trigger.
       Events[ev_ctr].Triggered = false; // Reset the trigger for persistent events
       Events[ev_ctr].Notified = false;  // Also reset the notification flag
     }
@@ -486,9 +489,11 @@ void FGScript::Debug(int from)
         cout << ":" << endl;
 
         if (Events[i].Persistent)
-          cout << "  " << "Always executes";
+          cout << "  " << "Whenever triggered, executes once";
+        else if (Events[i].Continuous)
+          cout << "  " << "While true, always executes";
         else
-          cout << "  " << "Executes once";
+          cout << "  " << "When first triggered, executes once";
 
         Events[i].Condition->PrintCondition();