]> git.mxchange.org Git - flightgear.git/commitdiff
Make polarization a configurable parameter
authoradrian <adrian@localhost.com>
Thu, 1 Dec 2011 12:33:25 +0000 (14:33 +0200)
committeradrian <adrian@localhost.com>
Thu, 1 Dec 2011 12:33:25 +0000 (14:33 +0200)
src/Radio/radio.cxx
src/Radio/radio.hxx

index 4f2772e4ed04eb430f80a9aac3ff8f6e1f2714e1..d2d6a159ba0935829012ce4effd3fd4ebfde4b90 100644 (file)
@@ -60,6 +60,8 @@ FGRadioTransmission::FGRadioTransmission() {
        _rx_line_losses = 2.0;  // to be configured for each station
        _tx_line_losses = 2.0;
        
+       _polarization = 1; // default vertical
+       
        _propagation_model = 2; 
        _terrain_sampling_distance = fgGetDouble("/sim/radio/sampling-distance", 90.0); // regular SRTM is 90 meters
 }
@@ -211,7 +213,7 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
        else
                frq_mhz = freq;
        int radio_climate = 5;          // continental temperate
-       int pol=1;      // assuming vertical polarization although this is more complex in reality
+       int pol= _polarization; 
        double conf = 0.90;     // 90% of situations and time, take into account speed
        double rel = 0.90;      
        double dbloss;
index 1261b7c5109aa9e0c585c2feef5fbb466cfa464a..ac6dc9e3d357449f4bffd82fa40f53bf3c08673a 100644 (file)
@@ -49,6 +49,7 @@ private:
        double _rx_line_losses;
        double _tx_line_losses;
        double _terrain_sampling_distance;
+       int _polarization;
        std::map<string, double[2]> _mat_database;
        
        int _propagation_model; /// 0 none, 1 round Earth, 2 ITM
@@ -76,6 +77,7 @@ public:
     void setTxLineLosses(double tx_line_losses) { _tx_line_losses = tx_line_losses; };
     void setRxLineLosses(double rx_line_losses) { _rx_line_losses = rx_line_losses; };
     void setPropagationModel(int model) { _propagation_model = model; };
+    void setPolarization(int polarization) { _polarization = polarization; };
     // transmission_type: 0 for air to ground 1 for ground to air, 2 for air to air, 3 for pilot to ground, 4 for pilot to air
     void receiveATC(SGGeod tx_pos, double freq, string text, int transmission_type);
     void receiveChat(SGGeod tx_pos, double freq, string text, int transmission_type);