diff --git a/src/ATC/trafficcontrol.cxx b/src/ATC/trafficcontrol.cxx index aefc39b42..3e27f9190 100644 --- a/src/ATC/trafficcontrol.cxx +++ b/src/ATC/trafficcontrol.cxx @@ -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 { diff --git a/src/ATC/trafficcontrol.hxx b/src/ATC/trafficcontrol.hxx index 90c83edb4..7c17665f9 100644 --- a/src/ATC/trafficcontrol.hxx +++ b/src/ATC/trafficcontrol.hxx @@ -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; diff --git a/src/Radio/radio.cxx b/src/Radio/radio.cxx index fdd8dd416..5ce656f6c 100644 --- a/src/Radio/radio.cxx +++ b/src/Radio/radio.cxx @@ -54,7 +54,7 @@ FGRadio::~FGRadio() } -double FGCommRadio::getFrequency(int radio) { +double FGRadio::getFrequency(int radio) { double freq = 118.0; switch (radio) { case 1: