From 9b9b99e20a0e3247ca11776e95491c4e9706ba20 Mon Sep 17 00:00:00 2001 From: Hugo Jean Ponsin Date: Tue, 28 Jul 2026 14:19:16 +0200 Subject: [PATCH] adding warning error if min > max --- src/device/handlers/PressureCalculator.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/device/handlers/PressureCalculator.cpp b/src/device/handlers/PressureCalculator.cpp index 58e3d93..458ee0e 100644 --- a/src/device/handlers/PressureCalculator.cpp +++ b/src/device/handlers/PressureCalculator.cpp @@ -3,6 +3,7 @@ #include "Average.h" #include "DemandHandler.h" #include "InputHandler.h" +#include "tmfe.h" #include #include @@ -98,11 +99,21 @@ void PressureCalculator::updatePower(float value) { void PressureCalculator::updateMinimalPressure(float value) { cachedMinimalPressure = value; + if (cachedMinimalPressure > cachedMaximalPressure) { + TMFE::Instance()->Msg( + MERROR, __FUNCTION__, + "Minimum value %f is higher than the maximum value %f !", + cachedMinimalPressure, cachedMaximalPressure); + } update(); } void PressureCalculator::updateMaximalPressure(float value) { cachedMaximalPressure = value; + TMFE::Instance()->Msg( + MERROR, __FUNCTION__, + "Maximum value %f is lower than the minimum value %f !", + cachedMaximalPressure, cachedMinimalPressure); update(); }