Skip to content

Commit fa08d31

Browse files
fix(a380x/sd): fuel values displayed in lbs in cruise page (#10327)
* fix: fuel metric conversion in cruise sd page * chore: remove non needed fuel for display call * chore: remove sdv1 cruise page --------- Co-authored-by: floridude <63071941+flogross89@users.noreply.github.com> (cherry picked from commit b2fffc4)
1 parent 3f85945 commit fa08d31

File tree

7 files changed

+16
-474
lines changed

7 files changed

+16
-474
lines changed
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
// @ts-strict-ignore
2-
export function fuelForDisplay(fuelValue, unitsC, timeUnit = 1, fobMultiplier = 1) {
3-
const fuelWeight = unitsC === '1' ? fuelValue / timeUnit : fuelValue / timeUnit / 0.4535934;
4-
const roundValue = unitsC === '1' ? 10 * fobMultiplier : 20 * fobMultiplier;
1+
// Copyright (c) 2025 FlyByWire Simulations
2+
// SPDX-License-Identifier: GPL-3.0
3+
4+
export function fuelForDisplay(fuelValue: number, metric: boolean, timeUnit = 1, fobMultiplier = 1) {
5+
const fuelWeight = metric ? fuelValue / timeUnit : fuelValue / timeUnit / 0.4535934;
6+
const roundValue = metric ? 10 * fobMultiplier : 20 * fobMultiplier;
57
return Math.round(fuelWeight / roundValue) * roundValue;
68
}
79

8-
export function fuelInTanksForDisplay(fuelValue, unitsC, gallon2Kg) {
10+
export function fuelInTanksForDisplay(fuelValue: number, metric: boolean, gallon2Kg: number) {
911
const weightInKg = fuelValue * gallon2Kg;
10-
const fuelWeight = unitsC === '1' ? weightInKg : weightInKg / 0.4535934;
11-
const roundValue = unitsC === '1' ? 10 : 20;
12+
const fuelWeight = metric ? weightInKg : weightInKg / 0.4535934;
13+
const roundValue = metric ? 10 : 20;
1214
return Math.round(fuelWeight / roundValue) * roundValue;
1315
}

fbw-a380x/src/systems/instruments/src/SD/Pages/Cruise/CruisePage.tsx

Lines changed: 0 additions & 115 deletions
This file was deleted.

fbw-a380x/src/systems/instruments/src/SD/Pages/Cruise/config.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

fbw-a380x/src/systems/instruments/src/SD/Pages/Cruise/elements/A380Cruise.tsx

Lines changed: 0 additions & 30 deletions
This file was deleted.

fbw-a380x/src/systems/instruments/src/SD/Pages/Cruise/elements/CruiseCond.tsx

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)