IgnoreLeadingNaN fix (#3547)

* test1

* test2

* Update edit_config_template.html

* fix

* Update NUMBER.CheckDigitIncreaseConsistency.md

---------

Co-authored-by: CaCO3 <caco3@ruinelli.ch>
This commit is contained in:
SybexX
2025-03-01 00:09:11 +01:00
committed by GitHub
parent c587ca3224
commit cd1165e547
7 changed files with 1828 additions and 1857 deletions

View File

@@ -31,7 +31,6 @@ enum t_RateType {
RateChange // time difference is considered and a normalized rate is used for comparison with NumberPost.maxRate
};
/**
* 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).
@@ -45,6 +44,7 @@ struct NumberPost {
int ChangeRateThreshold; // threshold parameter for negative rate detection
bool PreValueOkay; // previousValueValid; indicates that the reading of the previous round has no errors
bool AllowNegativeRates; // allowNegativeRate; defines if the consistency checks allow negative rates between consecutive meter readings.
bool IgnoreLeadingNaN;
bool checkDigitIncreaseConsistency; // extendedConsistencyCheck; performs an additional consistency check to avoid wrong readings
time_t timeStampLastValue; // Timestamp for the last read value; is used for the log
time_t timeStampLastPreValue; // Timestamp for the last PreValue set; is used for useMaxRateValue
@@ -83,4 +83,3 @@ struct NumberPost {
};
#endif

View File

@@ -320,7 +320,6 @@ ClassFlowPostProcessing::ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc, C
ListFlowControll = lfc;
flowTakeImage = NULL;
UpdatePreValueINI = false;
IgnoreLeadingNaN = false;
flowAnalog = _analog;
flowDigit = _digit;
@@ -431,6 +430,27 @@ void ClassFlowPostProcessing::handleAllowNegativeRate(string _decsep, string _va
}
}
void ClassFlowPostProcessing::handleIgnoreLeadingNaN(string _decsep, string _value) {
string _digit, _decpos;
int _pospunkt = _decsep.find_first_of(".");
if (_pospunkt > -1) {
_digit = _decsep.substr(0, _pospunkt);
}
else {
_digit = "default";
}
for (int j = 0; j < NUMBERS.size(); ++j) {
bool _zwdc = alphanumericToBoolean(_value);
// Set to default first (if nothing else is set)
if ((_digit == "default") || (NUMBERS[j]->name == _digit)) {
NUMBERS[j]->IgnoreLeadingNaN = _zwdc;
}
}
}
void ClassFlowPostProcessing::handleMaxRateType(string _decsep, string _value) {
string _digit, _decpos;
int _pospunkt = _decsep.find_first_of(".");
@@ -509,7 +529,7 @@ void ClassFlowPostProcessing::handleChangeRateThreshold(string _decsep, string _
}
}
}
/*
void ClassFlowPostProcessing::handlecheckDigitIncreaseConsistency(std::string _decsep, std::string _value)
{
std::string _digit;
@@ -532,7 +552,7 @@ void ClassFlowPostProcessing::handlecheckDigitIncreaseConsistency(std::string _d
}
}
}
*/
bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph) {
std::vector<string> splitted;
int _n;
@@ -585,12 +605,7 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
}
if ((toUpper(_param) == "CHECKDIGITINCREASECONSISTENCY") && (splitted.size() > 1)) {
// handlecheckDigitIncreaseConsistency(splitted[0], splitted[1]);
if (alphanumericToBoolean(splitted[1])) {
for (_n = 0; _n < NUMBERS.size(); ++_n) {
NUMBERS[_n]->checkDigitIncreaseConsistency = true;
}
}
handlecheckDigitIncreaseConsistency(splitted[0], splitted[1]);
}
if ((toUpper(_param) == "ALLOWNEGATIVERATES") && (splitted.size() > 1)) {
@@ -602,7 +617,7 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
}
if ((toUpper(_param) == "IGNORELEADINGNAN") && (splitted.size() > 1)) {
IgnoreLeadingNaN = alphanumericToBoolean(splitted[1]);
handleIgnoreLeadingNaN(splitted[0], splitted[1]);
}
if ((toUpper(_param) == "PREVALUEAGESTARTUP") && (splitted.size() > 1)) {
@@ -670,6 +685,7 @@ void ClassFlowPostProcessing::InitNUMBERS() {
_number->FlowRateAct = 0; // m3 / min
_number->PreValueOkay = false;
_number->AllowNegativeRates = false;
_number->IgnoreLeadingNaN = false;
_number->MaxRateValue = 0.1;
_number->MaxRateType = AbsoluteChange;
_number->useMaxRateValue = false;
@@ -821,7 +837,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) {
ESP_LOGD(TAG, "After ShiftDecimal: ReturnRaw %s", NUMBERS[j]->ReturnRawValue.c_str());
#endif
if (IgnoreLeadingNaN) {
if (NUMBERS[j]->IgnoreLeadingNaN) {
while ((NUMBERS[j]->ReturnRawValue.length() > 1) && (NUMBERS[j]->ReturnRawValue[0] == 'N')) {
NUMBERS[j]->ReturnRawValue.erase(0, 1);
}
@@ -868,13 +884,8 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) {
if (NUMBERS[j]->checkDigitIncreaseConsistency) {
if (flowDigit) {
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);
}
}
else {
#ifdef SERIAL_DEBUG
ESP_LOGD(TAG, "checkDigitIncreaseConsistency = true - no digit numbers defined!");

View File

@@ -10,7 +10,6 @@
#include <string>
class ClassFlowPostProcessing :
public ClassFlow
{
@@ -19,7 +18,6 @@ protected:
int PreValueAgeStartup;
bool ErrorMessage;
bool IgnoreLeadingNaN; // SPECIAL CASE for User Gustl ???
ClassFlowCNNGeneral* flowAnalog;
ClassFlowCNNGeneral* flowDigit;
@@ -35,15 +33,16 @@ protected:
float checkDigitConsistency(double input, int _decilamshift, bool _isanalog, double _preValue);
void InitNUMBERS();
void handleDecimalSeparator(string _decsep, string _value);
void handleMaxRateValue(string _decsep, string _value);
void handleDecimalExtendedResolution(string _decsep, string _value);
void handleMaxRateType(string _decsep, string _value);
void handleAnalogToDigitTransitionStart(string _decsep, string _value);
void handleAllowNegativeRate(string _decsep, string _value);
void handleIgnoreLeadingNaN(string _decsep, string _value);
void handleChangeRateThreshold(string _decsep, string _value);
std::string GetStringReadouts(general);
void handlecheckDigitIncreaseConsistency(std::string _decsep, std::string _value);
void WriteDataLog(int _index);
@@ -75,5 +74,4 @@ public:
string name(){return "ClassFlowPostProcessing";};
};
#endif //CLASSFFLOWPOSTPROCESSING_H

View File

@@ -31,7 +31,6 @@ AlignmentAlgo
CNNGoodThreshold
PreValueAgeStartup
ErrorMessage
CheckDigitIncreaseConsistency
IO0
IO1
IO3

View File

@@ -6,3 +6,6 @@ Default Value: `false`
An additional consistency check.
It especially improves the zero crossing check between digits.
!!! Note
This parameter must be prefixed with `<NUMBER>` followed by a dot (eg. `main.CheckDigitIncreaseConsistency`). `<NUMBER>` is the name of the number sequence defined in the ROI's.

View File

@@ -2,7 +2,7 @@
<html lang="en" xml:lang="en">
<head>
<meta charset="UTF-8" />
<meta charset="UTF-8"/>
<title>Configuration</title>
<style>
@@ -245,9 +245,7 @@
<hr />
<div id="divall" style="display:none">
<table class="table">
<colgroup>
<col span="1" style="width:290px">
<col span="1" style="width:300px;">
@@ -257,6 +255,7 @@
<tr style="border-bottom: 2px solid lightgray;">
<td colspan="3" style="padding-left: 0px; padding-bottom: 3px;"><h4>Configuration View</h4></td>
</tr>
<tr>
<td class="indent1">
<input style="margin-top:12px;margin-bottom:12px" type="checkbox" id="ExpertModus_enabled" value="1" onclick='UpdateExpertModus()' unchecked>
@@ -809,7 +808,6 @@
<td>$TOOLTIP_Digits_ROIImagesRetention</td>
</tr>
<!------------- Ananlog ROIs ------------------>
<tr style="border-bottom: 2px solid lightgray;" id="Category_Analog_ex4">
<td colspan="3" style="padding-left: 0px; padding-bottom: 3px;">
@@ -823,8 +821,7 @@
<class id="Analog_Model_text" style="color:black;">Model</class>
</td>
<td>
<select required class="select_large" id="Analog_Model_value1">
</select>
<select required class="select_large" id="Analog_Model_value1"></select>
</td>
<td>$TOOLTIP_Analog_Model</td>
</tr>
@@ -832,8 +829,7 @@
<tr class="AnalogItem">
<td class="indent1">
<input type="checkbox" id="Analog_ROIImagesLocation_enabled" value="1" onclick = 'InvertEnableItem("Analog", "ROIImagesLocation")' unchecked >
<label for=Analog_ROIImagesLocation_enabled><class id="Analog_ROIImagesLocation_text" style="color:black;">ROI Images Location</class>
</label>
<label for=Analog_ROIImagesLocation_enabled><class id="Analog_ROIImagesLocation_text" style="color:black;">ROI Images Location</class></label>
</td>
<td> <input required type="text" name="name" id="Analog_ROIImagesLocation_value1"> </td>
<td>$TOOLTIP_Analog_ROIImagesLocation</td>
@@ -842,7 +838,8 @@
<tr class="AnalogItem">
<td class="indent1">
<input type="checkbox" id="Analog_ROIImagesRetention_enabled" value="1" onclick = 'InvertEnableItem("Analog", "ROIImagesRetention")' unchecked >
<label for=Analog_ROIImagesRetention_enabled><class id="Analog_ROIImagesRetention_text" style="color:black;">ROI Images Retention</class></label></td>
<label for=Analog_ROIImagesRetention_enabled><class id="Analog_ROIImagesRetention_text" style="color:black;">ROI Images Retention</class></label>
</td>
<td>
<input required type="number" id="Analog_ROIImagesRetention_value1" min="0" step="1"
oninput="(!validity.rangeUnderflow||(value=0)) && (!validity.stepMismatch||(value=parseInt(this.value)));">Days
@@ -850,7 +847,6 @@
<td>$TOOLTIP_Analog_ROIImagesRetention</td>
</tr>
<!------------- Post-Processing ------------------>
<tr style="border-bottom: 2px solid lightgray;">
<td colspan="3" style="padding-left: 0px; padding-bottom: 3px;"><h4>Post-Processing</h4></td>
@@ -894,25 +890,10 @@
<td>$TOOLTIP_PostProcessing_ErrorMessage</td>
</tr>
<tr class="expert" unused_id="ex1dddd">
<td class="indent1">
<label><class id="PostProcessing_CheckDigitIncreaseConsistency_text" style="color:black;">Check Digit Increase Consistency</class></label>
</td>
<td>
<select id="PostProcessing_CheckDigitIncreaseConsistency_value1">
<option value="true">enabled (true)</option>
<option value="false" selected>disabled (false)</option>
</select>
</td>
<td>$TOOLTIP_PostProcessing_CheckDigitIncreaseConsistency</td>
</tr>
<tr style="margin-top:12px">
<td class="indent1" style="padding-top:25px" colspan="3">
<b>The following parameters are configurable individually for each number sequence:</b>
<select
style="font-weight: bold; margin-left:17px" id="Numbers_value1" onchange="numberChanged()">
</select>
<select style="font-weight: bold; margin-left:17px" id="Numbers_value1" onchange="numberChanged()"></select>
</td>
</tr>
@@ -1033,6 +1014,18 @@
<td>$TOOLTIP_PostProcessing_NUMBER.IgnoreAllNaN</td>
</tr>
------------------>
<tr class="expert" unused_id="ex1dddd">
<td class="indent2">
<label><class id="PostProcessing_CheckDigitIncreaseConsistency_text" style="color:black;">Check Digit Increase Consistency</class></label>
</td>
<td>
<select id="PostProcessing_CheckDigitIncreaseConsistency_value1">
<option value="true">enabled (true)</option>
<option value="false" selected>disabled (false)</option>
</select>
</td>
<td>$TOOLTIP_PostProcessing_NUMBER.CheckDigitIncreaseConsistency</td>
</tr>
<!------------- MQTT ------------------>
<tr style="border-bottom: 2px solid lightgray;">
@@ -1200,8 +1193,8 @@
<option value="energy_mwh">Energymeter (Value: MWh, Rate: MW)</option>
<option value="energy_gj">Energymeter (Value: GJ, Rate: GJ/h)</option>
<option value="temperature_c">Thermometer (Value: °C, Rate: °C/min)</option>
<option value="temperature_f">Thermometer (Value: °F, Rate: °F/min)</option>
<option value="temperature_k">Thermometer (Value: K, Rate: K/min)</option>
<option value="temperature_c">Thermometer (Value: °F, Rate: °F/min)</option>
<option value="temperature_c">Thermometer (Value: K, Rate: K/min)</option>
</select>
</td>
<td>$TOOLTIP_MQTT_MeterType</td>
@@ -1221,11 +1214,10 @@
<tr class="MQTTItem" style="margin-top:12px">
<td class="indent1" style="padding-top:25px" colspan="3">
<b>The following parameters are configurable individually for each number sequence:</b>
<select
style="font-weight: bold; margin-left:17px" id="NumbersMQTTIdx_value1" onchange="numberMQTTIdxChanged()">
</select>
<select style="font-weight: bold; margin-left:17px" id="NumbersMQTTIdx_value1" onchange="numberMQTTIdxChanged()"></select>
</td>
</tr>
<tr class="MQTTItem">
<td class="indent2">
<input type="checkbox" id="MQTT_DomoticzIDX_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "DomoticzIDX")' unchecked >
@@ -1237,13 +1229,13 @@
<td>$TOOLTIP_MQTT_NUMBER.DomoticzIDX</td>
</tr>
<!------------- INFLUXDB v1 ------------------>
<tr style="border-bottom: 2px solid lightgray;">
<td colspan="3" style="padding-left: 0px; padding-bottom: 3px;">
<h4>
<input type="checkbox" id="Category_InfluxDB_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
<label for=Category_InfluxDB_enabled>InfluxDB v1.x</label></h4>
<label for=Category_InfluxDB_enabled>InfluxDB v1.x</label>
</h4>
</td>
</tr>
@@ -1294,9 +1286,7 @@
<tr class="InfluxDBv1Item" style="margin-top:12px">
<td class="indent1" style="padding-top:25px" colspan="3">
<b>Parameter per number sequence:</b>
<select
style="font-weight: bold; margin-left:17px" id="NumbersInfluxDB_value1" onchange="numberInfluxDBChanged()">
</select>
<select style="font-weight: bold; margin-left:17px" id="NumbersInfluxDB_value1" onchange="numberInfluxDBChanged()"></select>
</td>
</tr>
@@ -1322,13 +1312,13 @@
<td>$TOOLTIP_InfluxDB_NUMBER.Field</td>
</tr>
<!------------- INFLUXDB v2 ------------------>
<tr style="border-bottom: 2px solid lightgray;">
<td colspan="3" style="padding-left: 0px; padding-bottom: 3px;">
<h4>
<input type="checkbox" id="Category_InfluxDBv2_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
<label for=Category_InfluxDBv2_enabled>InfluxDB v2.x</label></h4>
<label for=Category_InfluxDBv2_enabled>InfluxDB v2.x</label>
</h4>
</td>
</tr>
@@ -1379,9 +1369,7 @@
<tr class="InfluxDBv2Item" style="margin-top:12px">
<td class="indent1" style="padding-top:25px" colspan="3">
<b>Parameter per number sequence:</b>
<select
style="font-weight: bold; margin-left:17px" id="NumbersInfluxDBv2_value1" onchange="numberInfluxDBv2Changed()">
</select>
<select style="font-weight: bold; margin-left:17px" id="NumbersInfluxDBv2_value1" onchange="numberInfluxDBv2Changed()"></select>
</td>
</tr>
@@ -1571,7 +1559,8 @@
<td class="indent2">
<span class="GPIO_IO1 GPIO_item">GPIO1 PWM Duty Cycle Resolution</span>
</td>
<td><input required type="number" id="GPIO_IO1_value3" min="1" max="20"
<td>
<input required type="number" id="GPIO_IO1_value3" min="1" max="20"
oninput="(!validity.rangeUnderflow||(value=1)) && (!validity.rangeOverflow||(value=20)) &&
(!validity.stepMismatch||(value=parseInt(this.value)));"><span class="GPIO_IO1 GPIO_item">Bits</span>
</td>
@@ -1641,7 +1630,8 @@
<td class="indent2">
<span class="GPIO_IO3 GPIO_item">GPIO3 PWM Duty Cycle Resolution</span>
</td>
<td><input required type="number" id="GPIO_IO3_value3" min="1" max="20"
<td>
<input required type="number" id="GPIO_IO3_value3" min="1" max="20"
oninput="(!validity.rangeUnderflow||(value=1)) && (!validity.rangeOverflow||(value=20)) &&
(!validity.stepMismatch||(value=parseInt(this.value)));"><span class="GPIO_IO3 GPIO_item">Bits</span>
</td>
@@ -1690,6 +1680,7 @@
</td>
<td>$TOOLTIP_GPIO_IO4</td>
</tr>
<tr class="GPIO_item" style="border-top: 0px;">
<td colspan="2" style="padding-left:28px">
<b>IMPORTANT NOTE:</b><br>
@@ -1698,6 +1689,7 @@
intensity control (PWM) of the LED flash light is not functional anymore (only 100%).
</td>
</tr>
<tr class="GPIO_IO4 GPIO_item expert">
<td class="indent2">
<span class="GPIO_IO4 GPIO_item">GPIO4 Use Interrupt</span>
@@ -1719,7 +1711,8 @@
<td class="indent2">
<span class="GPIO_IO4 GPIO_item">GPIO4 PWM Duty Cycle Resolution</span>
</td>
<td><input required type="number" id="GPIO_IO4_value3" min="1" max="20"
<td>
<input required type="number" id="GPIO_IO4_value3" min="1" max="20"
oninput="(!validity.rangeUnderflow||(value=1)) && (!validity.rangeOverflow||(value=20)) &&
(!validity.stepMismatch||(value=parseInt(this.value)));"><span class="GPIO_IO4 GPIO_item">Bits</span>
</td>
@@ -1792,7 +1785,8 @@
<td class="indent2">
<span class="GPIO_IO12 GPIO_item">GPIO12 PWM Duty Cycle Resolution</span>
</td>
<td><input required type="number" id="GPIO_IO12_value3" min="1" max="20"
<td>
<input required type="number" id="GPIO_IO12_value3" min="1" max="20"
oninput="(!validity.rangeUnderflow||(value=1)) && (!validity.rangeOverflow||(value=20)) &&
(!validity.stepMismatch||(value=parseInt(this.value)));"><span class="GPIO_IO12 GPIO_item">Bits</span>
</td>
@@ -1860,6 +1854,7 @@
</td>
<td>$TOOLTIP_GPIO_LEDColor</td>
</tr>
<tr class="GPIO_item" unused_id="LEDRGBex9">
<td></td>
<td>
@@ -1868,6 +1863,7 @@
(!validity.stepMismatch||(value=parseInt(this.value)));">
</td>
</tr>
<tr class="GPIO_item" unused_id="LEDRGBex9">
<td></td>
<td>
@@ -1916,9 +1912,11 @@
<td class="indent2">
<span class="GPIO_IO13 GPIO_item">GPIO13 PWM Duty Cycle Resolution</span>
</td>
<td><input required type="number" id="GPIO_IO13_value3" min="1" max="20"
<td>
<input required type="number" id="GPIO_IO13_value3" min="1" max="20"
oninput="(!validity.rangeUnderflow||(value=1)) && (!validity.rangeOverflow||(value=20)) &&
(!validity.stepMismatch||(value=parseInt(this.value)));"><span class="GPIO_IO13 GPIO_item">Bits</span></td>
(!validity.stepMismatch||(value=parseInt(this.value)));"><span class="GPIO_IO13 GPIO_item">Bits</span>
</td>
<td></td>
</tr>
@@ -1947,12 +1945,10 @@
</tr>
<!------------- GPIO13 end ------------------>
<!------------- Autotimer ------------------>
<tr style="border-bottom: 2px solid lightgray;">
<td colspan="3" style="padding-left: 0px; padding-bottom: 3px;"><h4>Auto Timer</h4></td>
</tr>
<!--
<tr class="expert" unused_id="ex13">
<td class="indent1">
@@ -1967,7 +1963,6 @@
<td>$TOOLTIP_AutoTimer_AutoStart</td>
</tr>
-->
<tr>
<td class="indent1">
<class id="AutoTimer_Interval_text" style="color:black;">Round Interval</class>
@@ -1979,7 +1974,6 @@
<td>$TOOLTIP_AutoTimer_Interval</td>
</tr>
<!------------- Data Logging ------------------>
<tr style="border-bottom: 2px solid lightgray;">
<td colspan="3" style="padding-left: 0px; padding-bottom: 3px;"><h4>Data Logging</h4></td>
@@ -2009,7 +2003,6 @@
<td>$TOOLTIP_DataLogging_DataFilesRetention</td>
</tr>
<!------------- Debug Logging ------------------>
<tr style="border-bottom: 2px solid lightgray;">
<td colspan="3" style="padding-left: 0px; padding-bottom: 3px;"><h4>Debug</h4></td>
@@ -2124,10 +2117,8 @@
<hr>
<button class="button" onclick="saveTextAsFile()">Save Config</button>
</div>
<script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
<script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
@@ -2264,6 +2255,7 @@ function UpdateInputIndividual(sel) {
ReadParameter(param, "PostProcessing", "IgnoreLeadingNaN", false, NUNBERSAkt);
// ReadParameter(param, "PostProcessing", "IgnoreAllNaN", false, NUNBERSAkt);
ReadParameter(param, "PostProcessing", "AllowNegativeRates", false, NUNBERSAkt);
ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", false, NUNBERSAkt);
ReadParameter(param, "InfluxDB", "Field", true, NUNBERSAkt);
ReadParameter(param, "InfluxDBv2", "Field", true, NUNBERSAkt);
ReadParameter(param, "InfluxDB", "Measurement", true, NUNBERSAkt);
@@ -2283,12 +2275,12 @@ function UpdateInputIndividual(sel) {
WriteParameter(param, category, "PostProcessing", "IgnoreLeadingNaN", false, NUNBERSAkt);
// WriteParameter(param, category, "PostProcessing", "IgnoreAllNaN", false, NUNBERSAkt);
WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", false, NUNBERSAkt);
WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", false, NUNBERSAkt);
WriteParameter(param, category, "InfluxDB", "Field", true, NUNBERSAkt);
WriteParameter(param, category, "InfluxDBv2", "Field", true, NUNBERSAkt);
WriteParameter(param, category, "InfluxDB", "Measurement", true, NUNBERSAkt);
WriteParameter(param, category, "InfluxDBv2", "Measurement", true, NUNBERSAkt);
WriteParameter(param, category, "MQTT", "DomoticzIDX", true, NUNBERSAkt);
}
function UpdateInput() {
@@ -2364,7 +2356,7 @@ function UpdateInput() {
WriteParameter(param, category, "PostProcessing", "PreValueUse", false);
WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true);
WriteParameter(param, category, "PostProcessing", "ErrorMessage", false);
WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", false);
// WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", false);
WriteParameter(param, category, "MQTT", "Uri", true);
WriteParameter(param, category, "MQTT", "MainTopic", true);
@@ -2533,7 +2525,7 @@ function ReadParameterAll() {
ReadParameter(param, "PostProcessing", "PreValueUse", false);
ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true);
ReadParameter(param, "PostProcessing", "ErrorMessage", false);
ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", false);
// ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", false);
ReadParameter(param, "MQTT", "Uri", true);
ReadParameter(param, "MQTT", "MainTopic", true);
@@ -2819,7 +2811,6 @@ function camSettingsSet(){
}
var _denoise_temp = document.getElementById("TakeImage_CamDenoise_value1").value;
var _ledi_temp = document.getElementById("TakeImage_LEDIntensity_value1").value;
var _zoom_temp = document.getElementById("TakeImage_CamZoom_value1").selectedIndex;
@@ -2880,7 +2871,7 @@ function camSettingsSet(){
if (xhttp.responseText == "CamSettingsSet") {
document.getElementById("overlay").style.display = "none";
firework.launch('Cam Settings saved', 'success', 5000);
firework.launch('Cam Settings saved', 'success', 2000);
return;
}
else {
@@ -3099,7 +3090,6 @@ function setVisible(className, visible) {
function EnDisableItem(_status, _param, _category, _cat, _name, _optional, _number = -1) {
// _status = _category[_cat]["enabled"];
_color = "rgb(122, 122, 122)";
if (_status) {

View File

@@ -6,7 +6,6 @@ var ref = new Array(2);
var NUMBERS = new Array(0);
var REFERENCES = new Array(0);
function getNUMBERSList() {
_domainname = getDomainname();
var namenumberslist = "";
@@ -33,7 +32,6 @@ function getNUMBERSList() {
return namenumberslist;
}
function getDATAList() {
_domainname = getDomainname();
datalist = "";
@@ -62,7 +60,6 @@ function getDATAList() {
return datalist;
}
function getTFLITEList() {
_domainname = getDomainname();
tflitelist = "";
@@ -90,7 +87,6 @@ function getTFLITEList() {
return tflitelist;
}
function ParseConfig() {
config_split = config_gesamt.split("\n");
var aktline = 0;
@@ -172,7 +168,7 @@ function ParseConfig() {
category[catname]["enabled"] = false;
category[catname]["found"] = false;
param[catname] = new Object();
ParamAddValue(param, catname, "DecimalShift", 1, true);
ParamAddValue(param, catname, "DecimalShift", 1, true, "0");
ParamAddValue(param, catname, "AnalogToDigitTransitionStart", 1, true, "9.2");
ParamAddValue(param, catname, "ChangeRateThreshold", 1, true, "2");
// ParamAddValue(param, catname, "PreValueUse", 1, true, "true");
@@ -185,7 +181,7 @@ function ParseConfig() {
ParamAddValue(param, catname, "IgnoreLeadingNaN", 1, true, "false");
// ParamAddValue(param, catname, "IgnoreAllNaN", 1, true, "false");
ParamAddValue(param, catname, "ErrorMessage");
ParamAddValue(param, catname, "CheckDigitIncreaseConsistency");
ParamAddValue(param, catname, "CheckDigitIncreaseConsistency", 1, true, "false");
var catname = "MQTT";
category[catname] = new Object();
@@ -359,7 +355,6 @@ function ParseConfig() {
}
}
function ParamAddValue(param, _cat, _param, _anzParam = 1, _isNUMBER = false, _defaultValue = "", _checkRegExList = null) {
param[_cat][_param] = new Object();
param[_cat][_param]["found"] = false;
@@ -371,7 +366,6 @@ function ParamAddValue(param, _cat, _param, _anzParam = 1, _isNUMBER = false, _d
param[_cat][_param].checkRegExList = _checkRegExList;
};
function ParseConfigParamAll(_aktline, _catname) {
++_aktline;
@@ -403,7 +397,6 @@ function ParseConfigParamAll(_aktline, _catname) {
return _aktline;
}
function ParamExtractValue(_param, _linesplit, _catname, _paramname, _aktline, _iscom, _anzvalue = 1) {
if ((_linesplit[0].toUpperCase() == _paramname.toUpperCase()) && (_linesplit.length > _anzvalue)) {
_param[_catname][_paramname]["found"] = true;
@@ -417,7 +410,6 @@ function ParamExtractValue(_param, _linesplit, _catname, _paramname, _aktline, _
}
}
function ParamExtractValueAll(_param, _linesplit, _catname, _aktline, _iscom) {
for (var paramname in _param[_catname]) {
_AktROI = "default";
@@ -475,7 +467,6 @@ function ParamExtractValueAll(_param, _linesplit, _catname, _aktline, _iscom) {
}
}
function getCamConfig() {
ParseConfig();
@@ -653,12 +644,10 @@ function getCamConfig() {
return param;
}
function getConfigParameters() {
return param;
}
function WriteConfigININew() {
// Cleanup empty NUMBERS
for (var j = 0; j < NUMBERS.length; ++j) {
@@ -760,7 +749,6 @@ function WriteConfigININew() {
}
}
function isCommented(input) {
let isComment = false;
@@ -772,7 +760,6 @@ function isCommented(input) {
return [isComment, input];
}
function SaveConfigToServer(_domainname){
// leere Zeilen am Ende löschen
var zw = config_split.length - 1;
@@ -792,17 +779,14 @@ function SaveConfigToServer(_domainname){
FileSendContent(config_gesamt, "/config/config.ini", _domainname);
}
function getConfig() {
return config_gesamt;
}
function getConfigCategory() {
return category;
}
function ExtractROIs(_aktline, _type){
var linesplit = ZerlegeZeile(_aktline);
abc = getNUMBERS(linesplit[0], _type);
@@ -819,7 +803,6 @@ function ExtractROIs(_aktline, _type){
}
}
function getNUMBERS(_name, _type, _create = true) {
_pospunkt = _name.indexOf (".");
@@ -879,7 +862,6 @@ function getNUMBERS(_name, _type, _create = true) {
return neuroi;
}
function CopyReferenceToImgTmp(_domainname) {
for (index = 0; index < 2; ++index) {
_filenamevon = REFERENCES[index]["name"];
@@ -894,12 +876,10 @@ function CopyReferenceToImgTmp(_domainname) {
}
}
function GetReferencesInfo(){
return REFERENCES;
}
function UpdateConfigReferences(_domainname){
for (var index = 0; index < 2; ++index) {
_filenamenach = REFERENCES[index]["name"];
@@ -914,7 +894,6 @@ function UpdateConfigReferences(_domainname){
}
}
function UpdateConfigReference(_anzneueref, _domainname){
var index = 0;
@@ -939,12 +918,10 @@ function UpdateConfigReference(_anzneueref, _domainname){
FileCopyOnServer(_filenamevon, _filenamenach, _domainname);
}
function getNUMBERInfo(){
return NUMBERS;
}
function RenameNUMBER(_alt, _neu){
if ((_neu.indexOf(".") >= 0) || (_neu.indexOf(",") >= 0) || (_neu.indexOf(" ") >= 0) || (_neu.indexOf("\"") >= 0)) {
return "Number sequence name must not contain , . \" or a space";
@@ -972,7 +949,6 @@ function RenameNUMBER(_alt, _neu){
return "";
}
function DeleteNUMBER(_delete){
if (NUMBERS.length == 1) {
return "One number sequence is mandatory. Therefore this cannot be deleted"
@@ -993,7 +969,6 @@ function DeleteNUMBER(_delete){
return "";
}
function CreateNUMBER(_numbernew){
found = false;
@@ -1041,7 +1016,6 @@ function CreateNUMBER(_numbernew){
return "";
}
function getROIInfo(_typeROI, _number){
index = -1;
@@ -1059,7 +1033,6 @@ function getROIInfo(_typeROI, _number){
}
}
function RenameROI(_number, _type, _alt, _neu){
if ((_neu.includes("=")) || (_neu.includes(".")) || (_neu.includes(":")) || (_neu.includes(",")) || (_neu.includes(";")) || (_neu.includes(" ")) || (_neu.includes("\""))) {
return "ROI name must not contain . : , ; = \" or space";
@@ -1098,7 +1071,6 @@ function RenameROI(_number, _type, _alt, _neu){
return "";
}
function DeleteNUMBER(_delte) {
if (NUMBERS.length == 1) {
return "The last number cannot be deleted"
@@ -1119,7 +1091,6 @@ function DeleteNUMBER(_delte) {
return "";
}
function CreateROI(_number, _type, _pos, _roinew, _x, _y, _dx, _dy, _CCW){
_indexnumber = -1;