From 533583ce3f6a9f8ebd6aac23fa4c87676f96c8c3 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Fri, 13 May 2022 14:41:33 +0100 Subject: [PATCH] Fix miscellaneous bugs, including: - RETURN did not operate on DUPLICATE NAMES - Formatting of DUPLICATE NAMES LAT / LON did not have leading zeroes - Default SID did not set altitude constraint - Sequencing would occur repeatedly when paused --- Nasal/FMGC/flightplan.nas | 3 +++ Nasal/MCDU/F-PLN.nas | 3 ++- Nasal/MCDU/MCDU.nas | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 9c799e8d..eeb80e63 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -215,6 +215,8 @@ var flightPlanController = { autoSequencing: func() { if (!me.active.getBoolValue()) { return; } + if (pts.Sim.Pause.getBoolValue()) { return; } + me.calculateTimeAltitudeOnSequence(); # Advancing logic @@ -328,6 +330,7 @@ var flightPlanController = { # fudge the altitude since we cannot create a hdgtoAlt from nasal. Assume 600 feet per mile - 2.5 miles me.flightplans[n].insertWP(createWP(me.childWPBearingDistance(wptStore, me.flightplans[n].departure_runway.heading, 2.5 + (me.flightplans[n].departure_runway.length * M2NM)), "1500", "sid"), 1); me.flightplans[n].getWP(1).fly_type = "flyOver"; + me.flightplans[n].getWP(1).setAltitude(1500, "at"); fmgc.windController.insertWind(n, 1, 0, "1500"); } me.flightPlanChanged(n); diff --git a/Nasal/MCDU/F-PLN.nas b/Nasal/MCDU/F-PLN.nas index 149915cc..27d29162 100644 --- a/Nasal/MCDU/F-PLN.nas +++ b/Nasal/MCDU/F-PLN.nas @@ -665,8 +665,9 @@ var decimalToShortString = func(dms, type) { var degrees = split(".", sprintf(dms))[0]; if (type == "lat") { var sign = degrees >= 0 ? "N" : "S"; + return sprintf("%02d", abs(degrees)) ~ sign; } else { var sign = degrees >= 0 ? "E" : "W"; + return sprintf("%03d", abs(degrees)) ~ sign; } - return abs(degrees) ~ sign; } \ No newline at end of file diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 13876702..7de16207 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -851,6 +851,8 @@ var lskbutton = func(btn, i) { } else { if (canvas_mcdu.myDuplicate[i] != nil and canvas_mcdu.myDuplicate[i].flagPROG) { pagebutton("prog",i); + } else { + pageNode[i].setValue("F-PLNA"); } } } else if (page == "ARRIVAL") {