Updated to work with new instrumentation version of dme.
This commit is contained in:
parent
541ff04072
commit
fe3283eb12
2 changed files with 59 additions and 41 deletions
|
@ -396,9 +396,11 @@ bool FGATC610x::open() {
|
|||
|
||||
mag_compass = fgGetNode( "/instrumentation/magnetic-compass/indicated-heading-deg", true );
|
||||
|
||||
dme_min = fgGetNode( "/radios/dme/ete-min", true );
|
||||
dme_kt = fgGetNode( "/radios/dme/speed-kt", true );
|
||||
dme_nm = fgGetNode( "/radios/dme/distance-nm", true );
|
||||
dme_min = fgGetNode( "/instrumentation/dme/indicated-time-min", true );
|
||||
dme_kt = fgGetNode( "/instrumentation/dme/indicated-ground-speed-kt",
|
||||
true );
|
||||
dme_nm = fgGetNode( "/instrumentation/dme/indicated-distance-nm", true );
|
||||
dme_in_range = fgGetNode( "/instrumentation/dme/in-range", true );
|
||||
|
||||
adf_bus_power = fgGetNode( "/systems/electrical/outputs/adf", true );
|
||||
dme_bus_power = fgGetNode( "/systems/electrical/outputs/dme", true );
|
||||
|
@ -863,13 +865,21 @@ bool FGATC610x::do_radio_switches() {
|
|||
dme_switch = (radio_switch_data[7] >> 4) & 0x03;
|
||||
if ( dme_switch == 0 ) {
|
||||
// off
|
||||
fgSetInt( "/radios/dme/switch-position", 0 );
|
||||
fgSetInt( "/instrumentation/dme/switch-position", 0 );
|
||||
} else if ( dme_switch == 2 ) {
|
||||
// nav1
|
||||
fgSetInt( "/radios/dme/switch-position", 1 );
|
||||
fgSetInt( "/instrumentation/dme/switch-position", 1 );
|
||||
fgSetString( "/instrumentation/dme/frequencies/source",
|
||||
"/radios/nav[0]/frequencies/selected-mhz" );
|
||||
freq = fgGetFloat( "/radios/nav[0]/frequencies/selected-mhz", true );
|
||||
fgSetFloat( "/instrumentation/dme/frequencies/selected-mhz", freq );
|
||||
} else if ( dme_switch == 1 ) {
|
||||
// nav2
|
||||
fgSetInt( "/radios/dme/switch-position", 3 );
|
||||
fgSetInt( "/instrumentation/dme/switch-position", 3 );
|
||||
fgSetString( "/instrumentation/dme/frequencies/source",
|
||||
"/radios/nav[1]/frequencies/selected-mhz" );
|
||||
freq = fgGetFloat( "/radios/nav[1]/frequencies/selected-mhz", true );
|
||||
fgSetFloat( "/instrumentation/dme/frequencies/selected-mhz", freq );
|
||||
}
|
||||
|
||||
// NavCom1 Power
|
||||
|
@ -1325,6 +1335,7 @@ bool FGATC610x::do_radio_display() {
|
|||
int i;
|
||||
|
||||
if ( dme_has_power() && dme_servicable->getBoolValue() ) {
|
||||
if ( dme_in_range->getBoolValue() ) {
|
||||
// DME minutes
|
||||
float minutes = dme_min->getFloatValue();
|
||||
if ( minutes > 999 ) {
|
||||
|
@ -1362,6 +1373,12 @@ bool FGATC610x::do_radio_display() {
|
|||
radio_display_data[5] = 0x00 | digits[0];
|
||||
// the 0x00 in the upper nibble of the 6th byte of each
|
||||
// display turns on the decimal point
|
||||
} else {
|
||||
// out of range
|
||||
for ( i = 0; i < 6; ++i ) {
|
||||
radio_display_data[i] = 0xee;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// blank dem display
|
||||
for ( i = 0; i < 6; ++i ) {
|
||||
|
|
|
@ -78,6 +78,7 @@ class FGATC610x : public FGProtocol {
|
|||
// Property tree variables
|
||||
SGPropertyNode *mag_compass;
|
||||
SGPropertyNode *dme_min, *dme_kt, *dme_nm;
|
||||
SGPropertyNode *dme_in_range;
|
||||
SGPropertyNode *navcom1_power_btn, *navcom2_power_btn;
|
||||
SGPropertyNode *com1_freq, *com1_stby_freq;
|
||||
SGPropertyNode *com2_freq, *com2_stby_freq;
|
||||
|
|
Loading…
Reference in a new issue