Skip to content

Commit

Permalink
fix(fuel pred): dash altn time if value is 0
Browse files Browse the repository at this point in the history
Update changelog
  • Loading branch information
BravoMike99 committed Oct 27, 2023
1 parent 403fce0 commit 31a1594
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
Expand All @@ -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";

Expand Down

0 comments on commit 31a1594

Please sign in to comment.