]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/ATC-Main.cxx
Fix bug 141, by ensuring certain subsystems are assigned to the 'post FDM' group...
[flightgear.git] / src / Network / ATC-Main.cxx
index e291bb22b216934c04fe959cbc057388681b6247..b70b4abf36eb584ce1d6ffd726a8d093000c1f64 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <stdio.h>              //snprintf
-#if defined( _MSC_VER ) || defined(__MINGW32__)
+#ifdef _WIN32
 #  include <io.h>                 //lseek, read, write
 #endif
 
-#include STL_STRING
+#include <string>
 
 #include <plib/ul.h>
 
 #include <simgear/debug/logstream.hxx>
+#include <simgear/props/props_io.hxx>
 #include <simgear/io/iochannel.hxx>
 #include <simgear/math/sg_types.hxx>
 #include <simgear/misc/sg_path.hxx>
@@ -52,7 +53,7 @@
 
 #include "ATC-Main.hxx"
 
-SG_USING_STD(string);
+using std::string;
 
 
 // Lock the ATC hardware
@@ -94,7 +95,15 @@ void FGATCMain::init_config() {
     if ( envp != NULL ) {
         SGPath atcsim_config( envp );
         atcsim_config.append( ".fgfs-atc610x.xml" );
-        readProperties( atcsim_config.str(), globals->get_props() );
+       try {
+         SG_LOG(SG_GENERAL, SG_ALERT,
+                "Warning: loading deprecated config file: " <<
+                atcsim_config.str() );
+         readProperties( atcsim_config.str(), globals->get_props() );
+       } catch (const sg_exception &e) {
+         // fail silently, this is an old style config file I want to continue
+         // to support if it exists.
+       }
     }
 #endif
 }
@@ -211,10 +220,9 @@ bool FGATCMain::process() {
     // directly provide.
 
     FGNasalSys *n = (FGNasalSys*)globals->get_subsystem("nasal");
-    bool result = n->parseAndRun( "atcsim.do_hardware()" );
+    bool result = n->parseAndRun( "atcsim.update()" );
     if ( !result ) {
-        SG_LOG( SG_GENERAL, SG_ALERT,
-                "Nasal: atcsim.do_hardware() failed!" );
+        SG_LOG( SG_GENERAL, SG_ALERT, "Nasal: atcsim.update() failed!" );
     }
 
     // process the ATC outputs