Initial Implementation (#1834)

This commit is contained in:
jomjol
2023-01-14 13:28:58 +01:00
committed by GitHub
parent fd2d4408bf
commit cb4e6a0a30
4 changed files with 55 additions and 18 deletions

View File

@@ -393,6 +393,36 @@ void ClassFlowPostProcessing::handleAnalogDigitalTransitionStart(string _decsep,
}
}
void ClassFlowPostProcessing::handleAllowNegativeRate(string _decsep, string _value)
{
string _digit, _decpos;
int _pospunkt = _decsep.find_first_of(".");
// ESP_LOGD(TAG, "Name: %s, Pospunkt: %d", _decsep.c_str(), _pospunkt);
if (_pospunkt > -1)
_digit = _decsep.substr(0, _pospunkt);
else
_digit = "default";
for (int j = 0; j < NUMBERS.size(); ++j)
{
bool _rt = false;
if (toUpper(_value) == "TRUE")
_rt = true;
if (_digit == "default") // Set to default first (if nothing else is set)
{
NUMBERS[j]->AllowNegativeRates = _rt;
}
if (NUMBERS[j]->name == _digit)
{
NUMBERS[j]->AllowNegativeRates = _rt;
}
}
}
void ClassFlowPostProcessing::handleMaxRateType(string _decsep, string _value)
{
@@ -521,9 +551,12 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
}
if ((toUpper(_param) == "ALLOWNEGATIVERATES") && (splitted.size() > 1))
{
handleAllowNegativeRate(splitted[0], splitted[1]);
/* Updated to allow individual Settings
if (toUpper(splitted[1]) == "TRUE")
for (_n = 0; _n < NUMBERS.size(); ++_n)
NUMBERS[_n]->AllowNegativeRates = true;
*/
}
if ((toUpper(_param) == "ERRORMESSAGE") && (splitted.size() > 1))
{

View File

@@ -43,6 +43,8 @@ protected:
void handleDecimalExtendedResolution(string _decsep, string _value);
void handleMaxRateType(string _decsep, string _value);
void handleAnalogDigitalTransitionStart(string _decsep, string _value);
void handleAllowNegativeRate(string _decsep, string _value);
std::string GetStringReadouts(general);
void WriteDataLog(int _index);