]> git.mxchange.org Git - flightgear.git/blob - src/ATC/tower.cxx
Changes towards tower control - work in progress with no end-user benefit yet
[flightgear.git] / src / ATC / tower.cxx
1 // FGTower - a class to provide tower control at towered airports.
2 //
3 // Written by David Luff, started March 2002.
4 //
5 // Copyright (C) 2002  David C. Luff - david.luff@nottingham.ac.uk
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 #include <Main/globals.hxx>
22
23 #include "tower.hxx"
24 #include "ATCdisplay.hxx"
25 #include "ATCmgr.hxx"
26
27 // TowerPlaneRec
28
29 TowerPlaneRec::TowerPlaneRec() :
30 id("UNKNOWN"),
31 clearedToLand(false),
32 clearedToDepart(false),
33 longFinalReported(false),
34 longFinalAcknowledged(false),
35 finalReported(false),
36 finalAcknowledged(false)
37 {
38 }
39
40 TowerPlaneRec::TowerPlaneRec(string ID) :
41 clearedToLand(false),
42 clearedToDepart(false),
43 longFinalReported(false),
44 longFinalAcknowledged(false),
45 finalReported(false),
46 finalAcknowledged(false)
47 {
48         id = ID;
49 }
50
51 TowerPlaneRec::TowerPlaneRec(Point3D pt) :
52 id("UNKNOWN"),
53 clearedToLand(false),
54 clearedToDepart(false),
55 longFinalReported(false),
56 longFinalAcknowledged(false),
57 finalReported(false),
58 finalAcknowledged(false)
59 {
60         pos = pt;
61 }
62
63 TowerPlaneRec::TowerPlaneRec(string ID, Point3D pt) :
64 clearedToLand(false),
65 clearedToDepart(false),
66 longFinalReported(false),
67 longFinalAcknowledged(false),
68 finalReported(false),
69 finalAcknowledged(false)
70 {
71         id = ID;
72         pos = pt;
73 }
74
75
76 // FGTower
77
78 FGTower::FGTower() {
79 }
80
81 FGTower::~FGTower() {
82 }
83
84 void FGTower::Init() {
85     display = false;
86 }
87
88 void FGTower::Update() {
89     // Each time step, what do we need to do?
90     // We need to go through the list of outstanding requests and acknowedgements
91     // and process at least one of them.
92     // We need to go through the list of planes under our control and check if
93     // any need to be addressed.
94     // We need to check for planes not under our control coming within our 
95     // control area and address if necessary.
96
97     // Hardwired for testing
98     static int play = 0;
99     if(play == 200) {
100         //cout << "Registering message in tower.cxx ****************************\n";
101         //globals->get_ATC_display()->RegisterSingleMessage((string)"Cessna eight-two-zero Cleared for takeoff", 2);
102     }
103     ++play;
104 }