From a1137ed940710c6531fa12e5427fcaa6d1f3f0bd Mon Sep 17 00:00:00 2001 From: Thorsten Brehm Date: Tue, 5 Oct 2010 22:34:23 +0200 Subject: [PATCH] Another GPWS fix: terrain clearance filter must be reset on reset/reposition. Queue of recent altitude samples must be cleared on reset/reposition to avoid nuisance alerts... --- src/Instrumentation/mk_viii.cxx | 8 ++++++++ src/Instrumentation/mk_viii.hxx | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/mk_viii.cxx b/src/Instrumentation/mk_viii.cxx index 25e0f2491..d69cc96ad 100755 --- a/src/Instrumentation/mk_viii.cxx +++ b/src/Instrumentation/mk_viii.cxx @@ -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) { diff --git a/src/Instrumentation/mk_viii.hxx b/src/Instrumentation/mk_viii.hxx index 594094cf8..517ee49f1 100755 --- a/src/Instrumentation/mk_viii.hxx +++ b/src/Instrumentation/mk_viii.hxx @@ -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 (); -- 2.39.5