]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/FGFCS.cpp
Merge branch 'topic/tape' into next
[flightgear.git] / src / FDM / JSBSim / models / FGFCS.cpp
index e688273510a95f59b33e6c51a10c6df4579cb3d4..3d974bf6e74aa171023d8bdc0ae2236b459fe0e1 100644 (file)
@@ -46,7 +46,6 @@ INCLUDES
 #include <models/flight_control/FGDeadBand.h>
 #include <models/flight_control/FGGain.h>
 #include <models/flight_control/FGPID.h>
-#include <models/flight_control/FGGradient.h>
 #include <models/flight_control/FGSwitch.h>
 #include <models/flight_control/FGSummer.h>
 #include <models/flight_control/FGKinemat.h>
@@ -514,6 +513,10 @@ bool FGFCS::Load(Element* el, SystemType systype)
       return false;
     } else {
       document = LoadXMLDocument(file);
+      if (!document) {
+        cerr << "Error loading file " << file << endl;
+        return false;
+      }
       name = document->GetAttributeValue("name");
     }
   } else {
@@ -551,13 +554,13 @@ bool FGFCS::Load(Element* el, SystemType systype)
   }
 
   // After reading interface properties in a file, read properties in the local
-  // flight_control, autopiot, or system element. This allows general-purpose
+  // flight_control, autopilot, or system element. This allows general-purpose
   // systems to be defined in a file, with overrides or initial loaded constants
   // supplied in the relevant element of the aircraft configuration file.
 
   if (!fname.empty()) {
     property_element = el->FindElement("property");
-    if (property_element) cout << endl << "    Declared properties" << endl << endl;
+    if (property_element && debug_lvl > 0) cout << endl << "    Declared properties" << endl << endl;
     while (property_element) {
       double value=0.0;
       if ( ! property_element->GetAttributeValue("value").empty())
@@ -573,7 +576,8 @@ bool FGFCS::Load(Element* el, SystemType systype)
       } else {
         interface_properties.push_back(new double(value));
         PropertyManager->Tie(interface_property_string, interface_properties.back());
-        cout << "      " << interface_property_string << " (initial value: " << value << ")" << endl;
+       if (debug_lvl > 0)
+          cout << "      " << interface_property_string << " (initial value: " << value << ")" << endl;
       }
       
       
@@ -600,7 +604,8 @@ bool FGFCS::Load(Element* el, SystemType systype)
   channel_element = document->FindElement("channel");
   while (channel_element) {
   
-    cout << endl << highint << fgblue << "    Channel " 
+    if (debug_lvl > 0)
+      cout << endl << highint << fgblue << "    Channel " 
          << normint << channel_element->GetAttributeValue("name") << reset << endl;
   
     component_element = channel_element->GetElement();
@@ -965,7 +970,7 @@ void FGFCS::Debug(int from)
 
   if (debug_lvl & 1) { // Standard console startup message output
     if (from == 2) { // Loader
-      cout << endl << "  Flight Control (" << Name << ")" << endl;
+      cout << endl << "  " << Name << endl;
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification