From 31a1594c1440a29a918932082a737b6b15a20703 Mon Sep 17 00:00:00 2001 From: BravoMike99 <119708186+BravoMike99@users.noreply.github.com> Date: Fri, 27 Oct 2023 22:52:14 +0100 Subject: [PATCH] fix(fuel pred): dash altn time if value is 0 Update changelog --- .github/CHANGELOG.md | 1 + .../CDU/A320_Neo_CDU_FuelPredPage.js | 35 +++++++++++-------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 21500f980210..1185395ad39b 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -11,6 +11,7 @@ 1. [EFB] Fixed the main page and landing calculator to use the selected METAR source - @tracernz (Mike) 1. [FMS] Improve layout of PERF CLB, PERF CRZ and PERF DES pages according to H3 - @BlueberryKing (BlueberryKing) 1. [FMS] Implement CHECK SPEED MODE message - @BlueberryKing (BlueberryKing) +1. [MCDU] Dash alternate time predictions if alternate fuel is manually inserted @BravoMike99 (bruno_pt99) ## 0.11.0 diff --git a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_FuelPredPage.js b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_FuelPredPage.js index e0661780d334..95f0ee0bd96b 100644 --- a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_FuelPredPage.js +++ b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_FuelPredPage.js @@ -128,20 +128,20 @@ class CDUFuelPredPage { }; if (mcdu.altDestination) { - if (mcdu._routeAltFuelEntered) { - if (isFinite(mcdu.getRouteAltFuelWeight())) { - altFuelCell = "{sp}{sp}" + (NXUnits.kgToUser(mcdu.getRouteAltFuelWeight())).toFixed(1); - altFuelTimeCell = "{small}" + FMCMainDisplay.minutesTohhmm(mcdu.getRouteAltFuelTime()) + "{end}"; - altTimeColor = "{green}"; - altFuelColor = "[color]cyan"; - } - } else { + const altnFuelEntered = mcdu._routeAltFuelEntered; + if (!altnFuelEntered) { mcdu.tryUpdateRouteAlternate(); - if (isFinite(mcdu.getRouteAltFuelWeight())) { - altFuelCell = "{sp}{sp}{small}" + (NXUnits.kgToUser(mcdu.getRouteAltFuelWeight())).toFixed(1); - altFuelTimeCell = FMCMainDisplay.minutesTohhmm(mcdu.getRouteAltFuelTime()) + "{end}"; + } + if (isFinite(mcdu.getRouteAltFuelWeight())) { + altFuelCell = "{sp}{sp}" + (altnFuelEntered ? "" : "{small}") + (NXUnits.kgToUser(mcdu.getRouteAltFuelWeight())).toFixed(1); + altFuelColor = "[color]cyan"; + const time = mcdu.getRouteAltFuelTime(); + if (time) { + altFuelTimeCell = "{small}" + FMCMainDisplay.minutesTohhmm(time) + "{end}"; altTimeColor = "{green}"; - altFuelColor = "[color]cyan"; + } else { + altFuelTimeCell = "----"; + altTimeColor = "{white}"; } } } else { @@ -161,7 +161,6 @@ class CDUFuelPredPage { altIdentCell = mcdu.altDestination.ident; altEFOBCell = (NXUnits.kgToUser(mcdu.getAltEFOB(true))).toFixed(1); altEFOBCellColor = mcdu.getAltEFOB(true) < mcdu._minDestFob ? "[color]amber" : "[color]green"; - altTimeCellColor = "[color]green"; } mcdu.tryUpdateRouteTrip(isFlying); @@ -173,10 +172,18 @@ class CDUFuelPredPage { // Should we use predicted values or liveETATo and liveUTCto? destTimeCell = isFlying ? FMCMainDisplay.secondsToUTC(utcTime + FMCMainDisplay.minuteToSeconds(mcdu._routeTripTime)) : destTimeCell = FMCMainDisplay.minutesTohhmm(mcdu._routeTripTime); + if (mcdu.altDestination) { - altTimeCell = isFlying ? FMCMainDisplay.secondsToUTC(utcTime + FMCMainDisplay.minuteToSeconds(mcdu._routeTripTime) + FMCMainDisplay.minuteToSeconds(mcdu.getRouteAltFuelTime())) + if (mcdu.getRouteAltFuelTime()) { + altTimeCell = isFlying ? FMCMainDisplay.secondsToUTC(utcTime + FMCMainDisplay.minuteToSeconds(mcdu._routeTripTime) + FMCMainDisplay.minuteToSeconds(mcdu.getRouteAltFuelTime())) : FMCMainDisplay.minutesTohhmm(mcdu.getRouteAltFuelTime()); + altTimeCellColor = "[color]green"; + } else { + altTimeCell = "----"; + altTimeCellColor = "[color]white"; + } } + destEFOBCellColor = "[color]green"; destTimeCellColor = "[color]green";