Skip to content

Commit

Permalink
feat(fms): flight planning version 2 (#7692)
Browse files Browse the repository at this point in the history
* Remove `MagVar` class

* Fix no disco for waypoint insertion before destination

* Fix being able to clear PPOS

* fix: cleanup docker images for more space

* Remove deleted import

* Improve airway entry perf by filtering at db level

* Fix typo in constraint parsing

* Port AIRPORT key functionality

* Remove unnecessary navdata workaround

* Remove accidental CSS changes

* Use 0 as default origin altitude

* Rename to more meaningful name

* Only transmit fixinfos of active flightplan

* Treat "at" speed constraints as "atOrBelow"

* Fix inaccurate comments

* Use more appropriate name

* Keep using `Avionics.Utils.bearingDistanceToCoordinates` for now

* Fix typo

* Remove unused code

* Fix DIR to waypoint bug

* Move DIR to logic out of page rendering code

* Remove debugging code

* Fix AIRPORT button

* Fix VNAV not resetting after landing

* Port forced turn indications

* Fix turn area exceedance message logic

* Fix toggle overfly function in non active flightplan

* Keep database format for altitude constraints

* Remove unnecessary speed constraint abstraction layer

* Remove unused constraint properties on TF leg

* Remove unclear comment

* Filter out approach to missing runways

* Change to simpler FROM/TO deletion stopgap logic

* Keep upstream leg when stringing arrival to upstream

* Fix typo in FROM/TO validation

* Fix ILS frequency display after first arrival selection

* Allow selection of arrival without runway

* String XI to XF

* Remove XI if leg added after it

* Fix typecheck

* Fix airport/runway altitude shown in flight plan

* Delete alternate flight plan after NEW DEST

* Ensure DIR to leg is not in missed approach

* Use TF leg after truncating duplicate waypoint

* Fix performance data rounding

* Only change out of GA phase with new destination

* Make approach transition names unique

* fix: clock build

* fix: weather request manual entry

* Ignore null legs in distance calculation

* Identify procedures by id over ident

* fix: clock build pt 2

* Adjust flypad imports

* sync and serialization fixes

* fix: efb build

* Fix first departure leg runway check

* Fix linting issues

* Don't override runway idents

* Fix leftover procedure identification inconsistencies

* Export `getAlongTrackDistanceTo`

* Fix some more linting issues

* Port basic atsu flightplan synchronisation code

* Fix lint even harder

* Fix departure page layout

* Fix alternate destination being copied to active

* Do not try to string MANUAL legs

* Fix single waypoint SID imports again

* feat: fms-v2 msfs sync (#8508)

* add intial sync with all todos and hacks

* serialize dest and origin airports

* fix: guard origin and destination airport in serialization

* fix: waypoint insertion, add extra module for sync

* remove unncecessary change

* use more granular sync events

* some cleanup

* feat: sync flight plan from game

* fix some errors

* more log

* fix: export FlightPlanRpcServer

* fix: mapping

* fix: delay init until ingame

* use native fms2 sync

* fix: missing airport and runway in sync

* Revert "fix: missing airport and runway in sync"

This reverts commit 0d87e5a.

* Revert "use native fms2 sync"

This reverts commit b9f2f1f.

* fix: sync confusion

* small improvement

* enable basic load from sim

* fix: rpcclient creation

* only use rpc client for initial load

* fix: datastore subscription

* fix: enroute waypoint insertion

* fix: approach mapping, off by one error and runway selection

* remove flightPlanTest

* fix: typing errors

* fix: destination runways without secondary designator

* fix: lint

* fix(sync): use sensible defaults if mapping fails

* fix: init issue after fixing other init issue

* Fix wrong FD leg ident

* Improve arrival and departure pages

* Handle explicit NO SID, NO STAR, etc. selection

* Refactor MPR selection

* Fix missing disco after leg deletion in alternate

* Remove arrival procedures after changing alternate

* Dump entire alternate plan when changing altn dest

* feat: load MSFS flightplan in "SAVE" mode too

* Remove commented code

* Remove FacilityCache console logging

* Highlight entire row for selected approach

* Allow repeated constraints in F-PLN page

* Remove duplicate code

* Fix deletion of leg after CI at segment boundary

* Implement basic support for XI IF XF leg combination

* Disable SEC fpln functionality for now

* Disable fms-v2 tests until they are fixed

* improve error handling and runway designatorChars

* make loading and saving more resilient

* Disable inoperative buttons

* Remove debugger statement

* Fix WAYPOINT page entry

* Fix missing error message after waypoint insertion

* fix: potential bogus comparison

* Rebuild arrival after setting all alternate procedures

* Handle missing geometry leg again

* Reset managed speed constraint after GA

* Increase VM leg size

* Make MRP side dependent

* Remove dead code

* Fix AIRPORT button getting stuck

* Fix references to dead functions

* Fix typo

* Remove TODO for clarity

* Sync cruise step deletion

* Re-add licence identifier

* Move `WaypointConstraintType`

* fix: do not transmit empty vectors if not needed

* Encode MRP in ARINC429

* Update comment

* Remove unused arguments

* Fix wrong TO waypoint for runways

* Fix EFB build again

* fix: efb ts config

* fix: revert optimization until better solution found

* fix: new allocation optimisation for efis vector sync

* refactor: undefined -> null

* Add null check

* Remove JS FMCDataManager

* fix: hotfix for departure page issue with selecting new dep runway

* fix: only set atc crz flight level when defined, remove console logs

* Change runway ident format

* fix: fpln sync after recent changes

* Remove SID when changing runway

* Remove arrival when changing approach

* fix: text alignment for constraints (font still needs work)

* ci: Rename workflows from 'PR' to more descriptive names  (#8614)

* Update and rename pr.yml to pr-build.yml

* Update PULL_REQUEST_TEMPLATE.md

* Update and rename pr-target.yml to pr-semantics.yml

* Update pr-build.yml

* feat(flight_model): Add drag from landing lights (#8554)

* add landing light drag

* Doc and naming

* typo

* Auto stash before checking out "origin/master"

* Updated drag values

* changelog

* Update cruise.FLT

---------

Co-authored-by: 2hwk <[email protected]>
Co-authored-by: donstim <[email protected]>

* refactor: Fadec rewrite using Cpp framework (#8547)

* Initial scaffolding for new fadec

* Added SIMULATION RATE to base data

* Added SIM ON GROUND to base data

* Initial scaffolding for new EngineControl

* Initial scaffolding for both aircraft

* Remove build code for old fadec

* migrated the common.h code to Fadec.h

* removed simulation time params

* inlined var init

* Code cleanup and documentation

* Renaming of context var

* Added ThrustLimit_A380X class and helper methods in Fadec.h

* Improved insertThousandsSeparator helper

* Merge fix

* Commenting ThrustLimits_A380X.h

* Commenting SimDataStructs.h

* Adding Polynomials_A380X.hpp

* Adding Table1502_A380X.hpp

* Adding Table1502_A380X.hpp

* Adding some commenting to framework classes

* Adding FuelConfiguration class

* Added TODO

* Import fix

* code style fix

* Renamed Class

* changed class access and fixed migrated code

* Added FadecSimData class and implemented initialization of EngineControl

* Added EngineControl_A380X.cpp update()

* Adding some commenting to framework class

* Implemented additional update functions

* Implemented all required functions

* Checked initialize

* Checked update

* Bug fix setting feed tanks

* Fix unit for EGT

* Refactored var access

* Added profiler

* Added more profiler

* Refactored writing and added gauge profiler

* added "using DataDefinitionVector"

* Prepared A32NX fadec migration (wip)

* Improved Pause detection (removed unnecessary read)

* Additional profiler when PROFILING is set

* Added usage commenting to SimpleProfiler

* Added default flag to set data on Sim Object

* Added a flag to turn on/off warning of dirty data read.

* Minor docu fix in AircraftVariable.h

* Prepared A32NX fadec migration (wip)

* Fixed reading of initial pause var

* Added fuel config and data definitions

* Added ThrustLimits_A32NX.hpp

* Added Polynomials_A32NX.hpp

* Added Tables1502_A32NX.hpp

* Fixed to_string_with_zero_padding by making static

* Added initializeEngineControlData

* Added comment

* Added Gph (Gallons per hour) to UNITS

* Added profiler metadata output

* Migration done - debugging wip

* Commenting FuelConfiguration_A32NX.h

* Commenting and cleanup

* Commenting, cleanup and removed a recursion

* Commenting

* Added EngineRatios class

* Migration done - debugging wip

* Fixed engine startup - code working so far

* Moved read only Aircraft Variables to DataDefinition for 50% performance increase for data update

* Further cleanup

* Undo change in logic for fuel used

* Migration A380X done - debugging & testing

* Cleanup and commenting

* Fixed fuel issue on A380X

* Cleanup and commenting

* Removed previous fadec code

* Cleanup and commenting

* Reversed tank order of flyPad Fuel Page

* Cleanup and commenting

* Fix LVar resetting

* Review changes

* Added CHANGELOG.md entry

* fix(fadec): flex temp unit conversion (#8617)

fix: flex temp unit conversion

* Show NOT ALLOWED upon procedure reselection

* Merge legs after certain disco deletions

* Fix circling approach not showing up

* fix: Fixed bug in checklist to not display previous checklists as completed (#8615)

Fixed bug in checklist to not display previous checklists as completed.

* Fix ND not updating after TMPY deletion

* Fix disco deletion

* Show NOT ALLOWED upon procedure reselection

* Merge legs after certain disco deletions

* Fix circling approach not showing up

* Fix ND not updating after TMPY deletion

* Fix disco deletion

* fix: don't throw null true bearing when parsing discont

* fix: check for null vs truthiness

* fix: use strict !==

* Fix FREQ not shown after deduplicating airway fixes

* Port tropopause uplink

* Show NOT ALLOWED when attempting to clr ZFW/ZFWCG

* Remove unused import

* HIde circling approaches

* Show CLB or DES prompt when necessary

* Show NO TRANS when explicitly selected

* Show ENTRY for pilot constructed points on PROG page

* Filter STARs when only runway selected

* Revert "Show NO TRANS when explicitly selected"

This reverts commit f6a8905.

* Fix NO SID, NO STAR selection not working

* Improve automatic NONE selection

* Improve automatic NONE trans selection

* Handle missing airways during uplink

* feat(fms): fm legs

* fix(fms): to wpt details for fm leg

* Fix trans lvl being reset when changing runway

* Fix runway formatting on PERF page

* feat(utils): add angle normalise functions

* fix(fms): fix vor station declination

fixes fix info radials

* fix: handle "at or below" constraint

* chore: update fms-v2 workflow

* fix: 380 fadec build

* fix(fms): cf leg interpretation

* fix(fms): idf sids => also sids starting with cf leg

* feat(fms): fa leg v0.0.1

* fix: eslint ref

* style: run lint after merge

* chore: fix lint

* chore: fix lint

* Treat missed approach legs as climb constraints

* Fix missed approach track not being shown

* Allow SID without runway

* fix(fms): navaid selection fallback

* Fix missed approach path going dashed on landing

* Allow leg insertion at flight plan end

* Fix FM leg distance computation

* Prevent leg insertion after MANUAL

* Fix distance to destination on XM leg

* Improve uplink error handling

* Show ILS frequency for runway with LOC approach

* Always show solid flight plan line in preflight phase

* Fix cruise step deletion

* Don't show EFIS approach message for runway-only

* Keep holds when stringing

* Fix crash when changing departure runway

* Do not send constraints to PFD in GA phase

* Check for active plan on active leg symbol

* Delete constraint until MAP when going around

* Mark AF as computed after computation

* Fix turn direction indicator in alternate plan

* Fix PROG page crash when entering from/to after takeoff

* Don't show ENTER DEST DATA without from/to

* fix: costindex -> cruiseFlightLevel

* fix(fms): nav db info

* Fix sequencing of overshot legs

* Replace `GetAirportByIdent` calls

* Fix missed approach display logic in non PLAN mode

* Fix DIR TO waypoint in hold

* Treat HX legs equally

* Fix premature deceleration to hold speed

* Fix crash with bad navdata

* fix: mark FA leg as computed

* Improve arrival selection error handling

* Delete TMPY on error during procedure selection

* Handle missing alternate during uplink gracefully

---------

Co-authored-by: BBK <[email protected]>
Co-authored-by: Saschl <[email protected]>
Co-authored-by: Saschl <[email protected]>
Co-authored-by: Sascha Rudolf <[email protected]>
Co-authored-by: Andreas Guther <[email protected]>
Co-authored-by: 2hwk <[email protected]>
Co-authored-by: 2hwk <[email protected]>
Co-authored-by: Aurora Takemi <[email protected]>
Co-authored-by: Croc <[email protected]>
Co-authored-by: donstim <[email protected]>
Co-authored-by: Frank Kopp <[email protected]>
Co-authored-by: Michael Corcoran <[email protected]>
  • Loading branch information
13 people authored Jun 14, 2024
1 parent 1b0a221 commit 20c8d71
Show file tree
Hide file tree
Showing 293 changed files with 25,341 additions and 13,543 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fbw-a32nx/src/systems/fmgc/src/flightplanning/ManagedFlightPlan.ts
fbw-a32nx/src/systems/fmgc/src/flightplanning/ProcedureDetails.ts
fbw-a32nx/src/systems/fmgc/src/flightplanning/RawDataMapper.ts
fbw-a32nx/src/systems/fmgc/src/flightplanning/SegmentedFlightPlan.ts
fbw-a32nx/src/systems/fmgc/src/flightplanning/WaypointBuilder.ts
fbw-a32nx/src/systems/fmgc/src/flightplanning/WorldMagneticModel.ts
fbw-a32nx/src/systems/fmgc/src/utils/LzUtf8.js
fbw-a32nx/src/systems/fmgc/src/flightplanning/new/test/*
fbw-a32nx/src/systems/fmgc/src/flightplanning/**/*.spec.ts
53 changes: 53 additions & 0 deletions .github/workflows/fms-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: fms-v2
on:
push:
branches:
- fms-v2

jobs:
build:
# Prevent running this on forks
if: github.repository_owner == 'flybywiresim'
runs-on: ubuntu-latest
env:
FBW_PRODUCTION_BUILD: 1
A32NX_INSTRUMENTS_BUILD_WORKERS: 2
BUILD_DIR_NAME: fms-v2
AIRCRAFT_PROJECT_PREFIX: a32nx
AIRCRAFT_VARIANT: a320-251n
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set BUILT_DATE_TIME
run: echo "BUILT_DATE_TIME=$(date -u -Iseconds)" >> $GITHUB_ENV
- name: Create .env file
run: |
echo FBW_PRODUCTION_BUILD=1 >> fbw-a32nx/.env
echo CLIENT_ID=${{ secrets.NAVIGRAPH_CLIENT_ID }} >> .env
echo CLIENT_SECRET=${{ secrets.NAVIGRAPH_CLIENT_SECRET }} >> .env
echo CHARTFOX_SECRET=${{ secrets.CHARTFOX_SECRET }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .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
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
./scripts/dev-env/run.sh ./scripts/build_a32nx.sh --no-tty -j 4
rm -rf fbw-a32nx/src
docker system prune -af
ls -la ./fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel
- name: Build ZIP files
run: |
df -h
node ./scripts/fragment_a32nx.js
cp ./fbw-a32nx/out/build-modules/modules.json ./fbw-a32nx/out/flybywire-aircraft-a320-neo/install.json
node ./scripts/install-source_a32nx.js
- name: Upload to CloudFlare CDN
env:
CLOUDFLARE_BUCKET_PASSWORD: ${{ secrets.CLOUDFLARE_BUCKET_PASSWORD }}
CDN_BUCKET_DESTINATION: addons/a32nx/fms-v2
run: |
./scripts/cf-cdn.sh $CDN_BUCKET_DESTINATION ./fbw-a32nx/out/build-modules
14 changes: 14 additions & 0 deletions fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,20 @@ These variables are the interface between the 3D model and the systems/code.
- L
- R

- A32NX_EFIS_{side}_MRP_LAT
- Arinc429<Degrees>
- Provides the latitude of the map reference point in the FMS to show on the ND
- {side}
- L
- R

- A32NX_EFIS_{side}_MRP_LONG
- Arinc429<Degrees>
- Provides the longitude of the map reference point in the FMS to show on the ND
- {side}
- L
- R

- A32NX_PFD_MSG_SET_HOLD_SPEED
- Bool
- Indicates if the SET HOLD SPEED message is shown on the PFD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,16 @@ A32NX_Util.getIsaTempDeviation = (alt = Simplane.getAltitude(), sat = Simplane.g

/**
* Get the magvar to use for radials from a wp.
* @param {WayPoint} wp The waypoint.
* @param {VhfNavaid} facility The waypoint.
*/
A32NX_Util.getRadialMagVar = (wp) => {
if (wp.infos.icao.charAt(0) === "V") {
if (wp.infos.magneticVariation !== undefined) {
return 360 - wp.infos.magneticVariation;
A32NX_Util.getRadialMagVar = (facility) => {
if (facility.subSectionCode === 0 /* VhfNavaid */) {
if (facility.stationDeclination !== undefined) {
return facility.stationDeclination;
}
}

return Facilities.getMagVar(wp.infos.coordinates.lat, wp.infos.coordinates.long);
return Facilities.getMagVar(facility.location.lat, facility.location.long);
};

/**
Expand Down
Loading

0 comments on commit 20c8d71

Please sign in to comment.