X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FATC-Main.cxx;h=6c0da9bd96f400b86c3973ae3f9eb51780de72f8;hb=b0dcb657e77579ecc79798ff365737095f96f9e2;hp=e291bb22b216934c04fe959cbc057388681b6247;hpb=8e9f8674a64233e98c6f630bc129a6ced0a6a357;p=flightgear.git diff --git a/src/Network/ATC-Main.cxx b/src/Network/ATC-Main.cxx index e291bb22b..6c0da9bd9 100644 --- a/src/Network/ATC-Main.cxx +++ b/src/Network/ATC-Main.cxx @@ -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$ @@ -31,20 +31,22 @@ #include #include #include +#include + #include //snprintf -#if defined( _MSC_VER ) || defined(__MINGW32__) +#ifdef _WIN32 # include //lseek, read, write #endif -#include STL_STRING - -#include +#include #include +#include #include #include #include #include +#include #include #include
@@ -52,8 +54,10 @@ #include "ATC-Main.hxx" -SG_USING_STD(string); - +using std::string; +using std::cout; +using std::endl; +using std::vector; // Lock the ATC hardware static int fgATCMainLock( int fd ) { @@ -94,7 +98,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_NETWORK, 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 +223,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_NETWORK, SG_ALERT, "Nasal: atcsim.update() failed!" ); } // process the ATC outputs