1
0
Fork 0

call from FGATCController::transmit()

This commit is contained in:
adrian 2011-11-24 06:20:59 +02:00
parent 655b88dd17
commit 98a94d83ef
3 changed files with 23 additions and 3 deletions

View file

@ -743,7 +743,27 @@ void FGATCController::transmit(FGTrafficRecord * rec, FGAirportDynamics *parent,
|| (onBoardRadioFreqI1 == stationFreq)) {
if (rec->allowTransmissions()) {
fgSetString("/sim/messages/atc", text.c_str());
if( fgGetBool( "/instrumentation/use-itm-attenuation", false ) ) {
FGRadio* radio = new FGRadio();
SGGeod sender_pos;
double sender_alt_ft, sender_alt;
if(ground_to_air) {
sender_alt_ft = parent->getElevation();
sender_alt = sender_alt_ft * SG_FEET_TO_METER;
sender_pos= SGGeod::fromDegM( parent->getLongitude(),
parent->getLatitude(), sender_alt );
}
else {
sender_alt_ft = rec->getAltitude();
sender_alt = sender_alt_ft * SG_FEET_TO_METER;
sender_pos= SGGeod::fromDegM( rec->getLongitude(),
rec->getLatitude(), sender_alt );
}
radio->receiveText(sender_pos, stationFreq, text, ground_to_air);
}
else {
fgSetString("/sim/messages/atc", text.c_str());
}
}
}
} else {

View file

@ -453,7 +453,7 @@ public:
void setDt(double dt) {
dt_count = dt;
};
void transmit(FGTrafficRecord *rec, AtcMsgId msgId, AtcMsgDir msgDir, bool audible);
void transmit(FGTrafficRecord *rec, FGAirportDynamics *parent, AtcMsgId msgId, AtcMsgDir msgDir, bool audible);
string getGateName(FGAIAircraft *aircraft);
virtual void render(bool) = 0;
virtual string getName() = 0;

View file

@ -54,7 +54,7 @@ FGRadio::~FGRadio()
}
double FGCommRadio::getFrequency(int radio) {
double FGRadio::getFrequency(int radio) {
double freq = 118.0;
switch (radio) {
case 1: