]> git.mxchange.org Git - flightgear.git/commitdiff
cleanup
authoradrian <adrian@localhost.com>
Thu, 24 Nov 2011 04:39:54 +0000 (06:39 +0200)
committeradrian <adrian@localhost.com>
Thu, 24 Nov 2011 04:39:54 +0000 (06:39 +0200)
src/ATC/trafficcontrol.cxx
src/Radio/itm.cpp
src/Radio/radio.cxx
src/Radio/radio.hxx

index 3e27f919047cf58d21dcbcb86856c2ec663c2399..507c8f11388d40ae1a07331929eaace06a1745a6 100644 (file)
@@ -47,6 +47,7 @@
 #include <Airports/groundnetwork.hxx>
 #include <Airports/dynamics.hxx>
 #include <Airports/simple.hxx>
+#include <Radio/radio.hxx>
 
 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());
index 20862355b3f34826b9d5be56a20f655fe8fa642e..9c2f010fc2606fe7882eb19e84bec863f3998ebd 100644 (file)
@@ -37,7 +37,7 @@
 #include <math.h>
 #include <complex>
 #include <assert.h>
-
+#include <stdio.h>
 
 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
index 5ce656f6ce1abce775afa344ab603ef448f3fc6b..83068a285f8292ce8878f5a98fa105790a82156c 100644 (file)
@@ -25,7 +25,7 @@
 #include <math.h>
 #include <stdlib.h>
 #include <deque>
-
+#include "radio.hxx"
 #include <Scenery/scenery.hxx>
 
 #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)) {
index 7915d2e778069f36269df4a64ead167c3fe535f5..91d028047f3c1602a9f32e4a0fc29c9e083afef5 100644 (file)
@@ -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: