Minor Corrections

This commit is contained in:
jomjol
2020-08-07 18:34:00 +02:00
parent 7895d6ce0f
commit 272a74b346
3 changed files with 30 additions and 5 deletions

View File

@@ -29,7 +29,8 @@ public:
bool doNeuralNetwork(string time); bool doNeuralNetwork(string time);
bool doAlignAndCut(string time); bool doAlignAndCut(string time);
std::vector<HTMLInfo*> GetHTMLInfo(); std::vector<HTMLInfo*> GetHTMLInfo();
int AnzahlROIs(){return ROI.size();};
string name(){return "ClassFlowAnalog";}; string name(){return "ClassFlowAnalog";};
}; };

View File

@@ -5,6 +5,9 @@
#include "ClassFlowDigit.h" #include "ClassFlowDigit.h"
#include "ClassFlowMakeImage.h" #include "ClassFlowMakeImage.h"
#include <iomanip>
#include <sstream>
#include <time.h> #include <time.h>
string ClassFlowPostProcessing::GetPreValue() string ClassFlowPostProcessing::GetPreValue()
@@ -138,6 +141,20 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
{ {
PreValueUse = true; PreValueUse = true;
PreValueOkay = LoadPreValue(); PreValueOkay = LoadPreValue();
if (PreValueOkay)
{
Value = PreValue;
for (int i = 0; i < ListFlowControll->size(); ++i)
{
if (((*ListFlowControll)[i])->name().compare("ClassFlowAnalog") == 0)
{
int AnzahlNachkomma = ((ClassFlowAnalog*)(*ListFlowControll)[i])->AnzahlROIs();
std::stringstream stream;
stream << std::fixed << std::setprecision(AnzahlNachkomma) << Value;
ReturnValue = stream.str();
}
}
}
} }
} }
if ((zerlegt[0] == "AllowNegativeRates") && (zerlegt.size() > 1)) if ((zerlegt[0] == "AllowNegativeRates") && (zerlegt.size() > 1))
@@ -168,8 +185,10 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
string result = ""; string result = "";
string digit = ""; string digit = "";
string analog = ""; string analog = "";
string zwvalue;
bool isdigit = false; bool isdigit = false;
bool isanalog = false; bool isanalog = false;
int AnzahlNachkomma = 0;
string zw; string zw;
string error = ""; string error = "";
time_t imagetime = 0; time_t imagetime = 0;
@@ -189,6 +208,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
{ {
isanalog = true; isanalog = true;
analog = (*ListFlowControll)[i]->getReadout(); analog = (*ListFlowControll)[i]->getReadout();
AnzahlNachkomma = ((ClassFlowAnalog*)(*ListFlowControll)[i])->AnzahlROIs();
} }
} }
@@ -234,7 +254,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
if (isdigit) if (isdigit)
{ {
digit = ErsetzteN(digit); digit = ErsetzteN(digit);
zw = zw + digit; zw = digit;
} }
if (isdigit && isanalog) if (isdigit && isanalog)
zw = zw + "."; zw = zw + ".";
@@ -245,19 +265,23 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
Value = std::stof(zw); Value = std::stof(zw);
std::stringstream stream;
stream << std::fixed << std::setprecision(AnzahlNachkomma) << Value;
zwvalue = stream.str();
if ((!AllowNegativeRates) && (Value < PreValue)) if ((!AllowNegativeRates) && (Value < PreValue))
{ {
error = "Negative Rate - Return old value - " + std::to_string(Value); error = "Negative Rate - Return old value - " + zwvalue;
Value = PreValue; Value = PreValue;
} }
if (useMaxRateValue && ((Value - PreValue) > MaxRateValue)) if (useMaxRateValue && ((Value - PreValue) > MaxRateValue))
{ {
error = "Negative Rate - Return old value - " + std::to_string(Value); error = "Negative Rate - Return old value - " + zwvalue;
Value = PreValue; Value = PreValue;
} }
ReturnValue = std::to_string(Value); ReturnValue = zwvalue;
if (ErrorMessage && (error.length() > 0)) if (ErrorMessage && (error.length() > 0))
ReturnValue = ReturnValue + "\t" + error; ReturnValue = ReturnValue + "\t" + error;

Binary file not shown.