Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
1. [FMS] Show true bearings correctly in various FMS pages on the MCDU/MFD - @tracernz (Mike)
1. [A380X/FWS] Improve various ABN SENSED procedure accuracy - @Jonny23787 (Jonathan)
1. [A32NX/FMS] Add pilot entry ETT (Estimated Takeoff Time) functionality - @BravoMike99 (bruno_pt99)
1. [GSX] Changes to support new Features: Loader Behavior, Python Handlers and Service Cancellation - @Fragtality (Fragtality)
1. [GSX] Reworked Ground Power Synch with Jetway/GSX GPU - @Fragtality (Fragtality)

## 0.14.0

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
friendlyName = "FlyByWire A32NX Handler"
# Ensuring that Chocks and Brakes Tests are not overriden by an User-Profile
chocksTest = "(L:A32NX_PARK_BRAKE_LEVER_POS,number) (L:A32NX_GND_EQP_IS_VISIBLE,number) ||"
brakesTest = "(L:A32NX_PARK_BRAKE_LEVER_POS,number)"
fuelSync = LVariable("A32NX_GSX_FUEL_SYNC_ENABLED")

def onJetwayConnected(self):
pass

def onJetwayDisconnected(self):
pass

def setExtPowerAvail(self):
pass

def customTruckRequestedMessage(self):
if fuelSync.getValue() != 0:
return "Fuel Truck requested - load OFP/set planned Fuel in FlyPad"
else:
return self._super_customTruckRequestedMessage()

def customRefuelMessage(self):
if fuelSync.getValue() != 0:
return "GSX Refuel in Progress"
else:
return self._super_customRefuelMessage()

def customTruckInPositionMessage(self):
if fuelSync.getValue() != 0:
return "Fuel Truck in Position - Refuel starts automatically"
else:
return self._super_customTruckInPositionMessage()
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@
<FREQUENCY>10</FREQUENCY>
<UPDATE_CODE>
(A:SURFACE RELATIVE GROUND SPEED, feet per second) 0.1 &gt; ! (&gt;L:A32NX_IS_STATIONARY, bool)
(A:SIM ON GROUND, bool) (L:A32NX_ENGINE_N1:1, Number) 3.5 &lt; and (L:A32NX_ENGINE_N1:2, Number) 3.5 &lt; and (A:LIGHT BEACON, bool) 0 == and (L:FSDT_GSX_DEPARTURE_STATE, number) 5 != and (&gt;L:A32NX_GND_EQP_IS_VISIBLE, bool)
(A:SIM ON GROUND, bool) (L:A32NX_ENGINE_N1:1, Number) 3.5 &lt; and (L:A32NX_ENGINE_N1:2, Number) 3.5 &lt; and (L:A32NX_HYD_NW_STRG_DISC_ECAM_MEMO, bool) 0 == and (A:LIGHT BEACON, bool) 0 == and (L:FSDT_GSX_DEPARTURE_STATE, number) 5 != and (&gt;L:A32NX_GND_EQP_IS_VISIBLE, bool)
</UPDATE_CODE>
</UseTemplate>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export class CDUInitPage {
let zfwCg = undefined;
const a32nxBoarding = SimVar.GetSimVarValue('L:A32NX_BOARDING_STARTED_BY_USR', 'bool');
const gsxBoarding = SimVar.GetSimVarValue('L:FSDT_GSX_BOARDING_STATE', 'number');
if (a32nxBoarding || (gsxBoarding >= 4 && gsxBoarding < 6)) {
if (a32nxBoarding || gsxBoarding == 4 || gsxBoarding == 5) {
zfw = NXUnits.kgToUser(SimVar.GetSimVarValue('L:A32NX_AIRFRAME_ZFW_DESIRED', 'number'));
zfwCg = SimVar.GetSimVarValue('L:A32NX_AIRFRAME_ZFW_CG_PERCENT_MAC_DESIRED', 'number');
} else if (Number.isFinite(getZfw()) && Number.isFinite(getZfwcg())) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
friendlyName = "FlyByWire A380X Handler"
# Ensuring that Chocks and Brakes Tests are not overriden by an User-Profile
chocksTest = "(L:A32NX_PARK_BRAKE_LEVER_POS,number) (L:A32NX_GND_EQP_IS_VISIBLE,number) ||"
brakesTest = "(L:A32NX_PARK_BRAKE_LEVER_POS,number)"
fuelSync = LVariable("A32NX_GSX_FUEL_SYNC_ENABLED")

def onJetwayConnected(self):
pass

def onJetwayDisconnected(self):
pass

def setExtPowerAvail(self):
pass

def customTruckRequestedMessage(self):
if fuelSync.getValue() != 0:
return "Fuel Truck requested - set planned Fuel in FlyPad"
else:
return self._super_customTruckRequestedMessage()

def customRefuelMessage(self):
if fuelSync.getValue() != 0:
return "GSX Refuel in Progress"
else:
return self._super_customRefuelMessage()

def customTruckInPositionMessage(self):
if fuelSync.getValue() != 0:
return "Fuel Truck in Position - Refuel starts automatically"
else:
return self._super_customTruckInPositionMessage()
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@
<FREQUENCY>10</FREQUENCY>
<UPDATE_CODE>
(A:SURFACE RELATIVE GROUND SPEED, feet per second) 0.1 &gt; ! (&gt;L:A32NX_IS_STATIONARY, bool)
(A:SIM ON GROUND, bool) (L:A32NX_ENGINE_N1:1, Number) 3.5 &lt; and (L:A32NX_ENGINE_N1:2, Number) 3.5 &lt; and (L:A32NX_HYD_NW_STRG_DISC_ECAM_MEMO, bool) 0 == and (A:LIGHT BEACON, bool) 0 == and (&gt;L:A32NX_GND_EQP_IS_VISIBLE, bool)
(A:SIM ON GROUND, bool) (L:A32NX_ENGINE_N1:1, Number) 3.5 &lt; and (L:A32NX_ENGINE_N1:2, Number) 3.5 &lt; and (L:A32NX_ENGINE_N1:3, Number) 3.5 &lt; and (L:A32NX_ENGINE_N1:4, Number) 3.5 &lt; and (L:A32NX_HYD_NW_STRG_DISC_ECAM_MEMO, bool) 0 == and (A:LIGHT BEACON, bool) 0 == and (L:FSDT_GSX_DEPARTURE_STATE, number) 5 != and (&gt;L:A32NX_GND_EQP_IS_VISIBLE, bool)
</UPDATE_CODE>
</UseTemplate>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ export const FlightWidget = () => {
dispatch(setSimbriefDataPending(true));

const gsxInProgress =
(gsxDeBoardingState >= 4 && gsxDeBoardingState < 6) || (gsxBoardingState >= 4 && gsxBoardingState < 6);
gsxDeBoardingState == 4 ||
gsxDeBoardingState == 5 ||
gsxDeBoardingState == 7 ||
gsxBoardingState == 4 ||
gsxBoardingState == 5 ||
gsxBoardingState == 7;
const generalBoardingInProgress = gsxPayloadSyncEnabled ? gsxInProgress : boardingStarted;

if (generalBoardingInProgress || refuelStartedByUser) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ export const A320Fuel: React.FC<FuelProps> = ({
}, [simbriefDataLoaded, simbriefPlanRamp, totalTarget, refuelStartedByUser]);

const gsxRefuelActive = () =>
gsxRefuelState === GsxServiceStates.REQUESTED || gsxRefuelState === GsxServiceStates.ACTIVE;
gsxRefuelState === GsxServiceStates.REQUESTED ||
gsxRefuelState === GsxServiceStates.ACTIVE ||
gsxRefuelState === GsxServiceStates.COMPLETING;

const gsxRefuelCallable = () => gsxRefuelState === GsxServiceStates.CALLABLE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ export const A380Fuel: React.FC<FuelProps> = ({
}, [simbriefDataLoaded, simbriefPlanRamp, fuelDesiredKg, refuelStartedByUser]);

const gsxRefuelActive = () =>
gsxRefuelState === GsxServiceStates.REQUESTED || gsxRefuelState === GsxServiceStates.ACTIVE;
gsxRefuelState === GsxServiceStates.REQUESTED ||
gsxRefuelState === GsxServiceStates.ACTIVE ||
gsxRefuelState === GsxServiceStates.COMPLETING;

const gsxRefuelCallable = () => gsxRefuelState === GsxServiceStates.CALLABLE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,20 @@ export const A320Payload: React.FC<PayloadProps> = ({
const [gsxBoardingState] = useSimVar('L:FSDT_GSX_BOARDING_STATE', 'Number', 227);
const [gsxDeBoardingState] = useSimVar('L:FSDT_GSX_DEBOARDING_STATE', 'Number', 229);
const gsxInProgress = () =>
(gsxDeBoardingState >= 4 && gsxDeBoardingState < 6) || (gsxBoardingState >= 4 && gsxBoardingState < 6);
gsxDeBoardingState == 4 ||
gsxDeBoardingState == 5 ||
gsxDeBoardingState == 7 ||
gsxBoardingState == 4 ||
gsxBoardingState == 5 ||
gsxBoardingState == 7;
const gsxStates = {
AVAILABLE: 1,
NOT_AVAILABLE: 2,
BYPASSED: 3,
REQUESTED: 4,
PERFORMING: 5,
COMPLETED: 6,
COMPLETING: 7,
};

const dispatch = useAppDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,20 @@ export const A380Payload: React.FC<PayloadProps> = ({
const [gsxBoardingState] = useSimVar('L:FSDT_GSX_BOARDING_STATE', 'Number', 227);
const [gsxDeBoardingState] = useSimVar('L:FSDT_GSX_DEBOARDING_STATE', 'Number', 229);
const gsxInProgress = () =>
(gsxDeBoardingState >= 4 && gsxDeBoardingState < 6) || (gsxBoardingState >= 4 && gsxBoardingState < 6);
gsxDeBoardingState == 4 ||
gsxDeBoardingState == 5 ||
gsxDeBoardingState == 7 ||
gsxBoardingState == 4 ||
gsxBoardingState == 5 ||
gsxBoardingState == 7;
const gsxStates = {
AVAILABLE: 1,
NOT_AVAILABLE: 2,
BYPASSED: 3,
REQUESTED: 4,
PERFORMING: 5,
COMPLETED: 6,
COMPLETING: 7,
};

const dispatch = useAppDispatch();
Expand Down
12 changes: 12 additions & 0 deletions fbw-common/src/systems/instruments/src/EFB/Settings/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,24 @@ export const globalSyncedSettings: SyncedSettingDefinition[] = [
localVarUnit: 'bool',
defaultValue: '0',
},
{
configKey: 'GSX_FUEL_SYNC',
localVarName: 'L:A32NX_GSX_FUEL_SYNC_ENABLED',
localVarUnit: 'bool',
defaultValue: '0',
},
{
configKey: 'GSX_PAYLOAD_SYNC',
localVarName: 'L:A32NX_GSX_PAYLOAD_SYNC_ENABLED',
localVarUnit: 'bool',
defaultValue: '0',
},
{
configKey: 'GSX_POWER_SYNC',
localVarName: 'L:A32NX_GSX_POWER_SYNC_ENABLED',
localVarUnit: 'bool',
defaultValue: '0',
},
{
configKey: 'CONFIG_USING_METRIC_UNIT',
localVarName: 'L:A32NX_EFB_USING_METRIC_UNIT',
Expand Down
26 changes: 22 additions & 4 deletions fbw-common/src/systems/shared/src/GPUManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export class GPUManagement implements Instrument {

private readonly ExtPowerAvailStates = new Map<number, ConsumerSubject<boolean>>();

private readonly msfsSyncEnabled = ConsumerSubject.create(this.sub.on('msfs_power_sync_state'), true);

// state 2 is cockpit, state 3 is external
private readonly isIngame = MappedSubject.create(
([gameState, cameraState]) => gameState === GameState.ingame && (cameraState === 2 || cameraState === 3),
Expand Down Expand Up @@ -63,11 +65,17 @@ export class GPUManagement implements Instrument {
public init(): void {
Wait.awaitSubscribable(this.isIngame, (state) => state, true).then(() => {
this.sub.on('gpu_toggle').handle(this.toggleGPU.bind(this));
this.gpuHookedUp.sub((v) => this.setEXTpower(v));
this.sub.on('set_ext_power').handle(this.onExtPowerEvent.bind(this));
this.gpuHookedUp.sub((v) => {
if (this.msfsSyncEnabled.get() === true) this.setEXTpower(v);
});
this.groundVelocity.sub((v) => {
// disable ext power when aircraft starts moving
if (v > 0.3 && this.anyGPUAvail()) {
this.toggleGPU();
this.setEXTpower(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the p be capitalised?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought it should be for camel case and consistency

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't name it ... so maybe? 😅

if (this.gpuHookedUp.get()) {
this.toggleMSFSGpu();
}
}
});
this.initialIngameFrame = true;
Expand All @@ -87,21 +95,29 @@ export class GPUManagement implements Instrument {

private toggleGPU(): void {
if (!this.anyGPUAvail()) {
if (this.anyMSFSGPUAvail()) {
if (this.anyMSFSGPUAvail() || this.msfsSyncEnabled.get() === false) {
// if msfs ground power is avail we are at a powered stand
this.setEXTpower(true);
} else {
this.toggleMSFSGpu(); // if msfs ground power is not avail we call for gpu cart
}
} else {
if (this.gpuHookedUp.get()) {
if (this.gpuHookedUp.get() && this.msfsSyncEnabled.get() === true) {
this.toggleMSFSGpu();
} else {
this.setEXTpower(false);
}
}
}

private onExtPowerEvent(state: boolean): void {
if (!this.anyGPUAvail() && state) {
this.setEXTpower(true);
} else if (this.anyGPUAvail() && !state) {
this.setEXTpower(false);
}
}

private toggleMSFSGpu(): void {
SimVar.SetSimVarValue('K:REQUEST_POWER_SUPPLY', 'Bool', true);
}
Expand Down Expand Up @@ -140,4 +156,6 @@ export class GPUManagement implements Instrument {
export interface GPUControlEvents {
/** event to toggle the GPU*/
gpu_toggle: unknown;
set_ext_power: boolean;
msfs_power_sync_state: boolean;
}
Loading