1
0
Fork 0

Slightly more robust handling of runway vacation

This commit is contained in:
daveluff 2004-03-20 02:55:25 +00:00
parent 4d25095e76
commit fc36c51e89
2 changed files with 20 additions and 2 deletions

View file

@ -682,7 +682,7 @@ void FGTower::ProcessDownwindReport(TowerPlaneRec* t) {
void FGTower::ProcessRunwayVacatedReport(TowerPlaneRec* t) {
//cout << "Processing rwy vacated...\n";
current_atcdialog->remove_entry(ident, USER_REPORT_GOING_AROUND, TOWER);
if(t->isUser) current_atcdialog->remove_entry(ident, USER_REPORT_GOING_AROUND, TOWER);
string trns = t->plane.callsign;
if(separateGround) {
trns += " Contact ground on ";
@ -701,6 +701,8 @@ void FGTower::ProcessRunwayVacatedReport(TowerPlaneRec* t) {
if(_display) {
globals->get_ATC_display()->RegisterSingleMessage(trns);
}
RemoveFromRwyList(t->plane.callsign);
AddToVacatedList(t);
// Maybe we should check that the plane really *has* vacated the runway!
}
@ -1112,7 +1114,7 @@ void FGTower::CheckRunwayList(double dt) {
//cout << "Size of rwylist was " << rwyList.size() << '\n';
//cout << "Size of vacatedList was " << vacatedList.size() << '\n';
RemoveFromRwyList(t->plane.callsign);
vacatedList.push_back(t);
AddToVacatedList(t);
//cout << "Size of rwylist is " << rwyList.size() << '\n';
//cout << "Size of vacatedList is " << vacatedList.size() << '\n';
// At the moment we wait until Runway Vacated is reported by the plane before telling to contact ground etc.
@ -1603,6 +1605,19 @@ bool FGTower::AddToCircuitList(TowerPlaneRec* t) {
return(conflict);
}
// Add to vacated list only if not already present
void FGTower::AddToVacatedList(TowerPlaneRec* t) {
tower_plane_rec_list_iterator twrItr;
bool found = false;
for(twrItr = vacatedList.begin(); twrItr != vacatedList.end(); twrItr++) {
if((*twrItr)->plane.callsign == t->plane.callsign) {
found = true;
}
}
if(found) return;
vacatedList.push_back(t);
}
// Calculate the eta of a plane to the threshold.
// For ground traffic this is the fastest they can get there.

View file

@ -318,6 +318,9 @@ private:
bool AddToTrafficList(TowerPlaneRec* t, bool holding = false);
bool AddToCircuitList(TowerPlaneRec* t);
// Add to vacated list only if not already present
void AddToVacatedList(TowerPlaneRec* t);
// Ground can be separate or handled by tower in real life.
// In the program we will always use a separate FGGround class, but we need to know