1
0
Fork 0

Conditional compilation of ATCDCL module. Use --disable-atcdcl to try building flightgear without ATCDCL code.

This commit is contained in:
durk 2009-12-30 14:11:16 +00:00 committed by Tim Moore
parent d2c7179cd0
commit 8114d1d899
9 changed files with 81 additions and 25 deletions

View file

@ -158,6 +158,17 @@ else
fi fi
AM_CONDITIONAL(ENABLE_SP_FDM, test "x$enable_sp_fdms" != "xno") 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 dnl EXPERIMENTAL generic event driven input device
# defaults to no # defaults to no
@ -202,6 +213,7 @@ fi
AC_CHECK_HEADER(pthread.h) AC_CHECK_HEADER(pthread.h)
AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes") AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes")
dnl Used by JSBSim to conditionally compile in fgfs interface code dnl Used by JSBSim to conditionally compile in fgfs interface code
AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode]) AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
@ -880,3 +892,8 @@ else
echo "Include special purpose flight models: no" echo "Include special purpose flight models: no"
fi fi
if test "x$enable_atcdcl" != "xno"; then
echo "Build depricated ATC/AI module: yes"
else
echo "Build depricated ATC/AI module: no"
fi

View file

@ -447,15 +447,6 @@ void FGAIAircraft::announcePositionToController() {
case 4: //Take off tower controller case 4: //Take off tower controller
if (trafficRef->getDepartureAirport()->getDynamics()) { if (trafficRef->getDepartureAirport()->getDynamics()) {
controller = trafficRef->getDepartureAirport()->getDynamics()->getTowerController(); 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 { } else {
cerr << "Error: Could not find Dynamics at airport : " << trafficRef->getDepartureAirport()->getId() << endl; cerr << "Error: Could not find Dynamics at airport : " << trafficRef->getDepartureAirport()->getId() << endl;
} }

View file

@ -453,10 +453,8 @@ void FGATCController::transmit(FGTrafficRecord *rec, AtcMsgId msgId, AtcMsgDir m
// Display ATC message only when one of the radios is tuned // Display ATC message only when one of the radios is tuned
// the relevant frequency. // the relevant frequency.
// Note that distance attenuation is currently not yet implemented // Note that distance attenuation is currently not yet implemented
//cerr << "Transmitting " << text << " at " << stationFreq;
if ((onBoardRadioFreqI0 == stationFreq) || (onBoardRadioFreqI1 == stationFreq)) { if ((onBoardRadioFreqI0 == stationFreq) || (onBoardRadioFreqI1 == stationFreq)) {
fgSetString("/sim/messages/atc", text.c_str()); fgSetString("/sim/messages/atc", text.c_str());
//cerr << "Printing Message: " << endl;
} }
} }
@ -466,6 +464,8 @@ string FGATCController::formatATCFrequency3_2(int freq) {
return string(buffer); 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) { string FGATCController::genTransponderCode(string fltRules) {
if (fltRules == "VFR") { if (fltRules == "VFR") {
return string("1200"); return string("1200");

View file

@ -45,7 +45,6 @@ typedef vector<int>::iterator intVecIterator;
class FGAIFlightPlan; // forward reference class FGAIFlightPlan; // forward reference
class FGGroundNetwork; // forward reference class FGGroundNetwork; // forward reference
//class FGAISchedule; // forward reference
class FGAIAircraft; // forward reference class FGAIAircraft; // forward reference
/************************************************************************************** /**************************************************************************************

View file

@ -45,7 +45,9 @@
#include "simple.hxx" #include "simple.hxx"
#include "runways.hxx" #include "runways.hxx"
#include "pavement.hxx" #include "pavement.hxx"
#if ENABLE_ATCDCL
# include <ATCDCL/commlist.hxx> # include <ATCDCL/commlist.hxx>
#endif
#include <iostream> #include <iostream>
@ -75,7 +77,12 @@ public:
last_apt_type("") last_apt_type("")
{} {}
#ifdef ENABLE_ATCDCL
void parseAPT(const string &aptdb_file, FGCommList *comm_list) void parseAPT(const string &aptdb_file, FGCommList *comm_list)
#else
void parseAPT(const string &aptdb_file)
#endif
{ {
sg_gzifstream in( aptdb_file ); sg_gzifstream in( aptdb_file );
@ -461,7 +468,7 @@ private:
pvt->addNode(pos, num == 113); pvt->addNode(pos, num == 113);
} }
} }
#if ENABLE_ATCDCL
void parseATISLine(FGCommList *comm_list, const vector<string>& token) void parseATISLine(FGCommList *comm_list, const vector<string>& token)
{ {
if ( rwy_count <= 0 ) { if ( rwy_count <= 0 ) {
@ -505,19 +512,27 @@ private:
<< " type: " << a.type ); << " type: " << a.type );
#endif #endif
} }
#endif
}; };
// Load the airport data base from the specified aptdb file. The // Load the airport data base from the specified aptdb file. The
// metar file is used to mark the airports as having metar available // metar file is used to mark the airports as having metar available
// or not. // or not.
bool fgAirportDBLoad( const string &aptdb_file, bool fgAirportDBLoad( const string &aptdb_file,
#if ENABLE_ATCDCL
FGCommList *comm_list, const std::string &metar_file ) FGCommList *comm_list, const std::string &metar_file )
#else
const std::string &metar_file )
#endif
{ {
APTLoader ld; APTLoader ld;
#if ENABLE_ATCDCL
ld.parseAPT(aptdb_file, comm_list); ld.parseAPT(aptdb_file, comm_list);
#else
ld.parseAPT(aptdb_file);
#endif
// //
// Load the metar.dat file and update apt db with stations that // Load the metar.dat file and update apt db with stations that
// have metar data. // have metar data.

View 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, void FGGroundNetwork::update(int id, double lat, double lon, double heading, double speed, double alt,
double dt) { 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(); TrafficVectorIterator i = activeTraffic.begin();
// Search search if the current id has an entry // 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 // This might be faster using a map instead of a vector, but let's start by taking a safe route

View file

@ -9,6 +9,13 @@ else
SP_FDM_LIBS = SP_FDM_LIBS =
endif endif
if ENABLE_ATCDCL
ATCDCL_LIBS = $(top_builddir)/src/ATCDCL/libATCDCL.a
else
ATCDCL_LIBS =
endif
if WITH_THREADS if WITH_THREADS
THREAD_LIBS = -lsgthreads $(thread_LIBS) THREAD_LIBS = -lsgthreads $(thread_LIBS)
else else
@ -82,7 +89,7 @@ fgfs_SOURCES = bootstrap.cxx
fgfs_LDADD = \ fgfs_LDADD = \
libMain.a \ libMain.a \
$(top_builddir)/src/Aircraft/libAircraft.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/libCockpit.a \
$(top_builddir)/src/Cockpit/built_in/libBuilt_in.a \ $(top_builddir)/src/Cockpit/built_in/libBuilt_in.a \
$(top_builddir)/src/FDM/libFlight.a \ $(top_builddir)/src/FDM/libFlight.a \

View file

@ -73,8 +73,13 @@
#include <Airports/dynamics.hxx> #include <Airports/dynamics.hxx>
#include <AIModel/AIManager.hxx> #include <AIModel/AIManager.hxx>
#if ENABLE_ATCDCL
# include <ATCDCL/ATCmgr.hxx> # include <ATCDCL/ATCmgr.hxx>
# include <ATCDCL/AIMgr.hxx> # include <ATCDCL/AIMgr.hxx>
# include "ATCDCL/commlist.hxx"
#endif
#include <Autopilot/route_mgr.hxx> #include <Autopilot/route_mgr.hxx>
#include <Autopilot/xmlauto.hxx> #include <Autopilot/xmlauto.hxx>
#include <Autopilot/autobrake.hxx> #include <Autopilot/autobrake.hxx>
@ -82,7 +87,8 @@
#include <Cockpit/cockpit.hxx> #include <Cockpit/cockpit.hxx>
#include <Cockpit/panel.hxx> #include <Cockpit/panel.hxx>
#include <Cockpit/panel_io.hxx> #include <Cockpit/panel_io.hxx>
#ifdef ENABLE_SP_FDM
#if ENABLE_SP_FDM
#include <FDM/SP/ADA.hxx> #include <FDM/SP/ADA.hxx>
#include <FDM/SP/ACMS.hxx> #include <FDM/SP/ACMS.hxx>
#include <FDM/SP/MagicCarpet.hxx> #include <FDM/SP/MagicCarpet.hxx>
@ -130,7 +136,7 @@
#include "renderer.hxx" #include "renderer.hxx"
#include "viewmgr.hxx" #include "viewmgr.hxx"
#include "main.hxx" #include "main.hxx"
#include "ATCDCL/commlist.hxx"
#ifdef __APPLE__ #ifdef __APPLE__
# include <CoreFoundation/CoreFoundation.h> # include <CoreFoundation/CoreFoundation.h>
@ -973,9 +979,16 @@ fgInitNav ()
// Initialise the frequency search map BEFORE reading // Initialise the frequency search map BEFORE reading
// the airport database: // the airport database:
#if ENABLE_ATCDCL
current_commlist = new FGCommList; current_commlist = new FGCommList;
current_commlist->init( globals->get_fg_root() ); current_commlist->init( globals->get_fg_root() );
fgAirportDBLoad( aptdb.str(), current_commlist, p_metar.str() ); fgAirportDBLoad( aptdb.str(), current_commlist, p_metar.str() );
#else
fgAirportDBLoad( aptdb.str(), p_metar.str() );
#endif
FGNavList *navlist = new FGNavList; FGNavList *navlist = new FGNavList;
FGNavList *loclist = new FGNavList; FGNavList *loclist = new FGNavList;

View file

@ -1,9 +1,16 @@
if ENABLE_ATCDCL
ATCDCL_DIR = ATCDCL
else
ATCDCL_DIR =
endif
SUBDIRS = \ SUBDIRS = \
Include \ Include \
Aircraft \ Aircraft \
Airports \ Airports \
ATC \ ATC \
ATCDCL \ $(ATCDCL_DIR) \
Autopilot \ Autopilot \
Cockpit \ Cockpit \
Environment \ Environment \