]> git.mxchange.org Git - flightgear.git/commitdiff
Conditional compilation of ATCDCL module. Use --disable-atcdcl to try building flight...
authordurk <durk>
Wed, 30 Dec 2009 14:11:16 +0000 (14:11 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 30 Dec 2009 16:44:06 +0000 (17:44 +0100)
configure.ac
src/AIModel/AIAircraft.cxx
src/ATC/trafficcontrol.cxx
src/ATC/trafficcontrol.hxx
src/Airports/apt_loader.cxx
src/Airports/groundnetwork.cxx
src/Main/Makefile.am
src/Main/fg_init.cxx
src/Makefile.am

index 6ae6d7438f964ea35c212bd69d1ddbf6fa50dfac..1c1fa96132cbd491840954690d4ceb6d9897cd05 100644 (file)
@@ -158,6 +158,17 @@ else
 fi
 AM_CONDITIONAL(ENABLE_SP_FDM, test "x$enable_sp_fdms" != "xno")
 
+# Specify whether we want to compile ATCDCL.
+# default to with_atcdcl=yes
+AC_ARG_ENABLE(atcdcl, [  --enable-atcdcl                Compile and link the depricated atc/ai module], [enable_atcdcl="$enableval"] )
+if test "x$enable_atcdcl" != "xno"; then
+    AC_DEFINE([ENABLE_ATCDCL], 1, [Define to include old ATC/AI module])
+else
+    AC_DEFINE([ENABLE_ATCDCL], 0, [Define to include old ATC/AI module])
+fi
+AM_CONDITIONAL(ENABLE_ATCDCL, test "x$enable_atcdcl" != "xno")
+
+
 
 dnl EXPERIMENTAL generic event driven input device
 # defaults to no
@@ -202,6 +213,7 @@ fi
 AC_CHECK_HEADER(pthread.h)
 AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes")
 
+
 dnl Used by JSBSim to conditionally compile in fgfs interface code
 AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
 
@@ -283,7 +295,7 @@ AC_SEARCH_LIBS(clock_gettime, rt)
 base_LIBS="$LIBS"
 
 dnl Check for SDL or glut if enabled.
-AC_ARG_ENABLE(osgviewer, [  --enable-osgviewer                  Configure to use osgViewer(default)], [enable_osgviewer="$enableval"])
+AC_ARG_ENABLE(osgviewer, [  --enable-osgviewer             Configure to use osgViewer(default)], [enable_osgviewer="$enableval"])
 AC_ARG_ENABLE(sdl,  [  --enable-sdl                   Configure to use SDL], [enable_sdl="$enableval"])
 AC_ARG_ENABLE(glut, [  --enable-glut                  Configure to use GLUT], [enable_glut="$enableval"])
 AM_CONDITIONAL(USE_SDL, test "x$enable_sdl" = "xyes")
@@ -880,3 +892,8 @@ else
     echo "Include special purpose flight models: no"
 fi
 
+if test "x$enable_atcdcl" != "xno"; then
+    echo "Build depricated ATC/AI module: yes"
+else
+    echo "Build depricated ATC/AI module: no"
+fi
index 68d7f46c44d4d0d605a63a2751d4ba59fe4ec859..eb8469fdece8dd419a721b5c7262caf3ddc9a6af 100644 (file)
@@ -447,15 +447,6 @@ void FGAIAircraft::announcePositionToController() {
         case 4:              //Take off tower controller
             if (trafficRef->getDepartureAirport()->getDynamics()) {
                 controller = trafficRef->getDepartureAirport()->getDynamics()->getTowerController();
-                //if (trafficRef->getDepartureAirport()->getId() == "EHAM") {
-                //string trns = trafficRef->getCallSign() + " at runway " + fp->getRunway() + 
-                //              ". Ready for departure. " + trafficRef->getFlightType() + " to " +
-                //              trafficRef->getArrivalAirport()->getId();
-                //fgSetString("/sim/messages/atc", trns.c_str());
-                //  if (controller == 0) {
-                //cerr << "Error in assigning controller at " << trafficRef->getDepartureAirport()->getId() << endl;
-                //}
-                //}
             } else {
                 cerr << "Error: Could not find Dynamics at airport : " << trafficRef->getDepartureAirport()->getId() << endl;
             }
index 57f718812ce242bbf680a8eb9371ffd278e3b3fa..a04b6fc817ca26533b442b1ee90ab3cdaf982347 100644 (file)
@@ -264,7 +264,7 @@ bool FGTrafficRecord::isOpposing (FGGroundNetwork *net, FGTrafficRecord &other,
          if (other.intentions.size())
            {
              for (intVecIterator j = other.intentions.begin(); j != other.intentions.end(); j++)
-               {  
+               {
                  // cerr << "Current segment 1 " << (*i) << endl;
                  if ((*i) > 0) {
                    if ((opp = net->findSegment(*i)->opposite()))
@@ -402,7 +402,7 @@ void FGATCController::transmit(FGTrafficRecord *rec, AtcMsgId msgId, AtcMsgDir m
           // Assign SID, if necessery (TODO)
           case MSG_PERMIT_ENGINE_START:
                taxiFreqStr = formatATCFrequency3_2(taxiFreq);
-               
+
                heading = rec->getAircraft()->getTrafficRef()->getCourse();
                fltType = rec->getAircraft()->getTrafficRef()->getFlightType();
                rwyClass= rec->getAircraft()->GetFlightPlan()->getRunwayClassFromTrafficType(fltType);
@@ -453,10 +453,8 @@ void FGATCController::transmit(FGTrafficRecord *rec, AtcMsgId msgId, AtcMsgDir m
     // Display ATC message only when one of the radios is tuned
     // the relevant frequency.
     // Note that distance attenuation is currently not yet implemented
-    //cerr << "Transmitting " << text << " at " << stationFreq;
     if ((onBoardRadioFreqI0 == stationFreq) || (onBoardRadioFreqI1 == stationFreq)) {
         fgSetString("/sim/messages/atc", text.c_str());
-        //cerr << "Printing Message: " << endl;
     }
 }
 
@@ -466,6 +464,8 @@ string FGATCController::formatATCFrequency3_2(int freq) {
     return string(buffer);
 }
 
+// TODO: Set transponder codes according to real-world routes.
+// The current version just returns a random string of four octal numbers. 
 string FGATCController::genTransponderCode(string fltRules) {
     if (fltRules == "VFR") {
         return string("1200");
index 7ca8e88bf42cd04fe5ccb96f72151567741a8414..ef984efcac42091e97c0d628db61e47998eec51e 100644 (file)
@@ -45,7 +45,6 @@ typedef vector<int>::iterator intVecIterator;
 
 class FGAIFlightPlan;  // forward reference
 class FGGroundNetwork; // forward reference
-//class FGAISchedule;    // forward reference
 class FGAIAircraft;    // forward reference
 
 /**************************************************************************************
index af9319ae35cf81ba6a79ebe65ead10aa148089be..3dfcdf0591e0a658424214ebefb99fa51d5d0609 100644 (file)
@@ -45,7 +45,9 @@
 #include "simple.hxx"
 #include "runways.hxx"
 #include "pavement.hxx"
-#include <ATCDCL/commlist.hxx>
+#if ENABLE_ATCDCL
+#    include <ATCDCL/commlist.hxx>
+#endif
 
 #include <iostream>
 
@@ -75,7 +77,12 @@ public:
      last_apt_type("")
   {}
 
+
+#ifdef ENABLE_ATCDCL
   void parseAPT(const string &aptdb_file, FGCommList *comm_list)
+#else
+  void parseAPT(const string &aptdb_file)
+#endif
   {
     sg_gzifstream in( aptdb_file );
 
@@ -461,7 +468,7 @@ private:
       pvt->addNode(pos, num == 113);
     }
   }
-  
+#if ENABLE_ATCDCL  
   void parseATISLine(FGCommList *comm_list, const vector<string>& token) 
   {
     if ( rwy_count <= 0 ) {
@@ -505,19 +512,27 @@ private:
     << "  type: " << a.type );
 #endif
   }
+#endif
 };
 
+
 // Load the airport data base from the specified aptdb file.  The
 // metar file is used to mark the airports as having metar available
 // or not.
 bool fgAirportDBLoad( const string &aptdb_file, 
+#if ENABLE_ATCDCL
         FGCommList *comm_list, const std::string &metar_file )
+#else
+        const std::string &metar_file )
+#endif
 {
 
    APTLoader ld;
-
+#if ENABLE_ATCDCL
    ld.parseAPT(aptdb_file, comm_list);
-
+#else
+   ld.parseAPT(aptdb_file);
+#endif
     //
     // Load the metar.dat file and update apt db with stations that
     // have metar data.
index 8bdd947fc5ce4243123f2651c85b8546062d8837..7600033cee4331019c085a85cf6fcaf98fb0f558 100644 (file)
@@ -508,6 +508,13 @@ void FGGroundNetwork::signOff(int id) {
 
 void FGGroundNetwork::update(int id, double lat, double lon, double heading, double speed, double alt, 
                             double dt) {
+   // Check whether aircraft are on hold due to a preceding pushback. If so, make sure to 
+   // Transmit air-to-ground "Ready to taxi request:
+   // Transmit ground to air approval / hold
+   // Transmit confirmation ... 
+   // Probably use a status mechanism similar to the Engine start procedure in the startup controller.
+
+
    TrafficVectorIterator i = activeTraffic.begin();
    // Search search if the current id has an entry
    // This might be faster using a map instead of a vector, but let's start by taking a safe route
index 0994d859ad1c585049c147cb8f712a262dd1bec7..996c63e11b59502cde33cfe8ad3195654d50034c 100644 (file)
@@ -9,6 +9,13 @@ else
 SP_FDM_LIBS = 
 endif
 
+if ENABLE_ATCDCL
+ATCDCL_LIBS = $(top_builddir)/src/ATCDCL/libATCDCL.a
+else
+ATCDCL_LIBS = 
+endif
+
+
 if WITH_THREADS
 THREAD_LIBS = -lsgthreads $(thread_LIBS)
 else
@@ -82,7 +89,7 @@ fgfs_SOURCES = bootstrap.cxx
 fgfs_LDADD = \
        libMain.a \
        $(top_builddir)/src/Aircraft/libAircraft.a \
-       $(top_builddir)/src/ATCDCL/libATCDCL.a \
+       $(ATCDCL_LIBS) \
        $(top_builddir)/src/Cockpit/libCockpit.a \
        $(top_builddir)/src/Cockpit/built_in/libBuilt_in.a \
        $(top_builddir)/src/FDM/libFlight.a \
index 26a7987f4fc53ebf5f0c6fcd06982f4ede3c3dd2..ded6765fcb1d0a5bddae82b918c26fb67949b955 100644 (file)
 #include <Airports/dynamics.hxx>
 
 #include <AIModel/AIManager.hxx>
-#include <ATCDCL/ATCmgr.hxx>
-#include <ATCDCL/AIMgr.hxx>
+
+#if ENABLE_ATCDCL
+#   include <ATCDCL/ATCmgr.hxx>
+#   include <ATCDCL/AIMgr.hxx>
+#   include "ATCDCL/commlist.hxx"
+#endif
+
 #include <Autopilot/route_mgr.hxx>
 #include <Autopilot/xmlauto.hxx>
 #include <Autopilot/autobrake.hxx>
@@ -82,7 +87,8 @@
 #include <Cockpit/cockpit.hxx>
 #include <Cockpit/panel.hxx>
 #include <Cockpit/panel_io.hxx>
-#ifdef ENABLE_SP_FDM
+
+#if ENABLE_SP_FDM
 #include <FDM/SP/ADA.hxx>
 #include <FDM/SP/ACMS.hxx>
 #include <FDM/SP/MagicCarpet.hxx>
 #include "renderer.hxx"
 #include "viewmgr.hxx"
 #include "main.hxx"
-#include "ATCDCL/commlist.hxx"
+
 
 #ifdef __APPLE__
 #  include <CoreFoundation/CoreFoundation.h>
@@ -973,9 +979,16 @@ fgInitNav ()
 
 // Initialise the frequency search map BEFORE reading
 // the airport database:
+
+
+
+#if ENABLE_ATCDCL
     current_commlist = new FGCommList;
     current_commlist->init( globals->get_fg_root() );
     fgAirportDBLoad( aptdb.str(), current_commlist, p_metar.str() );
+#else
+    fgAirportDBLoad( aptdb.str(), p_metar.str() );
+#endif
 
     FGNavList *navlist = new FGNavList;
     FGNavList *loclist = new FGNavList;
index 178419eb064efa6da3bc520000cf51b19c288cd3..39b081ac151c84d4530f78af7f9d545778c94321 100644 (file)
@@ -1,9 +1,16 @@
+if ENABLE_ATCDCL
+ATCDCL_DIR = ATCDCL
+else
+ATCDCL_DIR = 
+endif
+
+
 SUBDIRS = \
         Include \
         Aircraft \
         Airports \
        ATC \
-        ATCDCL \
+        $(ATCDCL_DIR) \
         Autopilot \
         Cockpit \
         Environment \