lon_node(fgGetNode("/position/longitude-deg", true)),
lat_node(fgGetNode("/position/latitude-deg", true)),
alt_node(fgGetNode("/position/altitude-ft", true)),
+ bus_power(fgGetNode("/systems/electrical/outputs/adf", true)),
need_update(true),
valid(false),
inrange(false),
elapsed_timer(0.0),
tmp_timer(0.0)
{
- SGPath path( globals->get_fg_root() );
- SGPath term = path;
- term.append( "Navaids/range.term" );
- SGPath low = path;
- low.append( "Navaids/range.low" );
- SGPath high = path;
- high.append( "Navaids/range.high" );
-
- term_tbl = new SGInterpTable( term.str() );
- low_tbl = new SGInterpTable( low.str() );
- high_tbl = new SGInterpTable( high.str() );
}
// Destructor
FGKR_87::~FGKR_87() {
- delete term_tbl;
- delete low_tbl;
- delete high_tbl;
}
// Radio
////////////////////////////////////////////////////////////////////////
- if ( power_btn ) {
+ if ( has_power() ) {
// buttons
if ( adf_btn == 0 ) {
ant_mode = 1;
#include <simgear/compiler.h>
-#include <simgear/math/interpolater.hxx>
#include <simgear/timing/timestamp.hxx>
#include <Navaids/navlist.hxx>
{
FGMorse morse;
- SGInterpTable *term_tbl;
- SGInterpTable *low_tbl;
- SGInterpTable *high_tbl;
-
SGPropertyNode *lon_node;
SGPropertyNode *lat_node;
SGPropertyNode *alt_node;
+ SGPropertyNode *bus_power;
bool need_update;
inline double get_stn_lat() const { return stn_lat; }
inline double get_dist() const { return dist; }
inline double get_heading() const { return heading; }
+ inline bool has_power() const {
+ return power_btn && (bus_power->getDoubleValue() > 1.0);
+ }
// modes
inline int get_ant_mode() const { return ant_mode; }