diff --git a/CMakeLists-A333X.txt b/CMakeLists-A333X.txt index f35712c96..2a2e3c557 100644 --- a/CMakeLists-A333X.txt +++ b/CMakeLists-A333X.txt @@ -47,6 +47,10 @@ add_definitions( -DNO_EXAMPLES #PROFILING | NO_PROFILING - for logging of profiling information of pre-, post-, update() calls -DNO_PROFILING + # disable MSFS header min/max macros which clobber std::min/max + -DNOMINMAX + # MSFS stdlib uses 64-bit off_t for lseek etc. + -D_FILE_OFFSET_BITS=64 ) # add the common components diff --git a/CMakeLists-A339X.txt b/CMakeLists-A339X.txt index eb247e17a..01e2e45dd 100644 --- a/CMakeLists-A339X.txt +++ b/CMakeLists-A339X.txt @@ -47,6 +47,10 @@ add_definitions( -DNO_EXAMPLES #PROFILING | NO_PROFILING - for logging of profiling information of pre-, post-, update() calls -DNO_PROFILING + # disable MSFS header min/max macros which clobber std::min/max + -DNOMINMAX + # MSFS stdlib uses 64-bit off_t for lseek etc. + -D_FILE_OFFSET_BITS=64 ) # add the common components diff --git a/CMakeLists-SU95X.txt b/CMakeLists-SU95X.txt index 086804f84..52ec0c244 100644 --- a/CMakeLists-SU95X.txt +++ b/CMakeLists-SU95X.txt @@ -47,6 +47,10 @@ add_definitions( -DNO_EXAMPLES #PROFILING | NO_PROFILING - for logging of profiling information of pre-, post-, update() calls -DNO_PROFILING + # disable MSFS header min/max macros which clobber std::min/max + -DNOMINMAX + # MSFS stdlib uses 64-bit off_t for lseek etc. + -D_FILE_OFFSET_BITS=64 ) # add the common components diff --git a/flybywire b/flybywire index c989ce225..a77367e0b 160000 --- a/flybywire +++ b/flybywire @@ -1 +1 @@ -Subproject commit c989ce225b7a6c201346dfc73609ea45eb203ff0 +Subproject commit a77367e0bbb85f4ee32a044101a348d0cf2daca8 diff --git a/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/EngineControlA32NX.cpp b/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/EngineControlA32NX.cpp index 0e779e974..2f1985bbd 100644 --- a/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/EngineControlA32NX.cpp +++ b/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/EngineControlA32NX.cpp @@ -1,7 +1,6 @@ // Copyright (c) 2023-2024 FlyByWire Simulations // SPDX-License-Identifier: GPL-3.0 - #include "logging.h" #ifdef PROFILING #include "ScopedTimer.hpp" @@ -14,6 +13,8 @@ #include "Tables1502_A32NX.hpp" #include "ThrustLimits_A32NX.hpp" +#include + void EngineControl_A32NX::initialize(MsfsHandler* msfsHandler) { this->msfsHandlerPtr = msfsHandler; this->dataManagerPtr = &msfsHandler->getDataManager(); @@ -25,7 +26,7 @@ void EngineControl_A32NX::shutdown() { LOG_INFO("Fadec::EngineControl_A32NX::shutdown()"); } -void EngineControl_A32NX::update(sGaugeDrawData* pData) { +void EngineControl_A32NX::update() { #ifdef PROFILING profilerUpdate.start(); #endif @@ -43,7 +44,7 @@ void EngineControl_A32NX::update(sGaugeDrawData* pData) { return; } - const double deltaTime = pData->dt; + const double deltaTime = std::max(0.002, msfsHandlerPtr->getSimulationDeltaTime()); const double simTime = msfsHandlerPtr->getSimulationTime(); const double mach = simData.simVarsDataPtr->data().airSpeedMach; const double pressureAltitude = simData.simVarsDataPtr->data().pressureAltitude; @@ -556,7 +557,7 @@ double EngineControl_A32NX::updateFF(int engine, // Checking Fuel Logic and final Fuel Flow double outFlow = 0; if (correctedFuelFlow >= 1) { - outFlow = (std::max)(0.0, // + outFlow = std::max(0.0, // (correctedFuelFlow * Fadec::LBS_TO_KGS * EngineRatios::delta2(mach, ambientPressure) // * (std::sqrt)(EngineRatios::theta2(mach, ambientTemperature))) // - paramImbalance); // diff --git a/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/EngineControlA32NX.h b/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/EngineControlA32NX.h index 79a698bd5..c40d7ea4e 100644 --- a/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/EngineControlA32NX.h +++ b/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/EngineControlA32NX.h @@ -113,9 +113,8 @@ class EngineControl_A32NX { /** * @brief Updates the EngineControl_A32NX class once per frame. - * @param pData */ - void update(sGaugeDrawData* pData); + void update(); /** * @brief Shuts down the EngineControl_A32NX class once during the gauge shutdown. diff --git a/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/Fadec_A32NX.cpp b/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/Fadec_A32NX.cpp index ce75b3777..d1d213eaa 100644 --- a/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/Fadec_A32NX.cpp +++ b/hdw-a339x/src/wasm/fadec_a339x/src/Fadec/Fadec_A32NX.cpp @@ -11,13 +11,13 @@ bool Fadec_A32NX::initialize() { return true; } -bool Fadec_A32NX::update(sGaugeDrawData* pData) { +bool Fadec_A32NX::update([[maybe_unused]] sGaugeDrawData* pData) { if (!_isInitialized) { std::cerr << "Fadec_A32NX::update() - not initialized" << std::endl; return false; } - engineControl.update(pData); + engineControl.update(); return true; } diff --git a/scripts/build-cmake-a333x.sh b/scripts/build-cmake-a333x.sh index 7f11d9dbd..ab7385833 100755 --- a/scripts/build-cmake-a333x.sh +++ b/scripts/build-cmake-a333x.sh @@ -7,6 +7,9 @@ # Use set +x and set +v to turn off the above settings #set -x +# exit early with status if the script fails +set -e + # get directory of this script relative to root DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" pushd "${DIR}" || exit @@ -47,8 +50,8 @@ wasm-ld --version echo "" echo "Building extra-backend with CMAKE..." -cmake -DCMAKE_TOOLCHAIN_FILE=scripts/cmake/DockerToolchain.cmake -B${OUTPUT_DIR} -DCMAKE_BUILD_TYPE=${CONFIG} ../ || (echo "CMake config failed" && exit 1) -cmake --build ${OUTPUT_DIR} --config ${CONFIG} ${CLEAN} -j ${PARALLEL} || (echo "CMake build failed" && exit 1) +cmake -DCMAKE_TOOLCHAIN_FILE=scripts/cmake/DockerToolchain.cmake -B${OUTPUT_DIR} -DCMAKE_BUILD_TYPE=${CONFIG} ../ || (echo "CMake config failed"; exit 1) +cmake --build ${OUTPUT_DIR} --config ${CONFIG} ${CLEAN} -j ${PARALLEL} || (echo "CMake build failed"; exit 1) echo "" echo "WASM module built successfully!" diff --git a/scripts/build-cmake-a339x.sh b/scripts/build-cmake-a339x.sh index f86174cd0..465b8c004 100755 --- a/scripts/build-cmake-a339x.sh +++ b/scripts/build-cmake-a339x.sh @@ -7,6 +7,9 @@ # Use set +x and set +v to turn off the above settings #set -x +# exit early with status if the script fails +set -e + # get directory of this script relative to root DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" pushd "${DIR}" || exit @@ -47,8 +50,8 @@ wasm-ld --version echo "" echo "Building extra-backend with CMAKE..." -cmake -DCMAKE_TOOLCHAIN_FILE=scripts/cmake/DockerToolchain.cmake -B${OUTPUT_DIR} -DCMAKE_BUILD_TYPE=${CONFIG} ../ || (echo "CMake config failed" && exit 1) -cmake --build ${OUTPUT_DIR} --config ${CONFIG} ${CLEAN} -j ${PARALLEL} || (echo "CMake build failed" && exit 1) +cmake -DCMAKE_TOOLCHAIN_FILE=scripts/cmake/DockerToolchain.cmake -B${OUTPUT_DIR} -DCMAKE_BUILD_TYPE=${CONFIG} ../ || (echo "CMake config failed"; exit 1) +cmake --build ${OUTPUT_DIR} --config ${CONFIG} ${CLEAN} -j ${PARALLEL} || (echo "CMake build failed"; exit 1) echo "" echo "WASM module built successfully!" diff --git a/scripts/build-cmake-su95x.sh b/scripts/build-cmake-su95x.sh index cd30cc7b7..30492f7b2 100755 --- a/scripts/build-cmake-su95x.sh +++ b/scripts/build-cmake-su95x.sh @@ -7,6 +7,9 @@ # Use set +x and set +v to turn off the above settings #set -x +# exit early with status if the script fails +set -e + # get directory of this script relative to root DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" pushd "${DIR}" || exit @@ -47,8 +50,8 @@ wasm-ld --version echo "" echo "Building extra-backend with CMAKE..." -cmake -DCMAKE_TOOLCHAIN_FILE=scripts/cmake/DockerToolchain.cmake -B${OUTPUT_DIR} -DCMAKE_BUILD_TYPE=${CONFIG} ../ || (echo "CMake config failed" && exit 1) -cmake --build ${OUTPUT_DIR} --config ${CONFIG} ${CLEAN} -j ${PARALLEL} || (echo "CMake build failed" && exit 1) +cmake -DCMAKE_TOOLCHAIN_FILE=scripts/cmake/DockerToolchain.cmake -B${OUTPUT_DIR} -DCMAKE_BUILD_TYPE=${CONFIG} ../ || (echo "CMake config failed"; exit 1) +cmake --build ${OUTPUT_DIR} --config ${CONFIG} ${CLEAN} -j ${PARALLEL} || (echo "CMake build failed"; exit 1) echo "" echo "WASM module built successfully!"