#include <Navaids/ilslist.hxx>
#include <Navaids/navlist.hxx>
-#include <Sound/beacon.hxx>
#include <Sound/morse.hxx>
class FGNavCom : public FGSubsystem
{
- FGBeacon beacon;
FGMorse morse;
SGInterpTable *term_tbl;
SGPropertyNode *lon_node;
SGPropertyNode *lat_node;
SGPropertyNode *alt_node;
+ SGPropertyNode *bus_power;
+ SGPropertyNode *com_servicable, *nav_servicable;
+ SGPropertyNode *cdi_servicable, *gs_servicable, *tofrom_servicable;
- string last_nav_ident;
+ string last_nav_id;
bool last_nav_vor;
int nav_play_count;
time_t nav_last_time;
bool need_update;
- string comm_ident;
+ bool power_btn;
+ bool audio_btn;
+
bool comm_valid;
bool comm_inrange;
double comm_freq;
double comm_range;
double comm_effective_range;
- string nav_ident;
+ string nav_id;
string nav_trans_ident;
bool nav_valid;
bool nav_inrange;
double nav_gs_x;
double nav_gs_y;
double nav_gs_z;
+ sgdVec3 gs_base_vec;
double nav_gs_dist;
+ double nav_gs_dist_signed;
SGTimeStamp prev_time;
SGTimeStamp curr_time;
double nav_elev;
sprintf( dme_fx_name, "dme%d-vor-ident", index );
}
+ // NavCom Setters
+ inline void set_power_btn( bool val ) { power_btn = val; }
+ inline void set_audio_btn( bool val ) { audio_btn = val; }
+
// COMM Setters
inline void set_comm_freq( double freq ) {
comm_freq = freq; need_update = true;
}
inline void set_nav_ident_btn( bool val ) { nav_ident_btn = val; }
+ // NavCom Accessors
+ inline bool has_power() const {
+ return power_btn && (bus_power->getDoubleValue() > 1.0);
+ }
+ inline bool get_power_btn() const { return power_btn; }
+ inline bool get_audio_btn() const { return audio_btn; }
+
// COMM Accessors
inline double get_comm_freq () const { return comm_freq; }
inline double get_comm_alt_freq () const { return comm_alt_freq; }
inline double get_nav_gslon() const { return nav_gslon; }
inline double get_nav_gslat() const { return nav_gslat; }
inline double get_nav_gs_dist() const { return nav_gs_dist; }
+ inline double get_nav_gs_dist_signed() const { return nav_gs_dist_signed; }
inline double get_nav_elev() const { return nav_elev; }
inline double get_nav_heading() const { return nav_heading; }
inline double get_nav_radial() const { return nav_radial; }