1 // GroundController.hxx - forked from groundnetwork.cxx
3 // Written by Durk Talsma, started June 2005.
5 // Copyright (C) 2004 Durk Talsma.
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef ATC_GROUND_CONTROLLER_HXX
24 #define ATC_GROUND_CONTROLLER_HXX
26 #include <simgear/compiler.h>
30 #include <ATC/trafficcontrol.hxx>
32 class FGAirportDynamics;
34 /**************************************************************************************
35 * class FGGroundNetWork
36 *************************************************************************************/
37 class FGGroundController : public FGATCController
42 bool networkInitialized;
47 TrafficVector activeTraffic;
48 TrafficVectorIterator currTraffic;
50 FGTowerController *towerController;
52 FGAirportDynamics* dynamics;
55 void checkSpeedAdjustment(int id, double lat, double lon,
56 double heading, double speed, double alt);
57 void checkHoldPosition(int id, double lat, double lon,
58 double heading, double speed, double alt);
61 void updateStartupTraffic(TrafficVectorIterator i, int& priority, time_t now);
62 void updateActiveTraffic(TrafficVectorIterator i, int& priority, time_t now);
65 ~FGGroundController();
67 void setVersion (int v) { version = v;};
68 int getVersion() { return version; };
70 void init(FGAirportDynamics* pr);
74 void setTowerController(FGTowerController *twrCtrlr) {
75 towerController = twrCtrlr;
80 virtual void announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentRoute,
81 double lat, double lon, double hdg, double spd, double alt,
82 double radius, int leg, FGAIAircraft *aircraft);
83 virtual void signOff(int id);
84 virtual void updateAircraftInformation(int id, double lat, double lon, double heading, double speed, double alt, double dt);
85 virtual bool hasInstruction(int id);
86 virtual FGATCInstruction getInstruction(int id);
88 bool checkTransmissionState(int minState, int MaxState, TrafficVectorIterator i, time_t now, AtcMsgId msgId,
90 bool checkForCircularWaits(int id);
91 virtual void render(bool);
92 virtual std::string getName();
93 virtual void update(double dt);
95 void addVersion(int v) {version = v; };