1
0
Fork 0

Merge commit 'refs/merge-requests/18' of git://gitorious.org/fg/flightgear into merge-requests/18

This commit is contained in:
Durk Talsma 2011-12-06 18:07:48 +01:00
commit 3f0e8cec81
2 changed files with 10 additions and 8 deletions

View file

@ -1378,7 +1378,7 @@ double dlthx(double pfl[], const double &x1, const double &x2)
n = 10 * ka - 5;
kb = n - ka + 1;
sn = n - 1;
assert((s = new double[n+2]) != 0);
s = new double[n+2];
s[0] = sn;
s[1] = 1.0;
xb = (xb - xa) / sn;

View file

@ -236,7 +236,7 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
double own_alt= own_alt_ft * SG_FEET_TO_METER;
//cerr << "ITM:: pilot Lat: " << own_lat << ", Lon: " << own_lon << ", Alt: " << own_alt << endl;
SGGeod own_pos = SGGeod::fromDegM( own_lon, own_lat, own_alt );
SGGeod max_own_pos = SGGeod::fromDegM( own_lon, own_lat, SG_MAX_ELEVATION_M );
@ -253,7 +253,7 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
sender_alt = sender_alt_ft * SG_FEET_TO_METER;
SGGeod max_sender_pos = SGGeod::fromGeodM( pos, SG_MAX_ELEVATION_M );
SGGeoc sender_pos_c = SGGeoc::fromGeod( sender_pos );
//cerr << "ITM:: sender Lat: " << parent->getLatitude() << ", Lon: " << parent->getLongitude() << ", Alt: " << sender_alt << endl;
double point_distance= _terrain_sampling_distance;
double course = SGGeodesy::courseRad(own_pos_c, sender_pos_c);
@ -364,11 +364,12 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
_elevations.push_front(num_points -1);
int size = _elevations.size();
double itm_elev[10000];
double *itm_elev;
itm_elev = new double[size];
for(int i=0;i<size;i++) {
itm_elev[i]=_elevations[i];
//cerr << "ITM:: itm_elev: " << _elevations[i] << endl;
}
if((transmission_type == 3) || (transmission_type == 4)) {
@ -409,6 +410,7 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
_root_node->setDoubleValue("station[0]/field-strength-uV", field_strength_uV);
_root_node->setDoubleValue("station[0]/signal", signal);
_root_node->setDoubleValue("station[0]/tx-erp", tx_erp);
delete[] itm_elev;
return signal;
}