adding warning error if min > max

This commit is contained in:
2026-07-28 14:19:16 +02:00
parent 3db48a1378
commit 9b9b99e20a
@@ -3,6 +3,7 @@
#include "Average.h"
#include "DemandHandler.h"
#include "InputHandler.h"
#include "tmfe.h"
#include <algorithm>
#include <string>
@@ -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();
}