From 438cb4a462e4948096867fc2d63baa5d21ae4e47 Mon Sep 17 00:00:00 2001 From: Dave Luff Date: Tue, 23 Nov 2010 16:21:36 +0000 Subject: [PATCH] KLN89: Jump to the next position in the flightplan after waypoint entry, as per the real-life unit --- src/Instrumentation/KLN89/kln89_page_fpl.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Instrumentation/KLN89/kln89_page_fpl.cxx b/src/Instrumentation/KLN89/kln89_page_fpl.cxx index 6c57102cd..834a8b269 100644 --- a/src/Instrumentation/KLN89/kln89_page_fpl.cxx +++ b/src/Instrumentation/KLN89/kln89_page_fpl.cxx @@ -711,15 +711,23 @@ void KLN89FplPage::EntPressed() { _delWp = false; // Do we need to re-calc _fplPos here? } else if(_bEntExp) { + // We get here if we have just approved a waypoint review for addition with the ENT button _bEntWp = false; _bEntExp = false; _entWp = NULL; // DON'T delete it! - it's been pushed onto the waypoint list at this point. _entWpStr.clear(); _kln89->_cleanUpPage = -1; _wLinePos = 0; - // TODO - in actual fact the previously underlined waypoint stays in the same position and underlined - // in some or possibly all circumstances - need to check this out and match it, but not too important - // for now. + // The cursor should be moved either to the next waypoint in the list, or to the empty position at + // the end of the list if the waypoint just entered was the last one in the list. Unfortunately + // that means that we have to deal with the horrible _uLinePos / _fplPos interaction yet again :-( + if(_uLinePos == 4) { + // We can't handle this case by calling K1R1, since we want to jump the field type + _uLinePos = 5; + } else { + // Just call Knob1Right1 and let that handle the horrible logic :-) + Knob1Right1(); + } } else if(_bEntWp) { if(_entWp != NULL) { // TODO - should be able to get rid of this switch I think and use the enum values. -- 2.39.5