audio_btn(true),
nav_freq(0.0),
nav_alt_freq(0.0),
+ fmt_freq(""),
+ fmt_alt_freq(""),
nav_heading(0.0),
nav_radial(0.0),
nav_target_radial(0.0),
&FGNavRadio::get_nav_alt_freq, &FGNavRadio::set_nav_alt_freq);
fgSetArchivable( (branch + "/frequencies/standby-mhz").c_str() );
+ fgTie( (branch + "/frequencies/selected-mhz-fmt").c_str() , this,
+ &FGNavRadio::get_fmt_freq, &FGNavRadio::set_fmt_freq );
+ fgSetArchivable( (branch + "/frequencies/selected-mhz-fmt").c_str() );
+
+ fgTie( (branch + "/frequencies/standby-mhz-fmt").c_str() , this,
+ &FGNavRadio::get_fmt_alt_freq, &FGNavRadio::set_fmt_alt_freq);
+ fgSetArchivable( (branch + "/frequencies/standby-mhz-fmt").c_str() );
+
fgTie( (branch + "/radials/selected-deg").c_str() , this,
&FGNavRadio::get_nav_sel_radial, &FGNavRadio::set_nav_sel_radial );
fgSetArchivable((branch + "/radials/selected-deg").c_str() );
Point3D station;
double az1, az2, s;
+ // Create "formatted" versions of the nav frequencies for
+ // consistant display output.
+ char tmp[16];
+ sprintf( tmp, "%.2f", nav_freq );
+ fmt_freq = tmp;
+ sprintf( tmp, "%.2f", nav_alt_freq );
+ fmt_alt_freq = tmp;
+
// On timeout, scan again
_time_before_search_sec -= dt;
if ( _time_before_search_sec < 0 ) {
bool nav_loc;
double nav_freq;
double nav_alt_freq;
+ string fmt_freq; // formated frequency
+ string fmt_alt_freq; // formated alternate frequency
double nav_heading; // true heading to nav station
double nav_radial; // current radial we are on (taking
// into consideration the vor station
inline void set_nav_freq( double freq ) {
nav_freq = freq; need_update = true;
}
+ inline void set_fmt_freq( const char *freq ) { fmt_freq = freq; }
inline void set_nav_alt_freq( double freq ) { nav_alt_freq = freq; }
+ inline void set_fmt_alt_freq( const char *freq ) { fmt_alt_freq = freq; }
inline void set_nav_sel_radial( double radial ) {
nav_sel_radial = radial; need_update = true;
}
inline bool get_power_btn() const { return power_btn; }
inline bool get_audio_btn() const { return audio_btn; }
- // NAV Accessors
+ // NAV Accessors
inline double get_nav_freq () const { return nav_freq; }
+ inline const char *get_fmt_freq () const { return fmt_freq.c_str(); }
inline double get_nav_alt_freq () const { return nav_alt_freq; }
+ inline const char *get_fmt_alt_freq () const {
+ return fmt_alt_freq.c_str();
+ }
inline double get_nav_sel_radial() const { return nav_sel_radial; }
inline double get_nav_target_radial() const { return nav_target_radial; }
inline double get_nav_target_radial_true() const {