From 75ef24885041372d5840b93a2c87f4be01a41273 Mon Sep 17 00:00:00 2001 From: Mark Rivington Date: Fri, 14 Jul 2023 16:31:00 +0100 Subject: [PATCH] fix: Fuel/payload incorrectly imported from Simbrief #492 --- .../Salty_B747_8/FMC/PAYLOAD/B747_8_FMC_Fuel.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/salty-747/html_ui/Pages/VCockpit/Instruments/Airliners/Salty_B747_8/FMC/PAYLOAD/B747_8_FMC_Fuel.js b/salty-747/html_ui/Pages/VCockpit/Instruments/Airliners/Salty_B747_8/FMC/PAYLOAD/B747_8_FMC_Fuel.js index 8a0b0d09..626d8874 100644 --- a/salty-747/html_ui/Pages/VCockpit/Instruments/Airliners/Salty_B747_8/FMC/PAYLOAD/B747_8_FMC_Fuel.js +++ b/salty-747/html_ui/Pages/VCockpit/Instruments/Airliners/Salty_B747_8/FMC/PAYLOAD/B747_8_FMC_Fuel.js @@ -65,22 +65,21 @@ class FMC_Fuel { fmc.onRightInput[4] = async () => { FMC_Fuel.ofpRequestText = "SENDING"; - + setTimeout(async () => { - if (!fmc.simbrief.blockFuel) await getSimBriefPlan(fmc); + await getSimBriefPlan(fmc); if (fmc.simbrief.blockFuel) { Coherent.call("PLAY_INSTRUMENT_SOUND", "uplink_chime"); - const desiredFuel = parseFloat(fmc.simbrief.blockFuel.toString()); - setDesiredFuel(fmc, updateView, SaltyUnits.userToKg(desiredFuel)); - } else fmc.showErrorMessage("WRONG PILOT ID"); + let desiredFuel = parseFloat(fmc.simbrief.blockFuel.toString()); + if (fmc.simbrief.units == "lbs") desiredFuel = desiredFuel / 2.204625; + setDesiredFuel(fmc, updateView, desiredFuel); + } + else {fmc.showErrorMessage("WRONG PILOT ID");} FMC_Fuel.ofpRequestText = "SEND>"; }, fmc.getInsertDelay()) - - const desiredFuel = parseFloat(fmc.simbrief.blockFuel.toString()); - setDesiredFuel(fmc, updateView, SaltyUnits.userToKg(desiredFuel)); }; fmc.onLeftInput[5] = () => {