Lower receiver sensitivity, modify loading of antenna pattern
This commit is contained in:
parent
8a61ad0fc9
commit
4826b21968
3 changed files with 18 additions and 14 deletions
|
@ -39,6 +39,10 @@ FGRadioAntenna::FGRadioAntenna(string type) {
|
|||
}
|
||||
|
||||
FGRadioAntenna::~FGRadioAntenna() {
|
||||
for (unsigned i =0; i < _pattern.size(); i++) {
|
||||
AntennaGain *point_gain = _pattern[i];
|
||||
delete point_gain;
|
||||
}
|
||||
_pattern.clear();
|
||||
|
||||
}
|
||||
|
@ -55,11 +59,11 @@ double FGRadioAntenna::calculate_gain(double bearing, double angle) {
|
|||
int elevation = (int)floor(angle);
|
||||
elevation += elevation % 2;
|
||||
cerr << "Bearing: " << bearing << " angle: " << angle << " azimuth: " << azimuth << " elevation: " << elevation << endl;
|
||||
for (unsigned int i =0; i < _pattern.size(); i++) {
|
||||
AntennaGain point_gain = _pattern[i];
|
||||
for (unsigned i =0; i < _pattern.size(); i++) {
|
||||
AntennaGain *point_gain = _pattern[i];
|
||||
|
||||
if ( (azimuth == point_gain.azimuth) && (elevation == point_gain.elevation)) {
|
||||
return point_gain.gain;
|
||||
if ( (azimuth == point_gain->azimuth) && (elevation == point_gain->elevation)) {
|
||||
return point_gain->gain;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,10 +94,10 @@ void FGRadioAntenna::load_antenna_pattern(string type) {
|
|||
continue;
|
||||
}
|
||||
//cerr << "head: " << heading << " elev: " << elevation << " gain: " << gain << endl;
|
||||
AntennaGain datapoint;
|
||||
datapoint.azimuth = heading;
|
||||
datapoint.elevation = 90.0 - fabs(elevation);
|
||||
datapoint.gain = gain;
|
||||
AntennaGain *datapoint = new AntennaGain;
|
||||
datapoint->azimuth = heading;
|
||||
datapoint->elevation = 90.0 - fabs(elevation);
|
||||
datapoint->gain = gain;
|
||||
_pattern.push_back(datapoint);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ private:
|
|||
double gain;
|
||||
};
|
||||
SGPath _pattern_file;
|
||||
typedef std::vector<AntennaGain> AntennaPattern;
|
||||
typedef std::vector<AntennaGain*> AntennaPattern;
|
||||
AntennaPattern _pattern;
|
||||
|
||||
public:
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
FGRadioTransmission::FGRadioTransmission() {
|
||||
|
||||
|
||||
_receiver_sensitivity = -110.0; // typical AM receiver sensitivity seems to be 0.8 microVolt at 12dB SINAD
|
||||
_receiver_sensitivity = -105.0; // typical AM receiver sensitivity seems to be 0.8 microVolt at 12dB SINAD
|
||||
|
||||
/** AM transmitter power in dBm.
|
||||
* Typical output powers for ATC ground equipment, VHF-UHF:
|
||||
|
@ -362,15 +362,15 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
|
|||
double num_points= (double)elevations.size();
|
||||
|
||||
|
||||
_elevations.push_front(point_distance);
|
||||
_elevations.push_front(num_points -1);
|
||||
elevations.push_front(point_distance);
|
||||
elevations.push_front(num_points -1);
|
||||
|
||||
int size = _elevations.size();
|
||||
int size = elevations.size();
|
||||
double *itm_elev;
|
||||
itm_elev = new double[size];
|
||||
|
||||
for(int i=0;i<size;i++) {
|
||||
itm_elev[i]=_elevations[i];
|
||||
itm_elev[i]=elevations[i];
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue