diff --git a/src/ATC/trafficcontrol.cxx b/src/ATC/trafficcontrol.cxx index 3e27f9190..507c8f113 100644 --- a/src/ATC/trafficcontrol.cxx +++ b/src/ATC/trafficcontrol.cxx @@ -47,6 +47,7 @@ #include #include #include +#include using std::sort; @@ -760,6 +761,7 @@ void FGATCController::transmit(FGTrafficRecord * rec, FGAirportDynamics *parent, rec->getLatitude(), sender_alt ); } radio->receiveText(sender_pos, stationFreq, text, ground_to_air); + delete radio; } else { fgSetString("/sim/messages/atc", text.c_str()); diff --git a/src/Radio/itm.cpp b/src/Radio/itm.cpp index 20862355b..9c2f010fc 100644 --- a/src/Radio/itm.cpp +++ b/src/Radio/itm.cpp @@ -37,7 +37,7 @@ #include #include #include - +#include const float THIRD = (1.0/3.0); const float f_0 = 47.7; // 47.7 MHz from [Alg 1.1], to convert frequency into wavenumber and vica versa diff --git a/src/Radio/radio.cxx b/src/Radio/radio.cxx index 5ce656f6c..83068a285 100644 --- a/src/Radio/radio.cxx +++ b/src/Radio/radio.cxx @@ -25,7 +25,7 @@ #include #include #include - +#include "radio.hxx" #include #define WITH_POINT_TO_POINT 1 @@ -132,7 +132,8 @@ double FGRadio::ITM_calculate_attenuation(SGGeod pos, double freq, char strmode[150]; int errnum; - double tx_pow,ant_gain; + double tx_pow = _transmitter_power; + double ant_gain = _antenna_gain; double signal = 0.0; if(transmission_type == 1) @@ -269,7 +270,7 @@ double FGRadio::ITM_calculate_attenuation(SGGeod pos, double freq, // frequency in the middle of the bandplan, more accuracy is not necessary double fz_clr= 8.657 * sqrt(distance_m / 0.125); - // TODO: If we clear the first Fresnel zone, we are into line of sight teritory + // TODO: If we clear the first Fresnel zone, we are into line of sight territory // else we need to calculate point to point link loss if((transmission_type == 3) || (transmission_type == 4)) { diff --git a/src/Radio/radio.hxx b/src/Radio/radio.hxx index 7915d2e77..91d028047 100644 --- a/src/Radio/radio.hxx +++ b/src/Radio/radio.hxx @@ -45,7 +45,7 @@ private: double _antenna_gain; int _propagation_model; /// 0 none, 1 round Earth, 2 ITM - double ITM_calculate_attenuation(SGGeod tx_pos, double freq, int ground_to_air) + double ITM_calculate_attenuation(SGGeod tx_pos, double freq, int ground_to_air); public: