mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-31 14:51:02 +03:00
Bug fixing
This commit is contained in:
@@ -31,6 +31,8 @@ A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4571
|
|||||||
|
|
||||||
##### Rolling - (2020-09-13)
|
##### Rolling - (2020-09-13)
|
||||||
|
|
||||||
|
* Bug fixing DecimalShift (digits after comma)
|
||||||
|
|
||||||
* Implementation of decimal shift (New Parameter "DecimalShift = 1" in [PostProcessing])
|
* Implementation of decimal shift (New Parameter "DecimalShift = 1" in [PostProcessing])
|
||||||
DecimalShift = 2 --> Result: 123.456 --> 12345.6
|
DecimalShift = 2 --> Result: 123.456 --> 12345.6
|
||||||
DecimalShift = -1 --> Result: 123.456 --> 12.3456
|
DecimalShift = -1 --> Result: 123.456 --> 12.3456
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ string ClassFlowPostProcessing::GetPreValue()
|
|||||||
if (((*ListFlowControll)[i])->name().compare("ClassFlowAnalog") == 0)
|
if (((*ListFlowControll)[i])->name().compare("ClassFlowAnalog") == 0)
|
||||||
{
|
{
|
||||||
int AnzahlNachkomma = ((ClassFlowAnalog*)(*ListFlowControll)[i])->AnzahlROIs();
|
int AnzahlNachkomma = ((ClassFlowAnalog*)(*ListFlowControll)[i])->AnzahlROIs();
|
||||||
std::stringstream stream;
|
result = RundeOutput(PreValue, AnzahlNachkomma + DecimalShift);
|
||||||
stream << std::fixed << std::setprecision(AnzahlNachkomma) << PreValue;
|
|
||||||
result = stream.str();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,9 +79,7 @@ bool ClassFlowPostProcessing::LoadPreValue(void)
|
|||||||
if (((*ListFlowControll)[i])->name().compare("ClassFlowAnalog") == 0)
|
if (((*ListFlowControll)[i])->name().compare("ClassFlowAnalog") == 0)
|
||||||
{
|
{
|
||||||
int AnzahlNachkomma = ((ClassFlowAnalog*)(*ListFlowControll)[i])->AnzahlROIs();
|
int AnzahlNachkomma = ((ClassFlowAnalog*)(*ListFlowControll)[i])->AnzahlROIs();
|
||||||
std::stringstream stream;
|
ReturnValue = RundeOutput(Value, AnzahlNachkomma + DecimalShift);
|
||||||
stream << std::fixed << std::setprecision(AnzahlNachkomma) << Value;
|
|
||||||
ReturnValue = stream.str();
|
|
||||||
ReturnValueNoError = ReturnValue;
|
ReturnValueNoError = ReturnValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -346,18 +342,13 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
|||||||
zw = zw + analog;
|
zw = zw + analog;
|
||||||
|
|
||||||
Value = std::stof(zw);
|
Value = std::stof(zw);
|
||||||
|
zwvalue = RundeOutput(Value, AnzahlNachkomma + DecimalShift);
|
||||||
std::stringstream stream;
|
|
||||||
stream << std::fixed << std::setprecision(AnzahlNachkomma) << Value;
|
|
||||||
zwvalue = stream.str();
|
|
||||||
|
|
||||||
if ((!AllowNegativeRates) && (Value < PreValue))
|
if ((!AllowNegativeRates) && (Value < PreValue))
|
||||||
{
|
{
|
||||||
error = "Negative Rate - Returned old value - read value: " + zwvalue;
|
error = "Negative Rate - Returned old value - read value: " + zwvalue;
|
||||||
Value = PreValue;
|
Value = PreValue;
|
||||||
stream.str("");
|
zwvalue = RundeOutput(Value, AnzahlNachkomma + DecimalShift);
|
||||||
stream << std::fixed << std::setprecision(AnzahlNachkomma) << Value;
|
|
||||||
zwvalue = stream.str();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -365,9 +356,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
|||||||
{
|
{
|
||||||
error = "Rate too high - Returned old value - read value: " + zwvalue;
|
error = "Rate too high - Returned old value - read value: " + zwvalue;
|
||||||
Value = PreValue;
|
Value = PreValue;
|
||||||
stream.str("");
|
zwvalue = RundeOutput(Value, AnzahlNachkomma + DecimalShift);
|
||||||
stream << std::fixed << std::setprecision(AnzahlNachkomma) << Value;
|
|
||||||
zwvalue = stream.str();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,6 +385,12 @@ string ClassFlowPostProcessing::getReadoutParam(bool _rawValue, bool _noerror)
|
|||||||
return ReturnValue;
|
return ReturnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string ClassFlowPostProcessing::RundeOutput(float _in, int _anzNachkomma){
|
||||||
|
std::stringstream stream;
|
||||||
|
stream << std::fixed << std::setprecision(_anzNachkomma) << _in;
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
string ClassFlowPostProcessing::ErsetzteN(string input, int lastvalueanalog = -1)
|
string ClassFlowPostProcessing::ErsetzteN(string input, int lastvalueanalog = -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ protected:
|
|||||||
string ShiftDecimal(string in, int _decShift);
|
string ShiftDecimal(string in, int _decShift);
|
||||||
|
|
||||||
string ErsetzteN(string, int lastvalueanalog);
|
string ErsetzteN(string, int lastvalueanalog);
|
||||||
|
string RundeOutput(float _in, int _anzNachkomma);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ClassFlowPostProcessing();
|
ClassFlowPostProcessing();
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user