From 7a92a773c27b97d34afe30f9c86f002e085e8240 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Wed, 26 Jan 2022 15:28:19 +0000 Subject: [PATCH] Prevent sequencing on the ground. --- Nasal/FMGC/FMGC-b.nas | 9 ++++++++- Nasal/FMGC/flightplan.nas | 1 - Nasal/MCDU/F-PLN.nas | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index b88b0291..06563963 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -442,7 +442,7 @@ var ITAF = { if (enableFlyBy and FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue() and fmgc.flightPlanController.flightplans[2].getWP(FPLN.currentWPTemp).fly_type == "flyBy") { flightPlanController.autoSequencing(); - } elsif (FPLN.wp0Dist.getValue() <= 0.15) { + } elsif (FPLN.wp0Dist.getValue() <= 0.15 and !Gear.wow1.getBoolValue()) { flightPlanController.autoSequencing(); } } @@ -962,6 +962,13 @@ var ITAF = { }, }; + +setlistener(Gear.wow1, func(val) { + if (!val.getBoolValue() and FPLN.currentWP.getValue() == 0) { + flightPlanController.autoSequencing(); + } +}); + setlistener("/it-autoflight/input/ap1", func { Input.ap1Temp = Input.ap1.getBoolValue(); if (Input.ap1Temp != Output.ap1.getBoolValue()) { diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 416cd00f..c5547803 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -768,7 +768,6 @@ var flightPlanController = { } else { var thePlan = plan; } - debug.dump(me.flightplans[thePlan].getWP(index).wp_name); # check waypoints database here var wpFromDB = WaypointDatabase.getWP(text); diff --git a/Nasal/MCDU/F-PLN.nas b/Nasal/MCDU/F-PLN.nas index 80b79ed3..5c8f1c6c 100644 --- a/Nasal/MCDU/F-PLN.nas +++ b/Nasal/MCDU/F-PLN.nas @@ -425,6 +425,8 @@ var fplnPage = { # this one is only created once, and then updated - remember th decelShow = getprop("/instrumentation/nd/symbols/decel/show"); var startingIndex = fmgc.flightPlanController.currentToWptIndex.getValue() == -1 ? 0 : fmgc.flightPlanController.currentToWptIndex.getValue() - 1; + startingIndex == -1 ? 0 : startingIndex; + for (var i = startingIndex; i < me.plan.getPlanSize(); i += 1) { if (!me.temporaryFlagFpln and decelShow) { if (i == decelIndex) {