From 079ca3513731f2c1b0565c7da3aa800806ebfcea Mon Sep 17 00:00:00 2001 From: 2hwk Date: Mon, 2 Jan 2023 18:56:40 +0800 Subject: [PATCH] fix(efb): simbrief load not working on first attempt --- .../Pages/Payload/Loadsheet/a20nv55.json | 8 ++++---- .../src/EFB/Ground/Pages/Payload/Payload.tsx | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/instruments/src/EFB/Ground/Pages/Payload/Loadsheet/a20nv55.json b/src/instruments/src/EFB/Ground/Pages/Payload/Loadsheet/a20nv55.json index 170308b6e6b9..3247ccc3eaec 100644 --- a/src/instruments/src/EFB/Ground/Pages/Payload/Loadsheet/a20nv55.json +++ b/src/instruments/src/EFB/Ground/Pages/Payload/Loadsheet/a20nv55.json @@ -291,7 +291,7 @@ "stationIndex": 1, "position": 21.98, "fill": 0.19, - "bitFlags": "A32NX_PAX_FLAGS_A" + "simVar": "A32NX_PAX_FLAGS_A" }, { "name": "ROWS [7-13]", @@ -610,7 +610,7 @@ "stationIndex": 2, "position": 2.86, "fill": 0.25, - "bitFlags": "A32NX_PAX_FLAGS_B" + "simVar": "A32NX_PAX_FLAGS_B" }, { "name": "ROWS [14-21]", @@ -973,7 +973,7 @@ "stationIndex": 3, "position": -15.34, "fill": 0.28, - "bitFlags": "A32NX_PAX_FLAGS_C" + "simVar": "A32NX_PAX_FLAGS_C" }, { "name": "ROWS [22-29]", @@ -1336,7 +1336,7 @@ "index": 3, "stationIndex": 4, "position": -32.81, - "bitFlags": "A32NX_PAX_FLAGS_D" + "simVar": "A32NX_PAX_FLAGS_D" } ], "cargoMap": [ diff --git a/src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx b/src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx index 181dbb04a497..93e0f3e2956f 100644 --- a/src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx +++ b/src/instruments/src/EFB/Ground/Pages/Payload/Payload.tsx @@ -32,15 +32,15 @@ export const Payload = () => { const { usingMetric } = Units; const { showModal } = useModals(); - const [aFlags] = useSeatFlags(`L:${Loadsheet.seatMap[0].bitFlags}`, Loadsheet.seatMap[0].capacity); - const [bFlags] = useSeatFlags(`L:${Loadsheet.seatMap[1].bitFlags}`, Loadsheet.seatMap[1].capacity); - const [cFlags] = useSeatFlags(`L:${Loadsheet.seatMap[2].bitFlags}`, Loadsheet.seatMap[2].capacity); - const [dFlags] = useSeatFlags(`L:${Loadsheet.seatMap[3].bitFlags}`, Loadsheet.seatMap[3].capacity); + const [aFlags] = useSeatFlags(`L:${Loadsheet.seatMap[0].simVar}`, Loadsheet.seatMap[0].capacity); + const [bFlags] = useSeatFlags(`L:${Loadsheet.seatMap[1].simVar}`, Loadsheet.seatMap[1].capacity); + const [cFlags] = useSeatFlags(`L:${Loadsheet.seatMap[2].simVar}`, Loadsheet.seatMap[2].capacity); + const [dFlags] = useSeatFlags(`L:${Loadsheet.seatMap[3].simVar}`, Loadsheet.seatMap[3].capacity); - const [aFlagsDesired, setAFlagsDesired] = useSeatFlags(`L:${Loadsheet.seatMap[0].bitFlags}_DESIRED`, Loadsheet.seatMap[0].capacity); - const [bFlagsDesired, setBFlagsDesired] = useSeatFlags(`L:${Loadsheet.seatMap[1].bitFlags}_DESIRED`, Loadsheet.seatMap[1].capacity); - const [cFlagsDesired, setCFlagsDesired] = useSeatFlags(`L:${Loadsheet.seatMap[2].bitFlags}_DESIRED`, Loadsheet.seatMap[2].capacity); - const [dFlagsDesired, setDFlagsDesired] = useSeatFlags(`L:${Loadsheet.seatMap[3].bitFlags}_DESIRED`, Loadsheet.seatMap[3].capacity); + const [aFlagsDesired, setAFlagsDesired] = useSeatFlags(`L:${Loadsheet.seatMap[0].simVar}_DESIRED`, Loadsheet.seatMap[0].capacity); + const [bFlagsDesired, setBFlagsDesired] = useSeatFlags(`L:${Loadsheet.seatMap[1].simVar}_DESIRED`, Loadsheet.seatMap[1].capacity); + const [cFlagsDesired, setCFlagsDesired] = useSeatFlags(`L:${Loadsheet.seatMap[2].simVar}_DESIRED`, Loadsheet.seatMap[2].capacity); + const [dFlagsDesired, setDFlagsDesired] = useSeatFlags(`L:${Loadsheet.seatMap[3].simVar}_DESIRED`, Loadsheet.seatMap[3].capacity); const activeFlags = useMemo(() => [aFlags, bFlags, cFlags, dFlags], [aFlags, bFlags, cFlags, dFlags]); const desiredFlags = useMemo(() => [aFlagsDesired, bFlagsDesired, cFlagsDesired, dFlagsDesired], [aFlagsDesired, bFlagsDesired, cFlagsDesired, dFlagsDesired]); @@ -210,7 +210,7 @@ export const Payload = () => { fillCargo(i, cargoStationSize[i] / maxCargo, loadableCargoWeight); } fillCargo(0, 1, remainingWeight); - }, [...cargoDesired, paxBagWeight, ...cargoStationSize]); + }, [maxCargo, ...cargoStationSize, ...cargoMap, ...cargoDesired, paxBagWeight]); const calculatePaxMoment = useCallback(() => { let paxMoment = 0;