This commit is contained in:
jomjol
2021-09-12 07:29:30 +02:00
parent dd995ec28a
commit 7fcb5d1c0c
18 changed files with 104 additions and 32 deletions

View File

@@ -6,7 +6,9 @@
##### 7.1.2 MQTT-Update - (2021-06-17) ##### 7.1.2 MQTT-Update - (2021-06-17)
* NEW: 7.1.2: bug fix setting hostname, Flash-LED not off during rebootNEW: 7.1.1: bug fix wlan password with "=" (again) * NEW: 7.1.2: bug fix setting hostname, Flash-LED not off during reboot
* NEW: 7.1.1: bug fix wlan password with "=" (again)
* MQTT error message: changes "no error", send retain flag * MQTT error message: changes "no error", send retain flag

View File

@@ -47,20 +47,12 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
##### Rolling (2021-09-10) ##### 8.3.0 - Multi Meter Support (2021-09-12)
* Upgrade digital CNN to v12.1.0 (added new images) * Upgrade digital CNN to v12.1.0 (added new images)
* Internal refactoring (CNN-Handling) * Dedicated NaN handling, internal refactoring (CNN-Handling)
* html: confirmation after config update, spelling corrections * HTML: confirmation after config.ini update
* Bug fixing
Rolling (2021-08-31)
* Bug fix
Rolling (2021-08-30)
* Dedicated NaN-test case
* Based on v8.2.0
##### 8.2.0 - Multi Meter Support (2021-08-24) ##### 8.2.0 - Multi Meter Support (2021-08-24)

View File

@@ -76,17 +76,24 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0)
if (CNNType == DigitalHyprid) if (CNNType == DigitalHyprid)
{ {
int ergebnis_nachkomma = -1; // int ergebnis_nachkomma = -1;
int prev = -1; int zif_akt = -1;
float zahl = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result; float zahl = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result;
if (zahl >= 0) // NaN? if (zahl >= 0) // NaN?
{ {
ergebnis_nachkomma = ((int) floor(zahl * 10)) % 10; if (extendedResolution)
prev = ZeigerEval(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result, prev); {
result = std::to_string(prev); int ergebnis_nachkomma = ((int) floor(zahl * 10)) % 10;
if (extendedResolution && (CNNType != Digital)) int ergebnis_vorkomma = ((int) floor(zahl)) % 10;
result = result + std::to_string(ergebnis_nachkomma);
result = std::to_string(ergebnis_vorkomma) + std::to_string(ergebnis_nachkomma);
}
else
{
zif_akt = ZeigerEvalHybrid(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result, -1, -1);
result = std::to_string(zif_akt);
}
} }
else else
{ {
@@ -99,12 +106,12 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0)
{ {
if (GENERAL[_analog]->ROI[i]->result >= 0) if (GENERAL[_analog]->ROI[i]->result >= 0)
{ {
prev = ZeigerEval(GENERAL[_analog]->ROI[i]->result, prev); zif_akt = ZeigerEvalHybrid(GENERAL[_analog]->ROI[i]->result, GENERAL[_analog]->ROI[i+1]->result, zif_akt);
result = std::to_string(prev) + result; result = std::to_string(zif_akt) + result;
} }
else else
{ {
prev = -1; zif_akt = -1;
result = "N" + result; result = "N" + result;
} }
} }
@@ -114,6 +121,47 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0)
return result; return result;
} }
int ClassFlowCNNGeneral::ZeigerEvalHybrid(float zahl, float zahl_vorgaenger, int eval_vorgaenger)
{
int ergebnis_nachkomma = ((int) floor(zahl * 10)) % 10;
// int ergebnis_vorkomma = ((int) floor(zahl)) % 10;
if (zahl_vorgaenger < 0) // keine Vorzahl vorhanden !!! --> Runde die Zahl
{
if ((ergebnis_nachkomma <= 2) || (ergebnis_nachkomma >= 8)) // Band um die Ziffer --> Runden, da Ziffer im Rahmen Ungenauigkeit erreicht
return (int) round(zahl);
else
return (int) trunc(zahl);
}
if (zahl_vorgaenger > 9.2) // Ziffernwechsel beginnt
{
if (eval_vorgaenger == 0) // Wechsel hat schon stattgefunden
{
return (int) round(zahl); // Annahme, dass die neue Zahl schon in der Nähe des Ziels ist
}
else
{
if (zahl_vorgaenger <= 9.5) // Wechsel startet gerade, aber beginnt erst
{
if ((ergebnis_nachkomma <= 2) || (ergebnis_nachkomma >= 8)) // Band um die Ziffer --> Runden, da Ziffer im Rahmen Ungenauigkeit erreicht
return (int) round(zahl);
else
return (int) trunc(zahl);
}
else
{
return (int) trunc(zahl); // Wechsel schon weiter fortgeschritten, d.h. über 2 als Nachkomma
}
}
}
if ((ergebnis_nachkomma <= 2) || (ergebnis_nachkomma >= 8)) // Band um die Ziffer --> Runden, da Ziffer im Rahmen Ungenauigkeit erreicht
return (int) round(zahl);
return (int) trunc(zahl);
}
int ClassFlowCNNGeneral::ZeigerEval(float zahl, int ziffer_vorgaenger) int ClassFlowCNNGeneral::ZeigerEval(float zahl, int ziffer_vorgaenger)
{ {
int ergebnis_nachkomma = ((int) floor(zahl * 10)) % 10; int ergebnis_nachkomma = ((int) floor(zahl * 10)) % 10;
@@ -407,6 +455,8 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
printf(zwcnn.c_str());printf("\n"); printf(zwcnn.c_str());printf("\n");
if (!tflite->LoadModel(zwcnn)) { if (!tflite->LoadModel(zwcnn)) {
printf("Can't read model file /sdcard%s\n", cnnmodelfile.c_str()); printf("Can't read model file /sdcard%s\n", cnnmodelfile.c_str());
LogFile.WriteToFile("Cannot load model");
delete tflite; delete tflite;
return false; return false;
} }
@@ -488,12 +538,19 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
_num = tflite->GetOutClassification(0, 10); _num = tflite->GetOutClassification(0, 10);
_nachkomma = tflite->GetOutClassification(11, 22); _nachkomma = tflite->GetOutClassification(11, 22);
string _zwres = "Nach Invoke - Nummer: " + to_string(_num) + " Nachkomma: " + to_string(_nachkomma);
if (debugdetailgeneral) LogFile.WriteToFile(_zwres);
if ((_num == 10) || (_nachkomma == 10)) // NaN detektiert if ((_num == 10) || (_nachkomma == 10)) // NaN detektiert
GENERAL[_ana]->ROI[i]->result = -1; GENERAL[_ana]->ROI[i]->result = -1;
else else
GENERAL[_ana]->ROI[i]->result = fmod(_num + (_nachkomma-5)/10 + 10, 10); GENERAL[_ana]->ROI[i]->result = fmod((double) _num + (((double)_nachkomma)-5)/10 + (double) 10, 10);
printf("Result General(DigitalHyprid)%i: %f\n", i, GENERAL[_ana]->ROI[i]->result); printf("Result General(DigitalHyprid)%i: %f\n", i, GENERAL[_ana]->ROI[i]->result);
_zwres = "Result General(DigitalHyprid)" + to_string(i) + ": " + to_string(GENERAL[_ana]->ROI[i]->result);
if (debugdetailgeneral) LogFile.WriteToFile(_zwres);
if (isLogImage) if (isLogImage)
LogImage(logPath, GENERAL[_ana]->ROI[i]->name, &GENERAL[_ana]->ROI[i]->result, NULL, time, GENERAL[_ana]->ROI[i]->image_org); LogImage(logPath, GENERAL[_ana]->ROI[i]->name, &GENERAL[_ana]->ROI[i]->result, NULL, time, GENERAL[_ana]->ROI[i]->image_org);
} break; } break;

View File

@@ -40,6 +40,8 @@ protected:
bool extendedResolution; bool extendedResolution;
int ZeigerEval(float zahl, int ziffer_vorgaenger); int ZeigerEval(float zahl, int ziffer_vorgaenger);
int ZeigerEvalHybrid(float zahl, float zahl_vorgaenger, int eval_vorgaenger);
bool doNeuralNetwork(string time); bool doNeuralNetwork(string time);
bool doAlignAndCut(string time); bool doAlignAndCut(string time);
@@ -64,7 +66,7 @@ public:
general* FindGENERAL(string _name_number); general* FindGENERAL(string _name_number);
string getNameGENERAL(int _analog); string getNameGENERAL(int _analog);
bool isExtendedResolution(int _number); bool isExtendedResolution(int _number = 0);
void UpdateNameNumbers(std::vector<std::string> *_name_numbers); void UpdateNameNumbers(std::vector<std::string> *_name_numbers);

View File

@@ -48,9 +48,14 @@ void ClassFlowImage::LogImage(string logPath, string name, float *resultFloat, i
if (!isLogImage) if (!isLogImage)
return; return;
char buf[10]; char buf[10];
if (resultFloat != NULL) { if (resultFloat != NULL) {
sprintf(buf, "%.1f_", *resultFloat); if (*resultFloat < 0)
sprintf(buf, "N.N_");
else
sprintf(buf, "%.1f_", *resultFloat);
} else if (resultInt != NULL) { } else if (resultInt != NULL) {
sprintf(buf, "%d_", *resultInt); sprintf(buf, "%d_", *resultInt);
} else { } else {

View File

@@ -559,6 +559,10 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
if (flowAnalog) NUMBERS[j]->AnzahlAnalog = flowAnalog->AnzahlROIs(j); if (flowAnalog) NUMBERS[j]->AnzahlAnalog = flowAnalog->AnzahlROIs(j);
if (flowDigit) NUMBERS[j]->AnzahlDigital = flowDigit->AnzahlROIs(j); if (flowDigit) NUMBERS[j]->AnzahlDigital = flowDigit->AnzahlROIs(j);
if (flowDigit->isExtendedResolution())
NUMBERS[j]->DecimalShift = NUMBERS[j]->DecimalShiftInitial - 1;
NUMBERS[j]->Nachkomma = NUMBERS[j]->AnzahlAnalog - NUMBERS[j]->DecimalShift; NUMBERS[j]->Nachkomma = NUMBERS[j]->AnzahlAnalog - NUMBERS[j]->DecimalShift;

View File

@@ -194,6 +194,8 @@ void CTfLiteClass::MakeAllocate()
TfLiteStatus allocate_status = this->interpreter->AllocateTensors(); TfLiteStatus allocate_status = this->interpreter->AllocateTensors();
if (allocate_status != kTfLiteOk) { if (allocate_status != kTfLiteOk) {
TF_LITE_REPORT_ERROR(error_reporter, "AllocateTensors() failed"); TF_LITE_REPORT_ERROR(error_reporter, "AllocateTensors() failed");
LogFile.WriteToFile("AllocateTensors() failed");
this->GetInputDimension(); this->GetInputDimension();
return; return;
} }

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="af99de3"; const char* GIT_REV="dd995ec";
const char* GIT_TAG=""; const char* GIT_TAG="";
const char* GIT_BRANCH="rolling"; const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2021-09-10 07:03"; const char* BUILD_TIME="2021-09-12 07:26";

View File

@@ -13,7 +13,7 @@ extern "C"
#include "Helper.h" #include "Helper.h"
#include <fstream> #include <fstream>
const char* GIT_BASE_BRANCH = "master - v8.2.0 - 2021-08-24"; const char* GIT_BASE_BRANCH = "master - v8.3.0 - 2021-09-12";
const char* git_base_branch(void) const char* git_base_branch(void)

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="af99de3"; const char* GIT_REV="dd995ec";
const char* GIT_TAG=""; const char* GIT_TAG="";
const char* GIT_BRANCH="rolling"; const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2021-09-10 07:03"; const char* BUILD_TIME="2021-09-12 07:26";

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -468,6 +468,13 @@ function draw() {
context.strokeRect(x0, y0, dx, dy); context.strokeRect(x0, y0, dx, dy);
context.lineWidth = 1; context.lineWidth = 1;
context.strokeRect(x0+dx*0.2, y0+dy*0.2, dx*0.6, dy*0.6); context.strokeRect(x0+dx*0.2, y0+dy*0.2, dx*0.6, dy*0.6);
context.lineWidth = 2;
context.beginPath();
context.moveTo(x0, y0+dy/2);
context.lineTo(x0+dx, y0+dy/2);
context.stroke();
ROIInfo[aktindex]["x"] = rect.startX; ROIInfo[aktindex]["x"] = rect.startX;
ROIInfo[aktindex]["y"] = rect.startY; ROIInfo[aktindex]["y"] = rect.startY;
ROIInfo[aktindex]["dx"] = rect.w; ROIInfo[aktindex]["dx"] = rect.w;

View File

@@ -9,7 +9,7 @@ function getbasepath(){
{ {
// host = "http://192.168.2.219"; // jomjol interner test // host = "http://192.168.2.219"; // jomjol interner test
// host = "http://192.168.178.46"; // jomjol interner test // host = "http://192.168.178.46"; // jomjol interner test
host = "http://192.168.178.64"; // jomjol interner Real host = "http://192.168.178.22"; // jomjol interner Real
// host = "http://192.168.43.191"; // host = "http://192.168.43.191";
// host = "."; // jomjol interner localhost // host = "."; // jomjol interner localhost

View File

@@ -53,6 +53,7 @@ function ParseConfig() {
ParamAddValue(param, catname, "LogImageLocation"); ParamAddValue(param, catname, "LogImageLocation");
ParamAddValue(param, catname, "LogfileRetentionInDays"); ParamAddValue(param, catname, "LogfileRetentionInDays");
ParamAddValue(param, catname, "ModelInputSize", 2); ParamAddValue(param, catname, "ModelInputSize", 2);
ParamAddValue(param, catname, "ExtendedResolution");
var catname = "Analog"; var catname = "Analog";
category[catname] = new Object(); category[catname] = new Object();