]> git.mxchange.org Git - flightgear.git/commitdiff
Another GPWS fix: terrain clearance filter must be reset on reset/reposition.
authorThorsten Brehm <brehm@patagonia.southamerica>
Tue, 5 Oct 2010 20:34:23 +0000 (22:34 +0200)
committerThorsten Brehm <brehm@patagonia.southamerica>
Tue, 5 Oct 2010 20:34:23 +0000 (22:34 +0200)
Queue of recent altitude samples must be cleared on reset/reposition to avoid nuisance alerts...

src/Instrumentation/mk_viii.cxx
src/Instrumentation/mk_viii.hxx

index 25e0f24917a1892e421cc8ce02a8808647a77281..d69cc96adec8e23833bff94f841250cf2bb8caf4 100755 (executable)
@@ -362,6 +362,7 @@ MK_VIII::SystemHandler::update ()
       if (replay_state != last_replay_state)
        {
          mk->alert_handler.reposition();
+         mk->io_handler.reposition();
 
          last_replay_state = replay_state;
          state = STATE_REPOSITION;
@@ -1065,6 +1066,7 @@ MK_VIII::IOHandler::boot ()
   mk_doutput(glideslope_cancel) = power_saved.glideslope_cancel;
 
   altitude_samples.clear();
+  reset_terrain_clearance();
 }
 
 void
@@ -1364,6 +1366,12 @@ MK_VIII::IOHandler::reset_terrain_clearance ()
   update_terrain_clearance();
 }
 
+void
+MK_VIII::IOHandler::reposition ()
+{
+  reset_terrain_clearance();
+}
+
 void
 MK_VIII::IOHandler::handle_input_fault (bool test, FaultHandler::Fault fault)
 {
index 594094cf88b68f20504c9bdf6cc0b8c6bc8182a3..517ee49f1cecf435a093a8f55990295f6b79609d 100755 (executable)
@@ -609,6 +609,7 @@ public:
     void update_egpws_alert_discrete_2 ();
     void update_egpwc_alert_discrete_3 ();
     void update_outputs ();
+    void reposition ();
 
     void update_lamps ();
     void set_lamp (Lamp lamp);
@@ -639,7 +640,7 @@ public:
 
     public:
       inline TerrainClearanceFilter ()
-       : value(0) {}
+       : value(0.0), last_update(-1.0) {}
 
       double update (double agl);
       void reset ();