From 1e477114a8a029d9439bd164b18f5211bb91f0a7 Mon Sep 17 00:00:00 2001 From: Frank Kopp Date: Sat, 9 Nov 2024 12:37:46 +0100 Subject: [PATCH 01/16] docs: updating README.md with current repo structure (#9452) * Updating README.md with current repo structure * Updating localization docs * Updating repo structure --- docs/README.md | 179 ++++++++++++------ fbw-a32nx/src/localization/README.md | 39 ++-- fbw-a380x/src/localization/README.md | 27 ++- .../src/EFB/Localization/README.md | 32 ++-- 4 files changed, 174 insertions(+), 103 deletions(-) diff --git a/docs/README.md b/docs/README.md index b1a2667f84f..a62f3d4b12c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,68 +3,135 @@ ## Repo Structure ``` -aircraft (repo) -├── docs -├── fbw-a32nx -│ ├── docs -│ ├── out -│ └── src -│ ├── base -│ │ └── flybywire-aircraft-a320-neo -│ ├── behavior -│ ├── fonts -│ ├── model -│ ├── systems -│ │ ├── atsu -│ │ ├── failures -│ │ ├── fmgc -│ │ ├── instruments -│ │ ├── sentry-client -│ │ ├── shared -│ │ ├── simbridge-client -│ │ └── tcas -│ ├── textures -│ └── wasm -│ ├── fadec_a320 -│ ├── fbw_a320 -│ ├── flypad-backend -│ └── systems -│ ├── a320_systems -│ └── a320_systems_wasm -├── fbw-a380x -│ ├── docs -│ ├── out -│ └── src -│ ├── base -│ ├── systems -│ └── wasm -│ ├── fadec_a380 -│ ├── fbw_a380 -│ └── systems -│ ├── a380_systems -│ └── a380_systems_wasm -├── fbw-common -│ └── src -│ ├── jest -│ ├── typings -│ └── wasm -│ ├── fadec_common -│ ├── fbw_common -│ └── systems -│ ├── systems -│ └── systems_wasm -├── scripts -└── tools - ├── fdr2csv - └── heapdump -└── ... +├───.github +│ ├───ISSUE_TEMPLATE +│ └───workflows +| └───CHANGELOG.md +├───docs +├───fbw-a32nx +│ ├───docs +│ ├───out +│ └───src +│ ├───base +│ ├───behavior +│ ├───fonts +│ ├───localization +│ ├───model <3D model files and assets> +│ ├───systems +│ │ ├───atsu +│ │ ├───extras-host +│ │ ├───failures +│ │ ├───fmgc +│ │ ├───instruments +│ │ │ └───src +│ │ │ ├───ATC +│ │ │ ├───BAT +│ │ │ ├───Clock +│ │ │ ├───Common +│ │ │ ├───DCDU +│ │ │ ├───EFB +│ │ │ ├───EWD +│ │ │ ├───ISIS +│ │ │ ├───MsfsAvionicsCommon +│ │ │ ├───ND +│ │ │ ├───OANC +│ │ │ ├───PFD +│ │ │ ├───RMP +│ │ │ ├───RTPI +│ │ │ └───SD +│ │ ├───sentry-client +│ │ ├───shared +│ │ ├───simbridge-client +│ │ ├───systems-host +│ │ └───tcas +│ ├───textures +│ └───wasm +│ ├───extra-backend-a32nx +│ ├───fadec_a32nx +│ ├───fbw_a320 +│ └───systems +├───fbw-a380x +│ ├───docs +│ ├───out +│ └───src +│ ├───base +│ ├───fonts +│ ├───localization +│ ├───systems +│ │ ├───extras-host +│ │ ├───failures +│ │ ├───instruments +│ │ │ └───src +│ │ │ ├───ATCCOM +│ │ │ ├───BAT +│ │ │ ├───Clock +│ │ │ ├───Common +│ │ │ ├───EFB +│ │ │ ├───EWD +│ │ │ ├───FCU +│ │ │ ├───ISISlegacy +│ │ │ ├───MFD +│ │ │ ├───MsfsAvionicsCommon +│ │ │ ├───ND +│ │ │ ├───OIT +│ │ │ ├───PFD +│ │ │ ├───RMP +│ │ │ ├───RTPI +│ │ │ └───SD +│ │ ├───sentry-client +│ │ ├───shared +│ │ └───systems-host +│ └───wasm +│ ├───extra-backend-a380x +│ ├───fadec_a380x +│ ├───fbw_a380 +│ └───systems +├───fbw-common +│ ├───docs +│ ├───msfs-avionics-mirror +│ └───src +│ ├───jest +│ ├───systems +│ │ ├───datalink +│ │ ├───instruments +│ │ └───src +│ │ ├───BAT +│ │ ├───Clock +│ │ ├───EFB +│ ├───navdata +│ └───shared +│ ├───typings +│ └───wasm +│ ├───cpp-msfs-framework +│ ├───extra-backend +│ ├───fadec_common +│ ├───fbw_common +│ ├───systems +│ ├───terronnd +│ └───utils +├───fbw-ingamepanels-checklist-fix +│ ├───out +│ └───src +│ └───base +│ └───flybywire-ingamepanels-checklist-fix +├───large-files +│ ├───fbw-a380x +│ └───scripts +├───scripts +│ ├───cmake +│ └───dev-env +└───tools + ├───fdr2csv + └───heapdump ``` ## Branches -Pull request branches should reside on the developer's fork of the main repository. It is not necessary to push them to the main `flybywiresim/aircraft` repository as GitHub offers the ability for all maintainers to push to pull request branches even when they reside in another user's fork. +Pull request branches should reside on the developer's fork of the main repository. It is not necessary to push them to the main `flybywiresim/aircraft` repository as GitHub offers the ability for all +maintainers to push to pull request branches even when they reside in another user's fork. Branches to be retained on the main repository are: + - `master` - The source of truth and main development branch, - release branches (e.g. `v0.12`), - in special cases some long-running branches requiring collaboration (make a proposal in the #development channel on Discord). diff --git a/fbw-a32nx/src/localization/README.md b/fbw-a32nx/src/localization/README.md index 6b867b90f08..306c41c1068 100644 --- a/fbw-a32nx/src/localization/README.md +++ b/fbw-a32nx/src/localization/README.md @@ -6,28 +6,25 @@ TOC: - [Build Process](#build-process) - [Updating the Source File](#update-source-file) -OBS: - -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`. ## 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:** @@ -35,7 +32,7 @@ instead of `fbw-a32nx/src/localization/a32nx`. 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 @@ -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` @@ -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 @@ -85,11 +82,11 @@ Although an automatic update could be done we have chosen to manually make chang keys). ATTENTION:
-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) @@ -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) @@ -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`. diff --git a/fbw-a380x/src/localization/README.md b/fbw-a380x/src/localization/README.md index ba49458be15..3a9aab09578 100644 --- a/fbw-a380x/src/localization/README.md +++ b/fbw-a380x/src/localization/README.md @@ -6,17 +6,24 @@ TOC: - [Build Process](#build-process) - [Updating the Source File](#update-source-file) + +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`. + + ## Development Process - To add something to the localization files simply add the key to the source language files: - - 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 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:** @@ -24,7 +31,7 @@ TOC: 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 @@ -55,7 +62,7 @@ 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: -msfs locPak: +msfs locPak: `fbw-a380x/src/localization/msfs` and `out/flybywire-aircraft-a380-842/` ## Update Source File @@ -66,11 +73,11 @@ Although an automatic update could be done, we have chosen to manually make chan keys). ATTENTION:
-ANY CHANGES TO THE SOURCE FILES ON LOCALAZY WILL IMMEDIATELY BE VISIBLE IN EVER NEW BUILD OF -THE A32NX - INDEPENDENT OF EDITION. +ANY CHANGES TO THE SOURCE FILES ON LOCALAZY WILL 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) @@ -95,7 +102,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 - + #### MSFS locPak: - Make the necessary changes to the en.json (adding keys, removing key, changing default English strings) diff --git a/fbw-common/src/systems/instruments/src/EFB/Localization/README.md b/fbw-common/src/systems/instruments/src/EFB/Localization/README.md index 08ea5201f72..7e2f56007c5 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Localization/README.md +++ b/fbw-common/src/systems/instruments/src/EFB/Localization/README.md @@ -9,22 +9,22 @@ TOC: Aircraft locpak localization is still in the aircraft -(A32NX and eventually in the A380X) folder. -The folder is `fbw-a32nx/src/localization`. +(A32NX and A380X) folder. +The folder is `fbw-a32nx/src/localization` and `fbw-a380x/src/localization`. ## 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:** @@ -32,7 +32,7 @@ The folder is `fbw-a32nx/src/localization`. 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 @@ -59,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` @@ -68,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 @@ -82,11 +82,11 @@ Although an automatic update could be done we have chosen to manually make chang keys). ATTENTION:
-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) @@ -111,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) @@ -130,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`. From 6f4a456aacea9e682e72ef20607f223f64c2c040 Mon Sep 17 00:00:00 2001 From: Benjamin Dupont <4503241+Benjozork@users.noreply.github.com> Date: Sat, 9 Nov 2024 09:24:56 -0500 Subject: [PATCH 02/16] fix(a380x/fms): revisions on discontinuities (#9456) fix: revisions on discontinuities --- .../src/MFD/pages/FMS/F-PLN/FplnRevisionsMenu.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/FplnRevisionsMenu.tsx b/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/FplnRevisionsMenu.tsx index 66ea64694e8..7130bd043a4 100644 --- a/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/FplnRevisionsMenu.tsx +++ b/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/FplnRevisionsMenu.tsx @@ -24,7 +24,8 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType): return []; } - const revisedLeg = fpln.loadedFlightPlan?.legElementAt(legIndex); + const previousLeg = fpln.loadedFlightPlan?.maybeElementAt(legIndex - 1); + const revisedLeg = fpln.loadedFlightPlan?.elementAt(legIndex); return [ { @@ -34,6 +35,7 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType): legIndex >= (fpln.loadedFlightPlan?.firstMissedApproachLegIndex ?? Infinity) || planIndex === FlightPlanIndex.Temporary || [FplnRevisionsMenuType.Discontinuity || FplnRevisionsMenuType.TooSteepPath].includes(type) || + revisedLeg?.isDiscontinuity || !revisedLeg?.isXF(), onPressed: () => { const ppos = fpln.props.fmcService.master?.navigation.getPpos(); @@ -60,6 +62,7 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType): name: 'DELETE *', disabled: [FplnRevisionsMenuType.Runway || FplnRevisionsMenuType.TooSteepPath].includes(type) || + (revisedLeg?.isDiscontinuity && !previousLeg?.isDiscontinuity && previousLeg?.isVectors()) || planIndex === FlightPlanIndex.Temporary, onPressed: () => { fpln.props.fmcService.master?.flightPlanService.deleteElementAt(legIndex, false, planIndex, altnFlightPlan); @@ -87,7 +90,7 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType): name: 'HOLD', disabled: [FplnRevisionsMenuType.Discontinuity || FplnRevisionsMenuType.TooSteepPath].includes(type), onPressed: async () => { - if (revisedLeg && !revisedLeg.isHX()) { + if (revisedLeg && !revisedLeg.isDiscontinuity && !revisedLeg.isHX()) { const alt = revisedLeg.definition.altitude1 ? revisedLeg.definition.altitude1 : SimVar.GetSimVarValue('INDICATED ALTITUDE', 'feet'); @@ -97,7 +100,7 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType): let inboundMagneticCourse = 100; const prevTerm = previousLeg?.isDiscontinuity === false && previousLeg?.terminationWaypoint(); const wptTerm = revisedLeg.terminationWaypoint(); - if (previousLeg && previousLeg.isDiscontinuity === false && previousLeg.isXF() && prevTerm && wptTerm) { + if (previousLeg && !previousLeg.isDiscontinuity && previousLeg.isXF() && prevTerm && wptTerm) { inboundMagneticCourse = Avionics.Utils.computeGreatCircleHeading(prevTerm.location, wptTerm.location); } @@ -127,6 +130,7 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType): [ FplnRevisionsMenuType.Runway || FplnRevisionsMenuType.Discontinuity || FplnRevisionsMenuType.TooSteepPath, ].includes(type) || + revisedLeg?.isDiscontinuity || revisedLeg?.waypointDescriptor === WaypointDescriptor.Airport || revisedLeg?.waypointDescriptor === WaypointDescriptor.Runway, onPressed: () => { @@ -138,6 +142,7 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType): name: !altnFlightPlan && ![FplnRevisionsMenuType.Discontinuity || FplnRevisionsMenuType.TooSteepPath].includes(type) && + !revisedLeg?.isDiscontinuity && revisedLeg?.definition.overfly ? 'DELETE OVERFLY *' : 'OVERFLY *', @@ -192,6 +197,10 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType): name: '(N/A) WIND', disabled: true, onPressed: () => { + if (!revisedLeg || revisedLeg.isDiscontinuity) { + return; + } + // Find out whether waypoint is CLB, CRZ or DES waypoint and direct to appropriate WIND sub-page if (revisedLeg?.segment?.class === SegmentClass.Arrival) { fpln.props.mfd.uiService.navigateTo(`fms/${fpln.props.mfd.uiService.activeUri.get().category}/wind/des`); From 77ac2c4827e64ef478f5527ea5b0ae20f08825ed Mon Sep 17 00:00:00 2001 From: Florian Scheuner Date: Sat, 9 Nov 2024 16:43:24 +0200 Subject: [PATCH 03/16] ci: fix rename standalone part 001 (#9463) --- .github/workflows/master.yml | 2 +- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index c971503bdd7..7ae421418db 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -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: | diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 07a332e93d3..5cbcc6bd6fc 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -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: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c60f28bf114..e7af081e0b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 From 065b3f3d84fdced1abd31a39a0522572b9846a66 Mon Sep 17 00:00:00 2001 From: 2hwk <15316958+2hwk@users.noreply.github.com> Date: Sat, 9 Nov 2024 23:44:30 +0800 Subject: [PATCH 04/16] feat(a380x/efb): Added cabin lighting controls to EFB (#9093) * feat: cabin lighting efb v1 * feat: cabin auto brightness based on flight phase * refactor: a32nx light sync * refactor: remove from systems-host * feat: moved cabin potentiometer to 8, added localisation strings (local) and updated values for latest model * fix: traffic efis filter state at spawn * fix: adjusted pot and circuits * fix: ensure circuit is on * fix: cabin light bugs and refinement * chore: added changelog.md --- .github/CHANGELOG.md | 2 + fbw-a32nx/src/systems/extras-host/index.ts | 10 +- .../modules/light_sync/LightSync.ts | 79 ++++++++ .../src/systems/instruments/src/EFB/index.tsx | 1 + fbw-a32nx/src/systems/systems-host/index.ts | 59 +----- .../AirPlanes/FlyByWire_A380_842/Climb.flt | 3 + .../AirPlanes/FlyByWire_A380_842/approach.FLT | 3 + .../AirPlanes/FlyByWire_A380_842/apron.FLT | 1 + .../AirPlanes/FlyByWire_A380_842/cruise.FLT | 3 + .../AirPlanes/FlyByWire_A380_842/final.FLT | 3 + .../AirPlanes/FlyByWire_A380_842/hangar.flt | 1 + .../AirPlanes/FlyByWire_A380_842/runway.FLT | 3 + .../AirPlanes/FlyByWire_A380_842/systems.cfg | 54 +++--- .../AirPlanes/FlyByWire_A380_842/taxi.flt | 2 + fbw-a380x/src/systems/extras-host/index.ts | 10 +- .../modules/light_sync/LightSync.ts | 170 ++++++++++++++++++ .../src/systems/instruments/src/EFB/index.tsx | 1 + fbw-a380x/src/systems/systems-host/index.ts | 63 ------- .../instruments/src/EFB/AircraftContext.ts | 2 + .../src/EFB/Localization/data/en.json | 4 + .../src/EFB/Settings/Pages/SimOptionsPage.tsx | 48 ++++- .../instruments/src/EFB/Settings/sync.ts | 7 + .../src/EFB/StatusBar/QuickControls.tsx | 58 +++++- large-files | 2 +- 24 files changed, 436 insertions(+), 153 deletions(-) create mode 100644 fbw-a32nx/src/systems/extras-host/modules/light_sync/LightSync.ts create mode 100644 fbw-a380x/src/systems/extras-host/modules/light_sync/LightSync.ts diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 39297a1a57e..ef9c008a6b2 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -24,11 +24,13 @@ 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. [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. [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) ## 0.12.0 diff --git a/fbw-a32nx/src/systems/extras-host/index.ts b/fbw-a32nx/src/systems/extras-host/index.ts index 36eb5d3083e..9c71c65ac65 100644 --- a/fbw-a32nx/src/systems/extras-host/index.ts +++ b/fbw-a32nx/src/systems/extras-host/index.ts @@ -6,7 +6,7 @@ // 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'; @@ -14,6 +14,7 @@ import { FlightPlanAsoboSync } from 'extras-host/modules/flightplan_sync/FlightP 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. @@ -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; @@ -68,6 +72,8 @@ class ExtrasHost extends BaseInstrument { public readonly xmlConfig: Document; + private readonly lightSync: LightSync = new LightSync(this.bus); + /** * "mainmenu" = 0 * "loading" = 1 @@ -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'); } diff --git a/fbw-a32nx/src/systems/extras-host/modules/light_sync/LightSync.ts b/fbw-a32nx/src/systems/extras-host/modules/light_sync/LightSync.ts new file mode 100644 index 00000000000..c39a285905d --- /dev/null +++ b/fbw-a32nx/src/systems/extras-host/modules/light_sync/LightSync.ts @@ -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'))); + } +} diff --git a/fbw-a32nx/src/systems/instruments/src/EFB/index.tsx b/fbw-a32nx/src/systems/instruments/src/EFB/index.tsx index 053687abb46..3df1ba7cfb5 100644 --- a/fbw-a32nx/src/systems/instruments/src/EFB/index.tsx +++ b/fbw-a32nx/src/systems/instruments/src/EFB/index.tsx @@ -58,6 +58,7 @@ render( pilotSeat: false, registrationDecal: true, wheelChocks: true, + cabinLighting: false, }, throttle: { numberOfAircraftThrottles: 2, diff --git a/fbw-a32nx/src/systems/systems-host/index.ts b/fbw-a32nx/src/systems/systems-host/index.ts index 180553e2f85..38afa459c5c 100644 --- a/fbw-a32nx/src/systems/systems-host/index.ts +++ b/fbw-a32nx/src/systems/systems-host/index.ts @@ -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'; @@ -15,8 +15,6 @@ class SystemsHost extends BaseInstrument { private readonly atsu: AtsuSystem; - private keyInterceptManager: KeyEventManager; - /** * "mainmenu" = 0 * "loading" = 1 @@ -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 { @@ -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); diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/Climb.flt b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/Climb.flt index 805bc2f08e0..d4088ecc560 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/Climb.flt +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/Climb.flt @@ -257,6 +257,8 @@ A32NX_EFIS_R_NAVAID_2_MODE=2 A32NX_EFIS_R_ND_MODE=3 A32NX_EFIS_R_ND_RANGE=2 A32NX_EFIS_R_OANS_RANGE=4 +A380X_EFIS_L_TRAF_BUTTON_IS_ON=1 +A380X_EFIS_R_TRAF_BUTTON_IS_ON=1 A32NX_FAC_1_PUSHBUTTON_PRESSED=1 A32NX_FAC_2_PUSHBUTTON_PRESSED=1 A32NX_GEAR_LEVER_POSITION_REQUEST = 0 @@ -384,6 +386,7 @@ Potentiometer.18=0.5 Potentiometer.19=0.5 Potentiometer.20=0.5 Potentiometer.21=0.5 +Potentiometer.60=0 Potentiometer.76=0 Potentiometer.80=0.5 Potentiometer.81=0.5 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/approach.FLT b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/approach.FLT index c759a264063..9116d6cfd33 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/approach.FLT +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/approach.FLT @@ -273,6 +273,8 @@ A32NX_EFIS_R_NAVAID_1_MODE=2 A32NX_EFIS_R_NAVAID_2_MODE=2 A32NX_EFIS_R_ND_MODE=3 A32NX_EFIS_R_ND_RANGE=1 +A380X_EFIS_L_TRAF_BUTTON_IS_ON=1 +A380X_EFIS_R_TRAF_BUTTON_IS_ON=1 A32NX_ELEC_IDG1LOCK_TOGGLE=0 A32NX_ELEC_IDG2LOCK_TOGGLE=0 A32NX_ELEC_IDG3LOCK_TOGGLE=0 @@ -462,6 +464,7 @@ Potentiometer.8=0 Potentiometer.9=0 Potentiometer.10=0 Potentiometer.11=0 +Potentiometer.60=0 Potentiometer.76=0 Potentiometer.80=0.5 Potentiometer.81=0.5 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/apron.FLT b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/apron.FLT index be345a5f440..90b2bbcdc89 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/apron.FLT +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/apron.FLT @@ -456,6 +456,7 @@ Potentiometer.8=0 Potentiometer.9=0 Potentiometer.10=0 Potentiometer.11=0 +Potentiometer.60=0 Potentiometer.76=0 Potentiometer.80=0.5 Potentiometer.81=0.5 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/cruise.FLT b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/cruise.FLT index 5ad1e18a20f..4dd57bcbfbd 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/cruise.FLT +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/cruise.FLT @@ -287,6 +287,8 @@ A32NX_EFIS_R_NAVAID_2_MODE=2 A32NX_EFIS_R_ND_MODE=3 A32NX_EFIS_R_ND_RANGE=5 A32NX_EFIS_R_OANS_RANGE=4 +A380X_EFIS_L_TRAF_BUTTON_IS_ON=1 +A380X_EFIS_R_TRAF_BUTTON_IS_ON=1 A32NX_ELEC_IDG1LOCK_TOGGLE=0 A32NX_ELEC_IDG2LOCK_TOGGLE=0 A32NX_ELEC_IDG3LOCK_TOGGLE=0 @@ -497,6 +499,7 @@ Potentiometer.8=0 Potentiometer.9=0 Potentiometer.10=0 Potentiometer.11=0 +Potentiometer.60=0 Potentiometer.76=0 Potentiometer.80=0.5 Potentiometer.81=0.5 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/final.FLT b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/final.FLT index c098c599026..16356f66811 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/final.FLT +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/final.FLT @@ -286,6 +286,8 @@ A32NX_EFIS_R_NAVAID_2_MODE=2 A32NX_EFIS_R_ND_MODE=3 A32NX_EFIS_R_ND_RANGE=1 A32NX_EFIS_R_OANS_RANGE=4 +A380X_EFIS_L_TRAF_BUTTON_IS_ON=1 +A380X_EFIS_R_TRAF_BUTTON_IS_ON=1 A32NX_ELEC_IDG1LOCK_TOGGLE=0 A32NX_ELEC_IDG2LOCK_TOGGLE=0 A32NX_ELEC_IDG3LOCK_TOGGLE=0 @@ -497,6 +499,7 @@ Potentiometer.8=0 Potentiometer.9=0 Potentiometer.10=0 Potentiometer.11=0 +Potentiometer.60=0 Potentiometer.76=0 Potentiometer.80=0.5 Potentiometer.81=0.5 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/hangar.flt b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/hangar.flt index aac13d475bc..c71e1659bff 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/hangar.flt +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/hangar.flt @@ -423,6 +423,7 @@ Potentiometer.8=0 Potentiometer.9=0 Potentiometer.10=0 Potentiometer.11=0 +Potentiometer.60=0 Potentiometer.76=0 Potentiometer.80=0.5 Potentiometer.81=0.5 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/runway.FLT b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/runway.FLT index 3c4f455a25f..3ed8bf06a99 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/runway.FLT +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/runway.FLT @@ -286,11 +286,13 @@ A32NX_EFIS_L_NAVAID_2_MODE=2 A32NX_EFIS_L_ND_MODE=3 A32NX_EFIS_L_ND_RANGE=1 A32NX_EFIS_L_OANS_RANGE=4 +A380X_EFIS_L_TRAF_BUTTON_IS_ON=1 A32NX_EFIS_R_NAVAID_1_MODE=2 A32NX_EFIS_R_NAVAID_2_MODE=2 A32NX_EFIS_R_ND_MODE=3 A32NX_EFIS_R_ND_RANGE=1 A32NX_EFIS_R_OANS_RANGE=4 +A380X_EFIS_R_TRAF_BUTTON_IS_ON=1 A32NX_ELEC_IDG1LOCK_TOGGLE=0 A32NX_ELEC_IDG2LOCK_TOGGLE=0 A32NX_ELEC_IDG3LOCK_TOGGLE=0 @@ -519,6 +521,7 @@ Potentiometer.8=0 Potentiometer.9=0 Potentiometer.10=0 Potentiometer.11=0 +Potentiometer.60=0 Potentiometer.76=0 Potentiometer.80=0.5 Potentiometer.81=0.5 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/systems.cfg b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/systems.cfg index 7f80d100627..7dec817d36d 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/systems.cfg +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/systems.cfg @@ -258,32 +258,32 @@ lightdef.226 = Type:4#Index:5#LocalPosition:35,0.96,9#LocalRotation:110,90,0#Eff lightdef.227 = Type:4#Index:5#LocalPosition:34.488,-1.16,9.04#LocalRotation:110,90,0#EffectFile:LIGHT_A380X_CockpitSpotNarrow#PotentiometerIndex:96#Node:LIGHT_OVHD_READINGLTR ; FO READING LT ; CABIN LIGHTS LH -lightdef.230=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT1_LH -lightdef.231=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:120.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT2_LH -lightdef.232=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT3_LH -lightdef.234=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:190.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT5_LH -lightdef.235=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT6_LH -lightdef.236=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT7_LH -lightdef.237=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:120.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT2_LH -lightdef.238=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT3_LH -lightdef.239=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT4_LH -lightdef.240=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT6_LH -lightdef.241=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT7_LH -lightdef.242=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT8_LH +lightdef.230=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT1_LH +lightdef.231=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:120.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT2_LH +lightdef.232=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT3_LH +lightdef.234=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:190.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT5_LH +lightdef.235=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT6_LH +lightdef.236=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT7_LH +lightdef.237=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:120.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT2_LH +lightdef.238=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT3_LH +lightdef.239=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT4_LH +lightdef.240=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT6_LH +lightdef.241=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT7_LH +lightdef.242=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT8_LH ; CABIN LIGHTS RH -lightdef.243=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT1_RH -lightdef.244=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:120.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT2_RH -lightdef.245=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT3_RH -lightdef.246=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:190.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT5_RH -lightdef.247=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT6_RH -lightdef.248=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT7_RH -lightdef.249=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:120.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT2_RH -lightdef.250=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT3_RH -lightdef.251=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT4_RH -lightdef.252=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT6_RH -lightdef.253=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT7_RH -lightdef.254=Type:10#Index:1#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:7#Node:A380X_CABIN_LIGHT8_RH +lightdef.243=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT1_RH +lightdef.244=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:120.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT2_RH +lightdef.245=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT3_RH +lightdef.246=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:190.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT5_RH +lightdef.247=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT6_RH +lightdef.248=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,0.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT7_RH +lightdef.249=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:120.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT2_RH +lightdef.250=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT3_RH +lightdef.251=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:180.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT4_RH +lightdef.252=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT6_RH +lightdef.253=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT7_RH +lightdef.254=Type:10#Index:3#LocalPosition:0.000,0.000,0.000#LocalRotation:230.000,0.000,180.000#EffectFile:LIGHT_A380X_Cabin_light#PotentiometerIndex:60#Node:A380X_CABIN_LIGHT8_RH ; PEDESTAL LIGHT lightdef.291=Type:11#Index:1#LocalPosition:38.970001,-2.600000,5.870000#LocalRotation:-110.000000,0.000000,0.000000#EffectFile:LIGHT_A380X_Pedestal#PotentiometerIndex:76#Node:LIGHT_OVHD_TOPEDESTAL @@ -403,7 +403,6 @@ circuit.33 = Type:CIRCUIT_LIGHT_CABIN:2#Connections:bus.10#Power:30, 40, 20.0#Na ; Pedestal flood light: DC 1 circuit.34 = Type:CIRCUIT_LIGHT_PEDESTAL:1#Connections:bus.8#Power:3, 5, 20.0#Name:Pedestal_Light ; pedestal light 5W - circuit.35 = Type:CIRCUIT_NAV:1#Connections:bus.1#Power:4, 5, 20.0#Name:NAV1 ; NAV 1 5W circuit.36 = Type:CIRCUIT_COM:1#Connections:bus.10#Power:4, 5, 20.0#Name:COM1 ; COM 1 5W circuit.37 = Type:CIRCUIT_NAV:2#Connections:bus.1#Power:4, 5, 20.0#Name:NAV2 ; NAV 2 5W @@ -537,6 +536,11 @@ circuit.142 = Type:CIRCUIT_AVIONICS#Connections:bus.10#Power:0.5,1,20.0#Name:Avi circuit.143 = Type:CIRCUIT_XML:18#Connections:bus.9#Power:3, 5, 20.0#Name:WipersRIght ; Wipers 5W circuit.144 = Type:CIRCUIT_FUEL_VALVE:59#Connections:bus.1#Power:3, 5, 20.0#Name:Trim_Line_Iso_Valve_Aft_2 ; Fuel Valves 5W ; new circuit.145 = Type:CIRCUIT_FUEL_VALVE:60#Connections:bus.1#Power:3, 5, 20.0#Name:Trim_Inlet_Valve 2; Fuel Valves 5W ; new + +; Cabin Lights : DC 1 +circuit.146 = Type:CIRCUIT_LIGHT_CABIN:3#Connections:bus.8#Power:30, 40, 20.0#Name:Cabin_Lights_Upper_Main_Deck ; Cabin light 40W + + ; Below circuits are not being used. Would need to be re-indexed ;; Standby Instrument ISIS (panel.xml) ;circuit.125 = Type:CIRCUIT_SAI:1#Connections:bus.1#Power:25, 30, 20.0#Name:SAI_1 ; Standby Indicator diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/taxi.flt b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/taxi.flt index 5d464491ba0..09d5a59943c 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/taxi.flt +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/taxi.flt @@ -281,6 +281,8 @@ A32NX_EFIS_L_ND_RANGE=1 A32NX_EFIS_L_OANS_RANGE=4 A32NX_EFIS_R_NAVAID_1_MODE=2 A32NX_EFIS_R_NAVAID_2_MODE=2 +A380X_EFIS_L_TRAF_BUTTON_IS_ON=1 +A380X_EFIS_R_TRAF_BUTTON_IS_ON=1 A32NX_EFIS_R_ND_MODE=3 A32NX_EFIS_R_ND_RANGE=1 A32NX_EFIS_R_OANS_RANGE=4 diff --git a/fbw-a380x/src/systems/extras-host/index.ts b/fbw-a380x/src/systems/extras-host/index.ts index 2770141d6d2..17fedf9e0ef 100644 --- a/fbw-a380x/src/systems/extras-host/index.ts +++ b/fbw-a380x/src/systems/extras-host/index.ts @@ -1,13 +1,14 @@ // 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 { KeyInterceptor } from './modules/key_interceptor/KeyInterceptor'; import { VersionCheck } from './modules/version_check/VersionCheck'; import { AircraftSync } from 'extras-host/modules/aircraft_sync/AircraftSync'; +import { LightSync } from 'extras-host/modules/light_sync/LightSync'; import { TelexCheck } from 'extras-host/modules/telex_check/TelexCheck'; /** @@ -41,8 +42,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; @@ -61,6 +65,8 @@ class ExtrasHost extends BaseInstrument { private readonly telexCheck = new TelexCheck(); + private readonly lightSync: LightSync = new LightSync(this.bus); + /** * "mainmenu" = 0 * "loading" = 1 @@ -82,7 +88,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('A380X_EXTRASHOST: Created'); } diff --git a/fbw-a380x/src/systems/extras-host/modules/light_sync/LightSync.ts b/fbw-a380x/src/systems/extras-host/modules/light_sync/LightSync.ts new file mode 100644 index 00000000000..4b5b3e4fc78 --- /dev/null +++ b/fbw-a380x/src/systems/extras-host/modules/light_sync/LightSync.ts @@ -0,0 +1,170 @@ +/* eslint-disable no-case-declarations */ +// Copyright (c) 2024 FlyByWire Simulations +// SPDX-License-Identifier: GPL-3.0 + +import { ClockEvents, EventBus, GameStateProvider, Instrument, KeyEventManager, Wait } from '@microsoft/msfs-sdk'; +import { FmgcFlightPhase } from '@shared/flightphase'; + +enum TimeOfDayState { + Day = 1, + DuskDawn = 2, + Night = 3, +} + +enum FwcFlightPhase { + ElecPwr = 1, + FirstEngineStarted = 2, + SecondEngineTakeOffPower = 3, + AtOrAboveEightyKnots = 4, + AtOrAboveV1 = 5, + LiftOff = 6, + AtOrAbove400Feet = 7, + AtOrAbove1500FeetTo800Feet = 8, + AtOrBelow800Feet = 9, + TouchDown = 10, + AtOrBelowEightyKnots = 11, + EnginesShutdown = 12, +} +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(); + this.bus + .getSubscriber() + .on('realTime') + .onlyAfter(1500) + .handle((_now) => { + this.updateLighting(); + }); + }); + } + + public initLighting(): void { + console.log('[LightSync] initializing lighting to defaults'); + + const msfsCabinCircuitVar = SimVar.GetSimVarValue('A:CIRCUIT SWITCH ON:146', 'bool'); + if (!msfsCabinCircuitVar) { + SimVar.SetSimVarValue('K:ELECTRICAL_CIRCUIT_TOGGLE', 'number', 146); + } + + const autoBrightness = this.getAutoBrightness(); + + // OVHD Reading Lights + this.setPotentiometer(96, 0); // Capt + this.setPotentiometer(97, 0); // F/O + + // Glareshield + this.setPotentiometer(84, autoBrightness < 50 ? 1.5 * autoBrightness : 0); // Int Lt + this.setPotentiometer(87, autoBrightness); // Lcd Brt + this.setPotentiometer(10, 0); // table Cpt + this.setPotentiometer(11, 0); // table F/O + + // Instruments Cpt + this.setPotentiometer(88, autoBrightness); // PFD + this.setPotentiometer(89, autoBrightness); // ND + this.setPotentiometer(94, autoBrightness / 2); // wxRadar + this.setPotentiometer(98, autoBrightness); // MFD + this.setPotentiometer(8, autoBrightness < 50 ? 20 : 0); // console light + + // Instruments F/O + this.setPotentiometer(90, autoBrightness); // PFD + this.setPotentiometer(91, autoBrightness); // ND + this.setPotentiometer(95, autoBrightness / 2); // wxRadar + this.setPotentiometer(99, autoBrightness); // MFD + this.setPotentiometer(9, autoBrightness < 50 ? 20 : 0); // console light + + // Pedestal + this.setPotentiometer(80, autoBrightness); // rmpCptLightLevel + this.setPotentiometer(81, autoBrightness); // rmpFoLightLevel + this.setPotentiometer(82, autoBrightness); // rmpOvhdLightLevel + this.setPotentiometer(92, autoBrightness); // ecamUpperLightLevel + this.setPotentiometer(93, autoBrightness); // ecamLowerLightLevel + this.setPotentiometer(76, autoBrightness); // pedFloodLightLevel + this.setPotentiometer(83, autoBrightness); // mainPnlFloodLightLevel + this.setPotentiometer(85, autoBrightness); // integralLightLevel + this.setPotentiometer(7, autoBrightness); // ambianceLightLevel + } + + public onUpdate(): void {} + + public updateLighting(): void { + // Follow EFB Setting for Cabin Auto Brightness + if (SimVar.GetSimVarValue('L:A32NX_CABIN_USING_AUTOBRIGHTNESS', 'bool')) { + const timeOfDay = SimVar.GetSimVarValue('E:TIME OF DAY', 'Enum'); + const fmgcFlightPhase = SimVar.GetSimVarValue('L:A32NX_FMGC_FLIGHT_PHASE', 'Enum'); + + switch (timeOfDay) { + case TimeOfDayState.Day: + this.setPotentiometer(60, 0); + SimVar.SetSimVarValue('L:A32NX_CABIN_AUTOBRIGHTNESS', 'number', 0); + break; + case TimeOfDayState.DuskDawn: + case TimeOfDayState.Night: + switch (fmgcFlightPhase) { + case FmgcFlightPhase.Preflight: + this.setPotentiometer( + 60, + SimVar.GetSimVarValue('L:A32NX_FWC_FLIGHT_PHASE', 'Enum') >= FwcFlightPhase.FirstEngineStarted || + SimVar.GetSimVarValue('A:ON ANY RUNWAY', 'bool') + ? 1 + : 85, + true, + ); + break; + case FmgcFlightPhase.Takeoff: + case FmgcFlightPhase.Approach: + case FmgcFlightPhase.GoAround: + this.setPotentiometer(60, 1, true); + break; + case FmgcFlightPhase.Climb: + case FmgcFlightPhase.Cruise: + this.setPotentiometer(60, 0, true); + break; + case FmgcFlightPhase.Descent: + this.setPotentiometer( + 60, + Math.round(SimVar.GetSimVarValue('A:PLANE ALTITUDE', 'feet') / 100) * 100 >= + SimVar.GetSimVarValue('L:A32NX_AIRLINER_CRUISE_ALTITUDE', 'number') - 5000 + ? 5 + : 0, + true, + ); + break; + case FmgcFlightPhase.Done: + this.setPotentiometer(60, 85, true); + break; + } + break; + } + } else { + const manualBrightness = SimVar.GetSimVarValue('L:A32NX_CABIN_MANUAL_BRIGHTNESS', 'number'); + this.setPotentiometer(60, manualBrightness, false); + } + } + + private setPotentiometer(potentiometer: number, brightness: number, autoBrightness: boolean = false) { + if (this.keyInterceptManager) { + this.keyInterceptManager.triggerKey('LIGHT_POTENTIOMETER_SET', false, potentiometer, brightness); + } + if (autoBrightness) { + SimVar.SetSimVarValue('L:A32NX_CABIN_AUTOBRIGHTNESS', 'number', 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'))); + } +} diff --git a/fbw-a380x/src/systems/instruments/src/EFB/index.tsx b/fbw-a380x/src/systems/instruments/src/EFB/index.tsx index 8b325b8fca1..b02e5666197 100644 --- a/fbw-a380x/src/systems/instruments/src/EFB/index.tsx +++ b/fbw-a380x/src/systems/instruments/src/EFB/index.tsx @@ -55,6 +55,7 @@ render( pilotSeat: true, registrationDecal: false, // TODO FIXME: Enable when dynamic registration decal is completed wheelChocks: false, + cabinLighting: true, }, throttle: { numberOfAircraftThrottles: 4, diff --git a/fbw-a380x/src/systems/systems-host/index.ts b/fbw-a380x/src/systems/systems-host/index.ts index 807dee04163..b5f4449b409 100644 --- a/fbw-a380x/src/systems/systems-host/index.ts +++ b/fbw-a380x/src/systems/systems-host/index.ts @@ -5,9 +5,6 @@ import { EventBus, HEventPublisher, - KeyEventManager, - Wait, - GameStateProvider, InstrumentBackplane, Clock, ClockEvents, @@ -53,8 +50,6 @@ class SystemsHost extends BaseInstrument { private soundManager: LegacySoundManager; - private keyEventManager: KeyEventManager; - private readonly acEssBusPowered = ConsumerSubject.create(this.sub.on('acBusEss'), false); private readonly acBus2Powered = ConsumerSubject.create(this.sub.on('acBus2'), false); private readonly dcEssBusPowered = ConsumerSubject.create(this.sub.on('dcBusEss'), false); @@ -147,14 +142,6 @@ class SystemsHost extends BaseInstrument { this.gpws.update(dt); this.fwsCore.update(dt); }); - - Promise.all([ - KeyEventManager.getManager(this.bus), - Wait.awaitSubscribable(GameStateProvider.get(), (state) => state === GameState.ingame, true), - ]).then(([keyEventManager]) => { - this.keyEventManager = keyEventManager; - this.initLighting(); - }); } get templateID(): string { @@ -199,56 +186,6 @@ class SystemsHost extends BaseInstrument { this.backplane.onUpdate(); } - - // TODO this should be in extras host, it's not an aircraft system, but a sim thing - private initLighting() { - console.log('[systems-host] initializing lighting to defaults'); - - /** automatic brightness based on ambient light, [0, 1] scale */ - const autoBrightness = Math.max( - 15, - Math.min(85, SimVar.GetSimVarValue('GLASSCOCKPIT AUTOMATIC BRIGHTNESS', 'percent')), - ); - - // OVHD Reading Lights - this.setPotentiometer(96, 0); // Capt - this.setPotentiometer(97, 0); // F/O - - // Glareshield - this.setPotentiometer(84, autoBrightness < 50 ? 1.5 * autoBrightness : 0); // Int Lt - this.setPotentiometer(87, autoBrightness); // Lcd Brt - this.setPotentiometer(10, 0); // table Cpt - this.setPotentiometer(11, 0); // table F/O - - // Instruments Cpt - this.setPotentiometer(88, autoBrightness); // PFD - this.setPotentiometer(89, autoBrightness); // ND - this.setPotentiometer(94, autoBrightness / 2); // wxRadar - this.setPotentiometer(98, autoBrightness); // MFD - this.setPotentiometer(8, autoBrightness < 50 ? 20 : 0); // console light - - // Instruments F/O - this.setPotentiometer(90, autoBrightness); // PFD - this.setPotentiometer(91, autoBrightness); // ND - this.setPotentiometer(95, autoBrightness / 2); // wxRadar - this.setPotentiometer(99, autoBrightness); // MFD - this.setPotentiometer(9, autoBrightness < 50 ? 20 : 0); // console light - - // Pedestal - this.setPotentiometer(80, autoBrightness); // rmpCptLightLevel - this.setPotentiometer(81, autoBrightness); // rmpFoLightLevel - this.setPotentiometer(82, autoBrightness); // rmpOvhdLightLevel - this.setPotentiometer(92, autoBrightness); // ecamUpperLightLevel - this.setPotentiometer(93, autoBrightness); // ecamLowerLightLevel - this.setPotentiometer(76, autoBrightness); // pedFloodLightLevel - this.setPotentiometer(83, autoBrightness); // mainPnlFloodLightLevel - this.setPotentiometer(85, autoBrightness); // integralLightLevel - this.setPotentiometer(7, autoBrightness); // ambientLightLevel - } - - private setPotentiometer(potentiometer: number, brightness: number) { - this.keyEventManager.triggerKey('LIGHT_POTENTIOMETER_SET', false, potentiometer, brightness); - } } registerInstrument('systems-host', SystemsHost); diff --git a/fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts b/fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts index 4551e76420b..4e5fa1b2e99 100644 --- a/fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts +++ b/fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts @@ -51,6 +51,7 @@ interface SimOptions { pilotSeat: boolean; registrationDecal: boolean; wheelChocks: boolean; + cabinLighting: boolean; } interface ThrottleOptions { @@ -100,6 +101,7 @@ export const AircraftContext = createContext({ pilotSeat: false, registrationDecal: false, wheelChocks: false, + cabinLighting: false, }, throttle: { numberOfAircraftThrottles: 0, diff --git a/fbw-common/src/systems/instruments/src/EFB/Localization/data/en.json b/fbw-common/src/systems/instruments/src/EFB/Localization/data/en.json index 69293554b20..dc4e3590348 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Localization/data/en.json +++ b/fbw-common/src/systems/instruments/src/EFB/Localization/data/en.json @@ -554,7 +554,9 @@ "TT": { "AlignAdirs": "Instantly align ADIRS", "AutoBrightness": "Turn Auto Brightness On/Off", + "CabinAutoBrightness": "Turn Auto Cabin Lighting On/Off", "Brightness": "Set flyPad brightness", + "CabinLighting": "Set Cabin Lighting", "FinishBoarding": "Instantly finish boarding", "OnScreenKeyboard": "Turn OnScreen Keyboard On/Off", "PowerButton": "Power Off", @@ -647,6 +649,8 @@ "Active": "Active", "Auto": "Auto", "Both": "Synchronized", + "CabinAutoBrightness": "Auto Cabin Lighting", + "CabinManualBrightness": "Cabin Lighting Brightness", "Calibrate": "Calibrate", "ConesEnabled": "Safety Cones", "DefaultBarometerUnit": "Default Barometer Unit", diff --git a/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/SimOptionsPage.tsx b/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/SimOptionsPage.tsx index f628efe00b6..60c27bb96d0 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/SimOptionsPage.tsx +++ b/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/SimOptionsPage.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: GPL-3.0 /* eslint-disable max-len */ -/* eslint-disable max-len */ -import React, { useContext, useState } from 'react'; +import React, { useContext, useRef, useState } from 'react'; +import Slider from 'rc-slider'; import { DefaultPilotSeatConfig, PilotSeatConfig, @@ -15,7 +15,7 @@ import { import { toast } from 'react-toastify'; import { t } from '../../Localization/translation'; import { Toggle } from '../../UtilComponents/Form/Toggle'; -import { ButtonType, SettingItem, SettingsPage } from '../Settings'; +import { ButtonType, SettingGroup, SettingItem, SettingsPage } from '../Settings'; import { SelectGroup, SelectItem } from '../../UtilComponents/Form/Select'; import { SimpleInput } from '../../UtilComponents/Form/SimpleInput/SimpleInput'; @@ -40,6 +40,11 @@ export const SimOptionsPage = () => { const [, setFdrEnabledSimVar] = useSimVar('L:A32NX_FDR_ENABLED', 'number', 1); const [wheelChocksEnabled, setWheelChocksEnabled] = usePersistentNumberProperty('MODEL_WHEELCHOCKS_ENABLED', 1); const [conesEnabled, setConesEnabled] = usePersistentNumberProperty('MODEL_CONES_ENABLED', 1); + const [usingCabinAutobrightness, setUsingCabinAutobrightness] = usePersistentNumberProperty( + 'CABIN_USING_AUTOBRIGHTNESS', + 1, + ); + const [cabinManualBrightness, setCabinManualBrightness] = usePersistentNumberProperty('CABIN_MANUAL_BRIGHTNESS', 0); const [pilotSeat, setPilotSeat] = usePersistentProperty('CONFIG_PILOT_SEAT', DefaultPilotSeatConfig); const defaultBaroButtons: ButtonType[] = [ @@ -60,6 +65,8 @@ export const SimOptionsPage = () => { { name: t('Settings.SimOptions.Right'), setting: PilotSeatConfig.Right }, ]; + const cabinBrightnessSliderRef = useRef(null); + return ( <> {!showThrottleSettings && ( @@ -239,6 +246,41 @@ export const SimOptionsPage = () => { )} + + {aircraftContext.settingsPages.sim.cabinLighting && ( + + + { + setUsingCabinAutobrightness(value ? 1 : 0); + }} + /> + + + {!usingCabinAutobrightness && ( + +
+ setCabinManualBrightness(value)} + onAfterChange={() => cabinBrightnessSliderRef.current.blur()} + /> + setCabinManualBrightness(Number.parseInt(value))} + number + /> +
+
+ )} +
+ )} )} setShowThrottleSettings(false)} /> diff --git a/fbw-common/src/systems/instruments/src/EFB/Settings/sync.ts b/fbw-common/src/systems/instruments/src/EFB/Settings/sync.ts index 9f87f0728b9..491a2281960 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Settings/sync.ts +++ b/fbw-common/src/systems/instruments/src/EFB/Settings/sync.ts @@ -39,6 +39,13 @@ export const globalSyncedSettings: SyncedSettingDefinition[] = [ localVarUnit: 'bool', defaultValue: '0', }, + { configKey: 'CABIN_MANUAL_BRIGHTNESS', localVarName: 'L:A32NX_CABIN_MANUAL_BRIGHTNESS', defaultValue: '0' }, + { + configKey: 'CABIN_USING_AUTOBRIGHTNESS', + localVarName: 'L:A32NX_CABIN_USING_AUTOBRIGHTNESS', + localVarUnit: 'bool', + defaultValue: '1', + }, { configKey: 'ISIS_BARO_UNIT_INHG', localVarName: 'L:A32NX_ISIS_BARO_UNIT_INHG', diff --git a/fbw-common/src/systems/instruments/src/EFB/StatusBar/QuickControls.tsx b/fbw-common/src/systems/instruments/src/EFB/StatusBar/QuickControls.tsx index 6329a472a77..b06e7c3d0a3 100644 --- a/fbw-common/src/systems/instruments/src/EFB/StatusBar/QuickControls.tsx +++ b/fbw-common/src/systems/instruments/src/EFB/StatusBar/QuickControls.tsx @@ -11,6 +11,7 @@ import { Compass, Gear, Keyboard, + LightbulbFill, MoonFill, PersonCheck, Power, @@ -176,6 +177,12 @@ export const QuickControlsPane = ({ const [brightnessSetting, setBrightnessSetting] = usePersistentNumberProperty('EFB_BRIGHTNESS', 0); const [brightness] = useSimVar('L:A32NX_EFB_BRIGHTNESS', 'number', 500); const [usingAutobrightness, setUsingAutobrightness] = usePersistentNumberProperty('EFB_USING_AUTOBRIGHTNESS', 0); + const [cabinAutoBrightness] = useSimVar('L:A32NX_CABIN_AUTOBRIGHTNESS', 'number', 500); + const [cabinManualBrightness, setCabinManualBrightness] = usePersistentNumberProperty('CABIN_MANUAL_BRIGHTNESS', 0); + const [usingCabinAutobrightness, setUsingCabinAutobrightness] = usePersistentNumberProperty( + 'CABIN_USING_AUTOBRIGHTNESS', + 1, + ); const [autoOSK, setAutoOSK] = usePersistentNumberProperty('EFB_AUTO_OSK', 0); const [pauseAtTod, setPauseAtTod] = usePersistentBooleanProperty('PAUSE_AT_TOD', false); const [todArmed] = useSimVar('L:A32NX_PAUSE_AT_TOD_ARMED', 'bool', 500); @@ -203,10 +210,16 @@ export const QuickControlsPane = ({ // in the Slider component props. const brightnessSliderRef = useRef(null); + const cabinBrightnessSliderRef = useRef(null); + const handleAutoBrightness = () => { setUsingAutobrightness(usingAutobrightness ? 0 : 1); }; + const handleCabinAutoBrightness = () => { + setUsingCabinAutobrightness(usingCabinAutobrightness ? 0 : 1); + }; + const handleSettings = () => { history.push('/settings/flypad'); }; @@ -349,7 +362,7 @@ export const QuickControlsPane = ({ -
+
@@ -389,6 +402,49 @@ export const QuickControlsPane = ({
+ {/* Cabin Lighting */} + {aircraftContext.settingsPages.sim.cabinLighting && ( +
+
+ +
+ + + {`${usingCabinAutobrightness ? cabinAutoBrightness.toFixed(0) : cabinManualBrightness}%`} + +
+
+ cabinBrightnessSliderRef.current && cabinBrightnessSliderRef.current.blur()} + className="rounded-md" + style={{ width: '380px', height: '50px', padding: '0' }} + trackStyle={{ backgroundColor: 'var(--color-highlight)', height: '50px' }} + railStyle={{ backgroundColor: 'var(--color-body)', height: '50px' }} + handleStyle={{ top: '13px', height: '0px', width: '0px' }} + /> +
+
+
+ + + +
+ )} {/* Quick Settings Button */} {/* First Row */}
diff --git a/large-files b/large-files index 75d80e04b16..776b09063e3 160000 --- a/large-files +++ b/large-files @@ -1 +1 @@ -Subproject commit 75d80e04b164cdd98cc62dc49092258155b1d4fb +Subproject commit 776b09063e35bdab0b47850af685b1f271df5fc5 From 03e4028f9d335639e6dcc68f86ac555229ab50cd Mon Sep 17 00:00:00 2001 From: Benedict Etzel Date: Sat, 9 Nov 2024 19:02:33 +0100 Subject: [PATCH 05/16] revert: fix(a380x/flight model): Fix stall and auto rotate issues (#9467) Revert "fix(a380x/flight model): Fix stall and auto rotate issues (#9387)" This reverts commit a91cf61eece5dd718b864570b5efec222328c243. Co-authored-by: donstim <70166617+donstim@users.noreply.github.com> --- .github/CHANGELOG.md | 1 - .../AirPlanes/FlyByWire_A380_842/engines.cfg | 8 +- .../FlyByWire_A380_842/flight_model.cfg | 85 +++++++++++-------- 3 files changed, 55 insertions(+), 39 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index ef9c008a6b2..3172e71f993 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -28,7 +28,6 @@ 1. [A380X/AP] Improved support of simulation rate 4x - @aguther (Andreas Guther) 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) diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/engines.cfg b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/engines.cfg index a52204898c8..4448d42e8d2 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/engines.cfg +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/engines.cfg @@ -18,13 +18,13 @@ master_ignition_switch = 0 starter_type = 2 ; 0=Electric, 1=Manual, 2=Bleed Air max_contrail_temperature = -39.724 Engine.0 = -10, -84, -1.5 -ThrustAnglesPitchHeading.0 = -15, 0 +ThrustAnglesPitchHeading.0 = 0, 0 Engine.1 = 15, -47.5, -4 -ThrustAnglesPitchHeading.1 = -15, 0 +ThrustAnglesPitchHeading.1 = 0, 0 Engine.2 = 15, 47.5, -4 -ThrustAnglesPitchHeading.2 = -15, 0 +ThrustAnglesPitchHeading.2 = 0, 0 Engine.3 = -10, 84, -1.5 -ThrustAnglesPitchHeading.3 = -15, 0 +ThrustAnglesPitchHeading.3 = 0, 0 fuel_flow_scalar = 0; NOT [TURBINEENGINEDATA] diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg index 14853ff78ba..be3f520f2f5 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg @@ -1,6 +1,26 @@ ; Copyright (c) 2023-2024 FlyByWire Simulations ; SPDX-License-Identifier: GPL-3.0 +; A380 MSN 225 - WV03 A380-842 +; 07 Mar 2023 - Fuel System Update + +; 10 Feb 2024 - Masses (tanks/cargo) shift 5m fwd to match visual model +; Contact point of wing gear slightgly set higher so it gets less plane weight (shift weight on nose) +; Main gears contact points pushed a bit aft as a compromise between correct tilt animation and weight distribution + +; 14 Feb 2024 - Moved CG while keeping correct %Mac offset by moving aero center forward +; Changed contact points and empty mass to match real MSN empty weight load sheet + +; 15 Feb 2024 - Activate new spring method and update strut springs + +; 19 Jul 2024 - Adjust CG, wheels and fuel tanks to correct model origin to Airbus reference datum offset +; The position of the nose in the model coord. system is 35.1927m. The Airbus reference datum distance from the nose is 7.33m. +; So, the conversion from HArm value to model coordinates in m is: model_coord = (35.1927m + 7.33m) - harm_value + +; 13 Sept 2024 fixed some invalid entries in the trigger section + +; 22 Oct 2024 Fixed numerous issues with the fuel system. Code added to address MSFS fuel system issues and restrict transfers until airplane is in flight. + [VERSION] major = 1 minor = 0 @@ -488,10 +508,10 @@ Trigger.42 = Name:CGControlTransferEnd#Condition:Manual#EffectTrue:CloseValve.Tr [AIRPLANE_GEOMETRY] wing_area = 9096.0 ; Wing area S (SQUARE FEET) wing_span = 261.65 ; Wing span b (FEET) -wing_root_chord = 58.86 ; Wing root chord croot (FEET) +wing_root_chord = 58.86 ; Wing root chord croot (FEET), should be 57.97 but increased to match reference MAC length wing_camber = 1 ; (DEGREES) (Unkown - estimated value) wing_thickness_ratio = 0.05 ; Local thickness is local_chord(x)*wing_thickness_ratio, x = lateral coord -wing_dihedral = 5.6 ; Dihedral angle Lambda (DEGREES) +wing_dihedral = 6.5 ; Dihedral angle Lambda (DEGREES) wing_incidence = 2 ; Wing incidence (DEGREES) (unknown) wing_twist = -5.5 ; Wing twist epsilon (DEGREES) oswald_efficiency_factor = 0.70 ; Wing Oswald efficiency factor e (non dimensional) @@ -499,10 +519,10 @@ wing_winglets_flag = 0 ; Has winglets true/false (MSFS doesn't use this paramete wing_sweep = 37 ; Wing sweep (DEGREES) ;wing_pos_apex_lon = 0 ; Longitudinal (z) position of wing apex w.r.t reference datum (FEET) (not used) wing_pos_apex_vert = -2 ; Vertical (y) position of wing apex w.r.t reference datum (FEET) (estimated from mesh drawing) -htail_area = 1603 ; Horizontal tail area (SQUARE FEET) -htail_span = 80 ; Horizontal tail span (FEET) -htail_pos_lon = -105 ; Longitudinal (z) position of horizontal tail w.r.t reference datum (FEET) -htail_pos_vert = 13.8 ; Vertical (y) position of horizontal tail w.r.t reference datum (FEET) +htail_area = 1250 ; Horizontal tail area (SQUARE FEET) -original 1603 +htail_span = 80 ; Horizontal tail span (FEET) -OLD VALUE 83.50 +htail_pos_lon = -105 ; Longitudinal (z) position of horizontal tail w.r.t reference datum (FEET) -76.6 +htail_pos_vert = 13.8 ; Vertical (y) position of horizontal tail w.r.t reference datum (FEET) 13.8 11.35 -OLD VALUE 14.8 htail_incidence = -2 ; Horizontal tail incidence (DEGREES) OLD VALUE 0 htail_sweep = 38 ; Horizontal tail sweep angle (DEGREES) htail_thickness_ratio = 0.02 ; Local thickness is local_chord(x)*htail_thickness_ratio, x = lateral coord @@ -513,15 +533,15 @@ vtail_pos_lon = -90.5 ; Longitudinal (z) position of vertical tail w.r.t refere vtail_pos_vert = 37 ; Vertical (y) position of vertical tail w.r.t reference datum (FEET) vtail_thickness_ratio = 0.02 ; Local thickness is local_chord(x)*vtail_thickness_ratio, x = lateral coord fuselage_length = 230.97 ; Nose to tail (FEET) -fuselage_diameter = 25; +fuselage_diameter = 25; (is 23.43 horizontally, but 27.6 to 28.1 vertically) fuselage_center_pos = 10, 0, 7.1 -elevator_area = 1200 ; Elevator area (SQUARE FEET) +elevator_area = 500 ; Elevator area (SQUARE FEET) OLD VALUE 593 aileron_area = 258 ; Elevator area (SQUARE FEET) rudder_area = 416.6 ; Elevator area (SQUARE FEET) -elevator_up_limit = 30 ; Elevator max deflection up angle (DEGREES) -elevator_down_limit = 20 ; Elevator max deflection down angle (absolute value) (DEGREES) -aileron_up_limit = 30; Aileron max deflection angle (DEGREES) -aileron_down_limit = 20; Aileron max deflection down angle (absolute value) (DEGREES) +elevator_up_limit = 30 ; Elevator max deflection up angle (DEGREES) Real value is 30 +elevator_down_limit = 20 ; Elevator max deflection down angle (absolute value) (DEGREES) Real value is 17 +aileron_up_limit = 30; Aileron max deflection angle (DEGREES) Real value is 25 +aileron_down_limit = 20; Aileron max deflection down angle (absolute value) (DEGREES) Real value is 25 rudder_limit = 30; Rudder max deflection angle (absolute value) (DEGREES) rudder_trim_limit = 25.5 ; Rudder trim max deflection angle (absolute value) (DEGREES) elevator_trim_up_limit = 10 ; Elevator trim max angle (absolute value) (DEGREES) @@ -549,7 +569,7 @@ fly_by_wire = 0 ; Fly-by-wire available true/false elevator_elasticity_table = 0:1, 400:1 aileron_elasticity_table = 0:1, 400:1 rudder_elasticity_table = 0:1, 400:1 -elevator_trim_elasticity_table = 0:0.45, 50:0.7, 100:1.04, 115:1.5, 400:5.7 +elevator_trim_elasticity_table = 0:1, 400:1 ;controls_reactivity_scalar = 1 ; Reactivity scalar for all controls @@ -558,7 +578,7 @@ lift_coef_pitch_rate = -47.338 ; The change in lift per change in pitch rate lift_coef_daoa = 0 ; lift per change in angle of attack rate lift_coef_delta_elevator = -1.143 ; The change in lift per change in elevator deflection lift_coef_horizontal_incidence = 0 ; The change in lift per change in horizontal incidence angle -lift_coef_flaps = 1.5 ; Change in lift due to flaps +lift_coef_flaps = 1.905 ; Change in lift due to flaps lift_coef_spoilers = -0.546875 ; Change in lift due to spoilers drag_coef_zero_lift = 0.015 ; The zero lift drag polar drag_coef_flaps = 0.0706 @@ -636,7 +656,7 @@ yaw_moment_delta_rudder_mach_table = 0:0 yaw_moment_delta_aileron_mach_table = 0:0 yaw_moment_yaw_rate_mach_table = 0:0 yaw_moment_roll_rate_mach_table = 0:0 -elevator_scaling_table = -0.35:3.0, -0.3:2.5, -0.26:1.5, -0.1:1, 0:1, 0.55:1 ; scales control based on its deflection +elevator_scaling_table = 0:1 ; scales control based on its deflection aileron_scaling_table = 0:1 ; scales control based on its deflection rudder_scaling_table = 0:1 ; scales control based on its deflection aileron_load_factor_effectiveness_table = 0:1 ; scaling of roll_moment_delta_aileron versus gravity forces, G effects on aileron effectiveness, acts on roll_moment_delta_aileron @@ -645,9 +665,6 @@ lift_coef_at_drag_zero_flaps = 0.40000 ;elevator_lift_coef = 0.5 ; Defines elevator lift vs elevator angle-of-attack ;rudder_lift_coef = 0.5 ; Defines rudder lift vs rudder angle-of-attack ;fuselage_lateral_cx = 0.5; Defines fuselage lift and side force vs fuselage angle-of-attack and beta -StallDef_StartRatio = 1 -StallDef_EndRatio = 2 -StallDef_airflowdetachspeed = 0.1 [FLIGHT_TUNING] @@ -659,7 +676,7 @@ parasite_drag_scalar = 1 induced_drag_scalar = 1 flap_induced_drag_scalar = 0.5 elevator_effectiveness = 1 -elevator_maxangle_scalar = 1 +elevator_maxangle_scalar = 0.7 aileron_effectiveness = 1 rudder_effectiveness = 0.16 rudder_maxangle_scalar = 1 @@ -777,11 +794,11 @@ drag_scalar = 0 ; Scalar coefficient to ponderate global flap drag coef (non dim pitch_scalar = 0 ; Scalar coefficient to ponderate global flap pitch coef (non dimensioned) max_on_ground_position = 5 ; Dynamically set in-tool to last flap-position index by defaut when -1 is found. flaps-position.0 = 0.00, -1, 0.00, 0.00 ; CONF 0 -flaps-position.1 = 0.01, -1, 1.00, 1.00, 1.00, 0.00 0.00 ; CONF 1 -flaps-position.2 = 8.00, 222, 1.00, 1.00, 1.00, 0.00 0.00 ; CONF 1+F -flaps-position.3 = 17.00, 220, 1.00, 1.00 1.00, 0.00 0.00 ; CONF 2 -flaps-position.4 = 26.00, 196, 1.00, 1.00 1.00, 0.00 0.00 ; CONF 3 -flaps-position.5 = 32.00, 182, 1.00, 1.00 1.00, 0.00 -0.40 ; CONF FULL +flaps-position.1 = 0.01, -1, 1.00, 1.00 ; CONF 1 +flaps-position.2 = 8.00, 222, 1.00, 1.00 ; CONF 1+F +flaps-position.3 = 17.00, 220, 1.00, 1.00 ; CONF 2 +flaps-position.4 = 26.00, 196, 1.00, 1.00 ; CONF 3 +flaps-position.5 = 32.00, 182, 1.00, 1.00 ; CONF FULL [FLAPS.1] type = 1 ; Flap type 0 = None, 1 = trailing edge, 2 = leading edge @@ -797,11 +814,11 @@ drag_scalar = 1 ; Scalar coefficient to ponderate global flap drag coef (non dim pitch_scalar = 1 ; Scalar coefficient to ponderate global flap pitch coef (non dimensioned) max_on_ground_position = 5 ; Dynamically set in-tool to last flap-position index by defaut when -1 is found. flaps-position.0 = 0.00, -1, 0, 0.0 ; CONF 0 -flaps-position.1 = 5.0, -1, 1.00, 1.00 1.00, 0.00 0.00 ; CONF 1 -flaps-position.2 = 10.00, 222, 0.70, 0.95, 1.00, 0.00 0.00 ; CONF 1+F -flaps-position.3 = 15.00, 220, 1.30, 1.15, 1.00, 0.00 0.00 ; CONF 2 -flaps-position.4 = 20.00, 196, 1.50, 1.00, 1.00, 0.00 0.00 ; CONF 3 -flaps-position.5 = 32.00, 182, 1.00, 1.02 1.00, 0.00 -0.40 ; CONF FULL +flaps-position.1 = 5.0, -1, 1.00, 1.00 ; CONF 1 +flaps-position.2 = 10.00, 222, 0.70, 1.30 ; CONF 1+F +flaps-position.3 = 15.00, 220, 1.30, 1.25 ; CONF 2 +flaps-position.4 = 20.00, 196, 1.50, 1.50 ; CONF 3 +flaps-position.5 = 32.00, 182, 1.00, 1.00 ; CONF FULL [FLAPS.2] type = 2 ; Flap type 0 = None, 1 = trailing edge, 2 = leading edge @@ -817,8 +834,8 @@ drag_scalar = 0.5 ; Scalar coefficient to ponderate global flap drag coef (non d pitch_scalar = 1 ; Scalar coefficient to ponderate global flap pitch coef (non dimensioned) max_on_ground_position = 5 ; Dynamically set in-tool to last flap-position index by defaut when -1 is found. flaps-position.0 = 0.00, -1, 1.00, 1.00 ; CONF 0 -flaps-position.1 = 20.00, 263, 1.85, 0.55, 1.00, 0.00 0.00 ; CONF 1 -flaps-position.2 = 20.01, 222, 0.70, 0.99, 1.00, 0.00 0.00 ; CONF 1+F -flaps-position.3 = 20.02, 220, 1.30, 1.00, 1.00, 0.00 0.00 ; CONF 2 -flaps-position.4 = 23.00, 196, 1.50, 1.00, 1.00, 0.00 0.00 ; CONF 3 -flaps-position.5 = 23.01, 182, 1.00, 1.00, 1.00, 0.00 -0.40 ; CONF FULL +flaps-position.1 = 20.00, 263, 1.85, 0.55 ; CONF 1 +flaps-position.2 = 20.01, 222, 0.70, 1.00 ; CONF 1+F +flaps-position.3 = 20.02, 220, 1.30, 1.25 ; CONF 2 +flaps-position.4 = 23.00, 196, 1.50, 1.50 ; CONF 3 +flaps-position.5 = 23.01, 182, 1.00, 1.00 ; CONF FULL From 5d715e5da2c7659ebd977ef5fe33cb5dc591e189 Mon Sep 17 00:00:00 2001 From: C-Schaffhausen <93766735+C-Schaffhausen@users.noreply.github.com> Date: Sun, 10 Nov 2024 18:07:17 +0800 Subject: [PATCH 06/16] fix(a380x/jetway): Jetway connections tweak (#9429) * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md * Update flight_model.cfg * Jetway connections tweak updated 20241109 * Update flight_model.cfg --- .github/CHANGELOG.md | 1 + .../SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 3172e71f993..800da8711f8 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -26,6 +26,7 @@ 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/MODEL] Optimized 4K textures - @Repsol diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg index be3f520f2f5..f22823f108a 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/flight_model.cfg @@ -745,9 +745,9 @@ max_gear_extended = 250 ; (Kts) number_of_interactive_points = 20 ; Main Deck -interactive_point.0 = 0.4, 94.75, -9.75, 3.32, 0, 0, 0, -79, 72, 0, 85, 0, -2, 33 +interactive_point.0 = 0.4, 96.4, -8.65, 2.32, 0, 0, 0, -79, 65, 0, 33, 0, -2, 33 interactive_point.1 = 0.4, 94.75, 9.75, 3.32, 0, 0, 0, 79, 85, 1, 72, 2, -2, 33 -interactive_point.2 = 0.4, 60.7, -10.75, 3.32, 0, 0, 0, -90, 72, 0, 85, 0, -2, 33 +interactive_point.2 = 0.4, 63.15, -11, 2.32, 0, 0, 0, -92, 12, 0, 12, 0, -2, 33 interactive_point.3 = 0.4, 60.7, 10.75, 3.32, 2, 0, 0, 90, 85, 1, 72, 2, -2, 33 interactive_point.4 = 0.4, 10, -10.75, 3.32, 2, 0, 0, -90, 72, 0, 85, 0, -2, 33 interactive_point.5 = 0.4, 10, 10.75, 3.32, 2, 0, 0, 90, 85, 1, 72, 2, -2, 33 From 32dda085af1b92d0a2ffb59788b301d3e88fedaf Mon Sep 17 00:00:00 2001 From: Michael Corcoran Date: Sun, 10 Nov 2024 23:50:46 +1300 Subject: [PATCH 07/16] fix(a380x/afs): remove v/s knob push action (#9174) * fix(a380x/afs): remove v/s knob push action * chore: remove unused vs push code * fix(a380x/fcu): bring back old template for legacy users * chore: clean up unneeded cruft --- .github/CHANGELOG.md | 1 + .../legacy/generated/A32NX_Interior_FCU.xml | 30 ++++--------------- .../src/FCU/Managers/VerticalSpeedManager.ts | 18 ----------- .../fbw_a380/src/interface/SimConnectData.h | 1 + .../src/interface/SimConnectInterface.cpp | 6 ---- .../src/interface/SimConnectInterface.h | 1 - 6 files changed, 8 insertions(+), 49 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 800da8711f8..a1a8f5a4eea 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -31,6 +31,7 @@ 1. [A380X/MFD] Fixed DIRECT TO selection of active waypoint does nothing - @sognodelx (Sven Gross) 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) ## 0.12.0 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/legacy/generated/A32NX_Interior_FCU.xml b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/legacy/generated/A32NX_Interior_FCU.xml index d964817466c..f570d6abe16 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/legacy/generated/A32NX_Interior_FCU.xml +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/legacy/generated/A32NX_Interior_FCU.xml @@ -238,20 +238,11 @@ - -