Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Cpp WASM Lightweight Framework (#7711)
* Cpp WASM Lightweight Framework - squashed for rebase with new repo * Rebased to new repo structure * added build-script execute permissions * Refactored common code to fbw-common folder * Optimized imports * Corrected comment * Added extra-backend to A380X (modules not adapted to A380 yet) * Removed updateDataToSim from DataDefinitionVariable * Updated documentation * Updated documentation * Fixed some A380 build issues * Some minor A380X fixes pushback, lighting presets ok, aircraft presets needs new procedures * Fix pushback and aircraft presets reads from sim to respect cache * Fix cache and age handling * Examples for debugging * Removed redundant timeStamp/tickCounter in DataManager * Testing and minor changes * Some commenting for examples * Change order in in list of sources files * Added getter for isInitialized in Module.h * Added method for checking if a variable needs updating to the ManagedDataObjectBase class * Removed DataDefinitionVariable.cpp by moving remaining definition to .h * Added warning and small potential bug fix in Event.cpp * Removed DataDefinitionVariable.cpp by moving remaining definition to .h * Added a verbose var for easier debugging to AircraftPresets * Added typedefs to AircraftProcedures.h * Add warning for unknown/unimplemented sim messages * Introduced verbose LVAR for AircraftPresets * Simplification and commenting * Use optional instead of nullptr check * Added templated callback for static callback for key event handler * Added dummy classes for KeyEvent and InputEvent * Added ClientDataAreaVariable * Used template for math almostEqual * Renamed templated .h files to .hpp as they include full definition with no .cpp file * Added simtime and tickcounter to the processSimData method to allow for time/tick stamping when the actual data update happens. * Using c++-20 standard * Commenting * C++20 as standard and build script/cmake tweaks * Refined ClientDataAreaVariable and added documentation. * Clean up examples * Rebase fix * Removed unnecessary includes * More rebase fixes * Some tests and comments to string variable length * Move changed check and added listener to ManagedDataObjectBase. Also change some ctor parameters to use move * Change base data to automatic update * ClientDataBufferedArea (WIP) ClientDataBufferedArea (WIP) ClientDataBuffereArea (WIP) * Not working yet - ClientDataBufferedArea * Debug improvements to ClientDataBufferedAreaVariable.hpp and ExampleModule * Added KeyEvent Handling * Added KeyEvent Handling * Moved Callback.h into DataManager folder * Moved constructor of DataObjectBase.h to protected * Documentation update * Some restructuring and cleanup * Cleanup examples * Added getter for SimConnect handle * Added example for input events * Added input events to Event class and added documentation * Added ClientEvent to replace Event * Completed ClientEvent class * Removed/replaced old Event class * Made all data types ctors private so only DataManager can be used to create instances * Changed to clang-format - touched basically all files * Added method for DownUp event in one * Added option to not immediately register an event when constructing it * Added pause detection with events which doesn't work b/o sim bug. Commented out. * Added System Event mapping, completed ClientEvent and documentation * Fixed ClientDataBufferedAreaVariable.hpp * Simplified ClientDataAreaVariable.hpp and ClientDataBufferedAreaVariable.hpp creation * Added writing (sending) of ClientDataBufferedAreaVariable.hpp * Clean up, documentation, clean up examples * Moved SimconnectExceptionStrings.h * Added quantity from Sven's code * Renamed math_utils lib * Optimized Lighting Presets to change slower over time so knob animation can keep up. * Updated some documentation * Updated some GUIDELINE documentation * Made nodiscard more consistent * Added setInputGroupPriority to ClientEvent * Added another input event example * Added @brief tags to classes for doxygen docs * Some clean up * Some clean up * Updated A380X with latest A32NX code * Fixed accidental deletion of files * Fixed a compiler warning when not in debug mode * Bug fix in Lighting Presets * Review fixes and changes * fix compiler warnings if logging is disabled * move some base scripts to prepare for later replacement of manual build scripts * define the build script for the common framework * add a cmake script to automatically create the correct binaries * define the build targets for A32NX and A380X * define the top-level scripts for both aircrafts * adapt the build scripts * Make the scripts executable * add a compilation error in case of an invalid configuration * build the base for both aircrafts * use one toplevel cmake-build-script * update the execution flag * restructure the scripts to use only the top-level script * C++ wasm modules are built by one script * adapt the igniter commands * Rename the build script tp prepare for it to be valid for all cpp wasm modules * Added check if out folder exists when using build script directly * Changes to Cmake script to accomodate review changes * Restore fbw-a380x/src/wasm/fadec_a380/src/SimVars.h * Restore fbw-a32nx/src/wasm/fadec_a320/src/SimVars.h * Deactivating A80 compilation for the time being - will be reactivated again at a later point * Added debug clean build script * Fixed wasm build as CMake does not check for change on dependencies of custom commands as long as file exists. * Fixed wasm debug build * Fixes from review * Some cleanup * Turn off verbose CMake * Refactor update time/tick check * Removed marco definition in favor of templated using statement * Removed marco definition in favor of templated using statement * Renamed fbw-common/src/wasm/extra-backend to fbw-common/src/wasm/cpp-msfs-framework * Refactor to avoid aircraft dependency in framework by adding aircraft prefix in the modules at runtime * Moved the framework Example to the cpp-msfs-framework folder * Moved Pushback to fbw-common * Refactored AircraftPresets to use an aircraft specific configuration * Moved AircraftPresets to fbw-common * Data type changed for consistency * Refactored LightingPresets to split into common and aircraft-specific parts. * Added A380 compilation again * Fixed log output for a380x * Temporarily using A32NX_ prefix for A380 as A380X flyPad does not use the prefix yet * Renaming base variables in MsfsHandler * Testing and commenting for A380X * Formatted CMake with 4 spaces for continuation * Additional commenting * Updated copyright * Minor cleanup * Removed unnecessary keep file * Fixed some clang-tidy warnings * Rebase fixes * Cleanup imports and small consistency refactorings * Added docs comment * Added move ctor/assign delete and some additional cleanup * Added ScopedTimer * Added SimpleProfiler.hpp * Profiled and optimized LightingPresets * Added profiling class and compile option - see SimpleProfiler class * Added unregistering of all named var on msfsHandler shut down * Added template type check to ProfileBuffer.hpp * Added check if timer is started when calling stop. * Commenting * Added nodiscard to SimpleProfiler.hpp * Using accumulate for summing * Commenting * Added event base pause detection * Changed base data from single lvar into datadefinition with lvar * Fixed example pointers * removed -Werror * added prefix handling to base data lvars * Updated comment for pause detection * Updated comment and reformatting * ID starting at 0 now * Added min/max to ProfileBuffer.hpp * Added methods to retrieve trimmedAvg, min and max values. * Added default values for allocateClientDataArea back * Fixed refactor changes not reflected due to comments/ifdefs * Small refactor for readability * Small refactor for lib performance * Small cosmetic refactors * Combined autoRead/autoWrite to enum updateMode * Deactivating Examples * Remove unnecessary assert * Simplification of InertialDampener * Replaced accumulate with reduce in ProfileBuffer.hpp * Change trimmed average to 5% * Simplification in Pushback.cpp * Format fix for docs * Cleanup some code * Renamed .h to .hpp for files with included definition and no cpp * Added make_ functions for custom-, sim- and system-events * Fixed registeredToSim flag handling * Removed executor_code precompile * Using new make_ functions for creating events * Commenting * Optimized/fixed strobe handling in presets * Update to README * Simplification and commenting * Fixed comment * Added comment/Todo * Code simplification * Fix C++ build and change wasm-opt similar to other c++ build code * Updated framework READMEs * Code cleanup * Fix/optimize build * Calling set on a chashable variable now sets hasChanged. * Fixed CHANGELOG.md * Small code optimizations * Comment fix * Code review fixes * Change A380X panel.cfg to use extra-backend. --------- Co-authored-by: Sven Czarnian <[email protected]>
- Loading branch information