mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-31 03:48:25 +03:00
Rolling 210527
This commit is contained in:
@@ -22,13 +22,16 @@ static const char* TAG = "flow_controll";
|
||||
std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _host){
|
||||
std::string _classname = "";
|
||||
std::string result = "";
|
||||
// printf("_stepname: %s\n", _stepname.c_str());
|
||||
if ((_stepname.compare("[MakeImage]") == 0) || (_stepname.compare(";[MakeImage]") == 0)){
|
||||
_classname = "ClassFlowMakeImage";
|
||||
}
|
||||
if ((_stepname.compare("[Alignment]") == 0) || (_stepname.compare(";[Alignment]") == 0)){
|
||||
_classname = "ClassFlowAlignment";
|
||||
}
|
||||
if ((_stepname.compare("[Digits]") == 0) || (_stepname.compare(";[Digits]") == 0)){
|
||||
if ((_stepname.compare(0, 7, "[Digits") == 0) || (_stepname.compare(0, 8, ";[Digits") == 0)) {
|
||||
// if ((_stepname.compare("[Digits]") == 0) || (_stepname.compare(";[Digits]") == 0)){
|
||||
// printf("Digits!!!\n");
|
||||
_classname = "ClassFlowDigit";
|
||||
}
|
||||
if ((_stepname.compare("[Analog]") == 0) || (_stepname.compare(";[Analog]") == 0)){
|
||||
@@ -110,7 +113,7 @@ ClassFlow* ClassFlowControll::CreateClassFlow(std::string _type)
|
||||
cfc = new ClassFlowAnalog(&FlowControll);
|
||||
flowanalog = (ClassFlowAnalog*) cfc;
|
||||
}
|
||||
if (toUpper(_type).compare("[DIGITS]") == 0)
|
||||
if (toUpper(_type).compare(0, 7, "[DIGITS") == 0)
|
||||
{
|
||||
cfc = new ClassFlowDigit(&FlowControll);
|
||||
flowdigit = (ClassFlowDigit*) cfc;
|
||||
|
||||
@@ -26,7 +26,8 @@ void ClassFlowDigit::SetInitialParameter(void)
|
||||
previousElement = NULL;
|
||||
SaveAllFiles = false;
|
||||
disabled = false;
|
||||
|
||||
DecimalShift = 0;
|
||||
DecimalShiftEnabled = false;
|
||||
}
|
||||
|
||||
ClassFlowDigit::ClassFlowDigit() : ClassFlowImage(TAG)
|
||||
@@ -88,8 +89,25 @@ bool ClassFlowDigit::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||
if (!this->GetNextParagraph(pfile, aktparamgraph))
|
||||
return false;
|
||||
|
||||
printf("aktparamgraph: %s\n", aktparamgraph.c_str());
|
||||
|
||||
|
||||
/*
|
||||
if ((aktparamgraph.compare("[Digits]") != 0) && (aktparamgraph.compare(";[Digits]") != 0)) // Paragraph passt nich zu MakeImage
|
||||
return false;
|
||||
*/
|
||||
|
||||
if ((aktparamgraph.compare(0, 7, "[Digits") != 0) && (aktparamgraph.compare(0, 8, ";[Digits") != 0)) // Paragraph passt nich zu MakeImage
|
||||
return false;
|
||||
|
||||
int _pospkt = aktparamgraph.find_first_of(".");
|
||||
int _posklammerzu = aktparamgraph.find_first_of("]");
|
||||
// printf("Pos: %d, %d\n", _pospkt, _posklammerzu);
|
||||
if (_pospkt > -1)
|
||||
NameDigit = aktparamgraph.substr(_pospkt+1, _posklammerzu - _pospkt-1);
|
||||
else
|
||||
NameDigit = "";
|
||||
printf("Name Digit: %s\n", NameDigit.c_str());
|
||||
|
||||
if (aktparamgraph[0] == ';')
|
||||
{
|
||||
|
||||
@@ -21,6 +21,10 @@ protected:
|
||||
string cnnmodelfile;
|
||||
int modelxsize, modelysize;
|
||||
bool SaveAllFiles;
|
||||
string NameDigit;
|
||||
int DecimalShift;
|
||||
bool DecimalShiftEnabled;
|
||||
|
||||
|
||||
ClassFlowAlignment* flowpostalignment;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ void ClassFlowMakeImage::takePictureWithFlash(int flashdauer)
|
||||
rawImage->width = image_width;
|
||||
rawImage->height = image_height;
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
printf("Flashdauer: %d\n", flashdauer);
|
||||
Camera.CaptureToBasisImage(rawImage, flashdauer);
|
||||
time(&TimeImageTaken);
|
||||
localtime(&TimeImageTaken);
|
||||
@@ -92,6 +93,12 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||
if (toUpper(zerlegt[1]) == "TRUE")
|
||||
SaveAllFiles = true;
|
||||
}
|
||||
|
||||
if ((toUpper(zerlegt[0]) == "WAITBEFORETAKINGPICTURE") && (zerlegt.size() > 1))
|
||||
{
|
||||
waitbeforepicture = stoi(zerlegt[1]);
|
||||
}
|
||||
|
||||
|
||||
if ((toUpper(zerlegt[0]) == "BRIGHTNESS") && (zerlegt.size() > 1))
|
||||
{
|
||||
@@ -124,9 +131,9 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||
rawImage->CreateEmptyImage(image_width, image_height, 3);
|
||||
|
||||
waitbeforepicture_store = waitbeforepicture;
|
||||
if (FixedExposure)
|
||||
if (FixedExposure && (waitbeforepicture > 0))
|
||||
{
|
||||
printf("Fixed Exposure enabled!\n");
|
||||
// printf("Fixed Exposure enabled!\n");
|
||||
int flashdauer = (int) (waitbeforepicture * 1000);
|
||||
Camera.EnableAutoExposure(flashdauer);
|
||||
waitbeforepicture = 0.2;
|
||||
|
||||
@@ -434,6 +434,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
||||
if (ErrorMessageText.length() == 0)
|
||||
{
|
||||
PreValue = Value;
|
||||
ErrorMessageText = "no error";
|
||||
SavePreValue(Value, zwtime);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user