1
0
Fork 0

Write a few more properties:

signal-dbm - signal strength in dBm
field-strength-uV - signal strength in microvolts
This commit is contained in:
adrian 2011-12-03 16:00:14 +02:00
parent 3340694170
commit e4f511fb31
3 changed files with 9 additions and 4 deletions

View file

@ -47,8 +47,7 @@ double FGRadioAntenna::calculate_gain(double azimuth, double elevation) {
/*** load external plot file generated by NEC4
*
***/
void FGRadioAntenna::_load_antenna_pattern() {
void FGRadioAntenna::load_antenna_pattern() {
}

View file

@ -30,7 +30,7 @@
class FGRadioAntenna
{
private:
void _load_antenna_pattern();
void load_antenna_pattern();
int _mirror_y;
int _mirror_z;
int _invert_ground;

View file

@ -133,10 +133,11 @@ void FGRadioTransmission::receiveATC(SGGeod tx_pos, double freq, string text, in
else {
if ( _propagation_model == 0) {
// skip propagation routines entirely
fgSetString("/sim/messages/atc", text.c_str());
}
else if ( _propagation_model == 1 ) {
// TODO: free space, round earth
// Use free-space, round earth
double signal = LOS_calculate_attenuation(tx_pos, freq, ground_to_air);
if (signal <= 0.0) {
return;
@ -231,6 +232,7 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
double link_budget = tx_pow - _receiver_sensitivity - _rx_line_losses - _tx_line_losses + ant_gain;
double signal_strength = tx_pow - _rx_line_losses - _tx_line_losses + ant_gain;
FGScenery * scenery = globals->get_scenery();
@ -405,6 +407,10 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
//if (errnum == 4) // if parameters are outside sane values for lrprop, the alternative method is used
// return -1;
signal = link_budget - dbloss - clutter_loss + pol_loss;
double signal_strength_dbm = signal_strength - dbloss - clutter_loss + pol_loss;
double field_strength_uV = dbm_to_microvolt(signal_strength_dbm);
_root_node->setDoubleValue("station[0]/signal-dbm", signal_strength_dbm);
_root_node->setDoubleValue("station[0]/field-strength-uV", field_strength_uV);
return signal;
}