Better handling of glide slope and in range flags when slaved to external
GPS.
This commit is contained in:
parent
2923bd15bc
commit
12c5a631f6
3 changed files with 14 additions and 3 deletions
|
@ -89,6 +89,7 @@ FGNavRadio::FGNavRadio(SGPropertyNode *node) :
|
||||||
gps_cdi_deflection_node(NULL),
|
gps_cdi_deflection_node(NULL),
|
||||||
gps_to_flag_node(NULL),
|
gps_to_flag_node(NULL),
|
||||||
gps_from_flag_node(NULL),
|
gps_from_flag_node(NULL),
|
||||||
|
gps_has_gs_node(NULL),
|
||||||
last_nav_id(""),
|
last_nav_id(""),
|
||||||
last_nav_vor(false),
|
last_nav_vor(false),
|
||||||
play_count(0),
|
play_count(0),
|
||||||
|
@ -201,6 +202,7 @@ FGNavRadio::init ()
|
||||||
gps_cdi_deflection_node = fgGetNode("/instrumentation/gps/cdi-deflection", true);
|
gps_cdi_deflection_node = fgGetNode("/instrumentation/gps/cdi-deflection", true);
|
||||||
gps_to_flag_node = fgGetNode("/instrumentation/gps/to-flag", true);
|
gps_to_flag_node = fgGetNode("/instrumentation/gps/to-flag", true);
|
||||||
gps_from_flag_node = fgGetNode("/instrumentation/gps/from-flag", true);
|
gps_from_flag_node = fgGetNode("/instrumentation/gps/from-flag", true);
|
||||||
|
gps_has_gs_node = fgGetNode("/instrumentation/gps/has-gs", true);
|
||||||
|
|
||||||
std::ostringstream temp;
|
std::ostringstream temp;
|
||||||
temp << _name << "nav-ident" << _num;
|
temp << _name << "nav-ident" << _num;
|
||||||
|
@ -314,8 +316,16 @@ FGNavRadio::update(double dt)
|
||||||
bool nav_serviceable = nav_serviceable_node->getBoolValue();
|
bool nav_serviceable = nav_serviceable_node->getBoolValue();
|
||||||
bool cdi_serviceable = cdi_serviceable_node->getBoolValue();
|
bool cdi_serviceable = cdi_serviceable_node->getBoolValue();
|
||||||
bool tofrom_serviceable = tofrom_serviceable_node->getBoolValue();
|
bool tofrom_serviceable = tofrom_serviceable_node->getBoolValue();
|
||||||
bool inrange = inrange_node->getBoolValue();
|
bool inrange = false;
|
||||||
bool has_gs = has_gs_node->getBoolValue();
|
bool has_gs = false;
|
||||||
|
if ( nav_slaved_to_gps_node->getBoolValue() ) {
|
||||||
|
has_gs = gps_has_gs_node->getBoolValue();
|
||||||
|
inrange = gps_to_flag_node->getBoolValue()
|
||||||
|
|| gps_from_flag_node->getBoolValue();
|
||||||
|
} else {
|
||||||
|
has_gs = has_gs_node->getBoolValue();
|
||||||
|
inrange = inrange_node->getBoolValue();
|
||||||
|
}
|
||||||
bool is_loc = loc_node->getBoolValue();
|
bool is_loc = loc_node->getBoolValue();
|
||||||
double loc_dist = loc_dist_node->getDoubleValue();
|
double loc_dist = loc_dist_node->getDoubleValue();
|
||||||
double effective_range_m;
|
double effective_range_m;
|
||||||
|
|
|
@ -106,6 +106,7 @@ class FGNavRadio : public SGSubsystem
|
||||||
SGPropertyNode_ptr gps_cdi_deflection_node;
|
SGPropertyNode_ptr gps_cdi_deflection_node;
|
||||||
SGPropertyNode_ptr gps_to_flag_node;
|
SGPropertyNode_ptr gps_to_flag_node;
|
||||||
SGPropertyNode_ptr gps_from_flag_node;
|
SGPropertyNode_ptr gps_from_flag_node;
|
||||||
|
SGPropertyNode_ptr gps_has_gs_node;
|
||||||
|
|
||||||
// internal (private) values
|
// internal (private) values
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ bool FGAV400Sim::parse_message() {
|
||||||
}
|
}
|
||||||
fgSetDouble("/instrumentation/gps/cdi-deflection",
|
fgSetDouble("/instrumentation/gps/cdi-deflection",
|
||||||
(double)pos / 8.0);
|
(double)pos / 8.0);
|
||||||
fgSetBool("/instrumentation/nav[0]/has-gs", false);
|
fgSetBool("/instrumentation/gps/has-gs", false);
|
||||||
}
|
}
|
||||||
} else if ( ident == "k" ) {
|
} else if ( ident == "k" ) {
|
||||||
string ind = msg.substr(1,1);
|
string ind = msg.substr(1,1);
|
||||||
|
|
Loading…
Reference in a new issue