From ad6b0b81da93a70cc692479f512a9e51c1d153ab Mon Sep 17 00:00:00 2001 From: adrian Date: Thu, 1 Dec 2011 14:33:25 +0200 Subject: [PATCH] Make polarization a configurable parameter --- src/Radio/radio.cxx | 4 +++- src/Radio/radio.hxx | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Radio/radio.cxx b/src/Radio/radio.cxx index 4f2772e4e..d2d6a159b 100644 --- a/src/Radio/radio.cxx +++ b/src/Radio/radio.cxx @@ -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; diff --git a/src/Radio/radio.hxx b/src/Radio/radio.hxx index 1261b7c51..ac6dc9e3d 100644 --- a/src/Radio/radio.hxx +++ b/src/Radio/radio.hxx @@ -49,6 +49,7 @@ private: double _rx_line_losses; double _tx_line_losses; double _terrain_sampling_distance; + int _polarization; std::map _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);