mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 04:26:58 +03:00
Merge branch 'rolling' of https://github.com/jomjol/AI-on-the-edge-device into rolling
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
- Updated built environment to `espressif32@v5.2.0`
|
- Updated built environment to `espressif32@v5.2.0`
|
||||||
- [#1176](https://github.com/jomjol/AI-on-the-edge-device/discussions/1176) accept minor negative values (-0.2) if extended resolution is enabled
|
- [#1176](https://github.com/jomjol/AI-on-the-edge-device/discussions/1176) accept minor negative values (-0.2) if extended resolution is enabled
|
||||||
|
- [#1143](https://github.com/jomjol/AI-on-the-edge-device/issues/1143) added config parameter AnalogDigitalTransitionStart. It can setup very early and very late digit transition starts.
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- [#1116](https://github.com/jomjol/AI-on-the-edge-device/issues/1116) precision problem at setting prevalue
|
- [#1116](https://github.com/jomjol/AI-on-the-edge-device/issues/1116) precision problem at setting prevalue
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
static const char* TAG = "flow_analog";
|
static const char* TAG = "flow_analog";
|
||||||
|
|
||||||
bool debugdetailgeneral = false;
|
|
||||||
|
|
||||||
ClassFlowCNNGeneral::ClassFlowCNNGeneral(ClassFlowAlignment *_flowalign, t_CNNType _cnntype) : ClassFlowImage(NULL, TAG)
|
ClassFlowCNNGeneral::ClassFlowCNNGeneral(ClassFlowAlignment *_flowalign, t_CNNType _cnntype) : ClassFlowImage(NULL, TAG)
|
||||||
{
|
{
|
||||||
@@ -28,7 +28,7 @@ ClassFlowCNNGeneral::ClassFlowCNNGeneral(ClassFlowAlignment *_flowalign, t_CNNTy
|
|||||||
flowpostalignment = _flowalign;
|
flowpostalignment = _flowalign;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution, int prev, float _vorgaengerAnalog)
|
string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution, int prev, float _vorgaengerAnalog, float analogDigitalTransitionStart)
|
||||||
{
|
{
|
||||||
string result = "";
|
string result = "";
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
|||||||
{
|
{
|
||||||
// prev = ZeigerEval(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, prev);
|
// prev = ZeigerEval(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, prev);
|
||||||
if (_vorgaengerAnalog >= 0)
|
if (_vorgaengerAnalog >= 0)
|
||||||
prev = ZeigerEvalHybridNeu(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, _vorgaengerAnalog, prev, true);
|
prev = ZeigerEvalHybridNeu(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, _vorgaengerAnalog, prev, true, analogDigitalTransitionStart);
|
||||||
else
|
else
|
||||||
prev = ZeigerEvalHybridNeu(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, prev, prev);
|
prev = ZeigerEvalHybridNeu(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, prev, prev);
|
||||||
result = std::to_string(prev);
|
result = std::to_string(prev);
|
||||||
@@ -176,7 +176,7 @@ int ClassFlowCNNGeneral::ZeigerEvalHybridNeu(float zahl, float zahl_vorgaenger,
|
|||||||
|
|
||||||
if (AnalogerVorgaenger)
|
if (AnalogerVorgaenger)
|
||||||
{
|
{
|
||||||
result = ZeigerEvalAnalogToDigitNeu(zahl, zahl_vorgaenger, eval_vorgaenger);
|
result = ZeigerEvalAnalogToDigitNeu(zahl, zahl_vorgaenger, eval_vorgaenger, digitalAnalogTransitionStart);
|
||||||
if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::ZeigerEvalHybridNeu - Analoger Vorgänger, Bewertung über ZeigerEvalAnalogNeu = " + std::to_string(result) +
|
if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::ZeigerEvalHybridNeu - Analoger Vorgänger, Bewertung über ZeigerEvalAnalogNeu = " + std::to_string(result) +
|
||||||
" zahl: " + std::to_string(zahl) + " zahl_vorgaenger = " + std::to_string(zahl_vorgaenger)+ " eval_vorgaenger = " + std::to_string(eval_vorgaenger) + " DigitalUnschaerfe = " + std::to_string(DigitalUnschaerfe));
|
" zahl: " + std::to_string(zahl) + " zahl_vorgaenger = " + std::to_string(zahl_vorgaenger)+ " eval_vorgaenger = " + std::to_string(eval_vorgaenger) + " DigitalUnschaerfe = " + std::to_string(DigitalUnschaerfe));
|
||||||
return result;
|
return result;
|
||||||
@@ -230,11 +230,12 @@ int ClassFlowCNNGeneral::ZeigerEvalHybridNeu(float zahl, float zahl_vorgaenger,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vorgaenger, int eval_vorgaenger)
|
int ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vorgaenger, int eval_vorgaenger, float analogDigitalTransitionStart)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
int ergebnis_nachkomma = ((int) floor(zahl * 10)) % 10;
|
int ergebnis_nachkomma = ((int) floor(zahl * 10)) % 10;
|
||||||
int ergebnis_vorkomma = ((int) floor(zahl) + 10) % 10;
|
int ergebnis_vorkomma = ((int) floor(zahl) + 10) % 10;
|
||||||
|
bool roundedUp = false;
|
||||||
|
|
||||||
if (ziffer_vorgaenger < 0)
|
if (ziffer_vorgaenger < 0)
|
||||||
{
|
{
|
||||||
@@ -244,17 +245,20 @@ int ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vor
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ziffer_vorgaenger <= 3 && eval_vorgaenger<9) // Nulldurchgang hat stattgefunden (!Bewertung über Prev_value und nicht Zahl!) --> hier aufrunden (2.8 --> 3, aber auch 3.1 --> 3)
|
// Kein Nulldurchgang hat stattgefunden.
|
||||||
// aber Sonderfall ziffer_vorgaeger = 0.1 vor_vorgaenger 9.9 => eval_vorgaenger ist 9, damit hat Nulldurchgang nicht stattgefunden.
|
// Nur eval_vorgaenger verwendet, da ziffer_vorgaenger hier falsch sein könnte.
|
||||||
|
// ziffer_vorgaenger<=0.1 & eval_vorgaenger=9 entspricht analog wurde zurückgesetzt wegen vorhergehender analog, die noch nicht auf 0 sind.
|
||||||
|
if ((eval_vorgaenger>=6 && (ziffer_vorgaenger>analogDigitalTransitionStart || ziffer_vorgaenger<=0.2) && roundedUp)
|
||||||
|
// digit läuft dem Analog vor. Darf aber erst passieren, wenn
|
||||||
|
// digit wirklich schnon los läuft, deshalb 9
|
||||||
|
|| (eval_vorgaenger>9 && ziffer_vorgaenger>analogDigitalTransitionStart && ergebnis_nachkomma<=1))
|
||||||
|
|
||||||
{
|
{
|
||||||
if (ergebnis_nachkomma > 5)
|
result = ((ergebnis_vorkomma+10) - 1) % 10;
|
||||||
result = (ergebnis_vorkomma + 1) % 10;
|
if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu - Nulldurchgang noch nicht stattgefunden = " + std::to_string(result) +
|
||||||
else
|
" zahl: " + std::to_string(zahl) +
|
||||||
result = ergebnis_vorkomma;
|
" ziffer_vorgaenger = " + std::to_string(ziffer_vorgaenger) +
|
||||||
if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu - Nulldurchgang hat stattgefunden = " + std::to_string(result) +
|
" erg_nachkomma = " + std::to_string(ergebnis_nachkomma));
|
||||||
" zahl: " + std::to_string(zahl) + " ziffer_vorgaenger = " + std::to_string(ziffer_vorgaenger) + " DigitalUnschaerfe = " + std::to_string(DigitalUnschaerfe));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vorlauf ziffer_vorgaenger <=9.9 und ergebnis_nachkomma >=0..1 (digits drehen nach umschalten nicht gleich weiter)
|
// Vorlauf ziffer_vorgaenger <=9.9 und ergebnis_nachkomma >=0..1 (digits drehen nach umschalten nicht gleich weiter)
|
||||||
// Beispiel dig=4.0, ana=9.1 ==> dig=3
|
// Beispiel dig=4.0, ana=9.1 ==> dig=3
|
||||||
@@ -275,10 +279,9 @@ int ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vor
|
|||||||
else
|
else
|
||||||
result = ergebnis_vorkomma;
|
result = ergebnis_vorkomma;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debugdetailgeneral) LogFile.WriteToFile("ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu - 9.0 --> noch kein Nulldurchgang = " + std::to_string(result) +
|
|
||||||
" zahl: " + std::to_string(zahl) + " ziffer_vorgaenger = " + std::to_string(ziffer_vorgaenger) + " DigitalUnschaerfe = " + std::to_string(DigitalUnschaerfe));
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ClassFlowCNNGeneral::ZeigerEvalAnalogNeu(float zahl, int ziffer_vorgaenger)
|
int ClassFlowCNNGeneral::ZeigerEvalAnalogNeu(float zahl, int ziffer_vorgaenger)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class ClassFlowCNNGeneral :
|
|||||||
public ClassFlowImage
|
public ClassFlowImage
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
bool debugdetailgeneral = true;
|
||||||
t_CNNType CNNType;
|
t_CNNType CNNType;
|
||||||
std::vector<general*> GENERAL;
|
std::vector<general*> GENERAL;
|
||||||
float CNNGoodThreshold;
|
float CNNGoodThreshold;
|
||||||
@@ -28,7 +29,6 @@ protected:
|
|||||||
float DigitalUnschaerfe = 0.2;
|
float DigitalUnschaerfe = 0.2;
|
||||||
int DigitalBand = 3;
|
int DigitalBand = 3;
|
||||||
float DigitalAnalogerVorgaengerUebergangsbereich = 2;
|
float DigitalAnalogerVorgaengerUebergangsbereich = 2;
|
||||||
// nicht mehr benötigt float DigitalUebergangsbereichVorgaengerAnalogToDigit = 1; // war vorher 2
|
|
||||||
float DigitalUebergangsbereichVorgaenger = 0.7; // 9.3 - 0.7
|
float DigitalUebergangsbereichVorgaenger = 0.7; // 9.3 - 0.7
|
||||||
float DigitalUebergangsbereichVorlauf = 9.7; // Vorlauf-Nulldurchgang passiert erst ab ca. 9.7
|
float DigitalUebergangsbereichVorlauf = 9.7; // Vorlauf-Nulldurchgang passiert erst ab ca. 9.7
|
||||||
|
|
||||||
@@ -41,8 +41,8 @@ protected:
|
|||||||
bool SaveAllFiles;
|
bool SaveAllFiles;
|
||||||
|
|
||||||
int ZeigerEvalAnalogNeu(float zahl, int ziffer_vorgaenger);
|
int ZeigerEvalAnalogNeu(float zahl, int ziffer_vorgaenger);
|
||||||
int ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vorgaenger, int eval_vorgaenger);
|
int ZeigerEvalAnalogToDigitNeu(float zahl, float ziffer_vorgaenger, int eval_vorgaenger, float analogDigitalTransitionStart);
|
||||||
int ZeigerEvalHybridNeu(float zahl, float zahl_vorgaenger, int eval_vorgaenger, bool AnalogerVorgaenger = false);
|
int ZeigerEvalHybridNeu(float zahl, float zahl_vorgaenger, int eval_vorgaenger, bool AnalogerVorgaenger = false, float analogDigitalTransitionStart=9.2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
bool doFlow(string time);
|
bool doFlow(string time);
|
||||||
|
|
||||||
string getHTMLSingleStep(string host);
|
string getHTMLSingleStep(string host);
|
||||||
string getReadout(int _analog, bool _extendedResolution = false, int prev = -1, float _vorgaengerAnalog = -1);
|
string getReadout(int _analog, bool _extendedResolution = false, int prev = -1, float _vorgaengerAnalog = -1, float analogDigitalTransitionStart=9.2);
|
||||||
|
|
||||||
string getReadoutRawString(int _analog);
|
string getReadoutRawString(int _analog);
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ struct NumberPost {
|
|||||||
int AnzahlDigital;
|
int AnzahlDigital;
|
||||||
int DecimalShift;
|
int DecimalShift;
|
||||||
int DecimalShiftInitial;
|
int DecimalShiftInitial;
|
||||||
|
float AnalogDigitalTransitionStart; // Wann ist das digit > x.1, also wann fängt es an zu kippen
|
||||||
int Nachkomma;
|
int Nachkomma;
|
||||||
|
|
||||||
bool isExtendedResolution;
|
bool isExtendedResolution;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void ClassFlowImage::LogImage(string logPath, string name, float *resultFloat, i
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(buf, "%.1f_", *resultFloat);
|
sprintf(buf, "%.1f_", *resultFloat);
|
||||||
if (strcmp(buf, "10.0_"))
|
if (strcmp(buf, "10.0_") == 0)
|
||||||
sprintf(buf, "0.0_");
|
sprintf(buf, "0.0_");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,14 +119,16 @@ void ClassFlowImage::RemoveOldLogs()
|
|||||||
string folderPath = LogImageLocation + "/" + entry->d_name;
|
string folderPath = LogImageLocation + "/" + entry->d_name;
|
||||||
if (entry->d_type == DT_DIR) {
|
if (entry->d_type == DT_DIR) {
|
||||||
//ESP_LOGI(logTag, "Compare %s %s", entry->d_name, folderName.c_str());
|
//ESP_LOGI(logTag, "Compare %s %s", entry->d_name, folderName.c_str());
|
||||||
if ((strlen(entry->d_name) == folderName.length()) && (strcmp(entry->d_name, folderName.c_str()) < 0)) {
|
if ((strlen(entry->d_name) == folderName.length()) && (strcmp(entry->d_name, folderName.c_str()) == 0)) {
|
||||||
deleted += removeFolder(folderPath.c_str(), logTag);
|
removeFolder(folderPath.c_str(), logTag);
|
||||||
|
deleted++;
|
||||||
} else {
|
} else {
|
||||||
notDeleted ++;
|
notDeleted ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGI(logTag, "%d older log files deleted. %d current log files not deleted.", deleted, notDeleted);
|
ESP_LOGI(logTag, "%d image folder deleted. %d image folder not deleted.", deleted, notDeleted);
|
||||||
|
LogFile.WriteToFile("Image folder deleted: " + std::to_string(deleted) + ". Image folder not deleted: " + std::to_string(notDeleted));
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -343,6 +343,29 @@ void ClassFlowPostProcessing::handleDecimalSeparator(string _decsep, string _val
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClassFlowPostProcessing::handleAnalogDigitalTransitionStart(string _decsep, string _value)
|
||||||
|
{
|
||||||
|
string _digit, _decpos;
|
||||||
|
int _pospunkt = _decsep.find_first_of(".");
|
||||||
|
// printf("Name: %s, Pospunkt: %d\n", _decsep.c_str(), _pospunkt);
|
||||||
|
if (_pospunkt > -1)
|
||||||
|
_digit = _decsep.substr(0, _pospunkt);
|
||||||
|
else
|
||||||
|
_digit = "default";
|
||||||
|
|
||||||
|
for (int j = 0; j < NUMBERS.size(); ++j)
|
||||||
|
{
|
||||||
|
float _zwdc = 9.2;
|
||||||
|
{
|
||||||
|
_zwdc = stof(_value);
|
||||||
|
}
|
||||||
|
if (_digit == "default" || NUMBERS[j]->name == _digit) // erstmal auf default setzen (falls sonst nichts gesetzt)
|
||||||
|
{
|
||||||
|
NUMBERS[j]->AnalogDigitalTransitionStart = _zwdc;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ClassFlowPostProcessing::handleMaxRateType(string _decsep, string _value)
|
void ClassFlowPostProcessing::handleMaxRateType(string _decsep, string _value)
|
||||||
@@ -447,6 +470,10 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
{
|
{
|
||||||
handleDecimalSeparator(zerlegt[0], zerlegt[1]);
|
handleDecimalSeparator(zerlegt[0], zerlegt[1]);
|
||||||
}
|
}
|
||||||
|
if ((toUpper(_param) == "ANALOGDIGITALTRANSITIONSTART") && (zerlegt.size() > 1))
|
||||||
|
{
|
||||||
|
handleAnalogDigitalTransitionStart(zerlegt[0], zerlegt[1]);
|
||||||
|
}
|
||||||
if ((toUpper(_param) == "MAXRATEVALUE") && (zerlegt.size() > 1))
|
if ((toUpper(_param) == "MAXRATEVALUE") && (zerlegt.size() > 1))
|
||||||
{
|
{
|
||||||
handleMaxRateValue(zerlegt[0], zerlegt[1]);
|
handleMaxRateValue(zerlegt[0], zerlegt[1]);
|
||||||
@@ -557,6 +584,7 @@ void ClassFlowPostProcessing::InitNUMBERS()
|
|||||||
_number->DecimalShift = 0;
|
_number->DecimalShift = 0;
|
||||||
_number->DecimalShiftInitial = 0;
|
_number->DecimalShiftInitial = 0;
|
||||||
_number->isExtendedResolution = false;
|
_number->isExtendedResolution = false;
|
||||||
|
_number->AnalogDigitalTransitionStart=9.2;
|
||||||
|
|
||||||
|
|
||||||
_number->FlowRateAct = 0; // m3 / min
|
_number->FlowRateAct = 0; // m3 / min
|
||||||
@@ -674,7 +702,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
|||||||
if (NUMBERS[j]->digit_roi)
|
if (NUMBERS[j]->digit_roi)
|
||||||
{
|
{
|
||||||
if (NUMBERS[j]->analog_roi)
|
if (NUMBERS[j]->analog_roi)
|
||||||
NUMBERS[j]->ReturnRawValue = flowDigit->getReadout(j, false, previous_value, NUMBERS[j]->analog_roi->ROI[0]->result_float) + NUMBERS[j]->ReturnRawValue;
|
NUMBERS[j]->ReturnRawValue = flowDigit->getReadout(j, false, previous_value, NUMBERS[j]->analog_roi->ROI[0]->result_float, NUMBERS[j]->AnalogDigitalTransitionStart) + NUMBERS[j]->ReturnRawValue;
|
||||||
else
|
else
|
||||||
NUMBERS[j]->ReturnRawValue = flowDigit->getReadout(j, NUMBERS[j]->isExtendedResolution, previous_value); // Extended Resolution nur falls es keine analogen Ziffern gibt
|
NUMBERS[j]->ReturnRawValue = flowDigit->getReadout(j, NUMBERS[j]->isExtendedResolution, previous_value); // Extended Resolution nur falls es keine analogen Ziffern gibt
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ protected:
|
|||||||
void handleMaxRateValue(string _decsep, string _value);
|
void handleMaxRateValue(string _decsep, string _value);
|
||||||
void handleDecimalExtendedResolution(string _decsep, string _value);
|
void handleDecimalExtendedResolution(string _decsep, string _value);
|
||||||
void handleMaxRateType(string _decsep, string _value);
|
void handleMaxRateType(string _decsep, string _value);
|
||||||
|
void handleAnalogDigitalTransitionStart(string _decsep, string _value);
|
||||||
std::string GetStringReadouts(general);
|
std::string GetStringReadouts(general);
|
||||||
|
|
||||||
void WriteDataLog(int _analog);
|
void WriteDataLog(int _analog);
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ string getDirectory(string filename)
|
|||||||
|
|
||||||
string getFileType(string filename)
|
string getFileType(string filename)
|
||||||
{
|
{
|
||||||
size_t lastpos = filename.find(".", 0);
|
size_t lastpos = filename.rfind(".", filename.length());
|
||||||
size_t neu_pos;
|
size_t neu_pos;
|
||||||
while ((neu_pos = filename.find(".", lastpos + 1)) > -1)
|
while ((neu_pos = filename.find(".", lastpos + 1)) > -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ void ClassLogFile::RemoveOld()
|
|||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
if (entry->d_type == DT_REG) {
|
if (entry->d_type == DT_REG) {
|
||||||
//ESP_LOGI(TAG, "list log file : %s %s", entry->d_name, cmpfilename);
|
//ESP_LOGI(TAG, "list log file : %s %s", entry->d_name, cmpfilename);
|
||||||
if ((strlen(entry->d_name) == strlen(cmpfilename)) && (strcmp(entry->d_name, cmpfilename) < 0)) {
|
if ((strlen(entry->d_name) == strlen(cmpfilename)) && (strcmp(entry->d_name, cmpfilename) == 0)) {
|
||||||
ESP_LOGI(TAG, "delete log file : %s", entry->d_name);
|
ESP_LOGI(TAG, "delete log file : %s", entry->d_name);
|
||||||
std::string filepath = logroot + "/" + entry->d_name;
|
std::string filepath = logroot + "/" + entry->d_name;
|
||||||
if (unlink(filepath.c_str()) == 0) {
|
if (unlink(filepath.c_str()) == 0) {
|
||||||
@@ -244,7 +244,8 @@ void ClassLogFile::RemoveOld()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG, "%d older log files deleted. %d current log files not deleted.", deleted, notDeleted);
|
ESP_LOGI(TAG, "%d logfiles deleted. %d files not deleted (incl. leer.txt).", deleted, notDeleted);
|
||||||
|
LogFile.WriteToFile("logfiles deleted: " + std::to_string(deleted) + " files not deleted (incl. leer.txt): " + std::to_string(notDeleted));
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
#include <unity.h>
|
||||||
|
#include <ClassFlowCNNGeneral.h>
|
||||||
|
|
||||||
|
class UnderTestCNNGeneral : public ClassFlowCNNGeneral {
|
||||||
|
public:
|
||||||
|
UnderTestCNNGeneral( ClassFlowAlignment *_flowalign, t_CNNType _cnntype) :
|
||||||
|
ClassFlowCNNGeneral(_flowalign, _cnntype) {};
|
||||||
|
|
||||||
|
using ClassFlowCNNGeneral::ZeigerEvalAnalogToDigitNeu;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* Transition = x.8 - x.2 hier keine Transition in den Testfaellen
|
||||||
|
* Versatz = dig=x.n, ana= n.y: kein Versatz, da beide "n" gleich
|
||||||
|
*/
|
||||||
|
void test_analogToDigit_Standard() {
|
||||||
|
|
||||||
|
UnderTestCNNGeneral* undertest = new UnderTestCNNGeneral(nullptr, Digital100);
|
||||||
|
|
||||||
|
// 4.8 ist eine "hängende" 5. Heißt sie ist nicht bis auf 5.0 umgesprungen.
|
||||||
|
// ab Transition sollte trotzdem ein "hängendes Digit" gerundet werden.
|
||||||
|
// Transition = ja
|
||||||
|
// Versatz = nein
|
||||||
|
TEST_ASSERT_EQUAL_INT(5, undertest->ZeigerEvalAnalogToDigitNeu(4.8, 8.0, 8, 9.2));
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/921#issue-1344032217
|
||||||
|
// Standard: dig=9.6, ana=6.8 => erg=9
|
||||||
|
// Transition = nein
|
||||||
|
// Versatz = nein
|
||||||
|
TEST_ASSERT_EQUAL_INT(9, undertest->ZeigerEvalAnalogToDigitNeu( 9.6, 6.8, 6, 9.2));
|
||||||
|
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1220365920
|
||||||
|
// Standard: dig=4.6, ana=6.2 => erg=4
|
||||||
|
// Transition = nein
|
||||||
|
// Versatz = nein
|
||||||
|
TEST_ASSERT_EQUAL_INT(4, undertest->ZeigerEvalAnalogToDigitNeu( 4.6, 6.2, 6, 9.2));
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1143#issuecomment-1274434805
|
||||||
|
// Hängendes digit ()
|
||||||
|
// Standard: dig=6.8, ana=8.6 => erg=7
|
||||||
|
// Transition = nein
|
||||||
|
// Versatz = nein
|
||||||
|
TEST_ASSERT_EQUAL_INT(7, undertest->ZeigerEvalAnalogToDigitNeu( 6.8, 8.6, 6, 9.2));
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1143#issuecomment-1274434805
|
||||||
|
// Ebenfalls Hängendes digit () bei kleinem Zeiger nach 0-Durchlauf
|
||||||
|
// Standard: dig=6.8, ana=1.0 => erg=7
|
||||||
|
// Transition = nein
|
||||||
|
// Versatz = nein
|
||||||
|
TEST_ASSERT_EQUAL_INT(7, undertest->ZeigerEvalAnalogToDigitNeu( 6.8, 1.0, 1, 9.2));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_analogToDigit_Transition() {
|
||||||
|
UnderTestCNNGeneral* undertest = new UnderTestCNNGeneral(nullptr, Digital100);
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1222672175
|
||||||
|
// Standard: dig=3.9, ana=9.7 => erg=3
|
||||||
|
// Transition = ja
|
||||||
|
// Nulldurchgang = nein
|
||||||
|
// Versatz = nein
|
||||||
|
TEST_ASSERT_EQUAL_INT(3, undertest->ZeigerEvalAnalogToDigitNeu( 3.9, 9.7, 9, 9.2));
|
||||||
|
|
||||||
|
// ohne Referenz
|
||||||
|
// Standard: dig=4.0, ana=9.1 => erg=4
|
||||||
|
// Transition = ja
|
||||||
|
// Nulldurchgang = nein
|
||||||
|
// Versatz = nein
|
||||||
|
// Besonderheit: Digit ist bei analog 9.1 noch nicht losgelaufen
|
||||||
|
TEST_ASSERT_EQUAL_INT(4, undertest->ZeigerEvalAnalogToDigitNeu( 4.0, 9.1, 9, 9.2));
|
||||||
|
|
||||||
|
// ohne Referenz
|
||||||
|
// Standard: dig=9.8, ana=0.1, ana_2=9.9 => erg=9
|
||||||
|
// Transition = ja
|
||||||
|
// Nulldurchgang = nein
|
||||||
|
// Versatz = nein
|
||||||
|
// Besonderheit: analog wird durch vorherigen analog wieder auf 9 gesetzt
|
||||||
|
TEST_ASSERT_EQUAL_INT(9, undertest->ZeigerEvalAnalogToDigitNeu( 9.8, 0.1, 9, 9.2));
|
||||||
|
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1277425333
|
||||||
|
// Standard: dig=5.9, ana=9.4 => erg=9
|
||||||
|
// Transition = ja
|
||||||
|
// Nulldurchgang = nein
|
||||||
|
// Versatz = nein
|
||||||
|
// Besonderheit:
|
||||||
|
TEST_ASSERT_EQUAL_INT(5, undertest->ZeigerEvalAnalogToDigitNeu( 5.9, 9.4, 9, 9.2));
|
||||||
|
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1282168030
|
||||||
|
// Standard: dig=1.8, ana=7.8 => erg=9
|
||||||
|
// Transition = ja
|
||||||
|
// Nulldurchgang = nein
|
||||||
|
// Versatz = nein
|
||||||
|
// Besonderheit: Digit läuft mit Analog mit. Deshalb 1.8 (vs. 7.8)
|
||||||
|
TEST_ASSERT_EQUAL_INT(1, undertest->ZeigerEvalAnalogToDigitNeu( 1.8, 7.8, 7, 7.7));
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "test_flow.h"
|
#include "test_flow_postrocess_helper.h"
|
||||||
|
|
||||||
|
|
||||||
UnderTestPost* setUpClassFlowPostprocessing(t_CNNType digType, t_CNNType anaType)
|
UnderTestPost* setUpClassFlowPostprocessing(t_CNNType digType, t_CNNType anaType)
|
||||||
@@ -42,7 +42,9 @@ std::string process_doFlow(std::vector<float> analog, std::vector<float> digits,
|
|||||||
// run test
|
// run test
|
||||||
TEST_ASSERT_TRUE(_undertestPost->doFlow(time));
|
TEST_ASSERT_TRUE(_undertestPost->doFlow(time));
|
||||||
|
|
||||||
return _undertestPost->getReadout(0);
|
std::string result = _undertestPost->getReadout(0);
|
||||||
|
delete _undertestPost;
|
||||||
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,3 +142,13 @@ void setDecimalShift(UnderTestPost* _underTestPost, int _decimal_shift) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setAnalogdigitTransistionStart(UnderTestPost* _underTestPost, float _analogdigitTransistionStart) {
|
||||||
|
if (_analogdigitTransistionStart!=0) {
|
||||||
|
std::vector<NumberPost*>* NUMBERS = _underTestPost->GetNumbers();
|
||||||
|
for (int _n = 0; _n < (*NUMBERS).size(); ++_n) {
|
||||||
|
printf("Setting decimal shift on number: %d to %f\n", _n, _analogdigitTransistionStart);
|
||||||
|
(*NUMBERS)[_n]->AnalogDigitalTransitionStart = _analogdigitTransistionStart;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,4 +99,12 @@ void setExtendedResolution(UnderTestPost* _UnderTestPost, bool _extendedResoluti
|
|||||||
*/
|
*/
|
||||||
void setDecimalShift(UnderTestPost* _UnderTestPost, int decimal_shift);
|
void setDecimalShift(UnderTestPost* _UnderTestPost, int decimal_shift);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the Analogdigit Transistion Start
|
||||||
|
*
|
||||||
|
* @param _underTestPost the testobject
|
||||||
|
* @param _analogdigitTransistionStart the analog to digit transition start
|
||||||
|
*/
|
||||||
|
void setAnalogdigitTransistionStart(UnderTestPost* _underTestPost, float _analogdigitTransistionStart);
|
||||||
|
|
||||||
#endif // TEST_FLOW_H
|
#endif // TEST_FLOW_H
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "test_flow.h"
|
#include "test_flow_postrocess_helper.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
#include "test_flow.h"
|
#include "test_flow_postrocess_helper.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* ACHTUNG! Die Test laufen aktuell nur mit ausgeschaltetem Debug in ClassFlowCNNGeneral
|
||||||
|
*
|
||||||
|
*
|
||||||
* @brief Testet die doFlow-Methode von ClassFlowPostprocessing
|
* @brief Testet die doFlow-Methode von ClassFlowPostprocessing
|
||||||
* digits[] - enthält die liste der vom Model zurückgegebenen Ergebnisse (class100/cont) in der Reihenfolge von links nach rechts
|
* digits[] - enthält die liste der vom Model zurückgegebenen Ergebnisse (class100/cont) in der Reihenfolge von links nach rechts
|
||||||
* analog[] - enthält die Liste der Zeiger vom Model, wie bei den digits
|
* analog[] - enthält die Liste der Zeiger vom Model, wie bei den digits
|
||||||
@@ -29,7 +32,7 @@ void test_doFlow() {
|
|||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* https://github.com/jomjol/AI-on-the-edge-device/issues/921
|
* https://github.com/jomjol/AI-on-the-edge-device/issues/921#issue-1344032217
|
||||||
*
|
*
|
||||||
* Das Ergebnis sollte "376529.6" sein.
|
* Das Ergebnis sollte "376529.6" sein.
|
||||||
*/
|
*/
|
||||||
@@ -40,7 +43,7 @@ void test_doFlow() {
|
|||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* https://github.com/jomjol/AI-on-the-edge-device/issues/921
|
* https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1220365920
|
||||||
*
|
*
|
||||||
* Das Ergebnis sollte "167734.6" sein. Bzw. 16.98 ohne Extended true
|
* Das Ergebnis sollte "167734.6" sein. Bzw. 16.98 ohne Extended true
|
||||||
*/
|
*/
|
||||||
@@ -81,13 +84,13 @@ void test_doFlow() {
|
|||||||
|
|
||||||
digits = { 1.1, 9.0, 4.0};
|
digits = { 1.1, 9.0, 4.0};
|
||||||
analogs = { 8.1, 2.6, 6.25, 9.7};
|
analogs = { 8.1, 2.6, 6.25, 9.7};
|
||||||
expected = "193.8259";
|
expected = "194.8259";
|
||||||
result = process_doFlow(analogs, digits);
|
result = process_doFlow(analogs, digits);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
digits = { 1.1, 9.0, 4.0};
|
digits = { 1.1, 9.0, 4.0};
|
||||||
analogs = { 9.1, 2.6, 6.25, 9.7};
|
analogs = { 9.1, 2.6, 6.25, 9.7};
|
||||||
expected = "193.9259";
|
expected = "194.9259";
|
||||||
result = process_doFlow(analogs, digits);
|
result = process_doFlow(analogs, digits);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
@@ -346,10 +349,10 @@ void test_doFlow() {
|
|||||||
|
|
||||||
// Fehler bei V12.0.1
|
// Fehler bei V12.0.1
|
||||||
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issue-1391153343
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issue-1391153343
|
||||||
digits = { 1.0, 4.0, 2.0}; // 142.9269 als falsches Ergebnis
|
digits = { 1.0, 4.0, 2.0}; // 141.9269 als falsches Ergebnis
|
||||||
analogs = { 9.2, 2.5, 6.8, 9.0};
|
analogs = { 9.2, 2.5, 6.8, 9.0};
|
||||||
expected = "141.9269";
|
expected = "142.9269";
|
||||||
expected_extended= "141.92690";
|
expected_extended= "142.92690";
|
||||||
|
|
||||||
// extendResolution=false
|
// extendResolution=false
|
||||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||||
@@ -363,25 +366,31 @@ void test_doFlow() {
|
|||||||
// Fehler bei V12.0.1
|
// Fehler bei V12.0.1
|
||||||
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1262626388
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1262626388
|
||||||
digits = { 1.2, 6.8, 0.0, 0.0, 5.0, 2.8}; //170.05387 als falsches Ergebnis
|
digits = { 1.2, 6.8, 0.0, 0.0, 5.0, 2.8}; //170.05387 als falsches Ergebnis
|
||||||
|
// letztes digit läuft mit analog zeiger mit. Hier nur lösbar mit setAnalogdigitTransistionStart=7.7
|
||||||
analogs = { 8.7};
|
analogs = { 8.7};
|
||||||
expected = "170.0528";
|
expected = "170.0528";
|
||||||
expected_extended= "170.05287";
|
expected_extended= "170.05287";
|
||||||
|
|
||||||
// extendResolution=false
|
// extendResolution=false
|
||||||
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
UnderTestPost* undertestPost = init_do_flow(analogs, digits, Digital100, false, false, -3);
|
||||||
|
setAnalogdigitTransistionStart(undertestPost, 7.7);
|
||||||
|
result = process_doFlow(undertestPost);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
delete undertestPost;
|
||||||
|
|
||||||
// checkConsistency=false und extendResolution=true
|
// checkConsistency=false und extendResolution=true
|
||||||
result = process_doFlow(analogs, digits, Digital100, false, true, -3);
|
undertestPost = init_do_flow(analogs, digits, Digital100, false, true, -3);
|
||||||
|
setAnalogdigitTransistionStart(undertestPost, 7.7);
|
||||||
|
result = process_doFlow(undertestPost);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||||
|
delete undertestPost;
|
||||||
|
|
||||||
// Fehler bei rolling post V12.0.1
|
// Fehler bei rolling post V12.0.1
|
||||||
// lokal watermeter1
|
// lokal watermeter1
|
||||||
digits = { 0.0, 0.0, 9.0, 1.0}; //91.88174 als falsches Ergebnis
|
digits = { 0.0, 0.0, 9.0, 1.0}; //90.88174 als falsches Ergebnis
|
||||||
analogs = {9.0, 8.0, 1.8, 7.4};
|
analogs = {9.0, 8.0, 1.8, 7.4};
|
||||||
expected = "90.8817";
|
expected = "91.8817";
|
||||||
expected_extended= "90.88174";
|
expected_extended= "91.88174";
|
||||||
|
|
||||||
// extendResolution=false
|
// extendResolution=false
|
||||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||||
@@ -426,9 +435,8 @@ void test_doFlow() {
|
|||||||
// https://github.com/jomjol/AI-on-the-edge-device/issues/1143#issuecomment-1274434805
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1143#issuecomment-1274434805
|
||||||
digits = { 4.9, 6.9, 6.8}; // 576.8649 als falsches Ergebnis
|
digits = { 4.9, 6.9, 6.8}; // 576.8649 als falsches Ergebnis
|
||||||
analogs = {8.6, 6.2, 5.0, 9.0};
|
analogs = {8.6, 6.2, 5.0, 9.0};
|
||||||
// fall unklar ob wirklich 577 oder 576, erst mal 577
|
expected = "577.8649";
|
||||||
expected = "576.8649";
|
expected_extended= "577.86490";
|
||||||
expected_extended= "576.86490";
|
|
||||||
|
|
||||||
// extendResolution=false
|
// extendResolution=false
|
||||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||||
@@ -440,12 +448,26 @@ void test_doFlow() {
|
|||||||
|
|
||||||
|
|
||||||
// Fehler V12.0.1 "TODO 00211.03480 vs 00211.03580"
|
// Fehler V12.0.1 "TODO 00211.03480 vs 00211.03580"
|
||||||
// Lokal
|
// Lokal "Hängendes Digit"
|
||||||
digits = { 4.9, 6.9, 6.8}; // 576.8649 als falsches Ergebnis
|
digits = { 2.0, 1.0, 1.0, 0.0, 3.0, 4.8}; // 00211.03480 als falsches Ergebnis
|
||||||
analogs = {8.6, 6.2, 5.0, 9.0};
|
analogs = {8.0};
|
||||||
// fall unklar ob wirklich 577 oder 576, erst mal 577
|
expected = "211.0358";
|
||||||
expected = "576.8649";
|
expected_extended= "211.03580";
|
||||||
expected_extended= "576.86490";
|
|
||||||
|
// extendResolution=false
|
||||||
|
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||||
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
|
// checkConsistency=false und extendResolution=true
|
||||||
|
result = process_doFlow(analogs, digits, Digital100, false, true, -3);
|
||||||
|
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||||
|
|
||||||
|
// Fehler V12.0.1
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1143#issuecomment-1281231468
|
||||||
|
digits = { 1.0, 1.9, 6.0}; // 125.923 als falsches Ergebnis
|
||||||
|
analogs = {9.3, 2.3, 3.1};
|
||||||
|
expected = "126.923";
|
||||||
|
expected_extended= "126.9231";
|
||||||
|
|
||||||
// extendResolution=false
|
// extendResolution=false
|
||||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||||
@@ -455,7 +477,42 @@ void test_doFlow() {
|
|||||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||||
|
|
||||||
|
// Fehler V12.0.1
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1282168030
|
||||||
|
digits = { 3.0, 8.1, 5.9, 0.0, 5.0, 6.7}; // 386.05672 als richtiges Ergebnis. Letztes digit schein mit dem Analogzeiger mitzulaufen
|
||||||
|
analogs = {7.2};
|
||||||
|
expected = "386.0567";
|
||||||
|
expected_extended= "386.05672";
|
||||||
|
|
||||||
|
// extendResolution=false
|
||||||
|
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||||
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
|
||||||
|
// checkConsistency=false und extendResolution=true
|
||||||
|
result = process_doFlow(analogs, digits, Digital100, false, true, -3);
|
||||||
|
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||||
|
|
||||||
|
// Fehler V12.0.1
|
||||||
|
// https://github.com/jomjol/AI-on-the-edge-device/issues/1110#issuecomment-1282168030
|
||||||
|
digits = { 1.2, 7.0, 1.2, 2.0, 4.0, 1.8}; // 171.24278 als falsches Ergebnis.
|
||||||
|
// Test ist nur erfolgreich mit Veränderung des AnalogdigitTransistionStart
|
||||||
|
analogs = {7.8};
|
||||||
|
expected = "171.2417";
|
||||||
|
expected_extended= "171.24178";
|
||||||
|
|
||||||
|
// extendResolution=false
|
||||||
|
undertestPost = init_do_flow(analogs, digits, Digital100, false, false, -3);
|
||||||
|
setAnalogdigitTransistionStart(undertestPost, 7.7);
|
||||||
|
result = process_doFlow(undertestPost);
|
||||||
|
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||||
|
delete undertestPost;
|
||||||
|
|
||||||
|
// checkConsistency=false und extendResolution=true
|
||||||
|
undertestPost = init_do_flow(analogs, digits, Digital100, false, true, -3);
|
||||||
|
setAnalogdigitTransistionStart(undertestPost, 7.7);
|
||||||
|
result = process_doFlow(undertestPost);
|
||||||
|
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||||
|
delete undertestPost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
#include <unity.h>
|
#include <unity.h>
|
||||||
|
|
||||||
#include "components/jomjol-flowcontroll/test_flow.cpp"
|
#include "components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp"
|
||||||
#include "components/jomjol-flowcontroll/test_flowpostprocessing.cpp"
|
#include "components/jomjol-flowcontroll/test_flowpostprocessing.cpp"
|
||||||
#include "components/jomjol-flowcontroll/test_flow_pp_negative.cpp"
|
#include "components/jomjol-flowcontroll/test_flow_pp_negative.cpp"
|
||||||
|
#include "components/jomjol-flowcontroll/test_ZeigerEvalAnalogToDigitNeu.cpp"
|
||||||
// SD-Card ////////////////////
|
// SD-Card ////////////////////
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
#include "esp_vfs_fat.h"
|
#include "esp_vfs_fat.h"
|
||||||
@@ -103,9 +104,12 @@ extern "C" void app_main()
|
|||||||
initGPIO();
|
initGPIO();
|
||||||
Init_NVS_SDCard();
|
Init_NVS_SDCard();
|
||||||
UNITY_BEGIN();
|
UNITY_BEGIN();
|
||||||
|
|
||||||
RUN_TEST(testNegative);
|
RUN_TEST(testNegative);
|
||||||
RUN_TEST(test_doFlow);
|
|
||||||
|
RUN_TEST(test_analogToDigit_Standard);
|
||||||
|
RUN_TEST(test_analogToDigit_Transition);
|
||||||
|
RUN_TEST(test_doFlow);
|
||||||
|
|
||||||
UNITY_END();
|
UNITY_END();
|
||||||
}
|
}
|
||||||
@@ -42,6 +42,7 @@ main.ana4 155 328 92 92 false
|
|||||||
|
|
||||||
[PostProcessing]
|
[PostProcessing]
|
||||||
main.DecimalShift = 0
|
main.DecimalShift = 0
|
||||||
|
main.AnalogDigitalTransitionStart = 9.2
|
||||||
PreValueUse = true
|
PreValueUse = true
|
||||||
PreValueAgeStartup = 720
|
PreValueAgeStartup = 720
|
||||||
AllowNegativeRates = false
|
AllowNegativeRates = false
|
||||||
|
|||||||
@@ -489,6 +489,20 @@ textarea {
|
|||||||
Shift the digit separator within the digital digits (positiv and negativ)
|
Shift the digit separator within the digital digits (positiv and negativ)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent1">
|
||||||
|
<input type="checkbox" id="PostProcessing_AnalogDigitalTransitionStart_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "AnalogDigitalTransitionStart")' unchecked >
|
||||||
|
<label for=PostProcessing_AnalogDigitalTransitionStart_enabled><class id="PostProcessing_AnalogDigitalTransitionStart_text" style="color:black;">AnalogDigitalTransitionStart</class></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" id="PostProcessing_AnalogDigitalTransitionStart_value1" step="0.1" min="6.0" max="9.9" value="9.2">
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
If you have false Values, but the recognition is correct. Look for the start of changing of the first digit and note the analog pointer value behind. Set it here.
|
||||||
|
Only used on combination of digits and analog pointers. Default=9.2
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="PostProcessing_MaxRateValue_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateValue")' unchecked >
|
<input type="checkbox" id="PostProcessing_MaxRateValue_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateValue")' unchecked >
|
||||||
@@ -1670,6 +1684,7 @@ function UpdateInputIndividual()
|
|||||||
if (NUNBERSAkt != -1)
|
if (NUNBERSAkt != -1)
|
||||||
{
|
{
|
||||||
ReadParameter(param, "PostProcessing", "DecimalShift", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "DecimalShift", true, NUNBERSAkt)
|
||||||
|
ReadParameter(param, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt)
|
||||||
ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt)
|
||||||
ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt)
|
||||||
ReadParameter(param, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt)
|
||||||
@@ -1679,6 +1694,7 @@ function UpdateInputIndividual()
|
|||||||
var sel = document.getElementById("Numbers_value1");
|
var sel = document.getElementById("Numbers_value1");
|
||||||
NUNBERSAkt = sel.selectedIndex;
|
NUNBERSAkt = sel.selectedIndex;
|
||||||
WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt);
|
||||||
|
WriteParameter(param, category, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt);
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ function ParseConfig() {
|
|||||||
category[catname]["found"] = false;
|
category[catname]["found"] = false;
|
||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "DecimalShift", 1, true);
|
ParamAddValue(param, catname, "DecimalShift", 1, true);
|
||||||
|
ParamAddValue(param, catname, "AnalogDigitalTransitionStart", 1, true);
|
||||||
ParamAddValue(param, catname, "PreValueUse");
|
ParamAddValue(param, catname, "PreValueUse");
|
||||||
ParamAddValue(param, catname, "PreValueAgeStartup");
|
ParamAddValue(param, catname, "PreValueAgeStartup");
|
||||||
ParamAddValue(param, catname, "AllowNegativeRates");
|
ParamAddValue(param, catname, "AllowNegativeRates");
|
||||||
|
|||||||
Reference in New Issue
Block a user