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
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

View 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;
}

View 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");

View 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
/**************************************************************************************

View 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.

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,
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

View 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 \

View file

@ -73,8 +73,13 @@
#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>
@ -130,7 +136,7 @@
#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;

View 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 \