return ref->atGate();
}
- bool FGATCController::isUserAircraft(FGAIAircraft* ac)
- {
- return (ac->getCallSign() == fgGetString("/sim/multiplay/callsign")) ? true : false;
+ bool FGATCController::isUserAircraft(FGAIAircraft* ac)
+ {
+ return (ac->getCallSign() == fgGetString("/sim/multiplay/callsign")) ? true : false;
};
-void FGATCController::transmit(FGTrafficRecord * rec, AtcMsgId msgId,
+void FGATCController::transmit(FGTrafficRecord * rec, FGAirportDynamics *parent, AtcMsgId msgId,
AtcMsgDir msgDir, bool audible)
{
string sender, receiver;
// Display ATC message only when one of the radios is tuned
// the relevant frequency.
// Note that distance attenuation is currently not yet implemented
+
if ((onBoardRadioFreqI0 == stationFreq)
- || (onBoardRadioFreqI1 == stationFreq)) {
-
+ || (onBoardRadioFreqI1 == stationFreq)) {
if (rec->allowTransmissions()) {
+
fgSetString("/sim/messages/atc", text.c_str());
}
}
int n = trans_num->getIntValue();
if (n == 0) {
trans_num->setIntValue(-1);
- // PopupCallback(n);
- //cerr << "Selected transmission message " << n << endl;
- FGATCManager *atc = (FGATCManager*) globals->get_subsystem("atc");
- atc->getATCDialog()->removeEntry(1);
+ // PopupCallback(n);
+ //cerr << "Selected transmission message " << n << endl;
+ FGATCDialogNew::instance()->removeEntry(1);
} else {
//cerr << "creading message for " << i->getAircraft()->getCallSign() << endl;
- transmit(&(*i), msgId, msgDir, false);
+ transmit(&(*i), &(*parent), msgId, msgDir, false);
return false;
}
}
int n = trans_num->getIntValue();
if (n == 0) {
trans_num->setIntValue(-1);
- // PopupCallback(n);
- //cerr << "Selected transmission message " << n << endl;
- FGATCManager *atc = (FGATCManager*) globals->get_subsystem("atc");
- atc->getATCDialog()->removeEntry(1);
+ // PopupCallback(n);
+ //cerr << "Selected transmission message " << n << endl;
+ FGATCManager *atc = (FGATCManager*) globals->get_subsystem("atc");
+ FGATCDialogNew::instance()->removeEntry(1);
} else {
//cerr << "creating message for " << i->getAircraft()->getCallSign() << endl;
- transmit(&(*i), msgId, msgDir, false);
+ transmit(&(*i), &(*parent->getDynamics()), msgId, msgDir, false);
return false;
}
}