Skip to content

Commit

Permalink
Merge branch 'master' into a380x-press-failures-ecam
Browse files Browse the repository at this point in the history
  • Loading branch information
mjuhe authored Nov 11, 2024
2 parents a2c9faf + acf83e8 commit f915aef
Show file tree
Hide file tree
Showing 68 changed files with 1,567 additions and 796 deletions.
13 changes: 12 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,23 @@
1. [A380X/EWD] QoL: Add soft keys to EWD checklists, can be enabled via EFB - @flogross89 (floridude)
1. [A380X/LIGHTS] Implemented LOGO LT switch funcionality - @ImenesFBW (Imenes)
1. [A380X/SD] Added correct ECP ALL button SD page cycling to the A380X - @frankkopp (Frank Kopp)
1. [A380X/SURV] Fixed BTV setup from F/O side, and ROW issues at G/A with early THR RED - @flogross89 (floridude)
1. [A380/MFD] Limit keyboard inputs to keys present in the KCCU and remap comma to decimal dot - @beheh (Benedict Etzel)
1. [GENERAL] Mitigated issue with pop-ups (i.e. pause on TOD notification) being unable to be dismissed while camera is in freelook + ALT-TAB - @2hwk (2cas)
1. [A380X/AP] Improved support of simulation rate 4x - @aguther (Andreas Guther)
1. [A380/FLIGHTMODEL] Tweaked jetway connect position - @C-Schaffhausen (Cedric)
1. [A32NX/FANS] Restore Portuguese station codes - @tracernz (Mike)
1. [A380X/MFD] Fixed DIRECT TO selection of active waypoint does nothing - @sognodelx (Sven Gross)
1. [A380X/FLIGHT MODEL] Fix for stall and auto-rotation issues- @donstim (donbikes)
1. [A380X/MODEL] Optimized 4K textures - @Repsol
1. [A380X/EFB] Moved cabin lighting from ambient light knob to EFB Quick Settings - @2hwk (2cas)
1. [A380X/AFS] Fixed CP V/S knob push levelling off the aircraft when it should have no action - @tracernz (Mike)
1. [A380X/MFD] MFD/SURV: Fixed TCAS not switching status when using DEFAULT SETTINGS button - @flogross89 (floridude)
1. [A380/FUEL] Recalibrated inital fuel settings - @sschiphorst (Yahtzee94)
1. [A380X/ENGINES] Another adjustment to taxi thrust - @donstim (donbikes)
1. [A380/ANIM] Animation of flaps now from FPPU position. Interim fix for spoiler low end animation - @Crocket63 (crocket)
1. [A380X/ENG] Improve oil pressure lookup table - @tracernz (Mike)
1. [A380/WING_FLEX] Reduced stiffness of wings for more tip up bend - @Crocket63 (crocket)
1. [A380X/FWS] Add V1 callout - @flogross89 (floridude)

## 0.12.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ jobs:
cd ./fbw-a380x/out/
rm -rf build-modules
7z a -t7z -m0=lzma2 -mx=7 -v2047m ../../${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} ./flybywire-aircraft-a380-842/
cd ../../
if [ "$(ls -1 ./${{ env.BUILD_DIR_NAME }} | wc -l)" -eq 1 ]; then
mv ./${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }}.001 ./${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} # Only applicable if split in 1 part!
fi
cd ../../
df -h
- name: Count Standalone Download files
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ jobs:
cd ./fbw-a380x/out/
rm -rf build-modules
7z a -t7z -m0=lzma2 -mx=7 -v2047m ../../${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} ./flybywire-aircraft-a380-842/
cd ../../
if [ "$(ls -1 ./${{ env.BUILD_DIR_NAME }} | wc -l)" -eq 1 ]; then
mv ./${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }}.001 ./${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} # Only applicable if split in 1 part!
fi
cd ../../
df -h
- name: Count Standalone Download files
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ jobs:
cd ./fbw-a380x/out/
rm -rf build-modules
7z a -t7z -m0=lzma2 -mx=7 -v2047m ../../${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} ./flybywire-aircraft-a380-842/
cd ../../
if [ "$(ls -1 ./${{ env.BUILD_DIR_NAME }} | wc -l)" -eq 1 ]; then
mv ./${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }}.001 ./${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} # Only applicable if split in 1 part!
fi
cd ../../
df -h
- name: Upload release assets
uses: dwenegar/upload-release-assets@v1
Expand Down
179 changes: 123 additions & 56 deletions docs/README.md

Large diffs are not rendered by default.

39 changes: 18 additions & 21 deletions fbw-a32nx/src/localization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,33 @@ TOC:
- [Build Process](#build-process)
- [Updating the Source File](#update-source-file)

OBS:

<span style="color: red">
flyPad Localization files are now in the fbw-common EFB section
The localization files for the flyPad are now in the fbw-common EFB section.
The process is the same as described here. The only difference is the path
to the localization files. The path is `fbw-a32nx/src/localization/flypad`
instead of `fbw-a32nx/src/localization/a32nx`.
OBS:
The localization files for the flyPad are now in the fbw-common EFB section. The process is the same as described here.
The only difference is the path to the localization files. The path is `fbw-a32nx/src/localization/flypad` instead of
`fbw-a32nx/src/localization/a32nx`.
</span>

## Development Process

- To add something to the localization files simply add the key to the source language files:
- For flyPad: `fbw-a32nx/src/localization/flypad/en.json`
- For MSFS locPak: `fbw-a32nx/src/localization/msfs/en-US.locPak`
- Only change the source language file. The other language files are generated automatically from
- For flyPad: `fbw-a32nx/src/localization/flypad/en.json`
- For MSFS locPak: `fbw-a32nx/src/localization/msfs/en-US.locPak`
- Only change the source language file. The other language files are generated automatically from
Localazy and any changes will be overwritten.
- Ping in the Discord channel `#localisation` to have someone with write permission to Localazy to
- Ping in the Discord channel `#localisation` to have someone with write permission to Localazy to
add the key (several ways to do that - but the permission required is powerful). Adding it is a 2min thing.
- Do this in good time before it is merged to master
- Translators can now start to translate this (worst case is the term is not translated and shown in English)
- Same for removing or changing keys - do the change locally in the English source file and ping in
- Same for removing or changing keys - do the change locally in the English source file and ping in
`#localisation` for someone with write permission to Localazy to remove the key or change the default text.

**Remark:**

The update could be automated via GitHub actions (as the download is - it's basically one command) but this would
require the write key to be available in the GitHub action. As forks have no access to GitHub secrets automating
this would not work for forks without making the write key public which is of course a no-go.
Alternate solutions are still investigated.
Alternate solutions are still investigated.

## Build Process

Expand All @@ -62,7 +59,7 @@ To update the language files locally you need to run:

`npm run build:efb-translation local`

or
or

`npm run build:locPak-translation local`

Expand All @@ -71,10 +68,10 @@ folder of the flyPad or locPak folder.

It checks the JSON syntax and writes new JSON files for each language to their respective target folder:

flyPad:
flyPad:
`fbw-a32nx/src/localization/flypad`

msfs locPak:
msfs locPak:
`fbw-a32nx/src/localization/msfs` and `out/flybywire-aircraft-a320-neo/`

## Update Source File
Expand All @@ -85,11 +82,11 @@ Although an automatic update could be done we have chosen to manually make chang
keys).

ATTENTION:<br/>
ANY CHANGES TO THE SOURCE FILES ON LOCALAZY WILL BE IMMEDIATELY BE VISIBLE IN EVER NEW BUILD OF
THE A32NX - INDEPENDENT OF EDITION.
ANY CHANGES TO THE SOURCE FILES ON LOCALAZY WILL BE IMMEDIATELY BE VISIBLE IN EVER NEW BUILD OF
THE A32NX - INDEPENDENT OF EDITION.

### Using Localazy CLI

Install the Localazy CLI via `npm install -g @localazy/cli` and then use the following commands to upload the source.

[Localazy CLI Documentation](https://localazy.com/docs/cli/command-line-options)
Expand All @@ -114,7 +111,7 @@ MSFS locPak:
The writeKey can be found in the Localazy project settings which are accessible by the Owners/Managers of the project.

### Using the English source file and Localazy Website

#### flyPad:

- Make the necessary changes to the en.json (adding keys, removing key, changing default English strings)
Expand All @@ -133,7 +130,7 @@ The writeKey can be found in the Localazy project settings which are accessible
- new keys are ready to be translated in all other languages

#### MSFS locPak:

Same process as for flyPad but within the respective MSFS lokPak project.

Localazy filename is `flybywire.locPak`.
Expand Down
10 changes: 9 additions & 1 deletion fbw-a32nx/src/systems/extras-host/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
// Copyright (c) 2022 FlyByWire Simulations
// SPDX-License-Identifier: GPL-3.0

import { EventBus, HEventPublisher, InstrumentBackplane } from '@microsoft/msfs-sdk';
import { Clock, EventBus, HEventPublisher, InstrumentBackplane } from '@microsoft/msfs-sdk';
import { FlightDeckBounds, NotificationManager, PilotSeatManager } from '@flybywiresim/fbw-sdk';
import { ExtrasSimVarPublisher } from 'extras-host/modules/common/ExtrasSimVarPublisher';
import { PushbuttonCheck } from 'extras-host/modules/pushbutton_check/PushbuttonCheck';
import { FlightPlanAsoboSync } from 'extras-host/modules/flightplan_sync/FlightPlanAsoboSync';
import { KeyInterceptor } from './modules/key_interceptor/KeyInterceptor';
import { VersionCheck } from './modules/version_check/VersionCheck';
import { AircraftSync } from './modules/aircraft_sync/AircraftSync';
import { LightSync } from 'extras-host/modules/light_sync/LightSync';

/**
* This is the main class for the extras-host instrument.
Expand Down Expand Up @@ -46,8 +47,11 @@ class ExtrasHost extends BaseInstrument {
};

private readonly bus = new EventBus();

private readonly backplane = new InstrumentBackplane();

private readonly clock = new Clock(this.bus);

private readonly notificationManager: NotificationManager;

private readonly hEventPublisher: HEventPublisher;
Expand All @@ -68,6 +72,8 @@ class ExtrasHost extends BaseInstrument {

public readonly xmlConfig: Document;

private readonly lightSync: LightSync = new LightSync(this.bus);

/**
* "mainmenu" = 0
* "loading" = 1
Expand All @@ -92,7 +98,9 @@ class ExtrasHost extends BaseInstrument {
this.versionCheck = new VersionCheck(process.env.AIRCRAFT_PROJECT_PREFIX, this.bus);
this.aircraftSync = new AircraftSync(process.env.AIRCRAFT_PROJECT_PREFIX, this.bus);

this.backplane.addInstrument('Clock', this.clock);
this.backplane.addInstrument('PilotSeatManager', this.pilotSeatManager);
this.backplane.addInstrument('LightSync', this.lightSync);

console.log('A32NX_EXTRASHOST: Created');
}
Expand Down
79 changes: 79 additions & 0 deletions fbw-a32nx/src/systems/extras-host/modules/light_sync/LightSync.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// Copyright (c) 2024 FlyByWire Simulations
// SPDX-License-Identifier: GPL-3.0

import { EventBus, GameStateProvider, Instrument, KeyEventManager, Wait } from '@microsoft/msfs-sdk';

export class LightSync implements Instrument {
private keyInterceptManager: KeyEventManager;

private readonly bus: EventBus;

constructor(bus: EventBus) {
this.bus = bus;
}

public init(): void {
Promise.all([
KeyEventManager.getManager(this.bus),
Wait.awaitSubscribable(GameStateProvider.get(), (state) => state === GameState.ingame, true),
]).then(([keyEventManager]) => {
this.keyInterceptManager = keyEventManager;
this.initLighting();
});
}

public initLighting(): void {
console.log('[LightSync] initializing lighting to defaults');

const autoBrightness = this.getAutoBrightness();

// DOME
if (autoBrightness < 50) {
this.keyInterceptManager.triggerKey('CABIN_LIGHTS_SET', false, 1);
}
this.setPotentiometer(7, autoBrightness < 50 ? 20 : 0);
// MAIN FLOOD
this.setPotentiometer(83, autoBrightness < 50 ? 20 : 0);
// FCU INTEG
this.setPotentiometer(84, autoBrightness < 50 ? 1.5 * autoBrightness : 0);
// MAIN & PED INTEG
this.setPotentiometer(85, autoBrightness < 50 ? 1.5 * autoBrightness : 0);
// OVHD INTEG
this.setPotentiometer(86, autoBrightness < 50 ? 1.5 * autoBrightness : 0);
// FCU Displays
this.setPotentiometer(87, autoBrightness);
// CAPT PFD DU
this.setPotentiometer(88, autoBrightness);
// CAPT ND DU
this.setPotentiometer(89, autoBrightness);
// F/O PFD DU
this.setPotentiometer(90, autoBrightness);
// F/O ND DU
this.setPotentiometer(91, autoBrightness);
// Upper ECAM DU
this.setPotentiometer(92, autoBrightness);
// Lower ECAM DU
this.setPotentiometer(93, autoBrightness);
// CAPT MCDU
SimVar.SetSimVarValue('L:A32NX_MCDU_L_BRIGHTNESS', 'number', (8 * autoBrightness) / 100);
// FO MCDU
SimVar.SetSimVarValue('L:A32NX_MCDU_R_BRIGHTNESS', 'number', (8 * autoBrightness) / 100);
// CAPT DCDU
SimVar.SetSimVarValue('L:A32NX_PANEL_DCDU_L_BRIGHTNESS', 'number', autoBrightness / 100);
// FO DCDU
SimVar.SetSimVarValue('L:A32NX_PANEL_DCDU_R_BRIGHTNESS', 'number', autoBrightness / 100);
}

public onUpdate(): void {}

private setPotentiometer(potentiometer: number, brightness: number) {
if (this.keyInterceptManager) {
this.keyInterceptManager.triggerKey('LIGHT_POTENTIOMETER_SET', false, potentiometer, brightness);
}
}

private getAutoBrightness(): number {
/** automatic brightness based on ambient light, [0, 1] scale */
return Math.max(15, Math.min(85, SimVar.GetSimVarValue('GLASSCOCKPIT AUTOMATIC BRIGHTNESS', 'percent')));
}
}
1 change: 1 addition & 0 deletions fbw-a32nx/src/systems/instruments/src/EFB/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ render(
pilotSeat: false,
registrationDecal: true,
wheelChocks: true,
cabinLighting: false,
},
throttle: {
numberOfAircraftThrottles: 2,
Expand Down
59 changes: 1 addition & 58 deletions fbw-a32nx/src/systems/systems-host/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: GPL-3.0

import { EventBus, HEventPublisher, KeyEventManager, Wait, GameStateProvider } from '@microsoft/msfs-sdk';
import { EventBus, HEventPublisher } from '@microsoft/msfs-sdk';
import { AtsuSystem } from './systems/atsu';
import { PowerSupplyBusses } from './systems/powersupply';

Expand All @@ -15,8 +15,6 @@ class SystemsHost extends BaseInstrument {

private readonly atsu: AtsuSystem;

private keyInterceptManager: KeyEventManager;

/**
* "mainmenu" = 0
* "loading" = 1
Expand All @@ -32,13 +30,6 @@ class SystemsHost extends BaseInstrument {
this.hEventPublisher = new HEventPublisher(this.bus);
this.powerSupply = new PowerSupplyBusses(this.bus);
this.atsu = new AtsuSystem(this.bus);
Promise.all([
KeyEventManager.getManager(this.bus),
Wait.awaitSubscribable(GameStateProvider.get(), (state) => state === GameState.ingame, true),
]).then(([keyEventManager]) => {
this.keyInterceptManager = keyEventManager;
this.initLighting();
});
}

get templateID(): string {
Expand Down Expand Up @@ -85,54 +76,6 @@ class SystemsHost extends BaseInstrument {
this.powerSupply.update();
this.atsu.update();
}

private initLighting() {
/** automatic brightness based on ambient light, [0, 1] scale */
const autoBrightness = Math.max(
15,
Math.min(85, SimVar.GetSimVarValue('GLASSCOCKPIT AUTOMATIC BRIGHTNESS', 'percent')),
);

// DOME
if (autoBrightness < 50) {
this.keyInterceptManager.triggerKey('CABIN_LIGHTS_SET', false, 1);
}
this.setPotentiometer(7, autoBrightness < 50 ? 20 : 0);
// MAIN FLOOD
this.setPotentiometer(83, autoBrightness < 50 ? 20 : 0);
// FCU INTEG
this.setPotentiometer(84, autoBrightness < 50 ? 1.5 * autoBrightness : 0);
// MAIN & PED INTEG
this.setPotentiometer(85, autoBrightness < 50 ? 1.5 * autoBrightness : 0);
// OVHD INTEG
this.setPotentiometer(86, autoBrightness < 50 ? 1.5 * autoBrightness : 0);
// FCU Displays
this.setPotentiometer(87, autoBrightness);
// CAPT PFD DU
this.setPotentiometer(88, autoBrightness);
// CAPT ND DU
this.setPotentiometer(89, autoBrightness);
// F/O PFD DU
this.setPotentiometer(90, autoBrightness);
// F/O ND DU
this.setPotentiometer(91, autoBrightness);
// Upper ECAM DU
this.setPotentiometer(92, autoBrightness);
// Lower ECAM DU
this.setPotentiometer(93, autoBrightness);
// CAPT MCDU
SimVar.SetSimVarValue('L:A32NX_MCDU_L_BRIGHTNESS', 'number', (8 * autoBrightness) / 100);
// FO MCDU
SimVar.SetSimVarValue('L:A32NX_MCDU_R_BRIGHTNESS', 'number', (8 * autoBrightness) / 100);
// CAPT DCDU
SimVar.SetSimVarValue('L:A32NX_PANEL_DCDU_L_BRIGHTNESS', 'number', autoBrightness / 100);
// FO DCDU
SimVar.SetSimVarValue('L:A32NX_PANEL_DCDU_R_BRIGHTNESS', 'number', autoBrightness / 100);
}

private setPotentiometer(potentiometer, brightness) {
this.keyInterceptManager.triggerKey('LIGHT_POTENTIOMETER_SET', false, potentiometer, brightness);
}
}

registerInstrument('systems-host', SystemsHost);
Loading

0 comments on commit f915aef

Please sign in to comment.