#include <AIModel/AIAircraft.hxx>
#include <AIModel/AIFlightPlan.hxx>
+#include <ATC/atc_mgr.hxx>
+
#include <Scenery/scenery.hxx>
#include "groundnetwork.hxx"
}
}
+
void FGGroundNetwork::signOff(int id)
{
TrafficVectorIterator i = activeTraffic.begin();
int state = i->getState();
if ((state >= minState) && (state <= maxState) && available) {
if ((msgDir == ATC_AIR_TO_GROUND) && isUserAircraft(i->getAircraft())) {
-
//cerr << "Checking state " << state << " for " << i->getAircraft()->getCallSign() << endl;
static SGPropertyNode_ptr trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true);
int n = trans_num->getIntValue();
trans_num->setIntValue(-1);
// PopupCallback(n);
cerr << "Selected transmission message " << n << endl;
+ FGATCManager *atc = (FGATCManager*) globals->get_subsystem("atc");
+ atc->getATCDialog()->removeEntry(1);
} else {
//cerr << "creating message for " << i->getAircraft()->getCallSign() << endl;
transmit(&(*i), msgId, msgDir, false);
return false;
}
}
- //cerr << "Transmitting startup msg" << endl;
transmit(&(*i), msgId, msgDir, true);
i->updateState();
lastTransmission = now;
}
}
//Check traffic at the tower controller
+ // Note, as of 2011-08-01, this should no longer be necessecary.
+ /*
if (towerController->hasActiveTraffic()) {
for (TrafficVectorIterator i =
towerController->getActiveTraffic().begin();
}
}
// Finally, check UserPosition
+ // Note, as of 2011-08-01, this should no longer be necessecary.
double userLatitude = fgGetDouble("/position/latitude-deg");
double userLongitude = fgGetDouble("/position/longitude-deg");
SGGeod user(SGGeod::fromDeg(userLongitude, userLatitude));
minbearing = bearing;
otherReasonToSlowDown = true;
}
-
+ */
current->clearSpeedAdjustment();
if (current->checkPositionAndIntentions(*closest)
if (closest->getId() != current->getId())
current->setSpeedAdjustment(closest->getSpeed() *
(mindist / 100));
+ if (closest->getAircraft()->isScheduledForTakeoff())
+ current->getAircraft()->scheduleForATCTowerDepartureControl();
else
current->setSpeedAdjustment(0); // This can only happen when the user aircraft is the one closest
if (mindist < maxAllowableDistance) {
current->setState(0);
current->setHoldPosition(false);
}
-
- /*if ((state == 1) && (available)) {
- //cerr << "ACKNOWLEDGE HOLD" << endl;
- transmit(&(*current), MSG_ACKNOWLEDGE_HOLD_POSITION, ATC_AIR_TO_GROUND, true);
- current->setState(0);
- current->setHoldPosition(true);
- lastTransmission = now;
- available = false;
-
- }
- if ((state == 2) && (available)) {
- //cerr << "ACKNOWLEDGE RESUME" << endl;
- transmit(&(*current), MSG_ACKNOWLEDGE_RESUME_TAXI, ATC_AIR_TO_GROUND, true);
- current->setState(0);
- current->setHoldPosition(false);
- lastTransmission = now;
- available = false;
- }*/
}
/**
}
globals->get_scenery()->get_scene_graph()->addChild(group);
}
-}
\ No newline at end of file
+}
+
+string FGGroundNetwork::getName() {
+ return string(parent->getId() + "-ground");
+}