{
morse.init();
beacon.init();
+ blink.stamp();
search();
update();
fgTie("/radios/adf/ident", this,
&FGRadioStack::get_adf_ident_btn,
&FGRadioStack::set_adf_ident_btn);
+
+ fgTie("/radios/marker-beacons/inner", this,
+ &FGRadioStack::get_inner_blink);
+ fgTie("/radios/marker-beacons/middle", this,
+ &FGRadioStack::get_middle_blink);
+ fgTie("/radios/marker-beacons/outer", this,
+ &FGRadioStack::get_outer_blink);
}
void
fgUntie("/radios/adf/rotation");
fgUntie("/radios/adf/on");
fgUntie("/radios/adf/ident");
+
+ fgUntie("/radios/marker-beacons/inner");
+ fgUntie("/radios/marker-beacons/middle");
+ fgUntie("/radios/marker-beacons/outer");
}
globals->get_soundmgr()->stop( "adf-ident" );
}
}
+
+ // marker beacon blinking
+ bool light_on = ( outer_blink || middle_blink || inner_blink );
+ SGTimeStamp current;
+ current.stamp();
+
+ if ( light_on && (current - blink > 400000) ) {
+ light_on = false;
+ blink.stamp();
+ } else if ( !light_on && (current - blink > 100000) ) {
+ light_on = true;
+ blink.stamp();
+ }
+
+ if ( outer_marker ) {
+ outer_blink = light_on;
+ } else {
+ outer_blink = false;
+ }
+
+ if ( middle_marker ) {
+ middle_blink = light_on;
+ } else {
+ middle_blink = false;
+ }
+
+ if ( inner_marker ) {
+ inner_blink = light_on;
+ } else {
+ inner_blink = false;
+ }
+
+ cout << outer_blink << " " << middle_blink << " " << inner_blink << endl;
}
if ( beacon_type == FGMkrBeacon::OUTER ) {
outer_marker = true;
- cout << "OUTER MARKER" << endl;
+ // cout << "OUTER MARKER" << endl;
if ( last_beacon != FGMkrBeacon::OUTER ) {
if ( ! globals->get_soundmgr()->exists( "outer-marker" ) ) {
FGSimpleSound *sound = beacon.get_outer();
}
} else if ( beacon_type == FGMkrBeacon::MIDDLE ) {
middle_marker = true;
- cout << "MIDDLE MARKER" << endl;
+ // cout << "MIDDLE MARKER" << endl;
if ( last_beacon != FGMkrBeacon::MIDDLE ) {
if ( ! globals->get_soundmgr()->exists( "middle-marker" ) ) {
FGSimpleSound *sound = beacon.get_middle();
}
} else if ( beacon_type == FGMkrBeacon::INNER ) {
inner_marker = true;
- cout << "INNER MARKER" << endl;
+ // cout << "INNER MARKER" << endl;
if ( last_beacon != FGMkrBeacon::INNER ) {
if ( ! globals->get_soundmgr()->exists( "inner-marker" ) ) {
FGSimpleSound *sound = beacon.get_inner();
}
}
} else {
- cout << "no marker" << endl;
+ // cout << "no marker" << endl;
globals->get_soundmgr()->stop( "outer-marker" );
globals->get_soundmgr()->stop( "middle-marker" );
globals->get_soundmgr()->stop( "inner-marker" );
#include <simgear/compiler.h>
#include <simgear/math/interpolater.hxx>
+#include <simgear/timing/timestamp.hxx>
#include <Navaids/ilslist.hxx>
#include <Navaids/navlist.hxx>
bool middle_marker;
bool inner_marker;
+ SGTimeStamp blink;
+ bool outer_blink;
+ bool middle_blink;
+ bool inner_blink;
+
string adf_ident;
string adf_trans_ident;
bool adf_valid;
inline double get_adf_alt_freq () const { return adf_alt_freq; }
inline double get_adf_rotation () const { return adf_rotation; }
+ // Marker Beacon Accessors
+ inline bool get_inner_blink () const { return inner_blink; }
+ inline bool get_middle_blink () const { return middle_blink; }
+ inline bool get_outer_blink () const { return outer_blink; }
+
// Calculated values.
inline bool get_nav1_inrange() const { return nav1_inrange; }
bool get_nav1_to_flag () const;
// match up to twice the published range so we can model
// reduced signal strength
if ( d < maxrange2 ) {
- cout << "lon = " << lon << " lat = " << lat
- << " closest beacon = " << sqrt( min_dist ) << endl;
+ // cout << "lon = " << lon << " lat = " << lat
+ // << " closest beacon = " << sqrt( min_dist ) << endl;
return current->get_type();
}
}
- cout << "lon = " << lon << " lat = " << lat
- << " closest beacon = " << sqrt( min_dist ) << endl;
+ // cout << "lon = " << lon << " lat = " << lat
+ // << " closest beacon = " << sqrt( min_dist ) << endl;
return FGMkrBeacon::NOBEACON;
}