GSX Reset and Disable button
This commit is contained in:
1 parent
04e5ec4251
commit
acf4b9ee47
11 files changed
+117
-77
No files matched your search
@@ -1,21 +1,12 @@
|
||||
import {
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
COMM_BUS_UPDATE_TARGET_EVENT,
|
||||
MODE_LOAD_SET,
|
||||
MODE_OPTIONS_SET,
|
||||
MODE_SB_SET,
|
||||
MODE_STATION_SET,
|
||||
MODE_UNLOAD_SET,
|
||||
MODE_ZFW_SET,
|
||||
} from '../constants';
|
||||
import { SimBrief } from '../types/general';
|
||||
import { COHERENT_COMM_BUS_WASM_CALL } from '../constants';
|
||||
import { CallMode, CommBusEvent, SimBrief } from '../types/general';
|
||||
|
||||
export const loadAircraft = () => {
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
COMM_BUS_UPDATE_TARGET_EVENT,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: MODE_LOAD_SET,
|
||||
mode: CallMode.LOAD_SET,
|
||||
})
|
||||
);
|
||||
};
|
||||
@@ -23,9 +14,9 @@ export const loadAircraft = () => {
|
||||
export const unloadAircraft = () => {
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
COMM_BUS_UPDATE_TARGET_EVENT,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: MODE_UNLOAD_SET,
|
||||
mode: CallMode.UNLOAD_SET,
|
||||
})
|
||||
);
|
||||
};
|
||||
@@ -37,9 +28,9 @@ export const inRangeOf = (value: number, target: number, tolerance: number = 10)
|
||||
export const CoherentCallZFWEntry = (ZFWTarget: number, CGTarget: number) => {
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
COMM_BUS_UPDATE_TARGET_EVENT,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: MODE_ZFW_SET,
|
||||
mode: CallMode.ZFW_SET,
|
||||
ZFWTarget: ZFWTarget,
|
||||
CGTarget: CGTarget,
|
||||
})
|
||||
@@ -56,9 +47,9 @@ export const CoherentCallStationEntryPax = (
|
||||
) => {
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
COMM_BUS_UPDATE_TARGET_EVENT,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: MODE_STATION_SET,
|
||||
mode: CallMode.STATION_SET,
|
||||
business1,
|
||||
business2,
|
||||
economy1,
|
||||
@@ -79,9 +70,9 @@ export const CoherentCallStationEntryF = (
|
||||
) => {
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
COMM_BUS_UPDATE_TARGET_EVENT,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: MODE_STATION_SET,
|
||||
mode: CallMode.STATION_SET,
|
||||
upper1,
|
||||
upper2,
|
||||
upper3,
|
||||
@@ -93,25 +84,26 @@ export const CoherentCallStationEntryF = (
|
||||
};
|
||||
|
||||
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);
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: CallMode.SB_SET,
|
||||
cargo: SBPlan?.cargo,
|
||||
numPax: SBPlan ? parseInt(SBPlan.pax as unknown as string) : undefined,
|
||||
CGTarget: CGTarget,
|
||||
plannedZFW: SBPlan?.plannedZFW,
|
||||
plannedGW: SBPlan?.plannedGW,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
export const CoherentCallSBEntryF = (CGTarget: number, SBPlan?: SimBrief) => {
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
COMM_BUS_UPDATE_TARGET_EVENT,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: MODE_SB_SET,
|
||||
mode: CallMode.SB_SET,
|
||||
cargo: SBPlan?.cargo,
|
||||
CGTarget: CGTarget,
|
||||
plannedZFW: SBPlan?.plannedZFW,
|
||||
@@ -123,12 +115,22 @@ export const CoherentCallSBEntryF = (CGTarget: number, SBPlan?: SimBrief) => {
|
||||
export const CoherentCallOptionsSet = (GSXSync?: boolean, paxWeight?: number, bagWeight?: number) => {
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
COMM_BUS_UPDATE_TARGET_EVENT,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: MODE_OPTIONS_SET,
|
||||
mode: CallMode.OPTIONS_SET,
|
||||
GSXSync,
|
||||
paxWeight,
|
||||
bagWeight,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
export const CoherentCallGSXReset = () => {
|
||||
Coherent.call(
|
||||
COHERENT_COMM_BUS_WASM_CALL,
|
||||
CommBusEvent.UPDATE_TARGET,
|
||||
JSON.stringify({
|
||||
mode: CallMode.GSX_RESET,
|
||||
})
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user