Skip to content

Commit

Permalink
refactor(build/efb): aircraft project prefix overhaul to better suppo…
Browse files Browse the repository at this point in the history
…rt different a/c and variants (v0.1) (#8599)

* refactor: aircraft type check

fixes 8499

add simvar description

fix simvar docs

* lint fix

* lint fix

* add extra-host module for airframe check, remove airframe check from efb

* update conflict files: overview, flight widget

fix

fix

fix

port-back

fix

fix

* remove airframe enum

* fix lint, add missing aircraft type docs

* refactor: boolean logic

* fix: panel cfg

* feat: A/C prefix environ

* feat: bones for xml config to AirCraftSync (from AirframeCheck)

* refactor: env.AIRCRAFT_PREFIX -> env.AIRCRAFT_PROJECT_PREFIX

* refactor: remove getAircraftType redundant function and clean up 'a32nx' to use environ

* fix: broken index.ts

* fix: remove aboutpage diff

* fix: adding aircraftsync to a380 and removing aircraftTypeCheck

* fix: AircraftType

* feat: aircraft.json init

* refactor: env.AIRCRAFT_PREFIX -> env.AIRCRAFT_PROJECT_PREFIX

* refactor: json format changes

* fix: getAirframeInfo format

* fix: build and workflows

* Merge remote-tracking branch 'upstream/master' into efb-panel-cfg-overhaul

* refactor: main/upper deck selector overhaul with redux

* feat: VFS config for payload

* chore: updated json5

* chore: changelog.md

* fix: diff

* refactor: EFB flight widget and overview

* refactor: flypad config

* refactor: payload page

* refactor: port gsx fixes to big payload

* refactor: services page use airframeInfo

* refactor: pushback page

* refactor: throttle config page

* refactor: remove L:A32NX_AIRCRAFT_TYPE var

* refactor: panel.cfg and updated comments for 'TITLE' Simvar

* refactor: simbrief ID, developer key in airframe.json, numberofAxis key in flypad-misc.json

* refactor: move more efb items into fbw-common, remove code bandaid for config

* chore: comments

* refactor: pushback page, flypad -> airframe dimensions , cleanup

* Merge master into efb-panel-cfg-overhaul

* fix: remove old checklist json5

* chore: fix diff

* fix: lint

* fix: build

* refactor: readme for updated version numbers, json5 and more

* chore: comment

* chore: comments

---------

Co-authored-by: Denis Freund <[email protected]>
  • Loading branch information
2hwk and Revyn112 authored Apr 15, 2024
1 parent 46d43fc commit ccec55b
Show file tree
Hide file tree
Showing 77 changed files with 3,217 additions and 3,655 deletions.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
1. [EFB] Checklist restructure to add more capabilities and use json configs - @frankkopp (Frank Kopp)
1. [FLIGHTMODEL] Landing lights or RAT extended now have drag - @Crocket63 (crocket)
1. [ATHR/FADEC] Improved reverse thrust limit - @aguther (Andreas Guther)
1. [GENERAL] Implemented a new unified VFS JSON5 markup standard for A/C configuration for FlyByWire based projects (building block for per-livery configuration) - @2hwk (2Cas)
1. [GENERAL] Added environ AIRCRAFT_PROJECT_PREFIX to allow for custom aircraft project prefixes - @2hwk (2Cas)
1. [EFB] Read from VFS JSON5 markup for Ground > Payload page - @2hwk (2Cas)

## 0.11.0

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/a380x-exp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
FBW_PRODUCTION_BUILD: 1
A32NX_INSTRUMENTS_BUILD_WORKERS: 2
BUILD_DIR_NAME: a380x-experimental-a32nx
AIRCRAFT_PROJECT_PREFIX: a32nx
AIRCRAFT_VARIANT: a320-251n
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -29,6 +31,8 @@ jobs:
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET }}\" >> fbw-a32nx/.env
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a32nx/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a32nx/.env
echo AIRCRAFT_PROJECT_PREFIX=${{ env.AIRCRAFT_PROJECT_PREFIX }} >> fbw-a32nx/.env
echo AIRCRAFT_VARIANT=${{ env.AIRCRAFT_VARIANT }} >> fbw-a32nx/.env
echo BUILD_DIR_NAME=${{ env.BUILD_DIR_NAME }} >> .env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
Expand Down Expand Up @@ -66,6 +70,8 @@ jobs:
env:
FBW_PRODUCTION_BUILD: 1
BUILD_DIR_NAME: a380x-experimental-a380x
AIRCRAFT_PROJECT_PREFIX: a380x
AIRCRAFT_VARIANT: a380-842
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -78,6 +84,8 @@ jobs:
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET_A380X }}\" >> fbw-a380x/.env
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a380x/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a380x/.env
echo AIRCRAFT_PROJECT_PREFIX=${{ env.AIRCRAFT_PROJECT_PREFIX }} >> fbw-a380x/.env
echo AIRCRAFT_VARIANT=${{ env.AIRCRAFT_VARIANT }} >> fbw-a380x/.env
echo BUILD_DIR_NAME=${{ env.BUILD_DIR_NAME }} >> .env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
VMASTER_PRE_RELEASE_ID: 32243965
VMASTER_PRE_RELEASE_TAG: vmaster
BUILD_DIR_NAME: master-a32nx
AIRCRAFT_PROJECT_PREFIX: a32nx
AIRCRAFT_VARIANT: a320-251n
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -34,6 +36,8 @@ jobs:
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET }}\" >> fbw-a32nx/.env
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a32nx/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a32nx/.env
echo AIRCRAFT_PROJECT_PREFIX=\"${{ env.AIRCRAFT_PROJECT_PREFIX }}\" >> fbw-a32nx/.env
echo AIRCRAFT_VARIANT=${{ env.AIRCRAFT_VARIANT }} >> fbw-a32nx/.env
echo BUILD_DIR_NAME=${{ env.BUILD_DIR_NAME }} >> .env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
Expand Down Expand Up @@ -100,6 +104,8 @@ jobs:
VMASTER_PRE_RELEASE_ID: 32243965
VMASTER_PRE_RELEASE_TAG: vmaster
BUILD_DIR_NAME: master-a380x
AIRCRAFT_PROJECT_PREFIX: a380x
AIRCRAFT_VARIANT: a380-842
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -112,6 +118,8 @@ jobs:
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET_A380X }}\" >> fbw-a380x/.env
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a380x/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a380x/.env
echo AIRCRAFT_PROJECT_PREFIX=\"${{ env.AIRCRAFT_PROJECT_PREFIX }}\" >> fbw-a380x/.env
echo AIRCRAFT_VARIANT=\"${{ env.AIRCRAFT_VARIANT }}\" >> fbw-a380x/.env
echo BUILD_DIR_NAME=${{ env.BUILD_DIR_NAME }} >> .env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
if: github.event.pull_request.draft == false
env:
FBW_PRODUCTION_BUILD: 1
AIRCRAFT_PROJECT_PREFIX: a32nx
AIRCRAFT_VARIANT: a320-251n
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -60,6 +62,8 @@ jobs:
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET_A380X }}\" >> fbw-a32nx/.env
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a32nx/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a32nx/.env
echo AIRCRAFT_PROJECT_PREFIX=\"${{ env.AIRCRAFT_PROJECT_PREFIX }}\" >> fbw-a32nx/.env
echo AIRCRAFT_VARIANT=\"${{ env.AIRCRAFT_VARIANT }}\" >> fbw-a32nx/.env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
cat fbw-a32nx/.env
Expand Down Expand Up @@ -90,6 +94,8 @@ jobs:
if: github.event.pull_request.draft == false
env:
FBW_PRODUCTION_BUILD: 1
AIRCRAFT_PROJECT_PREFIX: a380x
AIRCRAFT_VARIANT: a380-842
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -102,6 +108,8 @@ jobs:
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a380x/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a380x/.env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo AIRCRAFT_PROJECT_PREFIX=\"${{ env.AIRCRAFT_PROJECT_PREFIX }}\" >> fbw-a380x/.env
echo AIRCRAFT_VARIANT=\"${{ env.AIRCRAFT_VARIANT }}\" >> fbw-a380x/.env
echo VITE_BUILD=false >> .env
cat fbw-a380x/.env
- name: Install dependencies
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
FBW_PRODUCTION_BUILD: 1
RELEASE_ZIP_NAME: A32NX-stable.7z
BUILD_DIR_NAME: stable
AIRCRAFT_PROJECT_PREFIX: a32nx
AIRCRAFT_VARIANT: a320-251n
steps:
- name: Checkout source
uses: actions/checkout@v2
Expand All @@ -23,6 +25,8 @@ jobs:
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a32nx/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a32nx/.env
echo BUILD_DIR_NAME=${{ env.BUILD_DIR_NAME }} >> .env
echo AIRCRAFT_PROJECT_PREFIX=${{ env.AIRCRAFT_PROJECT_PREFIX }} >> fbw-a32nx/.env
echo AIRCRAFT_VARIANT=${{ env.AIRCRAFT_VARIANT }} >> fbw-a32nx/.env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
- name: Build A32NX
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
STABLE_PRE_RELEASE_TAG: assets/stable
STABLE_ZIP_NAME: A32NX-stable.7z
BUILD_DIR_NAME: stable
AIRCRAFT_PROJECT_PREFIX: a32nx
AIRCRAFT_VARIANT: a320-251n
steps:
- name: Checkout source
uses: actions/checkout@v2
Expand All @@ -25,6 +27,8 @@ jobs:
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET }}\" >> fbw-a32nx/.env
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a32nx/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a32nx/.env
echo AIRCRAFT_PROJECT_PREFIX=${{ env.AIRCRAFT_PROJECT_PREFIX }} >> fbw-a32nx/.env
echo AIRCRAFT_VARIANT=${{ env.AIRCRAFT_VARIANT }} >> fbw-a32nx/.env
echo BUILD_DIR_NAME=${{ env.BUILD_DIR_NAME }} >> .env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
Expand Down
2 changes: 2 additions & 0 deletions fbw-a32nx/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ NODE_ENV=production
CLIENT_SECRET=""
CLIENT_ID=""
SENTRY_DSN=""
AIRCRAFT_PROJECT_PREFIX="a32nx"
AIRCRAFT_VARIANT="a320-251n"
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ size_mm = 1430,1000
pixel_size = 1430,1000
texture = $EFB

htmlgauge00 = A32NX/EFB/efb.html?Airframe=A320_251N, 0,0,1430,1000
htmlgauge00 = A32NX/EFB/efb.html, 0,0,1430,1000

[VCockpit17]
size_mm = 0,0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# FlyByWire Unified Config

!!!!!!!!!!!!

Note: This is a work in progress, consider this a developer-only preview, treat this as a private API and integrate with the current format and values at your own risk. Format at this stage can and will change suddenly without notice, warranty or support provided. Thank you for your cooperation, patience and understanding.


At this stage, if you have any suggestions, input or inquiries in regards to the structure/function of the config ``.json5`` files,
then please contact the FlyByWire core development team on [discord](https://discord.gg/flybywire).

!!!!!!!!!!!!!

The goal of this effort is to unify configuration for all FBW based projects, in a way that can be piped to both JS (completed) and WASM Gauges (pending),
and in doing so, exposing these variables for both easier visibility for contributors as well as aiding external parties in adapting the
flyPad and other components to other aircraft.

Currently, there is config and hardcoded values spreadout across the project repository, sometimes in various configuration (.json, .h, .toml, etc.) files.

The solution to this takes on (at the moment) the form of a VFS stored ``.json5`` markup files in ``config/<env.AIRCRAFT_PROJECT_PREFIX>/<Variant>/*.json5`` that has a format that currently is being decided and iterated upon.

This will (eventually) allow for deep, per-livery/tail number configuration i.e. dynamic passenger seating configurations and cargo loading by providing an override file (based on ATC ID/tailnumber),

i.e. ``<env.AIRCRAFT_PROJECT_PREFIX>/<variant>/<tail_num>/*.json5``

This consists of several components and will be expanded upon in stages to facilitate and aid our code review and refactoring processes.

**Note:** From this point, any configuration that exists in panel.xml and elsewhere that is left hardcoded should be considered to be left *NOT exposed on purpose*.
Please consult with our core development team before adding more configuration and hardcoded values into the ``config.json5`` markup.

Please do NOT add any new configuration to the panel.xml or other configuration files that are not already present in the unified config.
Please do NOT add any new configuration to the panel.cfg or other configuration files that are not already present in the unified config.
Please do NOT move any more configuration or hardcoded values from FlyByWire header files, or other json or markup in the unified config.

Please do NOT draft PRs or add configuration to the unified config, or any of its associated boilerplate and middleware, without first consulting with the core development team.

Please do NOT hesitate to ask questions or seek clarification on the FlyByWire [discord](https://discord.gg/flybywire) server, we are here to help!

**IMPORTANT**

The base configuration location is in ``config/<env.AIRCRAFT_PROJECT_PREFIX>/<Variant>/*.json5``

!!! DO NOT OVERWRITE, ADD, OR MODIFY ANY KEYS OR VALUES IN THE BASE CONFIG FILE. !!!
!!! DO NOT OVERWRITE, ADD, OR MODIFY ANY KEYS OR VALUES IN THE BASE CONFIG FILE. !!!
!!! DO NOT OVERWRITE, ADD, OR MODIFY ANY KEYS OR VALUES IN THE BASE CONFIG FILE. !!!
!!! DO NOT OVERWRITE, ADD, OR MODIFY ANY KEYS OR VALUES IN THE BASE CONFIG FILE. !!!

Doing so can cause issues with the aircraft and will not be supported by the FlyByWire team. If you need to change a value, please do so in the livery specific config file (when this feature is documented and available).

Certain unwritable keys are REQUIRED in order for the flyPad and potentially parts of the aircraft to function. These are usually marked with a _ in the base config, but not always.

Due to how the base configuration files in this folder are read and processed (i.e. ``config/<env.AIRCRAFT_PROJECT_PREFIX>/<Variant>/*.json5``), in relation to our GPLv3 license, these VFS based markup configurations are considered an integral part of the aircraft (as the addon cannot function without them) and is therefore part of the GPLv3 license.

*This means that any changes to the base configuration file must be made available under the same license as per copyleft.* This includes any liveries, plugins, or other modifications that use or override/subsitute specifically the files located in this folder, as they will be linking directly with other boilerplate and middleware which are licensed under GPLv3, *and thus any code which is linked with any modified json5 must also be released under GPLv3*. At this time, this may or may not apply to the livery override files (and has yet to be decided).

If you are unsure about any of this, please ask on our [discord.](https://discord.gg/flybywire)

### Current Functionality

Note: Before v 1.0, also known as the first published version, you can consider this as a "private" and thus mostly undocumented and unreleased feature, mainly here for the
Benefit of code contributors and developers, both working on this feature and in general.

We will not offer support, warranty or answer help queries based on liveries that have pre-maturely adopted this VFS unified config format structure before this time.

## v 0.1
- Basic Configuration for EFB pages (Payload, Ground Services, etc.)

### Planned Functionality

## v 0.2
- Deeper configuration for EFB pages
- Configuration per-livery (initial stage)

### v 0.3
- Configuration of EFB graphics (SVGs, etc)
- Further Documentation on the FBW Unified Config format (also into FBW docs format)

## v 1.x
- Configuration of EFB graphics (SVGs, etc)
- Per-livery config (without overriding default json)
- First published release of the FBW Unified Config

## Future
- Configuration of physical seating in the cabin model
- Configuration of Persistent Elements (SATCOM)
- Further Documentation on how the FBW Unified Config backend and middleware pipes configuration into both JS/WASM
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Copyright (c) 2024 FlyByWire Simulations
// SPDX-License-Identifier: GPL-3.0
// =======================================================================================
// This is the base airframe configuration file for A320-251N
// Any keys prefixed by underscore (_) should be considered read-only and not overwritable.
//
// NOTE: * This is currently a WIP * ! The override functionality has not been completed yet !
//
// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! **********
// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! **********
// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! **********
// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! **********
//
// Please follow the instructions in the documentation to create a new configuration file!
// =======================================================================================
// Last updated: 2 April 2024
{
"configMajorVersion": 0,
"configMinorVersion": 1,
"_variant": "A320-251N",
"_icao": "A20N",
"_name": "Airbus A320neo",
"_engines": "CFM LEAP-1A26",
"_developer": "FBW",
"msnReference": "MSN 9XXX",
"weightVariant": "WV055",
"designLimits": {
"weights": {
"maxGw": 79000, // kg
"maxZfw": 64300, // kg
"minZfw": 42500, // kg
"maxGwCg": 40, // %CG MAC
"maxZfwCg": 40, // %CG MAC
"maxCargo": 9435, // kg
"maxFuel": 23721, // kg
},
"endurance": {
"range": 3400, // nm
"mmo": "0.82", // mach
},
"performanceEnvelope": {
"mlw": [
[ 15, 42500 ],
[ 15, 53000 ],
[ 17, 63000 ],
[ 17, 67400 ],
[ 40, 67400 ],
[ 40, 67400 ],
[ 37, 50000 ],
[ 35, 46000 ],
[ 35, 42500 ]
],
"mzfw": [
[ 17, 64300 ],
[ 39.5, 64300 ],
[ 37, 50000 ],
[ 35, 46000 ],
[ 35, 42500 ],
[ 15, 42500 ]
],
"mtow": [
[ 15, 42500 ],
[ 15, 53000 ],
[ 17, 63000 ],
[ 17, 72000 ],
[ 27, 79000 ],
[ 36, 79000 ],
[ 40, 73500 ],
[ 40, 67400 ],
[ 37, 50000 ],
[ 33, 42500 ]
],
"flight": [
[ 13, 42500 ],
[ 13, 52500 ],
[ 15, 63000 ],
[ 15, 72000 ],
[ 25, 79000 ],
[ 38, 79000 ],
[ 41, 74500 ],
[ 41, 51000 ],
[ 35, 46000 ],
[ 35, 42500 ],
[ 13, 42500 ]
]
}
},
"_dimensions": {
"aircraftWheelBase": 12.64,
"aircraftLengthMeter": 37.57
}
}
Loading

0 comments on commit ccec55b

Please sign in to comment.