X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fmarker_beacon.cxx;h=41b981536a6262e6da037e66b03e5523bda64518;hb=4a94071ed78efdb6c8a9c5d44102dd48a001d920;hp=c9f7c9a34b54855a40204d432efe6af211a278b5;hpb=295d5eaf8c46ca7721a98ea46ed8b960763d16f7;p=flightgear.git diff --git a/src/Instrumentation/marker_beacon.cxx b/src/Instrumentation/marker_beacon.cxx index c9f7c9a34..41b981536 100644 --- a/src/Instrumentation/marker_beacon.cxx +++ b/src/Instrumentation/marker_beacon.cxx @@ -31,10 +31,10 @@ #include #include -#include #include #include "marker_beacon.hxx" +#include #include using std::string; @@ -43,7 +43,6 @@ using std::string; // Constructor FGMarkerBeacon::FGMarkerBeacon(SGPropertyNode *node) : audio_vol(NULL), - need_update(true), outer_blink(false), middle_blink(false), inner_blink(false), @@ -121,14 +120,17 @@ FGMarkerBeacon::init () _sgr = smgr->find("avionics", true); _sgr->tie_to_listener(); - morse.init(); - beacon.init(); - blink.stamp(); + reinit(); +} +void +FGMarkerBeacon::reinit () +{ + blink.stamp(); outer_marker = middle_marker = inner_marker = false; + _time_before_search_sec = 0.0; } - void FGMarkerBeacon::bind () { @@ -162,8 +164,6 @@ FGMarkerBeacon::unbind () void FGMarkerBeacon::update(double dt) { - need_update = false; - // On timeout, scan again, this needs to run every iteration no // matter what the power or serviceable state. If power is turned // off or the unit becomes unserviceable while a beacon sound is @@ -318,7 +318,7 @@ void FGMarkerBeacon::search() // cout << "OUTER MARKER" << endl; if ( last_beacon != OUTER ) { if ( ! _sgr->exists( current_sound_name ) ) { - SGSoundSample *sound = beacon.get_outer(); + SGSoundSample *sound = FGBeacon::instance()->get_outer(); if ( sound ) { _sgr->add( sound, current_sound_name ); } @@ -337,7 +337,7 @@ void FGMarkerBeacon::search() // cout << "MIDDLE MARKER" << endl; if ( last_beacon != MIDDLE ) { if ( ! _sgr->exists( current_sound_name ) ) { - SGSoundSample *sound = beacon.get_middle(); + SGSoundSample *sound = FGBeacon::instance()->get_middle(); if ( sound ) { _sgr->add( sound, current_sound_name ); } @@ -356,7 +356,7 @@ void FGMarkerBeacon::search() // cout << "INNER MARKER" << endl; if ( last_beacon != INNER ) { if ( ! _sgr->exists( current_sound_name ) ) { - SGSoundSample *sound = beacon.get_inner(); + SGSoundSample *sound = FGBeacon::instance()->get_inner(); if ( sound ) { _sgr->add( sound, current_sound_name ); }