adding warning error if min > max
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user