]> git.mxchange.org Git - flightgear.git/blob - src/ATC/GroundController.hxx
Fix a typo breaking some takeoff-state logic.
[flightgear.git] / src / ATC / GroundController.hxx
1 // GroundController.hxx - forked from groundnetwork.cxx
2 //
3 // Written by Durk Talsma, started June 2005.
4 //
5 // Copyright (C) 2004 Durk Talsma.
6 //
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.
11 //
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.
16 //
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.
20 //
21 // $Id$
22
23 #ifndef ATC_GROUND_CONTROLLER_HXX
24 #define ATC_GROUND_CONTROLLER_HXX
25
26 #include <simgear/compiler.h>
27
28 #include <string>
29
30 #include <ATC/trafficcontrol.hxx>
31
32 class FGAirportDynamics;
33
34 /**************************************************************************************
35  * class FGGroundNetWork
36  *************************************************************************************/
37 class FGGroundController : public FGATCController
38 {
39 private:
40
41     bool hasNetwork;
42     bool networkInitialized;
43     int count;
44     int version;
45   
46
47     TrafficVector activeTraffic;
48     TrafficVectorIterator currTraffic;
49
50     FGTowerController *towerController;
51     FGAirport *parent;
52     FGAirportDynamics* dynamics;
53
54
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);
59
60
61     void updateStartupTraffic(TrafficVectorIterator i, int& priority, time_t now);
62     void updateActiveTraffic(TrafficVectorIterator i, int& priority, time_t now);
63 public:
64     FGGroundController();
65     ~FGGroundController();
66     
67     void setVersion (int v) { version = v;};
68     int getVersion() { return version; };
69
70     void init(FGAirportDynamics* pr);
71     bool exists() {
72         return hasNetwork;
73     };
74     void setTowerController(FGTowerController *twrCtrlr) {
75         towerController = twrCtrlr;
76     };
77
78
79
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);
87
88     bool checkTransmissionState(int minState, int MaxState, TrafficVectorIterator i, time_t now, AtcMsgId msgId,
89                                 AtcMsgDir msgDir);
90     bool checkForCircularWaits(int id);
91     virtual void render(bool);
92     virtual std::string getName();
93     virtual void update(double dt);
94
95     void addVersion(int v) {version = v; };
96 };
97
98
99 #endif