mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-06 03:26:53 +03:00
Renamed digital to digit (#3219)
* renamed Digital to Digit * added param migration * Update .github/label-commenter-config.yaml * renamed AnalogDigitTransition* to AnalogToDigitTransition* --------- Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
4
.github/label-commenter-config.yaml
vendored
4
.github/label-commenter-config.yaml
vendored
@@ -115,9 +115,9 @@
|
||||
labeled:
|
||||
issue:
|
||||
body: |
|
||||
See [Digital Digits](https://jomjol.github.io/neural-network-digital-counter-readout) resp. [Analogue Pointers](https://jomjol.github.io/neural-network-analog-needle-readout) for an overview of all trained data.
|
||||
See [Digits](https://jomjol.github.io/neural-network-digital-counter-readout) resp. [Analogue Pointers](https://jomjol.github.io/neural-network-analog-needle-readout) for an overview of all trained data.
|
||||
If your type is not contained it can be added to our training material, see [here](https://jomjol.github.io/AI-on-the-edge-device-docs/collect-new-images/).
|
||||
discussion:
|
||||
body: |
|
||||
See [Digital Digits](https://jomjol.github.io/neural-network-digital-counter-readout) resp. [Analogue Pointers](https://jomjol.github.io/neural-network-analog-needle-readout) for an overview of all trained data.
|
||||
See [Digits](https://jomjol.github.io/neural-network-digital-counter-readout) resp. [Analogue Pointers](https://jomjol.github.io/neural-network-analog-needle-readout) for an overview of all trained data.
|
||||
If your type is not contained it can be added to our training material, see [here](https://jomjol.github.io/AI-on-the-edge-device-docs/collect-new-images/).
|
||||
|
||||
50
Changelog.md
50
Changelog.md
@@ -23,7 +23,7 @@ For a full list of changes see [Full list of changes](https://github.com/jomjol/
|
||||
- Add Firmware Version to MQTT
|
||||
|
||||
#### Bug Fixes
|
||||
- Reverted "Implemented late analog / digital transition [#2778](https://github.com/jomjol/AI-on-the-edge-device/pull/2778) (introduced in `v15.5`) as is seems to cause issues for many users.
|
||||
- Reverted "Implemented late analog / digit transition [#2778](https://github.com/jomjol/AI-on-the-edge-device/pull/2778) (introduced in `v15.5`) as is seems to cause issues for many users.
|
||||
|
||||
|
||||
## [15.6.0] - 2024-02-09
|
||||
@@ -42,7 +42,7 @@ For a full list of changes see [Full list of changes](https://github.com/jomjol/
|
||||
|
||||
- Update PlattformIO to v6.5.0, which means esp-idf to v5.1
|
||||
- Enhance busy notification
|
||||
- Implemented late analog / digital transition
|
||||
- Implemented late analog / digit transition
|
||||
|
||||
#### Fixed
|
||||
|
||||
@@ -202,7 +202,7 @@ For a full list of changes see [Full list of changes](https://github.com/jomjol/
|
||||
:bangbang: **Attention:** Update your configuration!
|
||||
- Hybrid CNN network to `dig-cont_0611_s3`
|
||||
- Analog CNN network to `ana-cont-11.0.5` and `ana-clas100-1.5.7`
|
||||
- Digital CNN network to `dig-class100-1.6.0`
|
||||
- Digit CNN network to `dig-class100-1.6.0`
|
||||
- Various Web interface Improvements/Enhancements:
|
||||
- Restructured Menu (Needs cache clearing to be applied)
|
||||
- Enhanced `Previous Value` page
|
||||
@@ -338,7 +338,7 @@ For a full list of changes see [Full list of changes](https://github.com/jomjol/
|
||||
- Improved OTA Update mechanism (only working after installation for next update)
|
||||
- Added data logging in `/log/data` - One day per file and each measurement is on one line
|
||||
- Format: csv - comma separated
|
||||
- Content: `time`, `name-of-number`, `raw-value`, `return-value`, `pre-value`, `change-rate`, `change-absolute`, `error-text`, `cnn-digital`, `cnn-analog`
|
||||
- Content: `time`, `name-of-number`, `raw-value`, `return-value`, `pre-value`, `change-rate`, `change-absolute`, `error-text`, `cnn-digit`, `cnn-analog`
|
||||
- Show graph of values direct in the user interface (thanks to [@rdmueller](https://github.com/rdmueller))
|
||||
|
||||
- Using new data logging (see above)
|
||||
@@ -356,10 +356,10 @@ For a full list of changes see [Full list of changes](https://github.com/jomjol/
|
||||
- Updated OTA functionality (more robust, but not fully bullet prove yet)
|
||||
- Updated Espressif library 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
|
||||
- [#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.
|
||||
- [#1143](https://github.com/jomjol/AI-on-the-edge-device/issues/1143) added config parameter `AnalogDigTransitionStart`. It can setup very early and very late digit transition starts.
|
||||
- New version of `dig-class100` (v1.4.0): added images of heliowatt powermeter
|
||||
- NEW v13.0.2: Update Tool "Logfile downloader and combiner" to handle the new csv file format.
|
||||
- NEW v13.0.2: MQTT: Added MQTT topic `status` (Digitalization Status), Timezone to MQTT topic `timestamp`.#
|
||||
- NEW v13.0.2: MQTT: Added MQTT topic `status` (Digitization Status), Timezone to MQTT topic `timestamp`.#
|
||||
- NEW v13.0.2: Logging: Disable heap logs by default, cleanup
|
||||
- NEW v13.0.7:
|
||||
- log NTP server name
|
||||
@@ -484,7 +484,7 @@ Intermediate Digits
|
||||
|
||||
- Updated analog neural network file (`ana-cont_11.3.0_s2.tflite` - default, `ana-class100_0120_s1_q.tflite`)
|
||||
|
||||
- Updated digital neural network file (`dig-cont_0570_s3.tflite` - default, `dig-class100_0120_s2_q.tflite`)
|
||||
- Updated digit neural network file (`dig-cont_0570_s3.tflite` - default, `dig-class100_0120_s2_q.tflite`)
|
||||
|
||||
- Added automated filtering of tflite-file in the graphical configuration (thanks to @**[caco3](https://github.com/caco3)**)
|
||||
|
||||
@@ -496,8 +496,8 @@ Intermediate Digits
|
||||
|
||||
Intermediate Digits
|
||||
|
||||
- New and improved consistency check (especially with analog and digital counters mixed)
|
||||
- Bug Fix: digital counter algorithm
|
||||
- New and improved consistency check (especially with analog and digit counters mixed)
|
||||
- Bug Fix: digit counter algorithm
|
||||
|
||||
## [11.0.1](https://github.com/jomjol/AI-on-the-edge-device/releases/tag/v11.0.1), 2022-08-18
|
||||
|
||||
@@ -537,7 +537,7 @@ Stability Increase
|
||||
|
||||
- `config.ini`: removal of modelsize (readout from tflite)
|
||||
|
||||
- Updated analog neural network file (`ana1000s2.tflite`) & digital neural network file (`dig1400s2q.tflite`)
|
||||
- Updated analog neural network file (`ana1000s2.tflite`) & digit neural network file (`dig1400s2q.tflite`)
|
||||
|
||||
- TFMicro/Lite: Update (espressif Version 20220716)
|
||||
|
||||
@@ -573,7 +573,7 @@ Stability Increase
|
||||
- In the future the new files will also be copied to the `firmware` directory of the repository
|
||||
- Added Wifi RSSI to MQTT information
|
||||
- Updated analog neural network file (`ana-s3-q-20220105.tflite`)
|
||||
- Updated digital neural network file (`dig-s1-q-20220102.tflite`)
|
||||
- Updated digit neural network file (`dig-s1-q-20220102.tflite`)
|
||||
- Updated build environment to `Espressif 3.5.0`
|
||||
|
||||
## [10.3.0] - (2022-01-29)
|
||||
@@ -639,7 +639,7 @@ Stability Increase
|
||||
|
||||
- Update analog neural network (ana-s3-q-20220105.tflite)
|
||||
|
||||
- Update digital neural network (dig-s1-q-20220102.tflite)
|
||||
- Update digit neural network (dig-s1-q-20220102.tflite)
|
||||
|
||||
- Increased web-server buffers
|
||||
|
||||
@@ -676,7 +676,7 @@ External Illumination
|
||||
- Direct JSON access: `http://IP-ADRESS/json`
|
||||
- Error message in log file in case camera error during startup
|
||||
- Upgrade analog CNN to v9.1.0
|
||||
- Upgrade digital CNN to v13.3.0 (added new images)
|
||||
- Upgrade digit CNN to v13.3.0 (added new images)
|
||||
- html: support of different ports
|
||||
|
||||
## [9.1.1] - External Illumination (2021-11-16)
|
||||
@@ -701,7 +701,7 @@ External Illumination
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade digital CNN to v13.1.0 (added new images)
|
||||
- Upgrade digit CNN to v13.1.0 (added new images)
|
||||
- bug fix: wlan password with space, double digit output
|
||||
|
||||
## [8.4.0] - Multi Meter Support (2021-09-25)
|
||||
@@ -731,7 +731,7 @@ External Illumination
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade digital CNN to v12.1.0 (added new images)
|
||||
- Upgrade digit CNN to v12.1.0 (added new images)
|
||||
- Dedicated NaN handling, internal refactoring (CNN-Handling)
|
||||
- HTML: confirmation after config.ini update
|
||||
- Bug fixing
|
||||
@@ -753,7 +753,7 @@ External Illumination
|
||||
- GPIO: using the general mqtt main topic for GPIO
|
||||
|
||||
|
||||
- Upgrade digital CNN to v12.0.0 (added new images)
|
||||
- Upgrade digit CNN to v12.0.0 (added new images)
|
||||
- Update tfmicro to new master (2021-08-07)
|
||||
- Bug fix: remove text in mqtt value, remove connect limit in wlan reconnet
|
||||
|
||||
@@ -789,7 +789,7 @@ External Illumination
|
||||
|
||||
- Update wlan handling to esp-idf 4.1
|
||||
|
||||
- Upgrade digital CNN to v8.7.0 (added new images)
|
||||
- Upgrade digit CNN to v8.7.0 (added new images)
|
||||
|
||||
- Bug fix: MQTT, WLAN, LED-Controll, GPIO usage, fixed IP, calculation flow rate
|
||||
|
||||
@@ -800,7 +800,7 @@ External Illumination
|
||||
- NEW: 7.0.1: bug fix wlan password with "="
|
||||
|
||||
|
||||
- Upgrade digital CNN to v8.5.0 (added new images)
|
||||
- Upgrade digit CNN to v8.5.0 (added new images)
|
||||
|
||||
- New MQTT topics: flow rate (units/minute), time stamp (last correct read readout)
|
||||
|
||||
@@ -817,7 +817,7 @@ External Illumination
|
||||
|
||||
- NEW 6.7.1: Improved stability of camera (back to v6.6.1) - remove black strips and areas
|
||||
|
||||
- Upgrade digital CNN to v8.3.0 (added new type of digits)
|
||||
- Upgrade digit CNN to v8.3.0 (added new type of digits)
|
||||
|
||||
- Internal update: TFlite (v2.5), esp32cam, startup sequence
|
||||
|
||||
@@ -838,7 +838,7 @@ External Illumination
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade digital CNN to v8.2.0 (added new type of digits)
|
||||
- Upgrade digit CNN to v8.2.0 (added new type of digits)
|
||||
|
||||
|
||||
- Supporting alignment structures in ROI definition
|
||||
@@ -874,7 +874,7 @@ External Illumination
|
||||
|
||||
- Determination of fixed illumination settings during startup - speed up of 5s in each run
|
||||
|
||||
- Update digital CNN to v8.1.1 (additional digital images trained)
|
||||
- Update digit CNN to v8.1.1 (additional digit images trained)
|
||||
|
||||
- Extended error message in MQTT error message
|
||||
|
||||
@@ -886,7 +886,7 @@ External Illumination
|
||||
|
||||
### Changed
|
||||
|
||||
- Disabling of analog / digital counters in configuration
|
||||
- Disabling of analog / digit counters in configuration
|
||||
|
||||
|
||||
- Improved Alignment Algorithm (`AlignmentAlgo` = `Default`, `Accurate` , `Fast`)
|
||||
@@ -906,7 +906,7 @@ External Illumination
|
||||
|
||||
- MQTT: Last Will Testament (LWT) implemented: "connection lost" in case of connection lost to `TopicError`
|
||||
- Disabled `CheckDigitIncreaseConsistency` in default configuration - must now be explicit enabled if needed
|
||||
- Update digital CNN to v7.2.1 (additional digital images trained)
|
||||
- Update digit CNN to v7.2.1 (additional digit images trained)
|
||||
- Setting of arbitrary time server in `config.ini`
|
||||
- Option for fixed IP-, DNS-Settings in `wlan.ini`
|
||||
- Increased stability (internal image and camera handling)
|
||||
@@ -940,7 +940,7 @@ External Illumination
|
||||
|
||||
- standardized access to current logfile via `http://IP-ADRESS/logfileact`
|
||||
|
||||
- Update digital CNN to v7.2.0, analog CNN to 6.3.0
|
||||
- Update digit CNN to v7.2.0, analog CNN to 6.3.0
|
||||
|
||||
- Bug fixing: truncation error, CheckDigitConsistency & PreValue implementation
|
||||
|
||||
@@ -959,7 +959,7 @@ External Illumination
|
||||
|
||||
### Changed
|
||||
|
||||
- Update digital CNN to v6.5.0 and HTML (Info to hostname, IP, ssid)
|
||||
- Update digit CNN to v6.5.0 and HTML (Info to hostname, IP, ssid)
|
||||
|
||||
- New implementation of "checkDigitConsistency" also for digits
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ bool ClassFlowAlignment::doFlow(string time)
|
||||
DrawRef(ImageTMP);
|
||||
}
|
||||
|
||||
flowctrl.DigitalDrawROI(ImageTMP);
|
||||
flowctrl.DigitDrawROI(ImageTMP);
|
||||
flowctrl.AnalogDrawROI(ImageTMP);
|
||||
ImageTMP->writeToMemoryAsJPG((ImageData *)AlgROI, 90);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ ClassFlowCNNGeneral::ClassFlowCNNGeneral(ClassFlowAlignment *_flowalign, t_CNNTy
|
||||
imagesRetention = 5;
|
||||
}
|
||||
|
||||
string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution, int prev, float _before_narrow_Analog, float analogDigitalTransitionStart) {
|
||||
string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution, int prev, float _before_narrow_Analog, float AnalogToDigitTransitionStart) {
|
||||
string result = "";
|
||||
|
||||
if (GENERAL[_analog]->ROI.size() == 0) {
|
||||
@@ -63,7 +63,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
||||
return result;
|
||||
}
|
||||
|
||||
if (CNNType == Digital) {
|
||||
if (CNNType == Digit) {
|
||||
for (int i = 0; i < GENERAL[_analog]->ROI.size(); ++i) {
|
||||
if (GENERAL[_analog]->ROI[i]->result_klasse >= 10) {
|
||||
result = result + "N";
|
||||
@@ -75,7 +75,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
||||
return result;
|
||||
}
|
||||
|
||||
if ((CNNType == DoubleHyprid10) || (CNNType == Digital100)) {
|
||||
if ((CNNType == DoubleHyprid10) || (CNNType == Digit100)) {
|
||||
float number = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float;
|
||||
// NaN?
|
||||
if (number >= 0) {
|
||||
@@ -90,7 +90,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
||||
}
|
||||
else {
|
||||
if (_before_narrow_Analog >= 0) {
|
||||
prev = PointerEvalHybridNew(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, _before_narrow_Analog, prev, true, analogDigitalTransitionStart);
|
||||
prev = PointerEvalHybridNew(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, _before_narrow_Analog, prev, true, AnalogToDigitTransitionStart);
|
||||
}
|
||||
else {
|
||||
prev = PointerEvalHybridNew(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, prev, prev);
|
||||
@@ -101,7 +101,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
||||
}
|
||||
else {
|
||||
result = "N";
|
||||
if (_extendedResolution && (CNNType != Digital)) {
|
||||
if (_extendedResolution && (CNNType != Digit)) {
|
||||
result = "NN";
|
||||
}
|
||||
}
|
||||
@@ -135,13 +135,13 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
|
||||
* 0.1 => 0 (eval_predecessors)
|
||||
* The 0 makes a 9.9 to 0 (eval_predecessors)
|
||||
* The 0 makes a 9.8 to 0
|
||||
* @param Analog_Predecessors false/true if the last ROI is an analog or digital ROI (default=false)
|
||||
* @param Analog_Predecessors false/true if the last ROI is an analog or digit ROI (default=false)
|
||||
* runs in special handling because analog is much less precise
|
||||
* @param digitalAnalogTransitionStart start of the transitionlogic begins on number_of_predecessor (default=9.2)
|
||||
* @param digitAnalogTransitionStart start of the transitionlogic begins on number_of_predecessor (default=9.2)
|
||||
*
|
||||
* @return int the determined number of the current ROI
|
||||
*/
|
||||
int ClassFlowCNNGeneral::PointerEvalHybridNew(float number, float number_of_predecessors, int eval_predecessors, bool Analog_Predecessors, float digitalAnalogTransitionStart) {
|
||||
int ClassFlowCNNGeneral::PointerEvalHybridNew(float number, float number_of_predecessors, int eval_predecessors, bool Analog_Predecessors, float digitAnalogTransitionStart) {
|
||||
int result;
|
||||
int result_after_decimal_point = ((int) floor(number * 10)) % 10;
|
||||
int result_before_decimal_point = ((int) floor(number) + 10) % 10;
|
||||
@@ -153,21 +153,21 @@ int ClassFlowCNNGeneral::PointerEvalHybridNew(float number, float number_of_pred
|
||||
result = (int) ((int) trunc(round((number+10 % 10)*100)) ) / 100;
|
||||
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalHybridNew - No predecessor - Result = " + std::to_string(result) +
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digital_Uncertainty = " + std::to_string(Digital_Uncertainty));
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digit_Uncertainty = " + std::to_string(Digit_Uncertainty));
|
||||
return result;
|
||||
}
|
||||
|
||||
if (Analog_Predecessors) {
|
||||
result = PointerEvalAnalogToDigitNew(number, number_of_predecessors, eval_predecessors, digitalAnalogTransitionStart);
|
||||
result = PointerEvalAnalogToDigitNew(number, number_of_predecessors, eval_predecessors, digitAnalogTransitionStart);
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalHybridNew - Analog predecessor, evaluation over PointerEvalAnalogNew = " + std::to_string(result) +
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digital_Uncertainty = " + std::to_string(Digital_Uncertainty));
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digit_Uncertainty = " + std::to_string(Digit_Uncertainty));
|
||||
return result;
|
||||
}
|
||||
|
||||
if ((number_of_predecessors >= Digital_Transition_Area_Predecessor ) && (number_of_predecessors <= (10.0 - Digital_Transition_Area_Predecessor))) {
|
||||
// no digit change, because predecessor is far enough away (0+/-DigitalTransitionRangePredecessor) --> number is rounded
|
||||
if ((number_of_predecessors >= Digit_Transition_Area_Predecessor ) && (number_of_predecessors <= (10.0 - Digit_Transition_Area_Predecessor))) {
|
||||
// no digit change, because predecessor is far enough away (0+/-DigitTransitionRangePredecessor) --> number is rounded
|
||||
// Band around the digit --> Round off, as digit reaches inaccuracy in the frame
|
||||
if ((result_after_decimal_point <= DigitalBand) || (result_after_decimal_point >= (10-DigitalBand))) {
|
||||
if ((result_after_decimal_point <= DigitBand) || (result_after_decimal_point >= (10-DigitBand))) {
|
||||
result = ((int) round(number) + 10) % 10;
|
||||
}
|
||||
else {
|
||||
@@ -175,7 +175,7 @@ int ClassFlowCNNGeneral::PointerEvalHybridNew(float number, float number_of_pred
|
||||
}
|
||||
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalHybridNew - NO analogue predecessor, no change of digits, as pre-decimal point far enough away = " + std::to_string(result) +
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digital_Uncertainty = " + std::to_string(Digital_Uncertainty));
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digit_Uncertainty = " + std::to_string(Digit_Uncertainty));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -192,16 +192,16 @@ int ClassFlowCNNGeneral::PointerEvalHybridNew(float number, float number_of_pred
|
||||
result = result_before_decimal_point % 10;
|
||||
}
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalHybridNew - NO analogue predecessor, zero crossing has taken placen = " + std::to_string(result) +
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digital_Uncertainty = " + std::to_string(Digital_Uncertainty));
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digit_Uncertainty = " + std::to_string(Digit_Uncertainty));
|
||||
return result;
|
||||
}
|
||||
|
||||
// remains only >= 9.x --> no zero crossing yet --> 2.8 --> 2,
|
||||
// and from 9.7(DigitalTransitionRangeLead) 3.1 --> 2
|
||||
// and from 9.7(DigitTransitionRangeLead) 3.1 --> 2
|
||||
// everything >=x.4 can be considered as current number in transition. With 9.x predecessor the current
|
||||
// number can still be x.6 - x.7.
|
||||
// Preceding (else - branch) does not already happen from 9.
|
||||
if (Digital_Transition_Area_Forward>=number_of_predecessors || result_after_decimal_point >= 4) {
|
||||
if (Digit_Transition_Area_Forward>=number_of_predecessors || result_after_decimal_point >= 4) {
|
||||
// The current digit, like the previous digit, does not yet have a zero crossing.
|
||||
result = result_before_decimal_point % 10;
|
||||
}
|
||||
@@ -212,39 +212,39 @@ int ClassFlowCNNGeneral::PointerEvalHybridNew(float number, float number_of_pred
|
||||
}
|
||||
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalHybridNew - O analogue predecessor, >= 9.5 --> no zero crossing yet = " + std::to_string(result) +
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digital_Uncertainty = " + std::to_string(Digital_Uncertainty) + " result_after_decimal_point = " + std::to_string(result_after_decimal_point));
|
||||
" number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digit_Uncertainty = " + std::to_string(Digit_Uncertainty) + " result_after_decimal_point = " + std::to_string(result_after_decimal_point));
|
||||
return result;
|
||||
}
|
||||
|
||||
int ClassFlowCNNGeneral::PointerEvalAnalogToDigitNew(float number, float numeral_preceder, int eval_predecessors, float analogDigitalTransitionStart) {
|
||||
int ClassFlowCNNGeneral::PointerEvalAnalogToDigitNew(float number, float numeral_preceder, int eval_predecessors, float AnalogToDigitTransitionStart) {
|
||||
int result;
|
||||
int result_after_decimal_point = ((int) floor(number * 10)) % 10;
|
||||
int result_before_decimal_point = ((int) floor(number) + 10) % 10;
|
||||
bool roundedUp = false;
|
||||
|
||||
// Within the digital inequalities
|
||||
if ((result_after_decimal_point >= (10-Digital_Uncertainty * 10)) // Band around the digit --> Round off, as digit reaches inaccuracy in the frame
|
||||
// Within the digit inequalities
|
||||
if ((result_after_decimal_point >= (10-Digit_Uncertainty * 10)) // Band around the digit --> Round off, as digit reaches inaccuracy in the frame
|
||||
|| (eval_predecessors <= 4 && result_after_decimal_point>=6)) { // or digit runs after (analogue =0..4, digit >=6)
|
||||
result = (int) (round(number) + 10) % 10;
|
||||
roundedUp = true;
|
||||
// before/ after decimal point, because we adjust the number based on the uncertainty.
|
||||
result_after_decimal_point = ((int) floor(result * 10)) % 10;
|
||||
result_before_decimal_point = ((int) floor(result) + 10) % 10;
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalAnalogToDigitNew - Digital Uncertainty - Result = " + std::to_string(result) +
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalAnalogToDigitNew - Digit Uncertainty - Result = " + std::to_string(result) +
|
||||
" number: " + std::to_string(number) + " numeral_preceder: " + std::to_string(numeral_preceder) +
|
||||
" erg before comma: " + std::to_string(result_before_decimal_point) +
|
||||
" erg after comma: " + std::to_string(result_after_decimal_point));
|
||||
}
|
||||
else {
|
||||
result = (int) ((int) trunc(number) + 10) % 10;
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalAnalogToDigitNew - NO digital Uncertainty - Result = " + std::to_string(result) +
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalAnalogToDigitNew - NO digit Uncertainty - Result = " + std::to_string(result) +
|
||||
" number: " + std::to_string(number) + " numeral_preceder = " + std::to_string(numeral_preceder));
|
||||
}
|
||||
|
||||
// No zero crossing has taken place.
|
||||
// Only eval_predecessors used because numeral_preceder could be wrong here.
|
||||
// numeral_preceder<=0.1 & eval_predecessors=9 corresponds to analogue was reset because of previous analogue that are not yet at 0.
|
||||
if ((eval_predecessors>=6 && (numeral_preceder>analogDigitalTransitionStart || numeral_preceder<=0.2) && roundedUp)) {
|
||||
if ((eval_predecessors>=6 && (numeral_preceder>AnalogToDigitTransitionStart || numeral_preceder<=0.2) && roundedUp)) {
|
||||
result = ((result_before_decimal_point+10) - 1) % 10;
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalAnalogToDigitNew - Nulldurchgang noch nicht stattgefunden = " + std::to_string(result) +
|
||||
" number: " + std::to_string(number) +
|
||||
@@ -593,17 +593,17 @@ bool ClassFlowCNNGeneral::getNetworkParameter() {
|
||||
ESP_LOGD(TAG, "TFlite-Type set to DoubleHyprid10");
|
||||
break;
|
||||
case 11:
|
||||
CNNType = Digital;
|
||||
ESP_LOGD(TAG, "TFlite-Type set to Digital");
|
||||
CNNType = Digit;
|
||||
ESP_LOGD(TAG, "TFlite-Type set to Digit");
|
||||
break;
|
||||
/* case 20:
|
||||
CNNType = DigitalHyprid10;
|
||||
ESP_LOGD(TAG, "TFlite-Type set to DigitalHyprid10");
|
||||
CNNType = DigitHyprid10;
|
||||
ESP_LOGD(TAG, "TFlite-Type set to DigitHyprid10");
|
||||
break;
|
||||
*/
|
||||
// case 22:
|
||||
// CNNType = DigitalHyprid;
|
||||
// ESP_LOGD(TAG, "TFlite-Type set to DigitalHyprid");
|
||||
// CNNType = DigitHyprid;
|
||||
// ESP_LOGD(TAG, "TFlite-Type set to DigitHyprid");
|
||||
// break;
|
||||
case 100:
|
||||
if (modelxsize==32 && modelysize == 32) {
|
||||
@@ -611,8 +611,8 @@ bool ClassFlowCNNGeneral::getNetworkParameter() {
|
||||
ESP_LOGD(TAG, "TFlite-Type set to Analogue100");
|
||||
}
|
||||
else {
|
||||
CNNType = Digital100;
|
||||
ESP_LOGD(TAG, "TFlite-Type set to Digital");
|
||||
CNNType = Digit100;
|
||||
ESP_LOGD(TAG, "TFlite-Type set to Digit");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -686,8 +686,8 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time) {
|
||||
}
|
||||
} break;
|
||||
|
||||
case Digital:
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "CNN Type: Digital");
|
||||
case Digit:
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "CNN Type: Digit");
|
||||
{
|
||||
GENERAL[n]->ROI[roi]->result_klasse = 0;
|
||||
GENERAL[n]->ROI[roi]->result_klasse = tflite->GetClassFromImageBasis(GENERAL[n]->ROI[roi]->image);
|
||||
@@ -778,10 +778,10 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time) {
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case Digital100:
|
||||
case Digit100:
|
||||
case Analogue100:
|
||||
{
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "CNN Type: Digital100 or Analogue100");
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "CNN Type: Digit100 or Analogue100");
|
||||
int _num;
|
||||
float _result_save_file;
|
||||
|
||||
@@ -829,7 +829,7 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time) {
|
||||
}
|
||||
|
||||
bool ClassFlowCNNGeneral::isExtendedResolution(int _number) {
|
||||
if (CNNType == Digital) {
|
||||
if (CNNType == Digit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -861,7 +861,7 @@ std::vector<HTMLInfo*> ClassFlowCNNGeneral::GetHTMLInfo() {
|
||||
zw->filename_org = GENERAL[_ana]->name + "_" + GENERAL[_ana]->ROI[i]->name + ".jpg";
|
||||
}
|
||||
|
||||
if (CNNType == Digital) {
|
||||
if (CNNType == Digit) {
|
||||
zw->val = GENERAL[_ana]->ROI[i]->result_klasse;
|
||||
}
|
||||
else {
|
||||
@@ -927,7 +927,7 @@ string ClassFlowCNNGeneral::getReadoutRawString(int _analog)
|
||||
rt = rt + "," + RundeOutput(GENERAL[_analog]->ROI[i]->result_float, 1);
|
||||
}
|
||||
|
||||
if (CNNType == Digital) {
|
||||
if (CNNType == Digit) {
|
||||
if (GENERAL[_analog]->ROI[i]->result_klasse >= 10) {
|
||||
rt = rt + ",N";
|
||||
}
|
||||
@@ -936,7 +936,7 @@ string ClassFlowCNNGeneral::getReadoutRawString(int _analog)
|
||||
}
|
||||
}
|
||||
|
||||
if ((CNNType == DoubleHyprid10) || (CNNType == Digital100)) {
|
||||
if ((CNNType == DoubleHyprid10) || (CNNType == Digit100)) {
|
||||
rt = rt + "," + RundeOutput(GENERAL[_analog]->ROI[i]->result_float, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ enum t_CNNType {
|
||||
AutoDetect,
|
||||
Analogue,
|
||||
Analogue100,
|
||||
Digital,
|
||||
DigitalHyprid10,
|
||||
Digit,
|
||||
DigitHyprid10,
|
||||
DoubleHyprid10,
|
||||
Digital100,
|
||||
Digit100,
|
||||
None
|
||||
};
|
||||
|
||||
@@ -26,15 +26,6 @@ protected:
|
||||
std::vector<general*> GENERAL;
|
||||
float CNNGoodThreshold;
|
||||
|
||||
//moved to define.h
|
||||
//float Analog_error = 3.0;
|
||||
//float AnalogToDigtalFehler = 0.8;
|
||||
//float Digital_Uncertainty = 0.2;
|
||||
//int DigitalBand = 3;
|
||||
//float Digital_Transition_Range_Predecessor = 2;
|
||||
//float Digital_Transition_Area_Predecessor = 0.7; // 9.3 - 0.7
|
||||
//float Digital_Transition_Area_Forward = 9.7; // Pre-run zero crossing only happens from approx. 9.7 onwards
|
||||
|
||||
string cnnmodelfile;
|
||||
int modelxsize, modelysize, modelchannel;
|
||||
bool isLogImageSelect;
|
||||
@@ -44,8 +35,8 @@ protected:
|
||||
bool SaveAllFiles;
|
||||
|
||||
int PointerEvalAnalogNew(float zahl, int numeral_preceder);
|
||||
int PointerEvalAnalogToDigitNew(float zahl, float numeral_preceder, int eval_predecessors, float analogDigitalTransitionStart);
|
||||
int PointerEvalHybridNew(float zahl, float number_of_predecessors, int eval_predecessors, bool Analog_Predecessors = false, float analogDigitalTransitionStart=9.2);
|
||||
int PointerEvalAnalogToDigitNew(float zahl, float numeral_preceder, int eval_predecessors, float AnalogToDigitTransitionStart);
|
||||
int PointerEvalHybridNew(float zahl, float number_of_predecessors, int eval_predecessors, bool Analog_Predecessors = false, float AnalogToDigitTransitionStart=9.2);
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +52,7 @@ public:
|
||||
bool doFlow(string time);
|
||||
|
||||
string getHTMLSingleStep(string host);
|
||||
string getReadout(int _analog, bool _extendedResolution = false, int prev = -1, float _before_narrow_Analog = -1, float analogDigitalTransitionStart=9.2);
|
||||
string getReadout(int _analog, bool _extendedResolution = false, int prev = -1, float _before_narrow_Analog = -1, float AnalogToDigitTransitionStart=9.2);
|
||||
|
||||
string getReadoutRawString(int _analog);
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ std::string ClassFlowControll::TranslateAktstatus(std::string _input)
|
||||
}
|
||||
|
||||
if (_input.compare("ClassFlowCNNGeneral") == 0) {
|
||||
return ("Digitalization of ROIs");
|
||||
return ("Digitization of ROIs");
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MQTT
|
||||
@@ -126,10 +126,10 @@ std::string ClassFlowControll::TranslateAktstatus(std::string _input)
|
||||
return "Unkown Status";
|
||||
}
|
||||
|
||||
std::vector<HTMLInfo*> ClassFlowControll::GetAllDigital()
|
||||
std::vector<HTMLInfo*> ClassFlowControll::GetAllDigit()
|
||||
{
|
||||
if (flowdigit) {
|
||||
ESP_LOGD(TAG, "ClassFlowControll::GetAllDigital - flowdigit != NULL");
|
||||
ESP_LOGD(TAG, "ClassFlowControll::GetAllDigit - flowdigit != NULL");
|
||||
return flowdigit->GetHTMLInfo();
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ std::vector<HTMLInfo*> ClassFlowControll::GetAllAnalog()
|
||||
return empty;
|
||||
}
|
||||
|
||||
t_CNNType ClassFlowControll::GetTypeDigital()
|
||||
t_CNNType ClassFlowControll::GetTypeDigit()
|
||||
{
|
||||
if (flowdigit) {
|
||||
return flowdigit->getCNNType();
|
||||
@@ -166,7 +166,7 @@ t_CNNType ClassFlowControll::GetTypeAnalog()
|
||||
}
|
||||
|
||||
#ifdef ALGROI_LOAD_FROM_MEM_AS_JPG
|
||||
void ClassFlowControll::DigitalDrawROI(CImageBasis *_zw)
|
||||
void ClassFlowControll::DigitDrawROI(CImageBasis *_zw)
|
||||
{
|
||||
if (flowdigit) {
|
||||
flowdigit->DrawROI(_zw);
|
||||
@@ -326,7 +326,7 @@ void ClassFlowControll::InitFlow(std::string config)
|
||||
// printf("Name: %s\n", cfc->name().c_str());
|
||||
|
||||
if (cfc) {
|
||||
ESP_LOGD(TAG, "Start ReadParameter (%s)", line.c_str());
|
||||
ESP_LOGE(TAG, "Start ReadParameter (%s)", line.c_str());
|
||||
cfc->ReadParameter(pFile, line);
|
||||
}
|
||||
else {
|
||||
@@ -841,8 +841,8 @@ esp_err_t ClassFlowControll::GetJPGStream(std::string _fn, httpd_req_t *req)
|
||||
else {
|
||||
std::vector<HTMLInfo*> htmlinfo;
|
||||
|
||||
htmlinfo = GetAllDigital();
|
||||
ESP_LOGD(TAG, "After getClassFlowControll::GetAllDigital");
|
||||
htmlinfo = GetAllDigit();
|
||||
ESP_LOGD(TAG, "After getClassFlowControll::GetAllDigit");
|
||||
|
||||
for (int i = 0; i < htmlinfo.size(); ++i)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
string TranslateAktstatus(std::string _input);
|
||||
|
||||
#ifdef ALGROI_LOAD_FROM_MEM_AS_JPG
|
||||
void DigitalDrawROI(CImageBasis *_zw);
|
||||
void DigitDrawROI(CImageBasis *_zw);
|
||||
void AnalogDrawROI(CImageBasis *_zw);
|
||||
#endif
|
||||
|
||||
@@ -77,10 +77,10 @@ public:
|
||||
std::string* getActStatus();
|
||||
void setActStatus(std::string _aktstatus);
|
||||
|
||||
std::vector<HTMLInfo*> GetAllDigital();
|
||||
std::vector<HTMLInfo*> GetAllDigit();
|
||||
std::vector<HTMLInfo*> GetAllAnalog();
|
||||
|
||||
t_CNNType GetTypeDigital();
|
||||
t_CNNType GetTypeDigit();
|
||||
t_CNNType GetTypeAnalog();
|
||||
|
||||
#ifdef ENABLE_MQTT
|
||||
|
||||
@@ -33,7 +33,7 @@ enum t_RateType {
|
||||
|
||||
|
||||
/**
|
||||
* Holds all properties and settings of a sequence. A sequence is a set of digital and/or analog ROIs that are combined to
|
||||
* Holds all properties and settings of a sequence. A sequence is a set of digit and/or analog ROIs that are combined to
|
||||
* provide one meter reading (value).
|
||||
* FIXME: can be renamed to `Sequence`
|
||||
*/
|
||||
@@ -60,10 +60,10 @@ struct NumberPost {
|
||||
string ReturnPreValue; // lastValidValueStr; corrected return value without error message
|
||||
string ErrorMessageText; // errorMessage; Error message for consistency checks
|
||||
int AnzahlAnalog; // numAnalogRoi; number of analog ROIs used in this sequence
|
||||
int AnzahlDigital; // numDigitalRoi; number of digital ROIs used in this sequence
|
||||
int AnzahlDigit; // numDigitRoi; number of digit ROIs used in this sequence
|
||||
int DecimalShift; // decimalShift; each increment shifts the decimal separator by one digit; value=value*10^decimalShift; pos. value shifts to the right
|
||||
int DecimalShiftInitial; // decimalShiftInitial; same as decimalShift but is a const to reset decimalShift after calculations
|
||||
float AnalogDigitalTransitionStart; // analogDigitalTransitionStartValue; FIXME: need a better description; When is the digit > x.1, i.e. when does it start to tilt?
|
||||
float AnalogToDigitTransitionStart; // AnalogToDigitTransitionStartValue; FIXME: need a better description; When is the digit > x.1, i.e. when does it start to tilt?
|
||||
int Nachkomma; // decimalPlaces; usually defined by the number of analog ROIs; affected by DecimalShift
|
||||
|
||||
string FieldV1; // influxdbFieldName_v1; Name of the Field in InfluxDBv1
|
||||
@@ -74,7 +74,7 @@ struct NumberPost {
|
||||
|
||||
bool isExtendedResolution; // extendResolution; Adds the decimal place of the least significant analog ROI to the value
|
||||
|
||||
general *digit_roi; // digitalRoi; set of digital ROIs for the sequence
|
||||
general *digit_roi; // digitRoi; set of digit ROIs for the sequence
|
||||
general *analog_roi; // analogRoi; set of analog ROIs for the sequence
|
||||
|
||||
string name; // name; Designation for the sequence
|
||||
|
||||
@@ -286,7 +286,7 @@ bool ClassFlowMQTT::doFlow(string zwtime)
|
||||
|
||||
if (resultchangabs.length() > 0) {
|
||||
success |= MQTTPublish(namenumber + "changeabsolut", resultchangabs, qos, SetRetainFlag); // Legacy API
|
||||
success |= MQTTPublish(namenumber + "rate_per_digitalization_round", resultchangabs, qos, SetRetainFlag);
|
||||
success |= MQTTPublish(namenumber + "rate_per_Digitization_round", resultchangabs, qos, SetRetainFlag);
|
||||
}
|
||||
|
||||
if (resultraw.length() > 0)
|
||||
|
||||
@@ -382,7 +382,7 @@ void ClassFlowPostProcessing::handleDecimalSeparator(string _decsep, string _val
|
||||
}
|
||||
}
|
||||
|
||||
void ClassFlowPostProcessing::handleAnalogDigitalTransitionStart(string _decsep, string _value) {
|
||||
void ClassFlowPostProcessing::handleAnalogToDigitTransitionStart(string _decsep, string _value) {
|
||||
string _digit, _decpos;
|
||||
int _pospunkt = _decsep.find_first_of(".");
|
||||
// ESP_LOGD(TAG, "Name: %s, Pospunkt: %d", _decsep.c_str(), _pospunkt);
|
||||
@@ -403,7 +403,7 @@ void ClassFlowPostProcessing::handleAnalogDigitalTransitionStart(string _decsep,
|
||||
|
||||
// Set to default first (if nothing else is set)
|
||||
if ((_digit == "default") || (NUMBERS[j]->name == _digit)) {
|
||||
NUMBERS[j]->AnalogDigitalTransitionStart = _zwdc;
|
||||
NUMBERS[j]->AnalogToDigitTransitionStart = _zwdc;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -564,8 +564,8 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||
handleDecimalSeparator(splitted[0], splitted[1]);
|
||||
}
|
||||
|
||||
if ((toUpper(_param) == "ANALOGDIGITALTRANSITIONSTART") && (splitted.size() > 1)) {
|
||||
handleAnalogDigitalTransitionStart(splitted[0], splitted[1]);
|
||||
if ((toUpper(_param) == "AnalogToDigitTransitionStart") && (splitted.size() > 1)) {
|
||||
handleAnalogToDigitTransitionStart(splitted[0], splitted[1]);
|
||||
}
|
||||
|
||||
if ((toUpper(_param) == "MAXRATEVALUE") && (splitted.size() > 1)) {
|
||||
@@ -648,10 +648,10 @@ void ClassFlowPostProcessing::InitNUMBERS() {
|
||||
}
|
||||
|
||||
if (_number->digit_roi) {
|
||||
_number->AnzahlDigital = _number->digit_roi->ROI.size();
|
||||
_number->AnzahlDigit = _number->digit_roi->ROI.size();
|
||||
}
|
||||
else {
|
||||
_number->AnzahlDigital = 0;
|
||||
_number->AnzahlDigit = 0;
|
||||
}
|
||||
|
||||
_number->analog_roi = NULL;
|
||||
@@ -677,7 +677,7 @@ void ClassFlowPostProcessing::InitNUMBERS() {
|
||||
_number->DecimalShift = 0;
|
||||
_number->DecimalShiftInitial = 0;
|
||||
_number->isExtendedResolution = false;
|
||||
_number->AnalogDigitalTransitionStart=9.2;
|
||||
_number->AnalogToDigitTransitionStart=9.2;
|
||||
_number->ChangeRateThreshold = 2;
|
||||
|
||||
_number->Value = 0; // last value read out, incl. corrections
|
||||
@@ -693,7 +693,7 @@ void ClassFlowPostProcessing::InitNUMBERS() {
|
||||
}
|
||||
|
||||
for (int i = 0; i < NUMBERS.size(); ++i) {
|
||||
ESP_LOGD(TAG, "Number %s, Anz DIG: %d, Anz ANA %d", NUMBERS[i]->name.c_str(), NUMBERS[i]->AnzahlDigital, NUMBERS[i]->AnzahlAnalog);
|
||||
ESP_LOGD(TAG, "Number %s, Anz DIG: %d, Anz ANA %d", NUMBERS[i]->name.c_str(), NUMBERS[i]->AnzahlDigit, NUMBERS[i]->AnzahlAnalog);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -804,7 +804,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) {
|
||||
|
||||
if (NUMBERS[j]->digit_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]->AnalogDigitalTransitionStart) + NUMBERS[j]->ReturnRawValue;
|
||||
NUMBERS[j]->ReturnRawValue = flowDigit->getReadout(j, false, previous_value, NUMBERS[j]->analog_roi->ROI[0]->result_float, NUMBERS[j]->AnalogToDigitTransitionStart) + NUMBERS[j]->ReturnRawValue;
|
||||
}
|
||||
else {
|
||||
NUMBERS[j]->ReturnRawValue = flowDigit->getReadout(j, NUMBERS[j]->isExtendedResolution, previous_value); // Extended Resolution only if there are no analogue digits
|
||||
@@ -812,7 +812,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) {
|
||||
}
|
||||
|
||||
#ifdef SERIAL_DEBUG
|
||||
ESP_LOGD(TAG, "After digital->getReadout: ReturnRaw %s", NUMBERS[j]->ReturnRawValue.c_str());
|
||||
ESP_LOGD(TAG, "After digit->getReadout: ReturnRaw %s", NUMBERS[j]->ReturnRawValue.c_str());
|
||||
#endif
|
||||
|
||||
NUMBERS[j]->ReturnRawValue = ShiftDecimal(NUMBERS[j]->ReturnRawValue, NUMBERS[j]->DecimalShift);
|
||||
@@ -868,8 +868,8 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) {
|
||||
|
||||
if (NUMBERS[j]->checkDigitIncreaseConsistency) {
|
||||
if (flowDigit) {
|
||||
if (flowDigit->getCNNType() != Digital) {
|
||||
ESP_LOGD(TAG, "checkDigitIncreaseConsistency = true - ignored due to wrong CNN-Type (not Digital Classification)");
|
||||
if (flowDigit->getCNNType() != Digit) {
|
||||
ESP_LOGD(TAG, "checkDigitIncreaseConsistency = true - ignored due to wrong CNN-Type (not Digit Classification)");
|
||||
}
|
||||
else {
|
||||
NUMBERS[j]->Value = checkDigitConsistency(NUMBERS[j]->Value, NUMBERS[j]->DecimalShift, NUMBERS[j]->analog_roi != NULL, NUMBERS[j]->PreValue);
|
||||
@@ -877,7 +877,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) {
|
||||
}
|
||||
else {
|
||||
#ifdef SERIAL_DEBUG
|
||||
ESP_LOGD(TAG, "checkDigitIncreaseConsistency = true - no digital numbers defined!");
|
||||
ESP_LOGD(TAG, "checkDigitIncreaseConsistency = true - no digit numbers defined!");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -990,7 +990,7 @@ void ClassFlowPostProcessing::WriteDataLog(int _index) {
|
||||
}
|
||||
|
||||
string analog = "";
|
||||
string digital = "";
|
||||
string digit = "";
|
||||
string timezw = "";
|
||||
char buffer[80];
|
||||
struct tm* timeinfo = localtime(&NUMBERS[_index]->timeStampLastValue);
|
||||
@@ -1002,20 +1002,20 @@ void ClassFlowPostProcessing::WriteDataLog(int _index) {
|
||||
}
|
||||
|
||||
if (flowDigit) {
|
||||
digital = flowDigit->getReadoutRawString(_index);
|
||||
digit = flowDigit->getReadoutRawString(_index);
|
||||
}
|
||||
|
||||
LogFile.WriteToData(timezw, NUMBERS[_index]->name, NUMBERS[_index]->ReturnRawValue, NUMBERS[_index]->ReturnValue, NUMBERS[_index]->ReturnPreValue,
|
||||
NUMBERS[_index]->ReturnRateValue, NUMBERS[_index]->ReturnChangeAbsolute, NUMBERS[_index]->ErrorMessageText, digital, analog);
|
||||
NUMBERS[_index]->ReturnRateValue, NUMBERS[_index]->ReturnChangeAbsolute, NUMBERS[_index]->ErrorMessageText, digit, analog);
|
||||
|
||||
ESP_LOGD(TAG, "WriteDataLog: %s, %s, %s, %s, %s", NUMBERS[_index]->ReturnRawValue.c_str(), NUMBERS[_index]->ReturnValue.c_str(), NUMBERS[_index]->ErrorMessageText.c_str(), digital.c_str(), analog.c_str());
|
||||
ESP_LOGD(TAG, "WriteDataLog: %s, %s, %s, %s, %s", NUMBERS[_index]->ReturnRawValue.c_str(), NUMBERS[_index]->ReturnValue.c_str(), NUMBERS[_index]->ErrorMessageText.c_str(), digit.c_str(), analog.c_str());
|
||||
}
|
||||
|
||||
void ClassFlowPostProcessing::UpdateNachkommaDecimalShift() {
|
||||
for (int j = 0; j < NUMBERS.size(); ++j) {
|
||||
// There are only digital digits
|
||||
// There are only digits
|
||||
if (NUMBERS[j]->digit_roi && !NUMBERS[j]->analog_roi) {
|
||||
// ESP_LOGD(TAG, "Nurdigital");
|
||||
// ESP_LOGD(TAG, "Nurdigit");
|
||||
NUMBERS[j]->DecimalShift = NUMBERS[j]->DecimalShiftInitial;
|
||||
|
||||
// Extended resolution is on and should also be used for this digit.
|
||||
@@ -1037,9 +1037,9 @@ void ClassFlowPostProcessing::UpdateNachkommaDecimalShift() {
|
||||
NUMBERS[j]->Nachkomma = -NUMBERS[j]->DecimalShift;
|
||||
}
|
||||
|
||||
// digital + analog
|
||||
// digit + analog
|
||||
if (NUMBERS[j]->digit_roi && NUMBERS[j]->analog_roi) {
|
||||
// ESP_LOGD(TAG, "Nur digital + analog");
|
||||
// ESP_LOGD(TAG, "Nur digit + analog");
|
||||
|
||||
NUMBERS[j]->DecimalShift = NUMBERS[j]->DecimalShiftInitial;
|
||||
NUMBERS[j]->Nachkomma = NUMBERS[j]->analog_roi->ROI.size() - NUMBERS[j]->DecimalShift;
|
||||
|
||||
@@ -39,7 +39,7 @@ protected:
|
||||
void handleMaxRateValue(string _decsep, string _value);
|
||||
void handleDecimalExtendedResolution(string _decsep, string _value);
|
||||
void handleMaxRateType(string _decsep, string _value);
|
||||
void handleAnalogDigitalTransitionStart(string _decsep, string _value);
|
||||
void handleAnalogToDigitTransitionStart(string _decsep, string _value);
|
||||
void handleAllowNegativeRate(string _decsep, string _value);
|
||||
void handleChangeRateThreshold(string _decsep, string _value);
|
||||
|
||||
|
||||
@@ -674,17 +674,17 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Digital ROIs */
|
||||
/* Digit ROIs */
|
||||
txt = "<body style=\"font-family: arial\">";
|
||||
txt += "<hr><h3>Recognized Digit ROIs (previous round)</h3>\n";
|
||||
txt += "<table style=\"border-spacing: 5px\"><tr style=\"text-align: center; vertical-align: top;\">\n";
|
||||
|
||||
std::vector<HTMLInfo *> htmlinfodig;
|
||||
htmlinfodig = flowctrl.GetAllDigital();
|
||||
htmlinfodig = flowctrl.GetAllDigit();
|
||||
|
||||
for (int i = 0; i < htmlinfodig.size(); ++i)
|
||||
{
|
||||
if (flowctrl.GetTypeDigital() == Digital)
|
||||
if (flowctrl.GetTypeDigit() == Digit)
|
||||
{
|
||||
// Numbers greater than 10 and less than 0 indicate NaN, since a Roi can only have values from 0 to 9.
|
||||
if ((htmlinfodig[i]->val >= 10) || (htmlinfodig[i]->val < 0))
|
||||
|
||||
@@ -120,15 +120,15 @@ void psram_free_shared_temp_image_memory(void) {
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* Memory used in Digitalization Steps
|
||||
* Memory used in Digitization Steps
|
||||
* During this step we only use the shared part of the PSRAM for the
|
||||
* Tensor Arena and one of the Models.
|
||||
* The shared memory is large enough for the largest model and the
|
||||
* Tensor Arena. Therefore we do not need to monitor the usage.
|
||||
*******************************************************************/
|
||||
void *psram_get_shared_tensor_arena_memory(void) {
|
||||
if ((sharedMemoryInUseFor == "") || (sharedMemoryInUseFor == "Digitalization_Model")) {
|
||||
sharedMemoryInUseFor = "Digitalization_Tensor";
|
||||
if ((sharedMemoryInUseFor == "") || (sharedMemoryInUseFor == "Digitization_Model")) {
|
||||
sharedMemoryInUseFor = "Digitization_Tensor";
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Allocating Tensor Arena (" + std::to_string(TENSOR_ARENA_SIZE) + " bytes, use shared memory in PSRAM)...");
|
||||
return shared_region; // Use 1th part of the shared memory for Tensor
|
||||
}
|
||||
@@ -140,8 +140,8 @@ void *psram_get_shared_tensor_arena_memory(void) {
|
||||
|
||||
|
||||
void *psram_get_shared_model_memory(void) {
|
||||
if ((sharedMemoryInUseFor == "") || (sharedMemoryInUseFor == "Digitalization_Tensor")) {
|
||||
sharedMemoryInUseFor = "Digitalization_Model";
|
||||
if ((sharedMemoryInUseFor == "") || (sharedMemoryInUseFor == "Digitization_Tensor")) {
|
||||
sharedMemoryInUseFor = "Digitization_Model";
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Allocating Model memory (" + std::to_string(MAX_MODEL_SIZE) + " bytes, use shared memory in PSRAM)...");
|
||||
return (uint8_t *)shared_region + TENSOR_ARENA_SIZE; // Use 2nd part of the shared memory (after Tensor Arena) for the model
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ void psram_free_shared_stbi_memory(void *p);
|
||||
void *psram_reserve_shared_tmp_image_memory(void);
|
||||
void psram_free_shared_temp_image_memory(void);
|
||||
|
||||
/* Memory used in Digitalization Steps */
|
||||
/* Memory used in Digitization Steps */
|
||||
void *psram_get_shared_tensor_arena_memory(void);
|
||||
void *psram_get_shared_model_memory(void);
|
||||
void psram_free_shared_tensor_arena_and_model_memory(void);
|
||||
|
||||
@@ -32,7 +32,7 @@ void ClassLogFile::WriteHeapInfo(std::string _id)
|
||||
}
|
||||
|
||||
|
||||
void ClassLogFile::WriteToData(std::string _timestamp, std::string _name, std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ReturnRateValue, std::string _ReturnChangeAbsolute, std::string _ErrorMessageText, std::string _digital, std::string _analog)
|
||||
void ClassLogFile::WriteToData(std::string _timestamp, std::string _name, std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ReturnRateValue, std::string _ReturnChangeAbsolute, std::string _ErrorMessageText, std::string _digit, std::string _analog)
|
||||
{
|
||||
ESP_LOGD(TAG, "Start WriteToData");
|
||||
time_t rawtime;
|
||||
@@ -67,7 +67,7 @@ void ClassLogFile::WriteToData(std::string _timestamp, std::string _name, std::s
|
||||
fputs(_ReturnChangeAbsolute.c_str(), pFile);
|
||||
fputs(",", pFile);
|
||||
fputs(_ErrorMessageText.c_str(), pFile);
|
||||
fputs(_digital.c_str(), pFile);
|
||||
fputs(_digit.c_str(), pFile);
|
||||
fputs(_analog.c_str(), pFile);
|
||||
fputs("\n", pFile);
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
void RemoveOldLogFile();
|
||||
void RemoveOldDataLog();
|
||||
|
||||
// void WriteToData(std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ErrorMessageText, std::string _digital, std::string _analog);
|
||||
void WriteToData(std::string _timestamp, std::string _name, std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ReturnRateValue, std::string _ReturnChangeAbsolute, std::string _ErrorMessageText, std::string _digital, std::string _analog);
|
||||
// void WriteToData(std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ErrorMessageText, std::string _digit, std::string _analog);
|
||||
void WriteToData(std::string _timestamp, std::string _name, std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ReturnRateValue, std::string _ReturnChangeAbsolute, std::string _ErrorMessageText, std::string _digit, std::string _analog);
|
||||
|
||||
|
||||
std::string GetCurrentFileName();
|
||||
|
||||
@@ -188,10 +188,10 @@ bool MQTThomeassistantDiscovery(int qos) {
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "value", "Value", "gauge", valueUnit, meterType, "total_increasing", "", qos);
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "raw", "Raw Value", "raw", "", "", "", "diagnostic", qos);
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "error", "Error", "alert-circle-outline", "", "", "", "diagnostic", qos);
|
||||
/* Not announcing "rate" as it is better to use rate_per_time_unit resp. rate_per_digitalization_round */
|
||||
/* Not announcing "rate" as it is better to use rate_per_time_unit resp. rate_per_Digitization_round */
|
||||
// allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "rate", "Rate (Unit/Minute)", "swap-vertical", "", "", "", ""); // Legacy, always Unit per Minute
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "rate_per_time_unit", "Rate (" + rateUnit + ")", "swap-vertical", rateUnit, "", "measurement", "", qos);
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "rate_per_digitalization_round", "Change since last digitalization round", "arrow-expand-vertical", valueUnit, "", "measurement", "", qos); // correctly the Unit is Unit/Interval!
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "rate_per_Digitization_round", "Change since last Digitization round", "arrow-expand-vertical", valueUnit, "", "measurement", "", qos); // correctly the Unit is Unit/Interval!
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "timestamp", "Timestamp", "clock-time-eight-outline", "", "timestamp", "", "diagnostic", qos);
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "json", "JSON", "code-json", "", "", "", "diagnostic", qos);
|
||||
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic(group, "problem", "Problem", "alert-outline", "", "problem", "", "", qos); // Special binary sensor which is based on error topic
|
||||
|
||||
@@ -176,13 +176,13 @@
|
||||
|
||||
//ClassFlowCNNGeneral
|
||||
#define Analog_error 3
|
||||
#define AnalogToDigtalFehler 0.8
|
||||
#define Digital_Uncertainty 0.2
|
||||
#define DigitalBand 3
|
||||
#define Digital_Transition_Range_Predecessor 2
|
||||
#define Digital_Transition_Area_Predecessor 0.7 // 9.3 - 0.7
|
||||
#define Digital_Transition_Area_Forward 9.7 // Pre-run zero crossing only happens from approx. 9.7 onwards
|
||||
|
||||
#define AnalogToDigtalFehler 0.8
|
||||
#define Digit_Uncertainty 0.2
|
||||
#define DigitBand 3
|
||||
#define Digit_Transition_Range_Predecessor 2
|
||||
#define Digit_Transition_Area_Predecessor 0.7 // 9.3 - 0.7
|
||||
#define Digit_Transition_Area_Forward 9.7 // Pre-run zero crossing only happens from approx. 9.7 onwards
|
||||
|
||||
//#define DEBUG_DETAIL_ON
|
||||
|
||||
|
||||
@@ -602,6 +602,7 @@ void migrateConfiguration(void) {
|
||||
}
|
||||
|
||||
if (section == "[PostProcessing]") {
|
||||
migrated = migrated | replaceString(configLines[i], "AnalogDigitalTransitionStart", "AnalogToDigitTransitionStart"); // Rename it
|
||||
migrated = migrated | replaceString(configLines[i], ";PreValueUse = true", ";PreValueUse = false"); // Set it to its default value
|
||||
migrated = migrated | replaceString(configLines[i], ";PreValueUse", "PreValueUse"); // Enable it
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ esp_err_t img_tmp_virtual_handler(httpd_req_t *req)
|
||||
if (filetosend == "raw.jpg")
|
||||
return GetRawJPG(req);
|
||||
|
||||
// Serve alg.jpg, alg_roi.jpg or digital and analog ROIs
|
||||
// Serve alg.jpg, alg_roi.jpg or digit and analog ROIs
|
||||
if (ESP_OK == GetJPG(filetosend, req))
|
||||
return ESP_OK;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class UnderTestCNNGeneral : public ClassFlowCNNGeneral {
|
||||
*/
|
||||
void test_analogToDigit_Standard() {
|
||||
|
||||
UnderTestCNNGeneral* undertest = new UnderTestCNNGeneral(nullptr, Digital100);
|
||||
UnderTestCNNGeneral* undertest = new UnderTestCNNGeneral(nullptr, Digit100);
|
||||
|
||||
// 4.8 is a "hanging" 5, i.e. it has not jumped over to 5.0.
|
||||
// A "hanging digit" should still be rounded from Transition.
|
||||
@@ -59,7 +59,7 @@ void test_analogToDigit_Standard() {
|
||||
}
|
||||
|
||||
void test_analogToDigit_Transition() {
|
||||
UnderTestCNNGeneral* undertest = new UnderTestCNNGeneral(nullptr, Digital100);
|
||||
UnderTestCNNGeneral* undertest = new UnderTestCNNGeneral(nullptr, Digit100);
|
||||
|
||||
// https://github.com/jomjol/AI-on-the-edge-device/issues/921#issuecomment-1222672175
|
||||
// Default: dig=3.9, ana=9.7 => erg=3
|
||||
|
||||
@@ -16,7 +16,7 @@ class UnderTestCNN : public ClassFlowCNNGeneral {
|
||||
*/
|
||||
void test_ZeigerEval()
|
||||
{
|
||||
UnderTestCNN undertest = UnderTestCNN(nullptr, Digital100);
|
||||
UnderTestCNN undertest = UnderTestCNN(nullptr, Digit100);
|
||||
|
||||
// the 5.2 is already above 5.0 and the previous digit too (3)
|
||||
printf("Test 5.2, 3\n");
|
||||
@@ -29,11 +29,11 @@ void test_ZeigerEval()
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalAnalogNew(5.2, 9));
|
||||
|
||||
printf("Test 4.4, 9\n");
|
||||
// the 4.4 (digital100) is not above 5 and the previous digit (analog) too (9.3)
|
||||
// the 4.4 (Digit100) is not above 5 and the previous digit (analog) too (9.3)
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalAnalogNew(4.4, 9));
|
||||
|
||||
printf("Test 4.5, 0\n");
|
||||
// the 4.5 (digital100) is not above 5 and the previous digit (analog) too (9.6)
|
||||
// the 4.5 (Digit100) is not above 5 and the previous digit (analog) too (9.6)
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalAnalogNew(4.5, 0));
|
||||
|
||||
}
|
||||
@@ -42,7 +42,7 @@ void test_ZeigerEval()
|
||||
* @brief test if all combinations of digit
|
||||
* evaluation are running correctly
|
||||
*
|
||||
* Desciption on call undertest.PointerEvalHybridNew(float number, float number_of_predecessors, int eval_predecessors, bool Analog_Predecessors, float digitalAnalogTransitionStart)
|
||||
* Desciption on call undertest.PointerEvalHybridNew(float number, float number_of_predecessors, int eval_predecessors, bool Analog_Predecessors, float digitAnalogTransitionStart)
|
||||
* @param number: is the current ROI as float value from recognition
|
||||
* @param number_of_predecessors: is the last (lower) ROI as float from recognition
|
||||
* @param eval_predecessors: is the evaluated number. Sometimes a much lower value can change higer values
|
||||
@@ -50,16 +50,16 @@ void test_ZeigerEval()
|
||||
* 0.1 => 0 (eval_predecessors)
|
||||
* The 0 makes a 9.9 to 0 (eval_predecessors)
|
||||
* The 0 makes a 9.8 to 0
|
||||
* @param Analog_Predecessors false/true if the last ROI is an analog or digital ROI (default=false)
|
||||
* @param Analog_Predecessors false/true if the last ROI is an analog or digit ROI (default=false)
|
||||
* runs in special handling because analog is much less precise
|
||||
* @param digitalAnalogTransitionStart start of the transitionlogic begins on number_of_predecessor (default=9.2)
|
||||
* @param digitAnalogTransitionStart start of the transitionlogic begins on number_of_predecessor (default=9.2)
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void test_ZeigerEvalHybrid() {
|
||||
UnderTestCNN undertest = UnderTestCNN(nullptr, Digital100);
|
||||
UnderTestCNN undertest = UnderTestCNN(nullptr, Digit100);
|
||||
|
||||
// the 5.2 and no previous should round down
|
||||
printf("PointerEvalHybridNew(5.2, 0, -1)\n");
|
||||
@@ -93,17 +93,17 @@ void test_ZeigerEvalHybrid() {
|
||||
// the 5.7 with previous and the previous >=9.5 should trunc to 5
|
||||
TEST_ASSERT_EQUAL(5, undertest.PointerEvalHybridNew(5.7, 9.6, 9));
|
||||
|
||||
// the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.6)
|
||||
// the 4.5 (Digit100) is not above 5 and the previous digit (analog) not over Zero (9.6)
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalHybridNew(4.5, 9.6, 0));
|
||||
|
||||
// the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.6)
|
||||
// the 4.5 (Digit100) is not above 5 and the previous digit (analog) not over Zero (9.6)
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalHybridNew(4.5, 9.6, 9));
|
||||
// the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.5)
|
||||
// the 4.5 (Digit100) is not above 5 and the previous digit (analog) not over Zero (9.5)
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalHybridNew(4.5, 9.5, 9));
|
||||
|
||||
// 59.96889 - Pre: 58.94888
|
||||
// 8.6 : 9.8 : 6.7
|
||||
// the 4.4 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.5)
|
||||
// the 4.4 (Digit100) is not above 5 and the previous digit (analog) not over Zero (9.5)
|
||||
TEST_ASSERT_EQUAL(8, undertest.PointerEvalHybridNew(8.6, 9.8, 9));
|
||||
|
||||
// pre = 9.9 (0.0 raw)
|
||||
@@ -111,7 +111,7 @@ void test_ZeigerEvalHybrid() {
|
||||
TEST_ASSERT_EQUAL(2, undertest.PointerEvalHybridNew(1.8, 9.0, 9));
|
||||
|
||||
// if a digit have an early transition and the pointer is < 9.0
|
||||
// prev (pointer) = 6.2, but on digital readout = 6.0 (prev is int parameter)
|
||||
// prev (pointer) = 6.2, but on digit readout = 6.0 (prev is int parameter)
|
||||
// zahl = 4.6
|
||||
TEST_ASSERT_EQUAL(4, undertest.PointerEvalHybridNew(4.6, 6.0, 6));
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ std::string process_doFlow(UnderTestPost* _underTestPost) {
|
||||
* @brief setup flow like it runs after recognition.
|
||||
*
|
||||
* @param analog the analog recognitions as array begins with the highest ROI
|
||||
* @param digits the digital regocnitions as array begins with the highest ROI
|
||||
* @param digType type of the model defaults do Digital100
|
||||
* @param checkConsistency for Digital type only. Not relvant for newer models
|
||||
* @param digits the digit regocnitions as array begins with the highest ROI
|
||||
* @param digType type of the model defaults do Digit100
|
||||
* @param checkConsistency for Digit type only. Not relvant for newer models
|
||||
* @param extendedResolution the lowest ROI will directly used (9.7 => 9.7) if false 9.7 => 9
|
||||
* @param decimal_shift the decimal point offset. -3 corresponds to x.yyy
|
||||
* @return std::string the value result
|
||||
@@ -162,7 +162,7 @@ void setAnalogdigitTransistionStart(UnderTestPost* _underTestPost, float _analog
|
||||
std::vector<NumberPost*>* NUMBERS = _underTestPost->GetNumbers();
|
||||
for (int _n = 0; _n < (*NUMBERS).size(); ++_n) {
|
||||
ESP_LOGD(TAG, "Setting decimal shift on number: %d to %f", _n, _analogdigitTransistionStart);
|
||||
(*NUMBERS)[_n]->AnalogDigitalTransitionStart = _analogdigitTransistionStart;
|
||||
(*NUMBERS)[_n]->AnalogToDigitTransitionStart = _analogdigitTransistionStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@ UnderTestPost* setUpClassFlowPostprocessing(t_CNNType digType, t_CNNType anaType
|
||||
*
|
||||
* @param analog the analog recognitions
|
||||
* @param digits the digit recognitions
|
||||
* @param digType the digit model type (default Digital100)
|
||||
* @param digType the digit model type (default Digit100)
|
||||
* @param checkConsistency sets property checkConsistency (default = false)
|
||||
* @param extendedResolution sets property extendedResolution (default = false)
|
||||
* @param decimal_shift set property decimal_shift (Nachkommastellen, default = 0)
|
||||
* @return UnderTestPost* the created testobject
|
||||
*/
|
||||
UnderTestPost* init_do_flow(std::vector<float> analog, std::vector<float> digits, t_CNNType digType = Digital100,
|
||||
UnderTestPost* init_do_flow(std::vector<float> analog, std::vector<float> digits, t_CNNType digType = Digit100,
|
||||
bool checkConsistency=false, bool extendedResolution=false, int decimal_shift=0);
|
||||
|
||||
/**
|
||||
@@ -47,13 +47,13 @@ UnderTestPost* init_do_flow(std::vector<float> analog, std::vector<float> digits
|
||||
*
|
||||
* @param analog the analog recognitions
|
||||
* @param digits the digit recognitions
|
||||
* @param digType the digit model type (default Digital100)
|
||||
* @param digType the digit model type (default Digit100)
|
||||
* @param checkConsistency sets property checkConsistency (default = false)
|
||||
* @param extendedResolution sets property extendedResolution (default = false)
|
||||
* @param decimal_shift set property decimal_shift (Nachkommastellen, default = 0)
|
||||
* @return std::string the return value of do_Flow is the Value as string
|
||||
*/
|
||||
std::string process_doFlow(std::vector<float> analog, std::vector<float> digits, t_CNNType digType = Digital100,
|
||||
std::string process_doFlow(std::vector<float> analog, std::vector<float> digits, t_CNNType digType = Digit100,
|
||||
bool checkConsistency=false, bool extendedResolution=false, int decimal_shift=0);
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,7 @@ void testNegative() {
|
||||
|
||||
// extendResolution=false
|
||||
// da kein negativ, sollte kein Error auftreten
|
||||
UnderTestPost* underTestPost = init_do_flow(analogs, digits, Digital100, false, false, 0);
|
||||
UnderTestPost* underTestPost = init_do_flow(analogs, digits, Digit100, false, false, 0);
|
||||
setAllowNegatives(underTestPost, false);
|
||||
setPreValue(underTestPost, preValue);
|
||||
std::string result = process_doFlow(underTestPost);
|
||||
@@ -31,7 +31,7 @@ void testNegative() {
|
||||
// extendResolution=true
|
||||
// da negativ im Rahmen (letzte Stelle -0.2 > ergebnis), kein Error
|
||||
// Aber der PreValue wird gesetzt
|
||||
underTestPost = init_do_flow(analogs, digits, Digital100, false, true, 0);
|
||||
underTestPost = init_do_flow(analogs, digits, Digit100, false, true, 0);
|
||||
setAllowNegatives(underTestPost, false);
|
||||
setPreValue(underTestPost, preValue_extended);
|
||||
result = process_doFlow(underTestPost);
|
||||
@@ -42,7 +42,7 @@ void testNegative() {
|
||||
// extendResolution=true
|
||||
// Tolleranz überschritten, Error wird gesetzt, kein ReturnValue
|
||||
preValue_extended = 16.988; // zu groß
|
||||
underTestPost = init_do_flow(analogs, digits, Digital100, false, true, 0);
|
||||
underTestPost = init_do_flow(analogs, digits, Digit100, false, true, 0);
|
||||
setAllowNegatives(underTestPost, false);
|
||||
setPreValue(underTestPost, preValue_extended);
|
||||
result = process_doFlow(underTestPost);
|
||||
@@ -53,7 +53,7 @@ void testNegative() {
|
||||
// extendResolution=false
|
||||
// value < (preValue -.01)
|
||||
preValue = 17.00; // zu groß
|
||||
underTestPost = init_do_flow(analogs, digits, Digital100, false, false, 0);
|
||||
underTestPost = init_do_flow(analogs, digits, Digit100, false, false, 0);
|
||||
setAllowNegatives(underTestPost, false);
|
||||
setPreValue(underTestPost, preValue);
|
||||
result = process_doFlow(underTestPost);
|
||||
@@ -65,7 +65,7 @@ void testNegative() {
|
||||
// value > (preValue -.01)
|
||||
// ist im Rahmen der Ungenauigkeit (-1 auf letzter Stelle)
|
||||
preValue = 16.99; // zu groß
|
||||
underTestPost = init_do_flow(analogs, digits, Digital100, false, false, 0);
|
||||
underTestPost = init_do_flow(analogs, digits, Digit100, false, false, 0);
|
||||
setAllowNegatives(underTestPost, false);
|
||||
setPreValue(underTestPost, preValue);
|
||||
result = process_doFlow(underTestPost);
|
||||
@@ -77,7 +77,7 @@ void testNegative() {
|
||||
// value < preValue
|
||||
// Aber Prüfung abgeschaltet => kein Fehler
|
||||
preValue = 17.99; // zu groß
|
||||
underTestPost = init_do_flow(analogs, digits, Digital100, false, false, 0);
|
||||
underTestPost = init_do_flow(analogs, digits, Digit100, false, false, 0);
|
||||
setAllowNegatives(underTestPost, true);
|
||||
setPreValue(underTestPost, preValue_extended);
|
||||
result = process_doFlow(underTestPost);
|
||||
@@ -105,7 +105,7 @@ void testNegative_Issues() {
|
||||
// value < preValue
|
||||
// Prüfung eingeschaltet => Fehler
|
||||
preValue = 22018.09; // zu groß
|
||||
UnderTestPost* underTestPost = init_do_flow(analogs, digits, Digital100, false, false, -2);
|
||||
UnderTestPost* underTestPost = init_do_flow(analogs, digits, Digit100, false, false, -2);
|
||||
setAllowNegatives(underTestPost, false);
|
||||
setPreValue(underTestPost, preValue_extended);
|
||||
std::string result = process_doFlow(underTestPost);
|
||||
|
||||
@@ -178,7 +178,7 @@ void test_doFlowPP2() {
|
||||
std::vector<float> digits = { 1.0, 9.0, 9.0}; // Übergang wurde um 1 erhöht (200, statt 199)
|
||||
std::vector<float> analogs = { 7.1, 4.8, 8.3};
|
||||
const char* expected = "199.748";
|
||||
std::string result = process_doFlow(analogs, digits, Digital);
|
||||
std::string result = process_doFlow(analogs, digits, Digit);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// Fehler bei Rolling (2002-09-09)
|
||||
@@ -191,15 +191,15 @@ void test_doFlowPP2() {
|
||||
// expected_extended= "32289.4198";
|
||||
|
||||
// extendResolution=false, checkConsistency=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// checkConsistency=true und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler Rolling (2022-09-10)
|
||||
@@ -210,20 +210,20 @@ void test_doFlowPP2() {
|
||||
expected_extended= "83.99401";
|
||||
|
||||
// checkConsistency=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false);
|
||||
result = process_doFlow(analogs, digits, Digit100, false);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
|
||||
// checkConsistency=true
|
||||
result = process_doFlow(analogs, digits, Digital100, true);
|
||||
result = process_doFlow(analogs, digits, Digit100, true);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// checkConsistency=true und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler Rolling (2022-09-10)
|
||||
@@ -234,16 +234,16 @@ void test_doFlowPP2() {
|
||||
expected_extended= "123235.6";
|
||||
|
||||
// checkConsistency=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
|
||||
// checkConsistency=true
|
||||
result = process_doFlow(analogs, digits, Digital100, true, false);
|
||||
result = process_doFlow(analogs, digits, Digit100, true, false);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler bei V11.2.0
|
||||
@@ -254,11 +254,11 @@ void test_doFlowPP2() {
|
||||
expected_extended= "3249.4692";
|
||||
|
||||
// checkConsistency=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler bei V11.2.0
|
||||
@@ -269,11 +269,11 @@ void test_doFlowPP2() {
|
||||
expected_extended= "269.92272";
|
||||
|
||||
// extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler bei V11.3.1
|
||||
@@ -284,11 +284,11 @@ void test_doFlowPP2() {
|
||||
expected_extended= "169.35935";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, 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);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler bei V12.0.1
|
||||
@@ -299,11 +299,11 @@ void test_doFlowPP2() {
|
||||
expected_extended= "211.03555";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, 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);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler bei V12.0.1
|
||||
@@ -314,11 +314,11 @@ void test_doFlowPP2() {
|
||||
expected_extended= "245.9386";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler bei V12.0.1
|
||||
@@ -329,11 +329,11 @@ void test_doFlowPP2() {
|
||||
expected_extended= "245.9386";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
}
|
||||
|
||||
@@ -346,11 +346,11 @@ void test_doFlowPP3() {
|
||||
const char* expected_extended= "247.2045";
|
||||
|
||||
// extendResolution=false
|
||||
std::string result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||
std::string result = process_doFlow(analogs, digits, Digit100, false, false, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
|
||||
@@ -362,11 +362,11 @@ void test_doFlowPP3() {
|
||||
expected_extended= "142.92690";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
|
||||
@@ -379,14 +379,14 @@ void test_doFlowPP3() {
|
||||
expected_extended= "170.05287";
|
||||
|
||||
// extendResolution=false
|
||||
UnderTestPost* undertestPost = init_do_flow(analogs, digits, Digital100, false, false, -3);
|
||||
UnderTestPost* undertestPost = init_do_flow(analogs, digits, Digit100, 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);
|
||||
undertestPost = init_do_flow(analogs, digits, Digit100, false, true, -3);
|
||||
setAnalogdigitTransistionStart(undertestPost, 7.7);
|
||||
result = process_doFlow(undertestPost);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
@@ -400,11 +400,11 @@ void test_doFlowPP3() {
|
||||
expected_extended= "91.88174";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
|
||||
@@ -416,11 +416,11 @@ void test_doFlowPP3() {
|
||||
expected_extended= "92.38320";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler V11.3.0
|
||||
@@ -431,11 +431,11 @@ void test_doFlowPP3() {
|
||||
expected_extended= "7472.7594";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, 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);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler V12.0.1
|
||||
@@ -446,11 +446,11 @@ void test_doFlowPP3() {
|
||||
expected_extended= "577.86490";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
|
||||
@@ -462,11 +462,11 @@ void test_doFlowPP3() {
|
||||
expected_extended= "211.03580";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, 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);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler V12.0.1
|
||||
@@ -477,11 +477,11 @@ void test_doFlowPP3() {
|
||||
expected_extended= "126.9231";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, false, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true, 0);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, 0);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler V12.0.1
|
||||
@@ -492,11 +492,11 @@ void test_doFlowPP3() {
|
||||
expected_extended= "386.05672";
|
||||
|
||||
// extendResolution=false
|
||||
result = process_doFlow(analogs, digits, Digital100, false, false, -3);
|
||||
result = process_doFlow(analogs, digits, Digit100, 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);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true, -3);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
// Fehler V12.0.1
|
||||
@@ -508,14 +508,14 @@ void test_doFlowPP3() {
|
||||
expected_extended= "171.24178";
|
||||
|
||||
// extendResolution=false
|
||||
undertestPost = init_do_flow(analogs, digits, Digital100, false, false, -3);
|
||||
undertestPost = init_do_flow(analogs, digits, Digit100, 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);
|
||||
undertestPost = init_do_flow(analogs, digits, Digit100, false, true, -3);
|
||||
setAnalogdigitTransistionStart(undertestPost, 7.7);
|
||||
result = process_doFlow(undertestPost);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
@@ -533,11 +533,11 @@ void test_doFlowPP4() {
|
||||
const char* expected_extended= "717.01658";
|
||||
|
||||
// extendResolution=false
|
||||
std::string result = process_doFlow(analogs, digits, Digital100, false, false);
|
||||
std::string result = process_doFlow(analogs, digits, Digit100, false, false);
|
||||
TEST_ASSERT_EQUAL_STRING(expected, result.c_str());
|
||||
|
||||
// checkConsistency=false und extendResolution=true
|
||||
result = process_doFlow(analogs, digits, Digital100, false, true);
|
||||
result = process_doFlow(analogs, digits, Digit100, false, true);
|
||||
TEST_ASSERT_EQUAL_STRING(expected_extended, result.c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
void test_getReadoutRawString() {
|
||||
|
||||
// no ROIs setted up
|
||||
UnderTestPost* _undertestPost = setUpClassFlowPostprocessing(Digital100, Analogue100);
|
||||
UnderTestPost* _undertestPost = setUpClassFlowPostprocessing(Digit100, Analogue100);
|
||||
|
||||
string result = _undertestPost->flowAnalog->getReadoutRawString(0);
|
||||
TEST_ASSERT_EQUAL_STRING("", result.c_str());
|
||||
|
||||
@@ -8,7 +8,7 @@ The single value will be published with the following key: `MAINTOPIC/NUMBER/RES
|
||||
With:
|
||||
|
||||
- `NUMBER`: The name of the value (a meter might have more than one value).
|
||||
The names get defined in the analog and digital ROI configuration (defaults to `main`).
|
||||
The names get defined in the analog and digit ROI configuration (defaults to `main`).
|
||||
- `RESULT_TOPIC`: Automatically filled with the right name, eg. `value`, `rate`, `timestamp`, `error`, ....
|
||||
|
||||
The general connection status can be found in `MAINTOPIC/CONNECTION`.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Parameter `<NUMBER>.AnalogDigitalTransitionStart`
|
||||
# Parameter `<NUMBER>.AnalogDigitTransitionStart`
|
||||
Default Value: `9.2`
|
||||
|
||||
This can be used if you have wrong values, but the recognition of the individual ROIs are 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.
|
||||
See [here](../Watermeter-specific-analog---digital-transition) for details.
|
||||
See [here](../Watermeter-specific-analog---digit-transition) for details.
|
||||
|
||||
Range: `6.0` .. `9.9`.
|
||||
@@ -65,7 +65,7 @@ main.ana4 155 328 92 92 false
|
||||
|
||||
[PostProcessing]
|
||||
main.DecimalShift = 0
|
||||
main.AnalogDigitalTransitionStart = 9.2
|
||||
main.AnalogDigitTransitionStart = 9.2
|
||||
main.ChangeRateThreshold = 2
|
||||
PreValueUse = true
|
||||
PreValueAgeStartup = 720
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
}
|
||||
catch (error){}
|
||||
|
||||
document.getElementById("overlaytext").innerHTML = "Device is busy, waiting until the Digitalization Round got completed (this can take several minutes)...<br><br>Current step: " + xhttp.responseText;
|
||||
document.getElementById("overlaytext").innerHTML = "Device is busy, waiting until the Digitization Round got completed (this can take several minutes)...<br><br>Current step: " + xhttp.responseText;
|
||||
console.log("Device is busy, waiting 5s then checking again...");
|
||||
await sleep(5000);
|
||||
}
|
||||
@@ -512,7 +512,7 @@
|
||||
}
|
||||
catch (error){}
|
||||
|
||||
document.getElementById("overlaytext").innerHTML = "Device is busy, waiting until the Digitalization Round got completed (this can take several minutes)...<br><br>Current step: " + xhttp.responseText;
|
||||
document.getElementById("overlaytext").innerHTML = "Device is busy, waiting until the Digitization Round got completed (this can take several minutes)...<br><br>Current step: " + xhttp.responseText;
|
||||
console.log("Device is busy, waiting 5s then checking again...");
|
||||
await sleep(5000);
|
||||
}
|
||||
|
||||
@@ -932,15 +932,15 @@
|
||||
|
||||
<tr>
|
||||
<td class="indent2">
|
||||
<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;">Analog/Digital Transition Start</class></label>
|
||||
<input type="checkbox" id="PostProcessing_AnalogToDigitTransitionStart_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "AnalogToDigitTransitionStart")' unchecked >
|
||||
<label for=PostProcessing_AnalogToDigitTransitionStart_enabled><class id="PostProcessing_AnalogToDigitTransitionStart_text" style="color:black;">Analog/Digital Transition Start</class></label>
|
||||
</td>
|
||||
<td>
|
||||
<input required type="number" id="PostProcessing_AnalogDigitalTransitionStart_value1" step="0.1" min="5.0" max="9.9" value="9.2"
|
||||
<input required type="number" id="PostProcessing_AnalogToDigitTransitionStart_value1" step="0.1" min="5.0" max="9.9" value="9.2"
|
||||
oninput="(!validity.rangeUnderflow||(value=5.0)) && (!validity.rangeOverflow||(value=9.9)) &&
|
||||
(!validity.stepMismatch||(value=parseInt(this.value)));">
|
||||
</td>
|
||||
<td>$TOOLTIP_PostProcessing_NUMBER.AnalogDigitalTransitionStart</td>
|
||||
<td>$TOOLTIP_PostProcessing_NUMBER.AnalogToDigitTransitionStart</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -2188,7 +2188,7 @@ function UpdateInputIndividual(sel) {
|
||||
if (NUNBERSAkt != -1) {
|
||||
// ReadParameter(param, "PostProcessing", "PreValueUse", false, NUNBERSAkt);
|
||||
ReadParameter(param, "PostProcessing", "DecimalShift", true, NUNBERSAkt);
|
||||
ReadParameter(param, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt);
|
||||
ReadParameter(param, "PostProcessing", "AnalogToDigitTransitionStart", true, NUNBERSAkt);
|
||||
ReadParameter(param, "PostProcessing", "ChangeRateThreshold", true, NUNBERSAkt);
|
||||
ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt);
|
||||
ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt);
|
||||
@@ -2206,7 +2206,7 @@ function UpdateInputIndividual(sel) {
|
||||
NUNBERSAkt = sel.selectedIndex;
|
||||
// WriteParameter(param, category, "PostProcessing", "PreValueUse", false, NUNBERSAkt);
|
||||
WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt);
|
||||
WriteParameter(param, category, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt);
|
||||
WriteParameter(param, category, "PostProcessing", "AnalogToDigitTransitionStart", true, NUNBERSAkt);
|
||||
WriteParameter(param, category, "PostProcessing", "ChangeRateThreshold", true, NUNBERSAkt);
|
||||
WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt);
|
||||
WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt);
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><img style="width:64px; height:64px" src="favicon.ico?v=$COMMIT_HASH"></td>
|
||||
<td><h1 id="id_title"> Digitizer - AI on the edge</h1>
|
||||
<h2>An ESP32 all inclusive neural network recognition system for meter digitalization</h2>
|
||||
<h2>An ESP32 all inclusive neural network recognition system for meter Digitization</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -173,7 +173,7 @@ function ParseConfig() {
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "DecimalShift", 1, true);
|
||||
ParamAddValue(param, catname, "AnalogDigitalTransitionStart", 1, true, "9.2");
|
||||
ParamAddValue(param, catname, "AnalogToDigitTransitionStart", 1, true, "9.2");
|
||||
ParamAddValue(param, catname, "ChangeRateThreshold", 1, true, "2");
|
||||
// ParamAddValue(param, catname, "PreValueUse", 1, true, "true");
|
||||
ParamAddValue(param, catname, "PreValueUse");
|
||||
|
||||
@@ -71,7 +71,7 @@ body, html {
|
||||
<td style="padding-right: 10px;"><img src="favicon.ico?v=$COMMIT_HASH"></td>
|
||||
<td>
|
||||
<h1> Digitizer - AI on the edge - Initial setup</h1>
|
||||
<h2>An ESP32 all inclusive neural network recognition system for meter digitalization</h2>
|
||||
<h2>An ESP32 all inclusive neural network recognition system for meter Digitization</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user