Skip to content

Commit

Permalink
refactor: Fadec rewrite using Cpp framework (2nd) (#8622)
Browse files Browse the repository at this point in the history
* 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

* Fixed FLX-CLB thrust limit transition

* Renamed isFlexActive var to wasFlexActive

* Fixed VNAV TakeOff path and time calculation issue (unit issue)

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

fix: flex temp unit conversion
(cherry picked from commit 8f3494b)

---------

Co-authored-by: Saschl <[email protected]>
  • Loading branch information
frankkopp and Saschl authored Apr 15, 2024
1 parent ccec55b commit e618ed8
Show file tree
Hide file tree
Showing 73 changed files with 6,592 additions and 6,433 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
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)
1. [FADEC] Fadec rewrite/cleanup/commenting using cpp framework - @frankkopp (Frank Kopp)

## 0.11.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ background_color = 0,0,0

htmlgauge00 = WasmInstrument/WasmInstrument.html?wasm_module=systems.wasm&wasm_gauge=systems,0,0,1,1
htmlgauge01 = WasmInstrument/WasmInstrument.html?wasm_module=fbw.wasm&wasm_gauge=fbw,0,0,1,1
htmlgauge02 = WasmInstrument/WasmInstrument.html?wasm_module=fadec.wasm&wasm_gauge=FadecGauge,0,0,1,1
htmlgauge02 = WasmInstrument/WasmInstrument.html?wasm_module=fadec-a32nx.wasm&wasm_gauge=Gauge_Fadec,0,0,1,1
htmlgauge03 = WasmInstrument/WasmInstrument.html?wasm_module=extra-backend-a32nx.wasm&wasm_gauge=Gauge_Extra_Backend,0,0,1,1

[VCockpit18]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class TakeoffPathBuilder {
const lastCheckpoint = profile.lastCheckpoint;

const startingAltitude = lastCheckpoint.altitude;
const predictedN1 = SimVar.GetSimVarValue('L:A32NX_AUTOTHRUST_THRUST_LIMIT_TOGA', 'Percent');
const predictedN1 = SimVar.GetSimVarValue('L:A32NX_AUTOTHRUST_THRUST_LIMIT_TOGA', 'Number');
const speed = v2Speed + 10;

const { fuelBurned, distanceTraveled, timeElapsed } = Predictions.altitudeStep(
Expand Down
5 changes: 3 additions & 2 deletions fbw-a32nx/src/wasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ set(OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../out/flybywire-aircraft-a3
add_definitions(-DA32NX)

add_subdirectory(extra-backend-a32nx)
add_subdirectory(fadec_a32nx)

# FIXME: remove the if-clause as soon as all components are using CMake
# these are only here to allow CMake compatible IDEs (JetBrains' Clion for example) to show systax
# highlighting and allow code navigation
if (WIN32)
add_subdirectory(fadec_a320)
add_subdirectory(fbw_a320)
endif ()
26 changes: 0 additions & 26 deletions fbw-a32nx/src/wasm/fadec_a320/CMakeLists.txt

This file was deleted.

9 changes: 0 additions & 9 deletions fbw-a32nx/src/wasm/fadec_a320/README.md

This file was deleted.

75 changes: 0 additions & 75 deletions fbw-a32nx/src/wasm/fadec_a320/build.sh

This file was deleted.

Loading

0 comments on commit e618ed8

Please sign in to comment.