From ebfbb4b037df207cdb77a9fa711ce566d3d6f44d Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Thu, 12 May 2022 21:41:47 +0100 Subject: [PATCH] Temporary fix - sync current WP after temporary flightplan sequencing --- Nasal/FMGC/flightplan.nas | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 69f34220..9c799e8d 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -77,6 +77,7 @@ var flightPlanController = { me.arrivalIndex[n] = 0; # reset arrival index calculations }, + oldCurrentWp: 0, createTemporaryFlightPlan: func(n) { me.resetFlightplan(n); me.flightplans[n] = me.flightplans[2].clone(); @@ -91,6 +92,9 @@ var flightPlanController = { canvas_mcdu.myAirways[n].updateTmpy(); } fmgc.windController.createTemporaryWinds(n); + + me.oldCurrentWp = FPLN.currentWP.getValue(); + me.flightPlanChanged(n); }, @@ -161,6 +165,12 @@ var flightPlanController = { } fmgc.windController.destroyTemporaryWinds(n, a); + + # TODO - handle changed wpt order + if (FPLN.currentWP.getValue() != me.oldCurrentWp) { + FPLN.currentWP.setValue(me.oldCurrentWp); + } + me.flightPlanChanged(n); },