-/// trafficrecord.cxx - Implementation of AIModels ATC code.
+// trafficrecord.cxx - Implementation of AIModels ATC code.
//
// Written by Durk Talsma, started September 2006.
//
double onBoardRadioFreq1 = fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz");
int onBoardRadioFreqI0 = (int) floor(onBoardRadioFreq0 * 100 + 0.5);
int onBoardRadioFreqI1 = (int) floor(onBoardRadioFreq1 * 100 + 0.5);
- //cerr << "Using " << currFreqI << " and " << commFreq << endl;
+ //cerr << "Using " << onBoardRadioFreq0 << ", " << onBoardRadioFreq1 << " and " << stationFreq << endl;
// Display ATC message only when one of the radios is tuned
// the relevant frequency.
FGStartupController::FGStartupController() :
FGATCController()
{
- available = true;
+ available = false;
+ lastTransmission = 0;
}
void FGStartupController::announcePosition(int id, FGAIFlightPlan *intendedRoute, int currentPosition,
int state = i->getState();
time_t startTime = i->getAircraft()->getTrafficRef()->getDepartureTime();
time_t now = time(NULL) + fgGetLong("/sim/time/warp");
+ //cerr << i->getAircraft()->getTrafficRef()->getCallSign()
+ // << " is scheduled to depart in " << startTime-now << " seconds. Available = " << available
+ // << " at parking " << getGateName(i->getAircraft()) << endl;
if ((now - lastTransmission) > 3 + (rand() % 15)) {
available = true;
if ((state == 0) && available) {
if (now > startTime) {
+ //cerr << "Transmitting startup msg" << endl;
transmit(&(*i), MSG_ANNOUNCE_ENGINE_START, ATC_AIR_TO_GROUND);
i->updateState();
lastTransmission = now;