Updated adf property names.
This commit is contained in:
parent
f6e8060879
commit
24d14dd421
5 changed files with 63 additions and 84 deletions
|
@ -56,10 +56,10 @@ static double kludgeRange ( double stationElev, double aircraftElev,
|
||||||
double range = fabs(nominalRange * factor);
|
double range = fabs(nominalRange * factor);
|
||||||
|
|
||||||
// Clamp the range to keep it sane; for
|
// Clamp the range to keep it sane; for
|
||||||
// now, never less than 25% or more than
|
// now, never less than 50% or more than
|
||||||
// 500% of nominal range.
|
// 500% of nominal range.
|
||||||
if (range < nominalRange/4.0) {
|
if (range < nominalRange/2.0) {
|
||||||
range = nominalRange/4.0;
|
range = nominalRange/2.0;
|
||||||
} else if (range > nominalRange*5.0) {
|
} else if (range > nominalRange*5.0) {
|
||||||
range = nominalRange*5.0;
|
range = nominalRange*5.0;
|
||||||
}
|
}
|
||||||
|
@ -131,52 +131,52 @@ void
|
||||||
FGKR_87::bind ()
|
FGKR_87::bind ()
|
||||||
{
|
{
|
||||||
// User inputs
|
// User inputs
|
||||||
fgTie("/radios/adf/frequencies/selected-khz", this,
|
fgTie("/radios/kr-87/frequencies/selected-khz", this,
|
||||||
&FGKR_87::get_freq, &FGKR_87::set_freq);
|
&FGKR_87::get_freq, &FGKR_87::set_freq);
|
||||||
fgSetArchivable("/radios/adf/frequencies/selected-khz");
|
fgSetArchivable("/radios/kr-87/frequencies/selected-khz");
|
||||||
fgTie("/radios/adf/frequencies/standby-khz", this,
|
fgTie("/radios/kr-87/frequencies/standby-khz", this,
|
||||||
&FGKR_87::get_stby_freq, &FGKR_87::set_stby_freq);
|
&FGKR_87::get_stby_freq, &FGKR_87::set_stby_freq);
|
||||||
fgSetArchivable("/radios/adf/frequencies/standby-khz");
|
fgSetArchivable("/radios/kr-87/frequencies/standby-khz");
|
||||||
fgTie("/radios/adf/rotation-deg", this,
|
fgTie("/radios/kr-87/rotation-deg", this,
|
||||||
&FGKR_87::get_rotation, &FGKR_87::set_rotation);
|
&FGKR_87::get_rotation, &FGKR_87::set_rotation);
|
||||||
fgSetArchivable("/radios/adf/rotation-deg");
|
fgSetArchivable("/radios/kr-87/rotation-deg");
|
||||||
fgTie("/radios/adf/needle-deg", this,
|
fgTie("/radios/kr-87/needle-deg", this,
|
||||||
&FGKR_87::get_needle_deg);
|
&FGKR_87::get_needle_deg);
|
||||||
fgTie("/radios/adf/on-off-volume", this,
|
fgTie("/radios/kr-87/on-off-volume", this,
|
||||||
&FGKR_87::get_on_off_vol_btn,
|
&FGKR_87::get_on_off_vol_btn,
|
||||||
&FGKR_87::set_on_off_vol_btn);
|
&FGKR_87::set_on_off_vol_btn);
|
||||||
fgSetArchivable("/radios/adf/on-off-volume");
|
fgSetArchivable("/radios/kr-87/on-off-volume");
|
||||||
fgTie("/radios/adf/adf-btn", this,
|
fgTie("/radios/kr-87/adf-btn", this,
|
||||||
&FGKR_87::get_adf_btn,
|
&FGKR_87::get_adf_btn,
|
||||||
&FGKR_87::set_adf_btn);
|
&FGKR_87::set_adf_btn);
|
||||||
fgTie("/radios/adf/bfo-btn", this,
|
fgTie("/radios/kr-87/bfo-btn", this,
|
||||||
&FGKR_87::get_bfo_btn,
|
&FGKR_87::get_bfo_btn,
|
||||||
&FGKR_87::set_bfo_btn);
|
&FGKR_87::set_bfo_btn);
|
||||||
fgTie("/radios/adf/frq-btn", this,
|
fgTie("/radios/kr-87/frq-btn", this,
|
||||||
&FGKR_87::get_frq_btn,
|
&FGKR_87::get_frq_btn,
|
||||||
&FGKR_87::set_frq_btn);
|
&FGKR_87::set_frq_btn);
|
||||||
fgTie("/radios/adf/flt-et-btn", this,
|
fgTie("/radios/kr-87/flt-et-btn", this,
|
||||||
&FGKR_87::get_flt_et_btn,
|
&FGKR_87::get_flt_et_btn,
|
||||||
&FGKR_87::set_flt_et_btn);
|
&FGKR_87::set_flt_et_btn);
|
||||||
fgTie("/radios/adf/set-rst-btn", this,
|
fgTie("/radios/kr-87/set-rst-btn", this,
|
||||||
&FGKR_87::get_set_rst_btn,
|
&FGKR_87::get_set_rst_btn,
|
||||||
&FGKR_87::set_set_rst_btn);
|
&FGKR_87::set_set_rst_btn);
|
||||||
fgTie("/radios/adf/stby-mode", this,
|
fgTie("/radios/kr-87/stby-mode", this,
|
||||||
&FGKR_87::get_stby_mode);
|
&FGKR_87::get_stby_mode);
|
||||||
fgTie("/radios/adf/timer-mode", this,
|
fgTie("/radios/kr-87/timer-mode", this,
|
||||||
&FGKR_87::get_timer_mode);
|
&FGKR_87::get_timer_mode);
|
||||||
fgTie("/radios/adf/count-mode", this,
|
fgTie("/radios/kr-87/count-mode", this,
|
||||||
&FGKR_87::get_count_mode);
|
&FGKR_87::get_count_mode);
|
||||||
fgTie("/radios/adf/ident", this,
|
fgTie("/radios/kr-87/ident", this,
|
||||||
&FGKR_87::get_ident_btn,
|
&FGKR_87::get_ident_btn,
|
||||||
&FGKR_87::set_ident_btn);
|
&FGKR_87::set_ident_btn);
|
||||||
fgSetArchivable("/radios/adf/ident");
|
fgSetArchivable("/radios/kr-87/ident");
|
||||||
|
|
||||||
// calculated values
|
// calculated values
|
||||||
fgTie("/radios/adf/inrange", this, &FGKR_87::get_inrange);
|
fgTie("/radios/kr-87/inrange", this, &FGKR_87::get_inrange);
|
||||||
fgTie("/radios/adf/heading", this, &FGKR_87::get_heading);
|
fgTie("/radios/kr-87/heading", this, &FGKR_87::get_heading);
|
||||||
fgTie("/radios/adf/flight-timer", this, &FGKR_87::get_flight_timer);
|
fgTie("/radios/kr-87/flight-timer", this, &FGKR_87::get_flight_timer);
|
||||||
fgTie("/radios/adf/elapsed-timer", this,
|
fgTie("/radios/kr-87/elapsed-timer", this,
|
||||||
&FGKR_87::get_elapsed_timer,
|
&FGKR_87::get_elapsed_timer,
|
||||||
&FGKR_87::set_elapsed_timer);
|
&FGKR_87::set_elapsed_timer);
|
||||||
}
|
}
|
||||||
|
@ -184,23 +184,23 @@ FGKR_87::bind ()
|
||||||
void
|
void
|
||||||
FGKR_87::unbind ()
|
FGKR_87::unbind ()
|
||||||
{
|
{
|
||||||
fgUntie("/radios/adf/frequencies/selected-khz");
|
fgUntie("/radios/kr-87/frequencies/selected-khz");
|
||||||
fgUntie("/radios/adf/frequencies/standby-khz");
|
fgUntie("/radios/kr-87/frequencies/standby-khz");
|
||||||
fgUntie("/radios/adf/rotation-deg");
|
fgUntie("/radios/kr-87/rotation-deg");
|
||||||
fgUntie("/radios/adf/needle-deg");
|
fgUntie("/radios/kr-87/needle-deg");
|
||||||
fgUntie("/radios/adf/on-off-volume");
|
fgUntie("/radios/kr-87/on-off-volume");
|
||||||
fgUntie("/radios/adf/adf-btn");
|
fgUntie("/radios/kr-87/adf-btn");
|
||||||
fgUntie("/radios/adf/bfo-btn");
|
fgUntie("/radios/kr-87/bfo-btn");
|
||||||
fgUntie("/radios/adf/frq-btn");
|
fgUntie("/radios/kr-87/frq-btn");
|
||||||
fgUntie("/radios/adf/flt-et-btn");
|
fgUntie("/radios/kr-87/flt-et-btn");
|
||||||
fgUntie("/radios/adf/set-rst-btn");
|
fgUntie("/radios/kr-87/set-rst-btn");
|
||||||
fgUntie("/radios/adf/timer-mode");
|
fgUntie("/radios/kr-87/timer-mode");
|
||||||
fgUntie("/radios/adf/count-mode");
|
fgUntie("/radios/kr-87/count-mode");
|
||||||
fgUntie("/radios/adf/ident");
|
fgUntie("/radios/kr-87/ident");
|
||||||
fgUntie("/radios/adf/inrange");
|
fgUntie("/radios/kr-87/inrange");
|
||||||
fgUntie("/radios/adf/heading");
|
fgUntie("/radios/kr-87/heading");
|
||||||
fgUntie("/radios/adf/flight-timer");
|
fgUntie("/radios/kr-87/flight-timer");
|
||||||
fgUntie("/radios/adf/elapsed-timer");
|
fgUntie("/radios/kr-87/elapsed-timer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -467,24 +467,4 @@ double FGSteam::get_HackOBS2_deg () {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
double FGSteam::get_HackADF_deg () {
|
|
||||||
static SGPropertyNode *adf_inrange = fgGetNode("/radios/adf/inrange", true);
|
|
||||||
static SGPropertyNode *adf_heading = fgGetNode("/radios/adf/heading", true);
|
|
||||||
static double last_r = 0;
|
|
||||||
|
|
||||||
if ( adf_inrange->getBoolValue() ) {
|
|
||||||
double r = adf_heading->getDoubleValue()
|
|
||||||
- fgGetDouble("/orientation/heading-deg");
|
|
||||||
last_r = r;
|
|
||||||
// cout << "Radial = " << adf_heading->getDoubleValue() << endl;
|
|
||||||
// cout << "/orientation/heading-deg = "
|
|
||||||
// << fgGetDouble("/orientation/heading-deg") << endl;
|
|
||||||
return r;
|
|
||||||
} else {
|
|
||||||
return last_r;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// end of steam.cxx
|
// end of steam.cxx
|
||||||
|
|
|
@ -81,7 +81,6 @@ public:
|
||||||
// static double get_HackGS_deg ();
|
// static double get_HackGS_deg ();
|
||||||
// static double get_HackVOR2_deg ();
|
// static double get_HackVOR2_deg ();
|
||||||
static double get_HackOBS2_deg ();
|
static double get_HackOBS2_deg ();
|
||||||
// static double get_HackADF_deg ();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -396,16 +396,16 @@ bool FGATC610x::open() {
|
||||||
nav2_stby_freq
|
nav2_stby_freq
|
||||||
= fgGetNode( "/radios/nav[1]/frequencies/standby-mhz", true );
|
= fgGetNode( "/radios/nav[1]/frequencies/standby-mhz", true );
|
||||||
|
|
||||||
adf_on_off_vol = fgGetNode( "/radios/adf/on-off-volume", true );
|
adf_on_off_vol = fgGetNode( "/radios/kr-87/on-off-volume", true );
|
||||||
adf_adf_btn = fgGetNode( "/radios/adf/adf-btn", true );
|
adf_adf_btn = fgGetNode( "/radios/kr-87/adf-btn", true );
|
||||||
adf_bfo_btn = fgGetNode( "/radios/adf/bfo-btn", true );
|
adf_bfo_btn = fgGetNode( "/radios/kr-87/bfo-btn", true );
|
||||||
adf_freq = fgGetNode( "/radios/adf/frequencies/selected-khz", true );
|
adf_freq = fgGetNode( "/radios/kr-87/frequencies/selected-khz", true );
|
||||||
adf_stby_freq = fgGetNode( "/radios/adf/frequencies/standby-khz", true );
|
adf_stby_freq = fgGetNode( "/radios/kr-87/frequencies/standby-khz", true );
|
||||||
adf_stby_mode = fgGetNode( "/radios/adf/stby-mode", true );
|
adf_stby_mode = fgGetNode( "/radios/kr-87/stby-mode", true );
|
||||||
adf_timer_mode = fgGetNode( "/radios/adf/timer-mode", true );
|
adf_timer_mode = fgGetNode( "/radios/kr-87/timer-mode", true );
|
||||||
adf_count_mode = fgGetNode( "/radios/adf/count-mode", true );
|
adf_count_mode = fgGetNode( "/radios/kr-87/count-mode", true );
|
||||||
adf_flight_timer = fgGetNode( "/radios/adf/flight-timer", true );
|
adf_flight_timer = fgGetNode( "/radios/kr-87/flight-timer", true );
|
||||||
adf_elapsed_timer = fgGetNode( "/radios/adf/elapsed-timer", true );
|
adf_elapsed_timer = fgGetNode( "/radios/kr-87/elapsed-timer", true );
|
||||||
|
|
||||||
inner = fgGetNode( "/radios/marker-beacon/inner", true );
|
inner = fgGetNode( "/radios/marker-beacon/inner", true );
|
||||||
middle = fgGetNode( "/radios/marker-beacon/middle", true );
|
middle = fgGetNode( "/radios/marker-beacon/middle", true );
|
||||||
|
@ -472,7 +472,7 @@ bool FGATC610x::do_analog_in() {
|
||||||
|
|
||||||
// adf volume
|
// adf volume
|
||||||
tmp = (float)analog_in_data[26] / 1024.0f;
|
tmp = (float)analog_in_data[26] / 1024.0f;
|
||||||
fgSetFloat( "/radios/adf/on-off-volume", tmp );
|
fgSetFloat( "/radios/kr-87/on-off-volume", tmp );
|
||||||
|
|
||||||
// nav2 obs tuner
|
// nav2 obs tuner
|
||||||
tmp = (float)analog_in_data[29] * 360.0f / 1024.0f;
|
tmp = (float)analog_in_data[29] * 360.0f / 1024.0f;
|
||||||
|
@ -865,21 +865,21 @@ bool FGATC610x::do_radio_switches() {
|
||||||
last_adf_tuner_coarse = adf_tuner_coarse;
|
last_adf_tuner_coarse = adf_tuner_coarse;
|
||||||
|
|
||||||
if ( adf_count_mode->getIntValue() == 2 ) {
|
if ( adf_count_mode->getIntValue() == 2 ) {
|
||||||
fgSetFloat( "/radios/adf/elapsed-timer", value );
|
fgSetFloat( "/radios/kr-87/elapsed-timer", value );
|
||||||
} else {
|
} else {
|
||||||
if ( adf_stby_mode->getIntValue() == 1 ) {
|
if ( adf_stby_mode->getIntValue() == 1 ) {
|
||||||
fgSetFloat( "/radios/adf/frequencies/selected-khz", value );
|
fgSetFloat( "/radios/kr-87/frequencies/selected-khz", value );
|
||||||
} else {
|
} else {
|
||||||
fgSetFloat( "/radios/adf/frequencies/standby-khz", value );
|
fgSetFloat( "/radios/kr-87/frequencies/standby-khz", value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ADF Modes
|
// ADF Modes
|
||||||
fgSetInt( "/radios/adf/adf-btn", !(radio_switch_data[23] & 0x01) );
|
fgSetInt( "/radios/kr-87/adf-btn", !(radio_switch_data[23] & 0x01) );
|
||||||
fgSetInt( "/radios/adf/bfo-btn", !(radio_switch_data[23] >> 1 & 0x01) );
|
fgSetInt( "/radios/kr-87/bfo-btn", !(radio_switch_data[23] >> 1 & 0x01) );
|
||||||
fgSetInt( "/radios/adf/frq-btn", !(radio_switch_data[23] >> 2 & 0x01) );
|
fgSetInt( "/radios/kr-87/frq-btn", !(radio_switch_data[23] >> 2 & 0x01) );
|
||||||
fgSetInt( "/radios/adf/flt-et-btn", !(radio_switch_data[23] >> 3 & 0x01) );
|
fgSetInt( "/radios/kr-87/flt-et-btn", !(radio_switch_data[23] >> 3 & 0x01) );
|
||||||
fgSetInt( "/radios/adf/set-rst-btn", !(radio_switch_data[23] >> 4 & 0x01) );
|
fgSetInt( "/radios/kr-87/set-rst-btn", !(radio_switch_data[23] >> 4 & 0x01) );
|
||||||
/* cout << "adf = " << !(radio_switch_data[23] & 0x01)
|
/* cout << "adf = " << !(radio_switch_data[23] & 0x01)
|
||||||
<< " bfo = " << !(radio_switch_data[23] >> 1 & 0x01)
|
<< " bfo = " << !(radio_switch_data[23] >> 1 & 0x01)
|
||||||
<< " stby = " << !(radio_switch_data[23] >> 2 & 0x01)
|
<< " stby = " << !(radio_switch_data[23] >> 2 & 0x01)
|
||||||
|
|
|
@ -64,7 +64,7 @@ bool FGAtlas::gen_message() {
|
||||||
// cout << "generating atlas message" << endl;
|
// cout << "generating atlas message" << endl;
|
||||||
|
|
||||||
static SGPropertyNode *adf_freq
|
static SGPropertyNode *adf_freq
|
||||||
= fgGetNode("/radios/adf/frequencies/selected-khz", true);
|
= fgGetNode("/radios/kr-87/frequencies/selected-khz", true);
|
||||||
|
|
||||||
char rmc[256], gga[256], patla[256];
|
char rmc[256], gga[256], patla[256];
|
||||||
char rmc_sum[10], gga_sum[10], patla_sum[10];
|
char rmc_sum[10], gga_sum[10], patla_sum[10];
|
||||||
|
|
Loading…
Add table
Reference in a new issue