Fix SB persist

This commit is contained in:
2025-06-19 16:05:54 +02:00
parent 390edd29b8
commit 2047c84d8d
5 changed files with 59 additions and 57 deletions
+16 -17
View File
@@ -92,31 +92,30 @@ export const CoherentCallStationEntryF = (
);
};
export const CoherentCallSBEntryPax = (cargo: number, numPax: number, CGTarget: number, SBPlan?: SimBrief) => {
Coherent.call(
COHERENT_COMM_BUS_WASM_CALL,
COMM_BUS_UPDATE_TARGET_EVENT,
JSON.stringify({
mode: MODE_SB_SET,
cargo: cargo,
numPax: numPax,
CGTarget: CGTarget,
plannedZFW: SBPlan?.plannedZFW ?? 0,
plannedGW: SBPlan?.plannedGW ?? 0,
})
);
export const CoherentCallSBEntryPax = (CGTarget: number, SBPlan?: SimBrief) => {
const payload = {
mode: MODE_SB_SET,
cargo: SBPlan?.cargo,
numPax: SBPlan ? parseInt(SBPlan.pax as unknown as string) : undefined,
CGTarget: CGTarget,
plannedZFW: SBPlan?.plannedZFW,
plannedGW: SBPlan?.plannedGW,
};
const string = JSON.stringify(payload);
Coherent.call(COHERENT_COMM_BUS_WASM_CALL, COMM_BUS_UPDATE_TARGET_EVENT, string);
};
export const CoherentCallSBEntryF = (cargo: number, CGTarget: number, SBPlan?: SimBrief) => {
export const CoherentCallSBEntryF = (CGTarget: number, SBPlan?: SimBrief) => {
Coherent.call(
COHERENT_COMM_BUS_WASM_CALL,
COMM_BUS_UPDATE_TARGET_EVENT,
JSON.stringify({
mode: MODE_SB_SET,
cargo: cargo,
cargo: SBPlan?.cargo,
CGTarget: CGTarget,
plannedZFW: SBPlan?.plannedZFW ?? 0,
plannedGW: SBPlan?.plannedGW ?? 0,
plannedZFW: SBPlan?.plannedZFW,
plannedGW: SBPlan?.plannedGW,
})
);
};