From d7a507ca058efeffb413f881607485c95dd61093 Mon Sep 17 00:00:00 2001 From: Slider0007 Date: Mon, 1 May 2023 14:19:31 +0200 Subject: [PATCH] Update WebUI --- sd-card/html/backup.html | 59 +- sd-card/html/common.js | 4 +- sd-card/html/data.html | 44 +- sd-card/html/edit_alignment.html | 207 +- sd-card/html/edit_analog.html | 509 ++-- sd-card/html/edit_check.html | 136 -- sd-card/html/edit_config.html | 124 +- sd-card/html/edit_config_param.html | 2068 ++++++++++------- sd-card/html/edit_digits.html | 448 ++-- sd-card/html/edit_explain_0.html | 55 +- sd-card/html/edit_explain_7.html | 74 + ...plain_6.html => edit_explain_7_abort.html} | 41 +- sd-card/html/edit_reference.html | 332 ++- sd-card/html/explain_1.html | 33 +- sd-card/html/explain_2.html | 21 +- sd-card/html/explain_3.html | 23 +- sd-card/html/explain_4.html | 22 +- sd-card/html/explain_5.html | 26 +- sd-card/html/explain_6.html | 24 +- sd-card/html/explain_7.html | 1 + sd-card/html/file_server.html | 271 ++- sd-card/html/firework.css | 6 +- sd-card/html/firework.js | 2 +- sd-card/html/graph.html | 78 +- sd-card/html/index.html | 205 +- sd-card/html/info.html | 643 +++-- sd-card/html/log.html | 29 +- sd-card/html/ota_page.html | 30 +- sd-card/html/overview.html | 177 +- sd-card/html/prevalue_set.html | 196 +- sd-card/html/readconfigcommon.js | 22 +- sd-card/html/readconfigparam.js | 47 +- sd-card/html/reboot_page.html | 15 +- sd-card/html/setup.html | 420 +++- sd-card/html/style.css | 50 +- sd-card/html/test.html | 33 - sd-card/html/testcnn.html | 1 - sd-card/html/timezones.html | 2 +- sd-card/html/wlan_config.html | 12 +- 39 files changed, 3961 insertions(+), 2529 deletions(-) delete mode 100644 sd-card/html/edit_check.html create mode 100644 sd-card/html/edit_explain_7.html rename sd-card/html/{edit_explain_6.html => edit_explain_7_abort.html} (50%) create mode 100644 sd-card/html/explain_7.html delete mode 100644 sd-card/html/test.html delete mode 100644 sd-card/html/testcnn.html diff --git a/sd-card/html/backup.html b/sd-card/html/backup.html index c55c3d3d..04af87f3 100644 --- a/sd-card/html/backup.html +++ b/sd-card/html/backup.html @@ -1,42 +1,41 @@ - + - -Backup/Restore Configuration - + Backup/Restore Configuration + - + .button { + padding: 5px 10px; + width: 205px; + font-size: 16px; + } + -

Backup Configuration

-

With the following action the config folder on the SD-card gets zipped and provided as a download.

+

Backup Configuration

+

With the following action the config folder on the SD-card gets zipped and provided as a download.

- -

-
-

Restore Configuration

-

Use the File Server to upload individual files.

+ +

+
+

Restore Configuration

+

Use the File Server to upload individual files.

@@ -105,7 +104,7 @@ function fetchFiles(urls, filesData, index, retry, zipFilename) { // console.log(url + " started (" + index + "/" + urls.length + ")"); if (retry == 0) { - setStatus(" - " + getFilenameFromUrl(urls[index]) + " (" + index + "/" + urls.length + ")..."); + setStatus(" - " + getFilenameFromUrl(urls[index]) + " (" + (index+1) + "/" + urls.length + ")..."); } else { setStatus("   Retrying (" + retry + ")..."); diff --git a/sd-card/html/common.js b/sd-card/html/common.js index bd0eea35..4919d435 100644 --- a/sd-card/html/common.js +++ b/sd-card/html/common.js @@ -145,8 +145,8 @@ function compareVersions() { console.log("FW Hash: " + fWGitHash + ", Web UI Hash: " + webUiHash); if (fWGitHash != webUiHash) { - firework.launch("The Version of the Web Interface (" + webUiHash + - ") does not match the Firmware Version (" + + firework.launch("The version of the web interface (" + webUiHash + + ") does not match the firmware version (" + fWGitHash + ")! It is suggested to keep them on the same version!", 'warning', 30000); } } diff --git a/sd-card/html/data.html b/sd-card/html/data.html index a592241c..09f9885b 100644 --- a/sd-card/html/data.html +++ b/sd-card/html/data.html @@ -1,17 +1,26 @@ - + + + Data Viewer + + -

Todays Data

-

Last part of Todays Data

+

Data Viewer

+

Today's latest data

- - - - + + + +
-



Loading Data file, please wait...
+



Loading data file, please wait...
diff --git a/sd-card/html/edit_alignment.html b/sd-card/html/edit_alignment.html index 434f1db7..fe89abc4 100644 --- a/sd-card/html/edit_alignment.html +++ b/sd-card/html/edit_alignment.html @@ -1,101 +1,135 @@ - + - -Alignment Marks - - - - - - + select { + padding: 3px 5px; + display: inline-block; + border: 1px solid #ccc; + font-size: 16px; + margin-right: 10px; + min-width: 100px; + vertical-align: middle; + } + + .button { + padding: 5px 10px; + width: 205px; + font-size: 16px; + } + + th, td { + padding: 5px 5px 5px 0px; + } + + table { + width: 660px; + padding: 5px; + } + + + + -

Alignment Marks

-

On this page you define two Reference Marks. - See https://jomjol.github.io/AI-on-the-edge-device-docs/Alignment/ for explanations.

-

After saving the Reference Marks, you can define the digit resp. analog ROI's.
- Only after those steps a reboot is required.

+

Alignment Marker

+
+ CLICK HERE for usage description. More infos in documentation: + Alignment + +

+ Two alignment marker with clear contour and proper contrast are needed to identify unique "fix points" on the image. + The marker area should be not be part of the variable area of ROI evaluation. Please find more information in documenation: + Alignment +

+

+ Select an alignment marker area using drag and dop feature by mouse operation or by manually entering the coordinates and sizes in the fields below the image. + After you selected a suitable first alignment marker area, push the "Update Marker" button. Switch to second alignment marker with "Marker" + and repeat the procedure. +

+

+ After definition of both alignment marker is completed don't forget to save with the "Save New Marker" button!
+ NOTE: There is no need to perform a reboot after every saving or step. It's sufficient to reboot after all configuration steps + (reference image, alignment, ROI configuration) are completed to activate new configuration. +

+
+
+ + + + + - - -
- - - - - + - + - - - + + + - - - -
Select Reference: + Marker: Storage Path/Name: Filename:
x: dx:
y: dy:
Original Image:Reference Image:Selected Image Area:Resulting Marker:
+ + + + + Reference Image: + + + + + + + + - - - - -
-

Proceed to update the digit resp. analog ROI's when you are done.

@@ -130,10 +164,15 @@ function ChangeSelection(){ } function SaveToConfig(){ - WriteConfigININew(); - UpdateConfigReference(domainname) - SaveConfigToServer(domainname); - firework.launch('Reference Marks got updated. The change will get applied after the next reboot!', 'success', 5000); + if (confirm("Are you sure you want to save the new alignment marker configuration?")) { + WriteConfigININew(); + UpdateConfigReference(domainname) + SaveConfigToServer(domainname); + document.getElementById("savemarker").disabled = true; + document.getElementById("enhancecontrast").disabled = true; + + firework.launch('Alignment marker saved. They will get applied after next reboot', 'success', 5000); + } } function EnhanceContrast(){ @@ -146,6 +185,7 @@ function EnhanceContrast(){ enhanceCon = true; if (MakeContrastImageZW(refInfo[aktindex], enhanceCon, domainname)) { UpdateReference(); + document.getElementById("enhancecontrast").disabled = true; } } @@ -174,7 +214,6 @@ function UpdateReference(){ document.getElementById("refy").value = refInfo[aktindex]["y"]; rect.startX = document.getElementById("refx").value; rect.startY = document.getElementById("refy").value; - document.getElementById("enhancecontrast").disabled = true; draw(); } @@ -215,14 +254,27 @@ function dataURLtoBlob(dataurl) { return { top: Math.round(top), left: Math.round(left) }; } + + /* hash #description open the details part of the page */ + function openDescription() { + if(window.location.hash) { + var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character + if(hash == 'description') + document.getElementById("desc_details").open = true; + } + } + - - function init() { + function init() { + openDescription(); domainname = getDomainname(); loadConfig(domainname); ParseConfig(); param = getConfigParameters(); + document.getElementById("savemarker").disabled = true; + document.getElementById("enhancecontrast").disabled = true; + canvas.addEventListener('mousedown', mouseDown, false); canvas.addEventListener('mouseup', mouseUp, false); canvas.addEventListener('mousemove', mouseMove, false); @@ -235,6 +287,8 @@ function dataURLtoBlob(dataurl) { drawImage(); } + + function drawImage(){ var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); @@ -254,6 +308,7 @@ function dataURLtoBlob(dataurl) { if (MakeRefZW(refInfo[aktindex], domainname)) { UpdateReference(); document.getElementById("enhancecontrast").disabled = false; + document.getElementById("savemarker").disabled = false; } } diff --git a/sd-card/html/edit_analog.html b/sd-card/html/edit_analog.html index d1641370..a3993d78 100644 --- a/sd-card/html/edit_analog.html +++ b/sd-card/html/edit_analog.html @@ -1,142 +1,221 @@ - + - - -Analog ROI's + + Analog ROI - + + + + -#div2{ - background-color:#777; - margin-bottom:20px; -} -.disabledDiv { - pointer-events: none; - opacity: 0.4; -} - - - - -

Analog ROI's

-

On this page you define ROI's for the analog counters. - See https://jomjol.github.io/AI-on-the-edge-device-docs/ROI-Configuration/ for explanations.

- -

- -
- - - - -
+

Analog ROI

+
+ CLICK HERE for usage description. More infos in documentation: + ROI Configuration + +

+ Region Of Interest (ROI) for analog pointer counter can be defined on this page. If no analog pointer counter need to be + processed, disable analog pointer counter processing by deselecting "Analog ROI Processing". +

+

+ By default one number sequence (a number seqence contains of 1-x digit ROIs + 1-x analog counter ROIs which are processed together) is + predefined and already selected in the drop down "Number Sequence". If you need more than one number sequence additional + one's can be added with the buttons next to the drop down. Each number sequence will be processed separately. +

+

+ Using drag and drop by mouse of by manually entering the parameters into the given fields the analog ROIs can be positined to the analog pointer + counters on the reference image. To have proper ROI definition please check the documentation: + ROI Configuration. It's very important to be + really precise to have reliable processing. With the drop down "ROI" you can change between the different ROIs in the selected + number sequence. To create new ROIs use "New ROI". +

+

+ The order of the ROIs defines the position (and therefore the multiplication factor) within the reading sequence. The position + in the number sequence can be changed with the buttons "Move ROI Lower" and "Move ROI Higher". The multiplication factor which is + shown below the ROI drop down is the multiplication factor of pure position/order in number sequence and the factor right-hand side to this is + the additionally corrected by decimal shift setting (configuration, expert parameter, default: 0). +

+

+ After definition of digit ROIs is completed don't forget to save with the "Save Config" button!
+ NOTE: There is no need to perform a reboot after every saving or step. It's sufficient to reboot after all configuration steps + (reference image, alignment, ROI configuration) are completed to activate new configuration. +

+
+
-

- - - Number: - - - - - -
+

+ +

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
x: Δx:
y: Δy:
-
+ +
+ + + + + + + + + + + + + + + + + +
Number Sequence:
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
ROI:
Multiplier:
+ (only based on order) +
Multiplier:
+ (order + decimal shift: ) +
- - - - - -
-
+ + + + + + + x: + Δx: + + + + y: + Δy: + + + + + + + +
+ + + + + + + + + + + + + + + + +
Reference Image:
@@ -158,16 +237,15 @@ th, td { lockSizes = false; domainname = getDomainname(); - -function doReboot() { - if (confirm("Are you sure you want to reboot? Did you save your changes?")) { - var stringota = getDomainname() + "/reboot"; - window.location = stringota; - window.location.href = stringota; - window.location.assign(stringota); - window.location.replace(stringota); + function doReboot() { + if (confirm("Are you sure you want to reboot? Did you save your changes?")) { + var stringota = getDomainname() + "/reboot"; + window.location = stringota; + window.location.href = stringota; + window.location.assign(stringota); + window.location.replace(stringota); + } } -} function EnDisableAnalog() { isEnabled = document.getElementById("Category_Analog_enabled").checked; @@ -186,9 +264,9 @@ function EnDisableAnalog() { sah1(document.getElementById("div1"), !isEnabled); - cofcat["Analog"]["enabled"] = isEnabled; - + document.getElementById("saveroi").disabled = false; + if (isEnabled) { UpdateROIs(); @@ -212,6 +290,10 @@ function onNameChange(){ } function deleteROI(){ + if (!confirm("Delete the selected ROI?")) { + return; //break out of the function early because prompt was aborted + } + ROIInfo.splice(aktindex, 1); if (aktindex > ROIInfo.length - 1){ aktindex = ROIInfo.length - 1; @@ -220,18 +302,21 @@ function deleteROI(){ draw(); } -function newROI(){ +function newROI() { var sel = document.getElementById("Numbers_value1"); var _number= sel.options[sel.selectedIndex].text; sel = document.getElementById("index"); var _roialt= sel.options[sel.selectedIndex].text; - var _roinew = prompt("Please enter name of new ROI", "name"); + var _roinew = prompt("Please enter a name for the new ROI", "name"); + if (_roinew === null) { + return; //break out of the function early because prompt was aborted + } if (ROIInfo.length > 0) - erg = CreateROI(_number, "analog", sel.selectedIndex, _roinew, 1, 1, ROIInfo[aktindex]["dx"], ROIInfo[aktindex]["dy"], ROIInfo[aktindex]["CCW"]=="true"); + erg = CreateROI(_number, "analog", sel.selectedIndex, _roinew, 15, 30, ROIInfo[aktindex]["dx"], ROIInfo[aktindex]["dy"], ROIInfo[aktindex]["CCW"]=="true"); else - erg = CreateROI(_number, "analog", sel.selectedIndex, _roinew, 1, 1, 30, 30, false); + erg = CreateROI(_number, "analog", sel.selectedIndex, _roinew, 15, 30, 30, 30, false); if (erg != "") firework.launch(erg, 'danger', 30000); @@ -275,7 +360,9 @@ function changeCCW(){ ROIInfo[aktindex]["CCW"] = "true"; else ROIInfo[aktindex]["CCW"] = "false"; - UpdateROIs(); + + UpdateROIs(); + } function ChangeSelection(){ @@ -285,11 +372,47 @@ function ChangeSelection(){ } function SaveToConfig(){ -// _zwcat = getConfigCategory(); - cofcat["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked; - WriteConfigININew(); - SaveConfigToServer(domainname); - firework.launch('Configuration got updated. It will get applied after the next reboot!', 'success', 5000); + if (confirm("Are you sure you want to save the new analog ROI configuration?")) { + //_zwcat = getConfigCategory(); + cofcat["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked; + WriteConfigININew(); + SaveConfigToServer(domainname); + UpdateROIs(); + document.getElementById("saveroi").disabled = true; + + firework.launch('Configuration saved. It will get applied after next reboot', 'success', 5000); + } +} + + +function ShowMultiplier(){ + var decimalShift = 0; + var multiplier = multiplier_decshift = aktindex+1-Number(decimalShift); + var fixedDecimals = fixedDecimals_decshift = aktindex+1; + var NumberInfo = getNUMBERInfo(); + + var sel = document.getElementById("Numbers_value1"); + var _number= sel.options[sel.selectedIndex].text; + var NumbersIndex = 0; + for (var i = 0; i < NumberInfo.length; ++i) + if (NumberInfo[i]["name"] == _number) + NumbersIndex = i; + + if (NumberInfo[NumbersIndex]["PostProcessing"]["DecimalShift"]["enabled"]) { + decimalShift = NumberInfo[NumbersIndex]["PostProcessing"]["DecimalShift"]["value1"]; + document.getElementById("decimalShift").value=decimalShift; + multiplier_decshift = aktindex+1-Number(decimalShift); + fixedDecimals_decshift = fixedDecimals_decshift-Number(decimalShift); // set to fixed decimals to avoid rounding issues + + if (fixedDecimals_decshift < 0) + fixedDecimals_decshift = 0; + } + else { + document.getElementById("decimalShift").value=0; + } + + document.getElementById("multiplier").value="x" + Number(10 ** (-1*multiplier)).toFixed(fixedDecimals); + document.getElementById("multiplier_decshift").value="x" + Number(10 ** (-1*multiplier_decshift)).toFixed(fixedDecimals_decshift); } @@ -305,19 +428,28 @@ function UpdateROIs(_sel){ { document.getElementById("Category_Analog_enabled").checked = false; EnDisableAnalog(); - firework.launch('Analog ROIs are disabled - please enable first (Check box top left)', 'warning', 10000); + firework.launch('Analog ROI processing is disabled. Activate with checkbox if needed', 'warning', 10000); return; } if (ROIInfo.length == 0){ - firework.launch('There are no ROIs defined. Please first create a new ROI ("New ROIs ...")', 'danger', 10000); + firework.launch('No analog ROIs defined in selected number sequence', 'warning', 10000); document.getElementById("newROI").disabled = false; document.getElementById("deleteROI").disabled = true; - document.getElementById("index").disabled = true; - document.getElementById("saveroi").disabled = true; document.getElementById("renameROI").disabled = true; + document.getElementById("index").disabled = true; + document.getElementById("multiplier").style.display = "none"; + document.getElementById("multiplier_decshift").style.display = "none"; + document.getElementById("refx").disabled = true; + document.getElementById("refdx").disabled = true; + document.getElementById("refy").disabled = true; + document.getElementById("refdy").disabled = true; + document.getElementById("lockSizes").disabled = true; + document.getElementById("lockAspectRatio").disabled = true; + document.getElementById("CCW").disabled = true; document.getElementById("moveNext").disabled = true; document.getElementById("movePrevious").disabled = true; + document.getElementById("saveroi").disabled = false; return; } else @@ -326,6 +458,15 @@ function UpdateROIs(_sel){ document.getElementById("deleteROI").disabled = false; document.getElementById("renameROI").disabled = false; document.getElementById("index").disabled = false; + document.getElementById("multiplier").style.display = ""; + document.getElementById("multiplier_decshift").style.display = ""; + document.getElementById("refx").disabled = false; + document.getElementById("refdx").disabled = false; + document.getElementById("refy").disabled = false; + document.getElementById("refdy").disabled = false; + document.getElementById("lockSizes").disabled = false; + document.getElementById("lockAspectRatio").disabled = false; + document.getElementById("CCW").disabled = false; document.getElementById("saveroi").disabled = false; } @@ -335,7 +476,7 @@ function UpdateROIs(_sel){ } if (aktindex > ROIInfo.length) - aktindex = ROIInfo.length; + aktindex = ROIInfo.length-1; for (var i = 0; i < ROIInfo.length; ++i){ var option = document.createElement("option"); @@ -358,7 +499,9 @@ function UpdateROIs(_sel){ document.getElementById("moveNext").disabled = false; if (aktindex == (ROIInfo.length-1)){ document.getElementById("moveNext").disabled = true; - } + } + + ShowMultiplier(); document.getElementById("lockAspectRatio").checked = lockAspectRatio; document.getElementById("lockSizes").checked = lockSizes; @@ -373,8 +516,7 @@ function UpdateROIs(_sel){ rect.startY = ROIInfo[aktindex]["y"]; rect.w = ROIInfo[aktindex]["dx"]; rect.h = ROIInfo[aktindex]["dy"]; - draw(); - + draw(); } function loadCanvas(dataURL) { @@ -404,10 +546,20 @@ function UpdateROIs(_sel){ var left = box.left + scrollLeft - clientLeft; return { top: Math.round(top), left: Math.round(left) }; } - - + + + /* hash #description open the details part of the page */ + function openDescription() { + if(window.location.hash) { + var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character + if(hash == 'description') + document.getElementById("desc_details").open = true; + } + } + function init() { + openDescription(); domainname = getDomainname(); canvas.addEventListener('mousedown', mouseDown, false); canvas.addEventListener('mouseup', mouseUp, false); @@ -440,11 +592,12 @@ function UpdateROIs(_sel){ console.log("Not all ROI have the same dX and dY, unticking the sync checkbox!"); } + document.getElementById("saveroi").disabled = true; drawImage(); draw(); } - + function drawImage(){ var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); @@ -483,10 +636,13 @@ function UpdateNUMBERS(_sel){ function renameNumber(){ var sel = document.getElementById("Numbers_value1"); - var _delte= sel.options[sel.selectedIndex].text; - var _numbernew = prompt("Please enter new name", _delte); + var _delete= sel.options[sel.selectedIndex].text; + var _numbernew = prompt("Please enter a new name for the selected number sequence", _delete); + if (_numbernew === null) { + return; //break out of the function early because prompt was aborted + } - erg = RenameNUMBER(_delte, _numbernew); + erg = RenameNUMBER(_delete, _numbernew); if (erg != "") firework.launch(erg, 'danger', 30000); else @@ -494,7 +650,10 @@ function renameNumber(){ } function newNumber(){ - var _numbernew = prompt("Please enter name of new number", "name"); + var _numbernew = prompt("Please enter a name for the new number sequence", "name"); + if (_numbernew === null) { + return; //break out of the function early because prompt was aborted + } erg = CreateNUMBER(_numbernew); if (erg != "") @@ -505,10 +664,13 @@ function newNumber(){ function removeNumber(){ - if (confirm("This will remove the number complete (analog and digital).\nIf you only want to remove the digital ROIs, please use \"Delete ROIs\".\nDo you want to proceed?")) { + if (confirm("The entire number sequence will be removed (digit + analog parts). " + + "To remove single ROI of the number sequence, use \"Delete ROI\" instead.\n" + + "Do you really want to proceed?")) + { var sel = document.getElementById("Numbers_value1"); - var _delte= sel.options[sel.selectedIndex].text; - erg = DeleteNUMBER(_delte); + var _delete= sel.options[sel.selectedIndex].text; + erg = DeleteNUMBER(_delete); if (erg != "") firework.launch(erg, 'danger', 30000); UpdateNUMBERS(); @@ -576,8 +738,12 @@ function drawTextBG(context, txt, x, y, padding) { var dx = parseInt(ROIInfo[_nb].dx) + parseInt(lw); var dy = parseInt(ROIInfo[_nb].dy) + parseInt(lw); context.strokeRect(x0, y0, dx, dy); - drawTextBG(context, ROIInfo[_nb]["name"], x0+dx/2-0.5, y0-13, 5); - + + if (ROIInfo[_nb]["CCW"] != "true") + drawTextBG(context, ROIInfo[_nb]["name"], x0+dx/2-0.5, y0-13, 5); + else + drawTextBG(context, ROIInfo[_nb]["name"]+" (CCW)", x0+dx/2-0.5, y0-13, 5); + lw = 1; var x0 = parseInt(ROIInfo[_nb].x) - parseInt(lw/2); var y0 = parseInt(ROIInfo[_nb].y) - parseInt(lw/2); @@ -602,8 +768,13 @@ function drawTextBG(context, txt, x, y, padding) { var y0 = parseInt(rect.startY) - parseInt(lw/2); var dx = parseInt(rect.w) + parseInt(lw); var dy = parseInt(rect.h) + parseInt(lw); - context.strokeRect(x0, y0, dx, dy); - drawTextBG(context, ROIInfo[aktindex]["name"], x0+dx/2, y0-11, 5); + context.strokeRect(x0, y0, dx, dy); + + if (ROIInfo[aktindex]["CCW"] != "true") + drawTextBG(context, ROIInfo[aktindex]["name"], x0+dx/2, y0-11, 5); + else + drawTextBG(context, ROIInfo[aktindex]["name"] + " (CCW)", x0+dx/2, y0-11, 5); + context.lineWidth = 1; context.beginPath(); context.arc(x0+dx/2, y0+dy/2, dx/2, 0, 2 * Math.PI); @@ -706,6 +877,7 @@ function drawTextBG(context, txt, x, y, padding) { rect.startY = document.getElementById("refy").value; draw(); } + document.getElementById("saveroi").disabled = false; } function valuemanualchangeddx(){ @@ -721,6 +893,7 @@ function drawTextBG(context, txt, x, y, padding) { rect.startY = document.getElementById("refy").value; draw(); } + document.getElementById("saveroi").disabled = false; } @@ -730,8 +903,10 @@ function drawTextBG(context, txt, x, y, padding) { sel = document.getElementById("index"); var _roialt= sel.options[sel.selectedIndex].text; - - var _roinew = prompt("Please enter new name", _roialt); + var _roinew = prompt("Please enter a new name for the selected ROI", _roialt); + if (_roinew === null) { + return; //break out of the function early because prompt was aborted + } erg = RenameROI(_number, "analog", _roialt, _roinew); if (erg != "") @@ -742,13 +917,15 @@ function drawTextBG(context, txt, x, y, padding) { function numberChanged() { + aktindex = 0; UpdateROIs(); } - init(); + + diff --git a/sd-card/html/edit_check.html b/sd-card/html/edit_check.html deleted file mode 100644 index 27ca5012..00000000 --- a/sd-card/html/edit_check.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - -Check - - - - - - - - - - - - - -
Result:
- - -

- -

-

-
-

-

- Takes up to 2 Minutes! -

- Digits and Analog recognition not yet implemented. -

- -

-

- -

-
- - - - - - - - diff --git a/sd-card/html/edit_config.html b/sd-card/html/edit_config.html index 475b875e..bbac9047 100644 --- a/sd-card/html/edit_config.html +++ b/sd-card/html/edit_config.html @@ -1,25 +1,24 @@ - + - Edit Config - + @@ -28,59 +27,60 @@ textarea { - - - - - - - - - - - -

Config.ini:

- -
+ +

Configuration - "Config.ini" Editor

+ +
+ +
- - - - + + + + + LoadConfigNeu(); + + diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 39895746..4c853b3e 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -1,108 +1,165 @@ - + - -Edit Config - +Configuration + @@ -116,50 +173,85 @@ textarea {

Configuration

-

The documentation of each parameter can be shown with hovering over the icon.
- The latest version of the documentation is available on jomjol.github.io/AI-on-the-edge-device-docs/Parameters.

- - -

- @@ -1410,13 +1648,6 @@ textarea { function LoadConfigNeu() { - var isInitialSetup = getParameterByName('InitialSetup'); - if (isInitialSetup === 'true') - { - document.getElementById("reboot").style.display = "none"; - } - - domainname = getDomainname(); if (!loadConfig(domainname)) { firework.launch('Configuration could not be loaded! Please reload the page!', 'danger', 30000); @@ -1434,42 +1665,43 @@ function LoadConfigNeu() { document.getElementById("divall").style.display = ''; } + function InitIndivParameter() { - NUMBERS = getNUMBERInfo(); + NUMBERS = getNUMBERInfo(); var _index = document.getElementById("Numbers_value1"); while (_index.length) _index.remove(0); - var _indexInflux = document.getElementById("NumbersInfluxDBv2_value1"); + var _indexInflux = document.getElementById("NumbersInfluxDBv2_value1"); while (_indexInflux.length) - _indexInflux.remove(0); + _indexInflux.remove(0); - var _indexInfluxv1 = document.getElementById("NumbersInfluxDB_value1"); + var _indexInfluxv1 = document.getElementById("NumbersInfluxDB_value1"); while (_indexInflux.length) - _indexInfluxv1.remove(0); + _indexInfluxv1.remove(0); - for (var i = 0; i < NUMBERS.length; ++i){ - var option = document.createElement("option"); + for (var i = 0; i < NUMBERS.length; ++i){ + var option = document.createElement("option"); option.text = NUMBERS[i]["name"]; option.value = i; _index.add(option); - var optionInflux = document.createElement("option"); + var optionInflux = document.createElement("option"); optionInflux.text = NUMBERS[i]["name"]; optionInflux.value = i; - _indexInflux.add(optionInflux); + _indexInflux.add(optionInflux); - var optionInfluxv1 = document.createElement("option"); + var optionInfluxv1 = document.createElement("option"); optionInfluxv1.text = NUMBERS[i]["name"]; optionInfluxv1.value = i; - _indexInfluxv1.add(optionInfluxv1); + _indexInfluxv1.add(optionInfluxv1); - } + } _index.selectedIndex = 0; - _indexInflux.selectedIndex = 0; - _indexInfluxv1.selectedIndex = 0; + _indexInflux.selectedIndex = 0; + _indexInfluxv1.selectedIndex = 0; } @@ -1478,418 +1710,438 @@ function getParameterByName(name, url = window.location.href) { var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); - if (!results) return null; + if (!results) return null; if (!results[2]) return ''; - return decodeURIComponent(results[2].replace(/\+/g, ' ')); + return decodeURIComponent(results[2].replace(/\+/g, ' ')); } + function WriteParameter(_param, _category, _cat, _name, _optional, _number = -1){ - let anzpara; - try { - anzpara = _param[_cat][_name].anzParam; - } - catch (error) { - firework.launch("Parameter '" + _name + "' in category '" + _cat + "' is unknown!", 'danger', 30000); - return; - } + let anzpara; + try { + anzpara = _param[_cat][_name].anzParam; + } + catch (error) { + firework.launch("Parameter '" + _name + "' in category '" + _cat + "' is unknown!", 'danger', 30000); + return; + } - if (_number > -1) { - if ((NUMBERS[_number] == undefined) || (NUMBERS[_number][_cat] == undefined) || (NUMBERS[_number][_cat][_name] == undefined)) - return; + if (_number > -1) { + if ((NUMBERS[_number] == undefined) || (NUMBERS[_number][_cat] == undefined) || (NUMBERS[_number][_cat][_name] == undefined)) + return; - if (_optional) { - document.getElementById(_cat+"_"+_name+"_enabled").checked = NUMBERS[_number][_cat][_name]["enabled"]; - for (var j = 1; j <= anzpara; ++j) { - document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !NUMBERS[_number][_cat][_name]["enabled"]; - } - } - document.getElementById(_cat+"_"+_name+"_text").style="color:black;" - setEnabled(_cat+"_"+_name, true); + if (_optional) { + document.getElementById(_cat+"_"+_name+"_enabled").checked = NUMBERS[_number][_cat][_name]["enabled"]; + for (var j = 1; j <= anzpara; ++j) { + document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !NUMBERS[_number][_cat][_name]["enabled"]; + } + } + document.getElementById(_cat+"_"+_name+"_text").style.color = "black" + setEnabled(_cat+"_"+_name, true); - for (var j = 1; j <= anzpara; ++j) { - let element = document.getElementById(_cat+"_"+_name+"_value"+j); - if (element.tagName.toLowerCase() == "select") { - var textToFind = NUMBERS[_number][_cat][_name]["value"+j]; - if (textToFind == undefined) - continue; + for (var j = 1; j <= anzpara; ++j) { + let element = document.getElementById(_cat+"_"+_name+"_value"+j); + if (element.tagName.toLowerCase() == "select") { + var textToFind = NUMBERS[_number][_cat][_name]["value"+j]; + if (textToFind == undefined) + continue; - _isFound = false; - element.selectedIndex = -1; - for (var i = 0; i < element.options.length; i++) { - if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) { - element.selectedIndex = i; - _isFound = true; - break; - } - } - if (!_isFound) - { - _zw_txt = "In the selected field the value '" + textToFind + "' in the parameter '"; - _zw_txt = _zw_txt + _cat + "' in the field '" + _name + "' is invalid. PLEASE CHECK BEFORE SAVING!"; - firework.launch(_zw_txt, 'warning', 10000); - } - } - else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) { - element.checked = NUMBERS[_number][_cat][_name]["value"+j] == "true"; - } - else { - element.value = NUMBERS[_number][_cat][_name]["value"+j]; - } - } - } - else { - if (_optional) { - document.getElementById(_cat+"_"+_name+"_enabled").checked = _param[_cat][_name]["enabled"]; - for (var j = 1; j <= anzpara; ++j) { - document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_param[_cat][_name]["enabled"]; - } - } - document.getElementById(_cat+"_"+_name+"_text").style="color:black;" - setEnabled(_cat+"_"+_name, true); + _isFound = false; + element.selectedIndex = -1; + for (var i = 0; i < element.options.length; i++) { + if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) { + element.selectedIndex = i; + _isFound = true; + break; + } + } + if (!_isFound) + { + _zw_txt = "In the selected field the value '" + textToFind + "' in the parameter '"; + _zw_txt = _zw_txt + _cat + "' in the field '" + _name + "' is invalid. PLEASE CHECK BEFORE SAVING!"; + firework.launch(_zw_txt, 'warning', 10000); + } + } + else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) { + element.checked = NUMBERS[_number][_cat][_name]["value"+j] == "true"; + } + else { + element.value = NUMBERS[_number][_cat][_name]["value"+j]; + } + } + } + else { + if (_optional) { + document.getElementById(_cat+"_"+_name+"_enabled").checked = _param[_cat][_name]["enabled"]; + for (var j = 1; j <= anzpara; ++j) { + document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_param[_cat][_name]["enabled"]; + } + } + document.getElementById(_cat+"_"+_name+"_text").style.color = "black" + setEnabled(_cat+"_"+_name, true); - for (var j = 1; j <= anzpara; ++j) { - let element = document.getElementById(_cat+"_"+_name+"_value"+j); - if (element.tagName.toLowerCase() == "select") { - var textToFind = _param[_cat][_name]["value"+j]; - if (textToFind == undefined) - continue; - - _isFound = false; - element.selectedIndex = -1; - for (var i = 0; i < element.options.length; i++) { - if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) { - element.selectedIndex = i; - _isFound = true; - break; - } - } - if (!_isFound) - { - _zw_txt = "In the selected field the value '" + textToFind + "' in the section '"; - _zw_txt = _zw_txt + _cat + "' in the field '" + _name + "' is invalid. PLEASE CHECK BEFORE SAVING!"; - firework.launch(_zw_txt, 'warning', 10000); - } + for (var j = 1; j <= anzpara; ++j) { + let element = document.getElementById(_cat+"_"+_name+"_value"+j); + if (element.tagName.toLowerCase() == "select") { + var textToFind = _param[_cat][_name]["value"+j]; + if (textToFind == undefined) + continue; + + _isFound = false; + element.selectedIndex = -1; + for (var i = 0; i < element.options.length; i++) { + if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) { + element.selectedIndex = i; + _isFound = true; + break; + } + } + if (!_isFound) + { + _zw_txt = "In the selected field the value '" + textToFind + "' in the section '"; + _zw_txt = _zw_txt + _cat + "' in the field '" + _name + "' is invalid. PLEASE CHECK BEFORE SAVING!"; + firework.launch(_zw_txt, 'warning', 10000); + } - } - else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) { - element.checked = _param[_cat][_name]["value"+j] == "true"; - } - else { - element.value = _param[_cat][_name]["value"+j]; - } - } - } + } + else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) { + element.checked = _param[_cat][_name]["value"+j] == "true"; + } + else { + element.value = _param[_cat][_name]["value"+j]; + } + } + } - ///////////////// am Ende, falls Kategorie als gesamtes nicht ausgewählt --> deaktivieren - if (_category[_cat]["enabled"] == false) - { - if (_optional) { - document.getElementById(_cat+"_"+_name+"_enabled").disabled = true; - for (var j = 1; j <= anzpara; ++j) { - document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true; - } - } - document.getElementById(_cat+"_"+_name+"_text").style="color: gray;" - setEnabled(_cat+"_"+_name, false); - } + ///////////////// am Ende, falls Kategorie als gesamtes nicht ausgewählt --> deaktivieren + if (_category[_cat]["enabled"] == false) + { + if (_optional) { + document.getElementById(_cat+"_"+_name+"_enabled").disabled = true; + for (var j = 1; j <= anzpara; ++j) { + document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true; + } + } + document.getElementById(_cat+"_"+_name+"_text").style="color: gray;" + setEnabled(_cat+"_"+_name, false); + } - EnDisableItem(_category[_cat]["enabled"], _param, _category, _cat, _name, _optional, _number); + EnDisableItem(_category[_cat]["enabled"], _param, _category, _cat, _name, _optional, _number); } + function InvertEnableItem(_cat, _param) { - _zw = _cat + "_" + _param + "_enabled"; - _isOn = document.getElementById(_zw).checked; + _zw = _cat + "_" + _param + "_enabled"; + _isOn = document.getElementById(_zw).checked; - _color = "color: rgb(122, 122, 122);"; - if (_isOn) { - _color = "color:black;"; - } + _color = "rgb(122, 122, 122)"; + if (_isOn) { + _color = "black"; + } - _zw = _cat + "_" + _param + "_text"; - document.getElementById(_zw).disabled = !_isOn; - document.getElementById(_zw).style = _color; + _zw = _cat + "_" + _param + "_text"; + document.getElementById(_zw).disabled = !_isOn; + document.getElementById(_zw).style.color = _color; - setEnabled(_cat + "_" + _param, _isOn); + setEnabled(_cat + "_" + _param, _isOn); - for (var j = 1; j <= param[_cat][_param]["anzParam"]; ++j) { - document.getElementById(_cat+"_"+_param+"_value"+j).disabled = !_isOn; - document.getElementById(_cat+"_"+_param+"_value"+j).style=_color; - } + for (var j = 1; j <= param[_cat][_param]["anzParam"]; ++j) { + document.getElementById(_cat+"_"+_param+"_value"+j).disabled = !_isOn; + document.getElementById(_cat+"_"+_param+"_value"+j).style.color = _color; + } } + function setEnabled(className, enabled) { - _color = "color: rgb(122, 122, 122);"; - if (enabled) { - _color = "color:black;"; - } + _color = "rgb(122, 122, 122)"; + if (enabled) { + _color = "black"; + } - let elements = document.getElementsByClassName(className); - for (i = 0; i < elements.length; i++) { - if (enabled) { - elements[i].classList.remove("disabled"); - } else { - elements[i].classList.add("disabled"); - } + let elements = document.getElementsByClassName(className); + for (i = 0; i < elements.length; i++) { + if (enabled) { + elements[i].classList.remove("disabled"); + } else { + elements[i].classList.add("disabled"); + } - let inputs = elements[i].getElementsByTagName("input"); - for (j = 0; j < inputs.length; j++) { - if (inputs[j].id.endsWith("_enabled")) - continue; + let inputs = elements[i].getElementsByTagName("input"); + for (j = 0; j < inputs.length; j++) { + if (inputs[j].id.endsWith("_enabled")) + continue; - inputs[j].style = _color - if (enabled) { - inputs[j].removeAttribute("disabled"); - } else { - inputs[j].setAttribute("disabled", "disabled"); - } - } - } + inputs[j].style.color = _color; + if (enabled) { + inputs[j].removeAttribute("disabled"); + } else { + inputs[j].setAttribute("disabled", "disabled"); + } + } + } } + function setVisible(className, visible) { - let elements = document.getElementsByClassName(className); - for (i = 0; i < elements.length; i++) { - if (visible) { - elements[i].classList.remove("hidden"); - } else { - elements[i].classList.add("hidden"); - } - } + let elements = document.getElementsByClassName(className); + for (i = 0; i < elements.length; i++) { + if (visible) { + elements[i].classList.remove("hidden"); + } else { + elements[i].classList.add("hidden"); + } + } } + function EnDisableItem(_status, _param, _category, _cat, _name, _optional, _number = -1) { - _status = _category[_cat]["enabled"]; + _status = _category[_cat]["enabled"]; - _color = "color: rgb(122, 122, 122);"; - if (_status) { - _color = "color:black;"; - } + _color = "rgb(122, 122, 122)"; + if (_status) { + _color = "black"; + } - if (_optional) { - document.getElementById(_cat+"_"+_name+"_enabled").disabled = !_status; - document.getElementById(_cat+"_"+_name+"_enabled").style=_color; - } + if (_optional) { + document.getElementById(_cat+"_"+_name+"_enabled").disabled = !_status; + document.getElementById(_cat+"_"+_name+"_enabled").style.color = _color; + } - if (_number == -1){ - if (!_param[_cat][_name]["enabled"]) { - _status = false; - _color = "color: rgb(122, 122, 122);"; - } - } - else - if (!NUMBERS[_number][_cat][_name]["enabled"]) { - _status = false; - _color = "color: rgb(122, 122, 122);"; - } + if (_number == -1){ + if (!_param[_cat][_name]["enabled"]) { + _status = false; + _color = "rgb(122, 122, 122)"; + } + } + else + if (!NUMBERS[_number][_cat][_name]["enabled"]) { + _status = false; + _color = "rgb(122, 122, 122)"; + } - document.getElementById(_cat+"_"+_name+"_text").disabled = !_status; - document.getElementById(_cat+"_"+_name+"_text").style = _color; + document.getElementById(_cat+"_"+_name+"_text").disabled = !_status; + document.getElementById(_cat+"_"+_name+"_text").style.color = _color; - setEnabled(_cat+"_"+_name, _status); + setEnabled(_cat+"_"+_name, _status); - for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) { - document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_status; - document.getElementById(_cat+"_"+_name+"_value"+j).style=_color; - } + for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) { + document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_status; + document.getElementById(_cat+"_"+_name+"_value"+j).style.color = _color; + } } function ReadParameter(_param, _cat, _name, _optional, _number = -1){ - if (_number > -1) { - if (_cat == "Digits") - _cat = "digit"; - if (_cat == "Analog") - _cat = "analog"; + if (_number > -1) { + if (_cat == "Digits") + _cat = "digit"; + if (_cat == "Analog") + _cat = "analog"; - if ((NUMBERS[_number] == undefined) || (NUMBERS[_number][_cat] == undefined) || (NUMBERS[_number][_cat][_name] == undefined)) - return; + if ((NUMBERS[_number] == undefined) || (NUMBERS[_number][_cat] == undefined) || (NUMBERS[_number][_cat][_name] == undefined)) + return; - if (_optional) { - NUMBERS[_number][_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked; - } + if (_optional) { + NUMBERS[_number][_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked; + } - for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) { - let element = document.getElementById(_cat+"_"+_name+"_value"+j); - if (element.tagName.toLowerCase() == "select") { - NUMBERS[_number][_cat][_name]["value"+j] = element.selectedIndex > -1 ? element.options[element.selectedIndex].value : ""; - } - else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) { - NUMBERS[_number][_cat][_name]["value"+j] = element.checked; - } - else { - if ((NUMBERS[_number][_cat][_name].checkRegExList != null) && (NUMBERS[_number][_cat][_name].checkRegExList[j-1] != null)) { - if (!element.value.match(NUMBERS[_cat][_name].checkRegExList[j-1])) { - element.classList.add("invalid-input"); - } else { - element.classList.remove("invalid-input"); - } - } - NUMBERS[_number][_cat][_name]["value"+j] = element.value; - } - } - } - else - { - if (_optional) { - _param[_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked; - } + for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) { + let element = document.getElementById(_cat+"_"+_name+"_value"+j); + if (element.tagName.toLowerCase() == "select") { + NUMBERS[_number][_cat][_name]["value"+j] = element.selectedIndex > -1 ? element.options[element.selectedIndex].value : ""; + } + else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) { + NUMBERS[_number][_cat][_name]["value"+j] = element.checked; + } + else { + if ((NUMBERS[_number][_cat][_name].checkRegExList != null) && (NUMBERS[_number][_cat][_name].checkRegExList[j-1] != null)) { + if (!element.value.match(NUMBERS[_cat][_name].checkRegExList[j-1])) { + element.classList.add("invalid-input"); + } else { + element.classList.remove("invalid-input"); + } + } + NUMBERS[_number][_cat][_name]["value"+j] = element.value; + } + } + } + else + { + if (_optional) { + _param[_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked; + } - for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) { - let element = document.getElementById(_cat+"_"+_name+"_value"+j); - if (element.tagName.toLowerCase() == "select") { - _param[_cat][_name]["value"+j] = element.selectedIndex > -1 ? element.options[element.selectedIndex].value : ""; - } - else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) { - _param[_cat][_name]["value"+j] = element.checked; - } - else { - if ((_param[_cat][_name].checkRegExList != null) && (_param[_cat][_name].checkRegExList[j-1] != null)) { - if (!element.value.match(_param[_cat][_name].checkRegExList[j-1])) { - element.classList.add("invalid-input"); - } else { - element.classList.remove("invalid-input"); - } - } - _param[_cat][_name]["value"+j] = element.value; - } - } - } + for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) { + let element = document.getElementById(_cat+"_"+_name+"_value"+j); + if (element.tagName.toLowerCase() == "select") { + _param[_cat][_name]["value"+j] = element.selectedIndex > -1 ? element.options[element.selectedIndex].value : ""; + } + else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) { + _param[_cat][_name]["value"+j] = element.checked; + } + else { + if ((_param[_cat][_name].checkRegExList != null) && (_param[_cat][_name].checkRegExList[j-1] != null)) { + if (!element.value.match(_param[_cat][_name].checkRegExList[j-1])) { + element.classList.add("invalid-input"); + } else { + element.classList.remove("invalid-input"); + } + } + _param[_cat][_name]["value"+j] = element.value; + } + } + } } + function UpdateInputIndividual(sel) { - if (NUNBERSAkt != -1) - { - ReadParameter(param, "PostProcessing", "DecimalShift", true, NUNBERSAkt) - ReadParameter(param, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt) - ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt) - ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt) - ReadParameter(param, "PostProcessing", "ExtendedResolution", false, NUNBERSAkt) - ReadParameter(param, "PostProcessing", "IgnoreLeadingNaN", false, NUNBERSAkt) - ReadParameter(param, "PostProcessing", "AllowNegativeRates", false, NUNBERSAkt) - ReadParameter(param, "InfluxDB", "Field", true, NUNBERSAkt) - ReadParameter(param, "InfluxDBv2", "Field", true, NUNBERSAkt) - ReadParameter(param, "InfluxDB", "Measurement", true, NUNBERSAkt) - ReadParameter(param, "InfluxDBv2", "Measurement", true, NUNBERSAkt) - } + if (NUNBERSAkt != -1) + { + ReadParameter(param, "PostProcessing", "DecimalShift", true, NUNBERSAkt); + ReadParameter(param, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt); + ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt); + ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt); + ReadParameter(param, "PostProcessing", "ExtendedResolution", false, NUNBERSAkt); + ReadParameter(param, "PostProcessing", "IgnoreLeadingNaN", false, NUNBERSAkt); + ReadParameter(param, "PostProcessing", "AllowNegativeRates", false, NUNBERSAkt); + ReadParameter(param, "InfluxDB", "Field", true, NUNBERSAkt); + ReadParameter(param, "InfluxDBv2", "Field", true, NUNBERSAkt); + ReadParameter(param, "InfluxDB", "Measurement", true, NUNBERSAkt); + ReadParameter(param, "InfluxDBv2", "Measurement", true, NUNBERSAkt); + } // var sel = document.getElementById("Numbers_value1"); - NUNBERSAkt = sel.selectedIndex; - WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt); - WriteParameter(param, category, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt); - WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt); - WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt); - WriteParameter(param, category, "PostProcessing", "ExtendedResolution", false, NUNBERSAkt); - WriteParameter(param, category, "PostProcessing", "IgnoreLeadingNaN", false, NUNBERSAkt); - WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", 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); + NUNBERSAkt = sel.selectedIndex; + WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt); + WriteParameter(param, category, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt); + WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt); + WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt); + WriteParameter(param, category, "PostProcessing", "ExtendedResolution", false, NUNBERSAkt); + WriteParameter(param, category, "PostProcessing", "IgnoreLeadingNaN", false, NUNBERSAkt); + WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", 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); } + function UpdateInput() { - document.getElementById("Category_Analog_enabled").checked = category["Analog"]["enabled"]; - document.getElementById("Category_Digits_enabled").checked = category["Digits"]["enabled"]; - document.getElementById("Category_MQTT_enabled").checked = category["MQTT"]["enabled"]; - document.getElementById("Category_GPIO_enabled").checked = category["GPIO"]["enabled"]; - document.getElementById("Category_InfluxDB_enabled").checked = category["InfluxDB"]["enabled"]; - document.getElementById("Category_InfluxDBv2_enabled").checked = category["InfluxDBv2"]["enabled"]; - setVisible("GPIO_item", category["GPIO"]["enabled"]); + document.getElementById("Category_Digits_enabled").checked = category["Digits"]["enabled"]; + setVisible("DigitItem", category["Digits"]["enabled"]); - WriteParameter(param, category, "TakeImage", "RawImagesLocation", true); - WriteParameter(param, category, "TakeImage", "RawImagesRetention", true); - WriteParameter(param, category, "TakeImage", "Demo", false); - WriteParameter(param, category, "TakeImage", "WaitBeforeTakingPicture", false); - WriteParameter(param, category, "TakeImage", "ImageQuality", false); - WriteParameter(param, category, "TakeImage", "Brightness", false); - WriteParameter(param, category, "TakeImage", "Contrast", false); - WriteParameter(param, category, "TakeImage", "Saturation", false); - WriteParameter(param, category, "TakeImage", "LEDIntensity", false); - WriteParameter(param, category, "TakeImage", "ImageSize", false); - WriteParameter(param, category, "TakeImage", "FixedExposure", false); + document.getElementById("Category_Analog_enabled").checked = category["Analog"]["enabled"]; + setVisible("AnalogItem", category["Analog"]["enabled"]); - WriteParameter(param, category, "Alignment", "SearchFieldX", false); - WriteParameter(param, category, "Alignment", "SearchFieldY", false); - WriteParameter(param, category, "Alignment", "AlignmentAlgo", true); + document.getElementById("Category_MQTT_enabled").checked = category["MQTT"]["enabled"]; + setVisible("MQTTItem", category["MQTT"]["enabled"]); - WriteParameter(param, category, "Digits", "CNNGoodThreshold", true); - WriteParameter(param, category, "Digits", "ROIImagesLocation", true); - WriteParameter(param, category, "Digits", "ROIImagesRetention", true); - - WriteParameter(param, category, "Analog", "ROIImagesLocation", true); - WriteParameter(param, category, "Analog", "ROIImagesRetention", true); - - WriteParameter(param, category, "PostProcessing", "PreValueUse", false); - WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true); + document.getElementById("Category_GPIO_enabled").checked = category["GPIO"]["enabled"]; + setVisible("GPIO_item", category["GPIO"]["enabled"]); + + document.getElementById("Category_InfluxDB_enabled").checked = category["InfluxDB"]["enabled"]; + setVisible("InfluxDBv1Item", category["InfluxDB"]["enabled"]); + + document.getElementById("Category_InfluxDBv2_enabled").checked = category["InfluxDBv2"]["enabled"]; + setVisible("InfluxDBv2Item", category["InfluxDBv2"]["enabled"]); + + WriteParameter(param, category, "TakeImage", "RawImagesLocation", true); + WriteParameter(param, category, "TakeImage", "RawImagesRetention", true); + WriteParameter(param, category, "TakeImage", "Demo", false); + WriteParameter(param, category, "TakeImage", "WaitBeforeTakingPicture", false); + WriteParameter(param, category, "TakeImage", "ImageQuality", false); + WriteParameter(param, category, "TakeImage", "Brightness", false); + WriteParameter(param, category, "TakeImage", "Contrast", false); + WriteParameter(param, category, "TakeImage", "Saturation", false); + WriteParameter(param, category, "TakeImage", "LEDIntensity", false); + WriteParameter(param, category, "TakeImage", "ImageSize", false); + WriteParameter(param, category, "TakeImage", "FixedExposure", false); + + WriteParameter(param, category, "Alignment", "SearchFieldX", false); + WriteParameter(param, category, "Alignment", "SearchFieldY", false); + WriteParameter(param, category, "Alignment", "AlignmentAlgo", true); + WriteParameter(param, category, "Alignment", "FlipImageSize", false); + WriteParameter(param, category, "Alignment", "InitialMirror", false); + + WriteParameter(param, category, "Digits", "CNNGoodThreshold", true); + WriteParameter(param, category, "Digits", "ROIImagesLocation", true); + WriteParameter(param, category, "Digits", "ROIImagesRetention", true); + + WriteParameter(param, category, "Analog", "ROIImagesLocation", true); + WriteParameter(param, category, "Analog", "ROIImagesRetention", true); + + WriteParameter(param, category, "PostProcessing", "PreValueUse", false); + WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true); // WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true); - WriteParameter(param, category, "PostProcessing", "ErrorMessage", false); - WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", false); + WriteParameter(param, category, "PostProcessing", "ErrorMessage", false); + WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", false); - WriteParameter(param, category, "MQTT", "Uri", true); - WriteParameter(param, category, "MQTT", "MainTopic", true); - WriteParameter(param, category, "MQTT", "ClientID", true); - WriteParameter(param, category, "MQTT", "user", true); - WriteParameter(param, category, "MQTT", "password", true); - WriteParameter(param, category, "MQTT", "RetainMessages", false); - WriteParameter(param, category, "MQTT", "HomeassistantDiscovery", false); - WriteParameter(param, category, "MQTT", "MeterType", true); - - WriteParameter(param, category, "InfluxDB", "Uri", true); - WriteParameter(param, category, "InfluxDB", "Database", true); + WriteParameter(param, category, "MQTT", "Uri", true); + WriteParameter(param, category, "MQTT", "MainTopic", true); + WriteParameter(param, category, "MQTT", "ClientID", true); + WriteParameter(param, category, "MQTT", "user", true); + WriteParameter(param, category, "MQTT", "password", true); + WriteParameter(param, category, "MQTT", "RetainMessages", false); + WriteParameter(param, category, "MQTT", "HomeassistantDiscovery", false); + WriteParameter(param, category, "MQTT", "MeterType", true); + + WriteParameter(param, category, "InfluxDB", "Uri", true); + WriteParameter(param, category, "InfluxDB", "Database", true); // WriteParameter(param, category, "InfluxDB", "Measurement", true); - WriteParameter(param, category, "InfluxDB", "user", true); - WriteParameter(param, category, "InfluxDB", "password", true); + WriteParameter(param, category, "InfluxDB", "user", true); + WriteParameter(param, category, "InfluxDB", "password", true); // WriteParameter(param, category, "InfluxDB", "Field", true); - WriteParameter(param, category, "InfluxDBv2", "Uri", true); - WriteParameter(param, category, "InfluxDBv2", "Database", true); + WriteParameter(param, category, "InfluxDBv2", "Uri", true); + WriteParameter(param, category, "InfluxDBv2", "Database", true); // WriteParameter(param, category, "InfluxDBv2", "Measurement", true); - WriteParameter(param, category, "InfluxDBv2", "Org", true); - WriteParameter(param, category, "InfluxDBv2", "Token", true); + WriteParameter(param, category, "InfluxDBv2", "Org", true); + WriteParameter(param, category, "InfluxDBv2", "Token", true); // WriteParameter(param, category, "InfluxDBv2", "Field", true); - WriteParameter(param, category, "GPIO", "IO0", true); - WriteParameter(param, category, "GPIO", "IO1", true); - WriteParameter(param, category, "GPIO", "IO3", true); - WriteParameter(param, category, "GPIO", "IO4", true); - WriteParameter(param, category, "GPIO", "IO12", true); - WriteParameter(param, category, "GPIO", "IO13", true); - WriteParameter(param, category, "GPIO", "LEDType", false); - WriteParameter(param, category, "GPIO", "LEDNumbers", false); - WriteParameter(param, category, "GPIO", "LEDColor", false); + WriteParameter(param, category, "GPIO", "IO0", true); + WriteParameter(param, category, "GPIO", "IO1", true); + WriteParameter(param, category, "GPIO", "IO3", true); + WriteParameter(param, category, "GPIO", "IO4", true); + WriteParameter(param, category, "GPIO", "IO12", true); + WriteParameter(param, category, "GPIO", "IO13", true); + WriteParameter(param, category, "GPIO", "LEDType", false); + WriteParameter(param, category, "GPIO", "LEDNumbers", false); + WriteParameter(param, category, "GPIO", "LEDColor", false); - WriteParameter(param, category, "AutoTimer", "AutoStart", false); - WriteParameter(param, category, "AutoTimer", "Interval", false); + WriteParameter(param, category, "AutoTimer", "AutoStart", false); + WriteParameter(param, category, "AutoTimer", "Interval", false); - WriteParameter(param, category, "DataLogging", "DataLogActive", false); - WriteParameter(param, category, "DataLogging", "DataFilesRetention", false); + WriteParameter(param, category, "DataLogging", "DataLogActive", false); + WriteParameter(param, category, "DataLogging", "DataFilesRetention", false); - WriteParameter(param, category, "Debug", "LogLevel", false); - WriteParameter(param, category, "Debug", "LogfilesRetention", false); + WriteParameter(param, category, "Debug", "LogLevel", false); + WriteParameter(param, category, "Debug", "LogfilesRetention", false); - WriteParameter(param, category, "System", "TimeZone", true); - WriteParameter(param, category, "System", "Hostname", true); - WriteParameter(param, category, "System", "TimeServer", true); - WriteParameter(param, category, "System", "RSSIThreshold", true); - WriteParameter(param, category, "System", "CPUFrequency", true); + WriteParameter(param, category, "System", "TimeZone", true); + WriteParameter(param, category, "System", "Hostname", true); + WriteParameter(param, category, "System", "TimeServer", true); + WriteParameter(param, category, "System", "RSSIThreshold", true); + WriteParameter(param, category, "System", "CPUFrequency", true); - WriteModelFiles(); + WriteModelFiles(); } + function WriteModelFiles() { - list_tflite = getTFLITEList(); + list_tflite = getTFLITEList(); var _indexDig = document.getElementById("Digits_Model_value1"); var _indexAna = document.getElementById("Analog_Model_value1"); while (_indexDig.length) _indexDig.remove(0); - while (_indexAna.length) + while (_indexAna.length) _indexAna.remove(0); for (var i = 0; i < list_tflite.length; ++i){ @@ -1899,23 +2151,23 @@ function WriteModelFiles() var text = list_tflite[i].replace("/config/", ""); if (list_tflite[i].includes("/dig")) { // Its a digital file, only show in the digital list box - optionDig.text = text; - optionDig.value = list_tflite[i]; - _indexDig.add(optionDig); + optionDig.text = text; + optionDig.value = list_tflite[i]; + _indexDig.add(optionDig); } else if (list_tflite[i].includes("/ana")) { // Its a digital file, only show in the analog list box - optionAna.text = text; - optionAna.value = list_tflite[i]; - _indexAna.add(optionAna); + optionAna.text = text; + optionAna.value = list_tflite[i]; + _indexAna.add(optionAna); } else { // all other files, show in both list boxes - optionDig.text = text; - optionDig.value = list_tflite[i]; - _indexDig.add(optionDig); - - optionAna.text = text; - optionAna.value = list_tflite[i]; - _indexAna.add(optionAna); + optionDig.text = text; + optionDig.value = list_tflite[i]; + _indexDig.add(optionDig); + + optionAna.text = text; + optionAna.value = list_tflite[i]; + _indexAna.add(optionAna); } } @@ -1923,241 +2175,265 @@ function WriteModelFiles() WriteParameter(param, category, "Digits", "Model", false); } + function ReadParameterAll() { - category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked; - category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked; - category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked; - category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked; - category["InfluxDBv2"]["enabled"] = document.getElementById("Category_InfluxDBv2_enabled").checked; - category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked; - - ReadParameter(param, "TakeImage", "RawImagesLocation", true); - ReadParameter(param, "TakeImage", "RawImagesRetention", true); - ReadParameter(param, "TakeImage", "Demo", false); - ReadParameter(param, "TakeImage", "WaitBeforeTakingPicture", false); - ReadParameter(param, "TakeImage", "ImageQuality", false); - ReadParameter(param, "TakeImage", "Brightness", false); - ReadParameter(param, "TakeImage", "Contrast", false); - ReadParameter(param, "TakeImage", "Saturation", false); - ReadParameter(param, "TakeImage", "LEDIntensity", false); - ReadParameter(param, "TakeImage", "ImageSize", false); - ReadParameter(param, "TakeImage", "FixedExposure", false); + category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked; + category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked; + category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked; + category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked; + category["InfluxDBv2"]["enabled"] = document.getElementById("Category_InfluxDBv2_enabled").checked; + category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked; + + ReadParameter(param, "TakeImage", "RawImagesLocation", true); + ReadParameter(param, "TakeImage", "RawImagesRetention", true); + ReadParameter(param, "TakeImage", "Demo", false); + ReadParameter(param, "TakeImage", "WaitBeforeTakingPicture", false); + ReadParameter(param, "TakeImage", "ImageQuality", false); + ReadParameter(param, "TakeImage", "Brightness", false); + ReadParameter(param, "TakeImage", "Contrast", false); + ReadParameter(param, "TakeImage", "Saturation", false); + ReadParameter(param, "TakeImage", "LEDIntensity", false); + ReadParameter(param, "TakeImage", "ImageSize", false); + ReadParameter(param, "TakeImage", "FixedExposure", false); - ReadParameter(param, "Alignment", "SearchFieldX", false); - ReadParameter(param, "Alignment", "SearchFieldY", false); - ReadParameter(param, "Alignment", "AlignmentAlgo", true); + ReadParameter(param, "Alignment", "SearchFieldX", false); + ReadParameter(param, "Alignment", "SearchFieldY", false); + ReadParameter(param, "Alignment", "AlignmentAlgo", true); + ReadParameter(param, "Alignment", "FlipImageSize", false); + ReadParameter(param, "Alignment", "InitialMirror", false); - ReadParameter(param, "Digits", "Model", false); - ReadParameter(param, "Digits", "CNNGoodThreshold", true); - ReadParameter(param, "Digits", "ROIImagesLocation", true); - ReadParameter(param, "Digits", "ROIImagesRetention", true); + ReadParameter(param, "Digits", "Model", false); + ReadParameter(param, "Digits", "CNNGoodThreshold", true); + ReadParameter(param, "Digits", "ROIImagesLocation", true); + ReadParameter(param, "Digits", "ROIImagesRetention", true); - ReadParameter(param, "Analog", "Model", false); - ReadParameter(param, "Analog", "ROIImagesLocation", true); - ReadParameter(param, "Analog", "ROIImagesRetention", true); + ReadParameter(param, "Analog", "Model", false); + ReadParameter(param, "Analog", "ROIImagesLocation", true); + ReadParameter(param, "Analog", "ROIImagesRetention", true); - ReadParameter(param, "PostProcessing", "PreValueUse", false); - ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true); - ReadParameter(param, "PostProcessing", "ErrorMessage", false); - ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", false); + ReadParameter(param, "PostProcessing", "PreValueUse", false); + ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true); + ReadParameter(param, "PostProcessing", "ErrorMessage", false); + ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", false); - ReadParameter(param, "MQTT", "Uri", true); - ReadParameter(param, "MQTT", "MainTopic", true); - ReadParameter(param, "MQTT", "ClientID", true); - ReadParameter(param, "MQTT", "user", true); - ReadParameter(param, "MQTT", "password", true); - ReadParameter(param, "MQTT", "RetainMessages", false); - ReadParameter(param, "MQTT", "HomeassistantDiscovery", false); - ReadParameter(param, "MQTT", "MeterType", true); + ReadParameter(param, "MQTT", "Uri", true); + ReadParameter(param, "MQTT", "MainTopic", true); + ReadParameter(param, "MQTT", "ClientID", true); + ReadParameter(param, "MQTT", "user", true); + ReadParameter(param, "MQTT", "password", true); + ReadParameter(param, "MQTT", "RetainMessages", false); + ReadParameter(param, "MQTT", "HomeassistantDiscovery", false); + ReadParameter(param, "MQTT", "MeterType", true); - ReadParameter(param, "InfluxDB", "Uri", true); - ReadParameter(param, "InfluxDB", "Database", true); - ReadParameter(param, "InfluxDB", "Measurement", true); - ReadParameter(param, "InfluxDB", "user", true); - ReadParameter(param, "InfluxDB", "password", true); + ReadParameter(param, "InfluxDB", "Uri", true); + ReadParameter(param, "InfluxDB", "Database", true); + ReadParameter(param, "InfluxDB", "Measurement", true); + ReadParameter(param, "InfluxDB", "user", true); + ReadParameter(param, "InfluxDB", "password", true); - ReadParameter(param, "InfluxDBv2", "Uri", true); - ReadParameter(param, "InfluxDBv2", "Database", true); - ReadParameter(param, "InfluxDBv2", "Measurement", true); - ReadParameter(param, "InfluxDBv2", "Org", true); - ReadParameter(param, "InfluxDBv2", "Token", true); + ReadParameter(param, "InfluxDBv2", "Uri", true); + ReadParameter(param, "InfluxDBv2", "Database", true); + ReadParameter(param, "InfluxDBv2", "Measurement", true); + ReadParameter(param, "InfluxDBv2", "Org", true); + ReadParameter(param, "InfluxDBv2", "Token", true); // ReadParameter(param, "InfluxDB", "Field", true); - ReadParameter(param, "GPIO", "IO0", true); - ReadParameter(param, "GPIO", "IO1", true); - ReadParameter(param, "GPIO", "IO3", true); - ReadParameter(param, "GPIO", "IO4", true); - ReadParameter(param, "GPIO", "IO12", true); - ReadParameter(param, "GPIO", "IO13", true); - ReadParameter(param, "GPIO", "LEDType", false); - ReadParameter(param, "GPIO", "LEDNumbers", false); - ReadParameter(param, "GPIO", "LEDColor", false); - // Folgende Zeilen sind für Abwärtskompatibität < v9.0.0 notwendig (manchmal parameter auskommentiert) - param["GPIO"]["LEDType"]["enabled"] = true; - param["GPIO"]["LEDNumbers"]["enabled"] = true; - param["GPIO"]["LEDColor"]["enabled"] = true; - param["GPIO"]["LEDType"]["found"] = true; - param["GPIO"]["LEDNumbers"]["found"] = true; - param["GPIO"]["LEDColor"]["found"] = true; + ReadParameter(param, "GPIO", "IO0", true); + ReadParameter(param, "GPIO", "IO1", true); + ReadParameter(param, "GPIO", "IO3", true); + ReadParameter(param, "GPIO", "IO4", true); + ReadParameter(param, "GPIO", "IO12", true); + ReadParameter(param, "GPIO", "IO13", true); + ReadParameter(param, "GPIO", "LEDType", false); + ReadParameter(param, "GPIO", "LEDNumbers", false); + ReadParameter(param, "GPIO", "LEDColor", false); + // Folgende Zeilen sind für Abwärtskompatibität < v9.0.0 notwendig (manchmal parameter auskommentiert) + param["GPIO"]["LEDType"]["enabled"] = true; + param["GPIO"]["LEDNumbers"]["enabled"] = true; + param["GPIO"]["LEDColor"]["enabled"] = true; + param["GPIO"]["LEDType"]["found"] = true; + param["GPIO"]["LEDNumbers"]["found"] = true; + param["GPIO"]["LEDColor"]["found"] = true; - ReadParameter(param, "AutoTimer", "AutoStart", false); - ReadParameter(param, "AutoTimer", "Interval", false); - - ReadParameter(param, "DataLogging", "DataLogActive", false); - ReadParameter(param, "DataLogging", "DataFilesRetention", false); + ReadParameter(param, "AutoTimer", "AutoStart", false); + ReadParameter(param, "AutoTimer", "Interval", false); + + ReadParameter(param, "DataLogging", "DataLogActive", false); + ReadParameter(param, "DataLogging", "DataFilesRetention", false); - ReadParameter(param, "Debug", "LogLevel", false); - ReadParameter(param, "Debug", "LogfilesRetention", false); + ReadParameter(param, "Debug", "LogLevel", false); + ReadParameter(param, "Debug", "LogfilesRetention", false); - ReadParameter(param, "System", "TimeZone", true); - ReadParameter(param, "System", "Hostname", true); - ReadParameter(param, "System", "TimeServer", true); - ReadParameter(param, "System", "RSSIThreshold", true); - ReadParameter(param, "System", "CPUFrequency", true); + ReadParameter(param, "System", "TimeZone", true); + ReadParameter(param, "System", "Hostname", true); + ReadParameter(param, "System", "TimeServer", true); + ReadParameter(param, "System", "RSSIThreshold", true); + ReadParameter(param, "System", "CPUFrequency", true); - var sel = document.getElementById("Numbers_value1"); - UpdateInputIndividual(sel); - + var sel = document.getElementById("Numbers_value1"); + UpdateInputIndividual(sel); + // FormatDecimalValue(param, "PostProcessing", "MaxRateValue"); } function FormatDecimalValue(_param, _cat, _name) { - for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) { - var _val = _param[_cat][_name]["value"+j]; - _val = _val.replace(",", "."); - _param[_cat][_name]["value"+j] = _val; - } + for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) { + var _val = _param[_cat][_name]["value"+j]; + _val = _val.replace(",", "."); + _param[_cat][_name]["value"+j] = _val; + } } + function UpdateAfterCategoryCheck() { - ReadParameterAll(); - category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked; - category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked; - category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked; - category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked; - category["InfluxDBv2"]["enabled"] = document.getElementById("Category_InfluxDBv2_enabled").checked; - category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked; + ReadParameterAll(); + category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked; + category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked; + category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked; + category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked; + category["InfluxDBv2"]["enabled"] = document.getElementById("Category_InfluxDBv2_enabled").checked; + category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked; - UpdateInput(); - var sel = document.getElementById("Numbers_value1"); - UpdateInputIndividual(sel); + UpdateInput(); + var sel = document.getElementById("Numbers_value1"); + UpdateInputIndividual(sel); } + function UpdateExpertModus() { // var _style = 'display:none;'; - var _style_pur = 'none'; - var _hidden = true; - if (document.getElementById("ExpertModus_enabled").checked) { + var _style_pur = 'none'; + var _hidden = true; + if (document.getElementById("ExpertModus_enabled").checked) { // _style = ''; - _style_pur = ''; - _hidden = false; - document.getElementById("Edit_Config_Direct").style.display = ""; - } - else - { - document.getElementById("Edit_Config_Direct").style.display = "none"; - } + _style_pur = ''; + _hidden = false; + document.getElementById("Edit_Config_Direct").style.display = ""; + firework.launch("Expert view activated. Please use carefully", 'warning', 5000); + } + else + { + document.getElementById("Edit_Config_Direct").style.display = "none"; + } - const expert = document.querySelectorAll(".expert"); - for (var i = 0; i < expert.length; i++) { - expert[i].style.display = _style_pur; + const expert = document.querySelectorAll(".expert"); + for (var i = 0; i < expert.length; i++) { + expert[i].style.display = _style_pur; // document.getElementById(expert[i].id).style = _style; - } + } + // Enable / Disable die Optionen in den Menues für die Auswahl. Falls kein Expertenmodus soll nur ein Wert (built-in-led oder externan-flash-ws281x) möglich sein + Array.from(document.querySelector("#GPIO_IO4_value1").options).forEach(function(option_element) { + if (option_element.value != "built-in-led") + option_element.hidden = _hidden; + }); - // Enable / Disable die Optionen in den Menues für die Auswahl. Falls kein Expertenmodus soll nur ein Wert (built-in-led oder externan-flash-ws281x) möglich sein - Array.from(document.querySelector("#GPIO_IO4_value1").options).forEach(function(option_element) { - if (option_element.value != "built-in-led") - option_element.hidden = _hidden; - }); - - Array.from(document.querySelector("#GPIO_IO12_value1").options).forEach(function(option_element) { - if (option_element.value != "external-flash-ws281x") - option_element.hidden = _hidden; - }); - + Array.from(document.querySelector("#GPIO_IO12_value1").options).forEach(function(option_element) { + if (option_element.value != "external-flash-ws281x") + option_element.hidden = _hidden; + }); } + function saveTextAsFile() { - ReadParameterAll(); - if (document.getElementsByClassName("invalid-input").length > 0) { - firework.launch("Settings cannot be saved. Please check your entries!", 'danger', 30000); - return; - } + ReadParameterAll(); + if (document.getElementsByClassName("invalid-input").length > 0) { + firework.launch("Settings cannot be saved. Please check your entries!", 'danger', 30000); + return; + } - if (confirm("Are you sure you want to update \"config.ini\"?")) { - ReadParameterAll(); - WriteConfigININew(); - SaveConfigToServer(domainname); - firework.launch('Configuration got updated. It will get applied after the next reboot!', 'success', 5000); - } + if (confirm("Are you sure you want to save the configuration?")) { + ReadParameterAll(); + WriteConfigININew(); + SaveConfigToServer(domainname); + + firework.launch('Configuration saved. It will get applied after the next reboot!', 'success', 5000); + } } + function doReboot() { - if (confirm("Are you sure you want to reboot the ESP32?")) { - var stringota = getDomainname() + "/reboot"; - window.location = stringota; - window.location.href = stringota; - window.location.assign(stringota); - window.location.replace(stringota); - } + if (confirm("Are you sure you want to reboot?")) { + var stringota = getDomainname() + "/reboot"; + window.location = stringota; + window.location.href = stringota; + window.location.assign(stringota); + window.location.replace(stringota); + } } + function editConfigDirect() { - if (confirm("Did you save your changes?")) { - var stringota = getDomainname() + "/edit_config.html?v=$COMMIT_HASH"; - window.location = stringota; - window.location.href = stringota; - window.location.assign(stringota); - window.location.replace(stringota); - } + if (confirm("Proceed to switch the view? Unsaved changes get lost")) { + var stringota = getDomainname() + "/edit_config.html?v=$COMMIT_HASH"; + window.location = stringota; + window.location.href = stringota; + window.location.assign(stringota); + window.location.replace(stringota); + } } + function numberChanged() { - var sel = document.getElementById("Numbers_value1"); - _neu = sel.selectedIndex; - UpdateInputIndividual(sel); + var sel = document.getElementById("Numbers_value1"); + _neu = sel.selectedIndex; + UpdateInputIndividual(sel); - var _selInflux = document.getElementById("NumbersInfluxDBv2_value1"); - if (_selInflux.selectedIndex != _neu) - _selInflux.selectedIndex = _neu + var _selInflux = document.getElementById("NumbersInfluxDBv2_value1"); + if (_selInflux.selectedIndex != _neu) + _selInflux.selectedIndex = _neu } - + + function numberInfluxDBv2Changed() { - var sel = document.getElementById("NumbersInfluxDBv2_value1"); - _neu = sel.selectedIndex; - UpdateInputIndividual(sel); + var sel = document.getElementById("NumbersInfluxDBv2_value1"); + _neu = sel.selectedIndex; + UpdateInputIndividual(sel); - var _sel2 = document.getElementById("Numbers_value1"); - if (_sel2.selectedIndex != _neu) - _sel2.selectedIndex = _neu + var _sel2 = document.getElementById("Numbers_value1"); + if (_sel2.selectedIndex != _neu) + _sel2.selectedIndex = _neu - var _sel3 = document.getElementById("NumbersInfluxDB_value1"); - if (_sel3.selectedIndex != _neu) - _sel3.selectedIndex = _neu + var _sel3 = document.getElementById("NumbersInfluxDB_value1"); + if (_sel3.selectedIndex != _neu) + _sel3.selectedIndex = _neu } + function numberInfluxDBChanged() { - var sel = document.getElementById("NumbersInfluxDB_value1"); - _neu = sel.selectedIndex; - UpdateInputIndividual(sel); + var sel = document.getElementById("NumbersInfluxDB_value1"); + _neu = sel.selectedIndex; + UpdateInputIndividual(sel); + + var _sel2 = document.getElementById("Numbers_value1"); + if (_sel2.selectedIndex != _neu) + _sel2.selectedIndex = _neu - var _sel2 = document.getElementById("Numbers_value1"); - if (_sel2.selectedIndex != _neu) - _sel2.selectedIndex = _neu - - var _sel3 = document.getElementById("NumbersInfluxDBv2_value1"); - if (_sel3.selectedIndex != _neu) - _sel3.selectedIndex = _neu + var _sel3 = document.getElementById("NumbersInfluxDBv2_value1"); + if (_sel3.selectedIndex != _neu) + _sel3.selectedIndex = _neu } + /* hash #description open the details part of the page */ +function openDescription() +{ + if(window.location.hash) { + var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character + if(hash == 'description') + document.getElementById("desc_details").open = true; + document.getElementById("reboot").style.display = "none"; + document.getElementById("reboot_text").style.display = "none"; + } +} + +openDescription(); LoadConfigNeu(); diff --git a/sd-card/html/edit_digits.html b/sd-card/html/edit_digits.html index 12b70356..05beee72 100644 --- a/sd-card/html/edit_digits.html +++ b/sd-card/html/edit_digits.html @@ -1,137 +1,212 @@ - + - - -Digit ROI's + + Digit ROI - + + + + -th, td { - padding: 5px 5px 5px 0px; -} - - - - -

Digit ROI's

-

On this page you define ROI's for the digits. - See https://jomjol.github.io/AI-on-the-edge-device-docs/ROI-Configuration/ for explanations.

- -

+

Digit ROI

+
+ CLICK HERE for usage description. More infos in documentation: + ROI Configuration + +

+ Region Of Interest (ROI) for digit numbers can be defined on this page. If no digit numbers need to be processed, + disable digit processing by deselecting "Digit ROI Processing". +

+

+ By default one number sequence (a number seqence contains of 1-x digit ROIs + 1-x analog counter ROIs which are processed together) is + predefined and already selected in the drop down "Number sequence". If you need more than one number sequence additional + one's can be added with the buttons next to the drop down. Each number sequence will be processed separately. +

+

+ Using drag and drop by mouse of by manually entering the parameters into the given fields the digit ROIs can be positined to the digit numbers + on the reference image. To have proper ROI definition please check the documentation: + ROI Configuration. It's very important to be + really precise to have reliable processing. With the drop down "ROI" you can change between the different ROIs in the selected + number sequence. To create new ROIs use "New ROI". +

+

+ The order of the ROIs defines the position (and therefore the multiplication factor) within the reading sequence. The position + in the number sequence can be changed with the buttons "Move ROI Lower" and "Move ROI Higher". The multiplication factor which is + shown below the ROI drop down is the multiplication factor of pure position/order in number sequence and the factor right-hand side to this is + the additionally corrected by decimal shift setting (configuration, expert parameter, default: 0). +

+

+ After definition of digit ROIs is completed don't forget to save with the "Save Config" button!
+ NOTE: There is no need to perform a reboot after every saving or step. It's sufficient to reboot after all configuration steps + (reference image, alignment, ROI configuration) are completed to activate new configuration. +

+
+
+ +

+ + +

-

After saving the digit ROI's, you can define the analog ROI's if your meter has analog counters.
- Only after those steps a reboot is required.

-
- - - - -
- -

- - - Number: +
+ + + + + + + + + + + -
Number Sequence:
- - - -
-

- + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ROI:
Multiplier:
+ (only based on order) +
Multiplier:
+ (order + decimal shift: ) +
+ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
- - - - - - -
x: Δx:
y: Δy:
-
x: Δx:
y: Δy:
+ +
-
- + - - - -
-

Proceed to update the analog ROI's when you are done or reboot if there are no analogue counters.

+ + + + + + + + Reference Image: + + + + + + @@ -183,6 +258,7 @@ function EnDisableDigits() { sah1(document.getElementById("div1"), !isEnabled); cofcat["Digits"]["enabled"] = isEnabled; + document.getElementById("saveroi").disabled = false; if (isEnabled) { @@ -208,6 +284,10 @@ function onNameChange(){ } function deleteROI(){ + if (!confirm("Delete the selected ROI?")) { + return; //break out of the function early because prompt was aborted + } + ROIInfo.splice(aktindex, 1); if (aktindex > ROIInfo.length - 1){ aktindex = ROIInfo.length - 1; @@ -222,7 +302,10 @@ function newROI() { sel = document.getElementById("index"); var _roialt= sel.options[sel.selectedIndex].text; - var _roinew = prompt("Please enter name of new ROI", "name"); + var _roinew = prompt("Please enter a name for the new ROI", "name"); + if (_roinew === null) { + return; //break out of the function early because prompt was aborted + } if (ROIInfo.length > 0) { if (ROIInfo.length > 1) { @@ -232,7 +315,7 @@ function newROI() { parseInt(ROIInfo[sel.selectedIndex].y), ROIInfo[aktindex]["dx"], ROIInfo[aktindex]["dy"], 0); } else - erg = CreateROI(_number, "digit", sel.selectedIndex, _roinew, 1, 1, 30, 51, 0); + erg = CreateROI(_number, "digit", sel.selectedIndex, _roinew, 15, 30, 30, 51, 0); if (erg != "") firework.launch(erg, 'danger', 30000); @@ -274,7 +357,7 @@ function changelockSizes(){ valuemanualchangedspace(); if (!lockSizes) { - firework.launch("For best results it is in most cases advised to keep the y, Δx and Δy identical!", 'warning', 10000); + firework.launch("In most cases it's advised to keep the y, Δx and Δy identical!", 'warning', 10000); } } @@ -296,11 +379,56 @@ function ChangeSelection(){ } function SaveToConfig(){ -// _zwcat = getConfigCategory(); - cofcat["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked; - WriteConfigININew(); - SaveConfigToServer(domainname); - firework.launch('Configuration got updated. It will get applied after the next reboot!', 'success', 5000); + if (confirm("Are you sure you want to save the new digit ROI configuration?")) { + // _zwcat = getConfigCategory(); + cofcat["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked; + WriteConfigININew(); + SaveConfigToServer(domainname); + UpdateROIs(); + document.getElementById("saveroi").disabled = true; + + firework.launch('Configuration saved. It will get applied after next reboot', 'success', 5000); + } +} + + +function ShowMultiplier(){ + var decimalShift = 0; + var negShift = false; + var multiplier = multiplier_decshift = ROIInfo.length-1-aktindex; + var fixedDecimals_decshift = ROIInfo.length-1-aktindex; + var NumberInfo = getNUMBERInfo(); + + var sel = document.getElementById("Numbers_value1"); + var _number= sel.options[sel.selectedIndex].text; + var NumbersIndex = 0; + for (var i = 0; i < NumberInfo.length; ++i) + if (NumberInfo[i]["name"] == _number) + NumbersIndex = i; + + if (NumberInfo[NumbersIndex]["PostProcessing"]["DecimalShift"]["enabled"]) { + decimalShift = NumberInfo[NumbersIndex]["PostProcessing"]["DecimalShift"]["value1"]; + document.getElementById("decimalShift").value=decimalShift; + multiplier_decshift = multiplier_decshift+Number(decimalShift); + fixedDecimals_decshift = fixedDecimals_decshift+Number(decimalShift); // set to fixed decimals to avoid rounding issues + + if (fixedDecimals_decshift < 0) { + negShift = true + fixedDecimals_decshift = -1*fixedDecimals_decshift; + } + } + else { + document.getElementById("decimalShift").value=0; + } + + if (!negShift) { + document.getElementById("multiplier").value="x" + Number(10 ** multiplier).toFixed(0); + document.getElementById("multiplier_decshift").value="x" + Number(10 ** multiplier_decshift).toFixed(0); + } + else { + document.getElementById("multiplier").value="x" + Number(10 ** multiplier).toFixed(0); + document.getElementById("multiplier_decshift").value="x" + Number(10 ** multiplier_decshift).toFixed(fixedDecimals_decshift); + } } @@ -316,19 +444,28 @@ function UpdateROIs(_sel){ { document.getElementById("Category_Digits_enabled").checked = false; EnDisableDigits(); - firework.launch('Digital ROIs are disabled - please enable first (Check box top left)', 'warning', 10000); + firework.launch('Digit ROI processing is disabled. Activate with checkbox if needed', 'warning', 10000); return; } if (ROIInfo.length == 0){ - firework.launch('There are no ROIs defined. Please first create a new ROI ("New ROIs ...")', 'danger', 10000); + firework.launch('No digit ROIs defined in selected number sequence', 'warning', 10000); document.getElementById("newROI").disabled = false; document.getElementById("deleteROI").disabled = true; - document.getElementById("index").disabled = true; - document.getElementById("saveroi").disabled = true; document.getElementById("renameROI").disabled = true; + document.getElementById("index").disabled = true; + document.getElementById("multiplier").style.display = "none"; + document.getElementById("multiplier_decshift").style.display = "none"; + document.getElementById("refx").disabled = true; + document.getElementById("refdx").disabled = true; + document.getElementById("refy").disabled = true; + document.getElementById("refdy").disabled = true; + document.getElementById("lockSizes").disabled = true; + document.getElementById("lockAspectRatio").disabled = true; + document.getElementById("lockSpaceEquidistant").disabled = true; document.getElementById("moveNext").disabled = true; document.getElementById("movePrevious").disabled = true; + document.getElementById("saveroi").disabled = false; return; } else @@ -337,6 +474,15 @@ function UpdateROIs(_sel){ document.getElementById("deleteROI").disabled = false; document.getElementById("renameROI").disabled = false; document.getElementById("index").disabled = false; + document.getElementById("multiplier").style.display = ""; + document.getElementById("multiplier_decshift").style.display = ""; + document.getElementById("refx").disabled = false; + document.getElementById("refdx").disabled = false; + document.getElementById("refy").disabled = false; + document.getElementById("refdy").disabled = false; + document.getElementById("lockSizes").disabled = false; + document.getElementById("lockAspectRatio").disabled = false; + document.getElementById("lockSpaceEquidistant").disabled = false; document.getElementById("saveroi").disabled = false; } @@ -346,7 +492,7 @@ function UpdateROIs(_sel){ } if (aktindex > ROIInfo.length) - aktindex = ROIInfo.length; + aktindex = ROIInfo.length-1; for (var i = 0; i < ROIInfo.length; ++i){ var option = document.createElement("option"); @@ -369,7 +515,9 @@ function UpdateROIs(_sel){ document.getElementById("moveNext").disabled = false; if (aktindex == (ROIInfo.length-1)){ document.getElementById("moveNext").disabled = true; - } + } + + ShowMultiplier(); document.getElementById("lockAspectRatio").checked = lockAspectRatio; document.getElementById("lockSizes").checked = lockSizes; @@ -390,7 +538,7 @@ function UpdateROIs(_sel){ rect.startY = ROIInfo[aktindex]["y"]; rect.w = ROIInfo[aktindex]["dx"]; rect.h = ROIInfo[aktindex]["dy"]; - draw(); + draw(); } function loadCanvas(dataURL) { @@ -420,8 +568,20 @@ function UpdateROIs(_sel){ var left = box.left + scrollLeft - clientLeft; return { top: Math.round(top), left: Math.round(left) }; } + + + /* hash #description open the details part of the page */ + function openDescription() { + if(window.location.hash) { + var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character + if(hash == 'description') + document.getElementById("desc_details").open = true; + } + } + function init() { + openDescription(); domainname = getDomainname(); canvas.addEventListener('mousedown', mouseDown, false); canvas.addEventListener('mouseup', mouseUp, false); @@ -481,6 +641,8 @@ function UpdateROIs(_sel){ document.getElementById("space").value = space; } + document.getElementById("saveroi").disabled = true; + drawImage(); draw(); } @@ -523,10 +685,13 @@ function UpdateNUMBERS(_sel){ function renameNumber(){ var sel = document.getElementById("Numbers_value1"); - var _delte= sel.options[sel.selectedIndex].text; - var _numbernew = prompt("Please enter new name", _delte); + var _delete= sel.options[sel.selectedIndex].text; + var _numbernew = prompt("Please enter a new name for the selected number sequence", _delete); + if (_numbernew === null) { + return; //break out of the function early because prompt was aborted + } - erg = RenameNUMBER(_delte, _numbernew); + erg = RenameNUMBER(_delete, _numbernew); if (erg != "") firework.launch(erg, 'danger', 30000); else @@ -534,21 +699,27 @@ function renameNumber(){ } function newNumber(){ - var _numbernew = prompt("Please enter name of new number", "name"); + var _numbernew = prompt("Please enter a name for the new number sequence", "name"); + if (_numbernew === null) { + return; //break out of the function early because prompt was aborted + } erg = CreateNUMBER(_numbernew); if (erg != "") - firework.launch(erg, 'danger', 30000); + firework.launch(erg, 'danger', 30000); else UpdateNUMBERS(_numbernew); } function removeNumber(){ - if (confirm("This will remove the number complete (analog and digital).\nIf you only want to remove the digital ROIs, please use \"Delete ROIs\".\nDo you want to proceed?")) { + if (confirm("The entire number sequence will be removed (digit + analog parts). " + + "To remove single ROI of the number sequence, use \"Delete ROI\" instead.\n" + + "Do you really want to proceed?")) + { var sel = document.getElementById("Numbers_value1"); - var _delte= sel.options[sel.selectedIndex].text; - erg = DeleteNUMBER(_delte); + var _delete= sel.options[sel.selectedIndex].text; + erg = DeleteNUMBER(_delete); if (erg != "") firework.launch(erg, 'danger', 30000); UpdateNUMBERS(); @@ -755,6 +926,7 @@ function draw() { } draw(); } + document.getElementById("saveroi").disabled = false; } function valuemanualchangeddx(){ @@ -780,6 +952,7 @@ function draw() { draw(); } + document.getElementById("saveroi").disabled = false; } function valuemanualchangedspace(){ @@ -821,8 +994,10 @@ function draw() { sel = document.getElementById("index"); var _roialt= sel.options[sel.selectedIndex].text; - - var _roinew = prompt("Please enter new name", _roialt); + var _roinew = prompt("Please enter a new name for the selected ROI", _roialt); + if (_roinew === null) { + return; //break out of the function early because prompt was aborted + } erg = RenameROI(_number, "digit", _roialt, _roinew); if (erg != "") @@ -833,6 +1008,7 @@ function draw() { function numberChanged() { + aktindex = 0; UpdateROIs(); } diff --git a/sd-card/html/edit_explain_0.html b/sd-card/html/edit_explain_0.html index 64aea8b1..c2f12129 100644 --- a/sd-card/html/edit_explain_0.html +++ b/sd-card/html/edit_explain_0.html @@ -1,10 +1,8 @@ - + - AI on the edge - - + + + + + + + + +

Step 7 / 7: Initial setup completed!

+ +

+ Congratulations! You have completed the initial setup and you are now ready to restart to the regular operation mode! +

+

+ Once you push the button below, the setup mode will be completed and the device will be automatically restart to regular web interface. + If configuration is error free, the device will automatically start with first processing. It will take some time until you get the first reading. +

+

+ +

+ + + + + + + + + diff --git a/sd-card/html/edit_explain_6.html b/sd-card/html/edit_explain_7_abort.html similarity index 50% rename from sd-card/html/edit_explain_6.html rename to sd-card/html/edit_explain_7_abort.html index 9af52302..3e66fd1e 100644 --- a/sd-card/html/edit_explain_6.html +++ b/sd-card/html/edit_explain_7_abort.html @@ -1,10 +1,8 @@ - + - AI on the edge - - + - - - + input:invalid { + background-color: rgba(255, 0, 0, 0.25); + border: 1px solid red; + } + + .button { + padding: 5px 10px; + width: 205px; + font-size: 16px; + } + + th, td { + padding: 5px 5px 5px 0px; + } + + table { + width: 660px; + padding: 5px; + } + + + + +

Reference Image

-

On this page you define the Reference Image. - See https://jomjol.github.io/AI-on-the-edge-device-docs/Reference-Image/ for explanations.

-

After saving a new Reference Image, make sure to update the Alignment Marks and then - the digit resp. analog ROI's.
- Only after those steps a reboot is required.

+
+ CLICK HERE for usage description. More infos in documentation: + Reference Image + +

+ The reference image is the base image on which the alignment markers, digit ROIs and anlog ROIs will be defined. +

+

+ Firstly the actual saved reference image is shown. If you start with the setup from scratch a default image is shown as placeholder. + Use the button "Create New Reference" to start creation of your own reference image. After selecting the button all configured parameter + will be applied to the shown image. With the button "Update Image" you can update the image (still all parameter + get applied to the new image). +

+

+ To have reliable evaluation processing a properly horizontal aligned evaluation area is mandatory. Using the parameters "Rotation angle" and + "Rotation angle (Fine-tune)" the image can be rotated in both directions. The resulting rotation anlge is used to prerotate the image before + the alignment algorithm is processed to compensate only small misalignments. Further information can be found in documenation: + Reference Image +

+

+ After setting up your reference image don't forget to save with the "Save New Reference" button!
+ NOTE: There is no need to perform a reboot after every saving or step. It's sufficient to reboot after all configuration steps + (reference image, alignment, ROI configuration) are completed to activate new configuration. +

+
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- LEDIntensity: - -
- Brightness: - -
Degrees - Contrast - -
Degrees - Saturation - -
- - - - - - - - -
-

Proceed to update the Alignment Marks when you are done.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ LED intensity: + + +
+ Brightness: + + + 0 +
+ degree + + Contrast: + + + 0 +
+ degree + + Saturation: + + + 0 +
+ + + + + + + + + + + + + + +
Reference Image: + +
@@ -102,7 +177,6 @@ table { - diff --git a/sd-card/html/explain_1.html b/sd-card/html/explain_1.html index 0a15e9db..da6785b0 100644 --- a/sd-card/html/explain_1.html +++ b/sd-card/html/explain_1.html @@ -1,34 +1,33 @@ - + + - AI on the edge - - + -

Step 1: Define a Reference Image

-The reference image is the base to define the digits, counters and references positions. -

- Firstly you see the default image. Use the Button "Create New Reference" to start to create your own reference image.
- Most important feature is a straight alignment of the image. Use the Pre-rotate angle and the fine alignment to adjust the rotation of the image. -

-

- Don't forget to save your changes with the "Save" button! -

+

Step 1 / 7: Adjust Focus And Verify Flashlight

+ Firstly you have find a proper mounting position and potentially have to adjust the focus of the camera lens to get a sharp and crisp image. + This live stream with flashlight on could be helpful for this task. More details about adjusting the camera lens can be found here: + Focus Adjustment
+ Additionally it should be verfied that the flashlight is not creating any distrubing reflection in the processing relevant areas. + Beside using the built-in internal flash LED it's also possible to attach additional external LEDs to the device to have more possiblities + to get proper light condition. Please read the documentation if you'd like to use extenal LEDs: + Installation Of External LEDs +

+ NOTE: The flashlight indensity is set to default (50%) for initial verfication in this step and can be modified in next step. After modification + you can come back to this step if you'd like to test with adjusted light intensity.
+ The live stream can also be called at any time also after setup mode is completed on regular web interface. +

diff --git a/sd-card/html/explain_2.html b/sd-card/html/explain_2.html index 76812db6..8187889f 100644 --- a/sd-card/html/explain_2.html +++ b/sd-card/html/explain_2.html @@ -1,34 +1,21 @@ - + + - AI on the edge - - + -

Step 2: Define two Alignment Marks

-Two opposite alignment marks are needed to identify unique fix points on the image. -

- Mark the reference by drag and dop with the mouse or with the coordinates and push "Update Reference". -
- You can switch between the two reference with "Select Reference". -

-

- Don't forget to save your changes with the "Save" button! -

+

Step 2 / 7: Create A Reference Image

diff --git a/sd-card/html/explain_3.html b/sd-card/html/explain_3.html index 8742a8ac..860cae34 100644 --- a/sd-card/html/explain_3.html +++ b/sd-card/html/explain_3.html @@ -1,36 +1,21 @@ - + + - AI on the edge - - + -

Step 3: Define ROI's for your Digits

-Here you define your digits you want to read. If you have more than one number on the reading you can define several numbers with the "Number" selector. There you can also define new numbers. -

- With the drop down menue "ROI x" you can change between the different digits. Mark them with the mouse or the coordinates. -
- To create new ROIs use "New ROIs". The order of the ROIs defines the positon within the reading.
- You can change it with "move Next" / "move Previous". -

-

- Don't forget to save your changes with the "Save" button! -

+

Step 3 / 7: Definement Of Alignment Marker

diff --git a/sd-card/html/explain_4.html b/sd-card/html/explain_4.html index 0fbb9e54..1df0c15a 100644 --- a/sd-card/html/explain_4.html +++ b/sd-card/html/explain_4.html @@ -1,35 +1,21 @@ - + + - AI on the edge - - + -

Step 4: Define ROI's for your Analog Counters

-Here you define your analog counters you want to read. If you have more than one number on the reading you can define several numbers with the "Number" selector. There you can also define new numbers. If you do not have analog counters delete all ROIs. -

- With the drop down menue "ROI x" you can change between the different counters. Mark them with the mouse or the coordinates. -
- To create new ROIs use "New ROIs". The order of the ROIs defines the positon within the reading.
- You can change it with "move Next" / "move Previous". -

-

- Don't forget to save your changes with the "Save" button! -

+

Step 4 / 7: Configuration Of ROIs For Digit Numbers

diff --git a/sd-card/html/explain_5.html b/sd-card/html/explain_5.html index 4c1ddd63..2610fa46 100644 --- a/sd-card/html/explain_5.html +++ b/sd-card/html/explain_5.html @@ -1,31 +1,21 @@ - - - -AI on the edge - - + - -

Step 5: General Configuration Settings

-

Here you can define additional settings. The default settings should fit for a normal/initial setup.

-

You will also be able to change them later, so don't worry if you do not understand the parameters yet!

-

-

- Don't forget to save your changes with the "Save" button! -

+

Step 5 / 7: Configuration Of ROIs For Analog Counters

- + \ No newline at end of file diff --git a/sd-card/html/explain_6.html b/sd-card/html/explain_6.html index 7fbc484a..29020f5e 100644 --- a/sd-card/html/explain_6.html +++ b/sd-card/html/explain_6.html @@ -1 +1,23 @@ - \ No newline at end of file + + + + +AI on the edge + + + + + + + +

Step 6 / 7: Configuration Page: List Of All Parameters

+

+ NOTE: All parameter can be edited later in the regular web interface. So don't worry if you do not understand the parameters yet! +

+ + diff --git a/sd-card/html/explain_7.html b/sd-card/html/explain_7.html new file mode 100644 index 00000000..7fbc484a --- /dev/null +++ b/sd-card/html/explain_7.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sd-card/html/file_server.html b/sd-card/html/file_server.html index 51cf37c5..59189266 100644 --- a/sd-card/html/file_server.html +++ b/sd-card/html/file_server.html @@ -1,9 +1,15 @@ - + + - - - - - - - -
-

Content on SD-Card

-
- + + +
- - + - - -
- + +

Fileserver

- + + + + + + + + + + + + +
+ + + +
+ + + + + +
- - - - - + + +
-
-      -
- - + + checkAtRootLevel(); - + console.log("Current path: " + getPath().replace("/fileserver", "")); + document.getElementById("currentpath").innerHTML = "Current path: " + getPath().replace("/fileserver", "") + ""; + + document.cookie = "page=" + getPath() + "; path=/"; + + + \ No newline at end of file diff --git a/sd-card/html/firework.css b/sd-card/html/firework.css index e905579e..db3cd49c 100644 --- a/sd-card/html/firework.css +++ b/sd-card/html/firework.css @@ -4,13 +4,15 @@ border-color: #888; border-radius: 6px; color: #fff; - left: 200px; + left: 10%; padding: 5px; position: fixed; opacity: 0; text-align: center; top: 0px; - width: 600px; + width: 80%; + min-width:30%; + max-width:580px; z-index: 99; font-size:120%; } diff --git a/sd-card/html/firework.js b/sd-card/html/firework.js index 19bbfc56..46306a10 100644 --- a/sd-card/html/firework.js +++ b/sd-card/html/firework.js @@ -29,7 +29,7 @@ p += parseInt($(this).height()) + 30 }); - $('
'+ m +'
') + $('
'+ m +'
') .appendTo('body') .animate({ opacity: 1, diff --git a/sd-card/html/graph.html b/sd-card/html/graph.html index 74843d55..fc46aeb9 100644 --- a/sd-card/html/graph.html +++ b/sd-card/html/graph.html @@ -1,16 +1,40 @@ - - + + + + Data Graph - + + - + - - -

Data Graph

-

Loading...

- - - - -   |   - - + - + +

Data Graph

+

Loading...

+ Number sequence: + + Day: + +

+ + + diff --git a/sd-card/html/index.html b/sd-card/html/index.html index b624afff..d4ea6fa1 100644 --- a/sd-card/html/index.html +++ b/sd-card/html/index.html @@ -1,65 +1,76 @@ - + - -AI on the edge - - - - + + AI on the edge + + + + - - - + + + - - - + + - + function resetMenu() { + [].forEach.call(document.querySelectorAll('.submenu'), function (el) { + el.style.visibility = 'visible'; + }); + } + + function getCookie(cname) { + let name = cname + "="; + let decodedCookie = decodeURIComponent(document.cookie); + let ca = decodedCookie.split(';'); + for(let i = 0; i
- - - +

Digitizer - AI on the edge

-

An ESP32 all inclusive neural network recognition system for meter digitalization

-
+ + + +

Digitizer - AI on the edge

+

An ESP32 all inclusive neural network recognition system for meter digitalization

+
- + -Loading version... +Loading version... + } + console.log("Loading page: " + getCookie("page")); + document.getElementById('maincontent').src = getCookie("page"); -
+ + function flow_start() { + var url = getDomainname() + '/flow_start'; + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + if (xhttp.responseText.substring(0,3) == "001") { + firework.launch('Flow start triggered', 'success', 5000); + window.location.reload(); + } + else if (xhttp.responseText.substring(0,3) == "002") { + firework.launch('Flow start scheduled. Start after round is completed', 'success', 5000); + } + else if (xhttp.responseText.substring(0,3) == "099") { + firework.launch('Flow start triggered, but start not possible (no flow task available)', 'danger', 5000); + } + } + } + xhttp.open("GET", url, true); + xhttp.send(); + } + + + function HA_send_discovery_visiblilty() { + loadConfig(domainname); + ParseConfig(); + category = getConfigCategory(); + param = getConfigParameters(); + if (category["MQTT"]["enabled"] && param["MQTT"]["HomeassistantDiscovery"]["value1"] == "true") + document.getElementById("HASendDiscovery").style.display=""; + } + + + function HA_send_discovery() { + var url = getDomainname() + '/mqtt_publish_discovery'; + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + firework.launch('Sending HA discovery topics scheduled. The sending will be processed in state "Publish to MQTT"', 'success', 5000); + } + } + xhttp.open("GET", url, true); + xhttp.send(); + } + + + function start_livestream(streamFlashlight) { + if (streamPopup) + streamPopup.close(); + + if (streamFlashlight) + streamPopup = window.open(getDomainname() + '/stream?flashlight=true','LivestreamWithlight',streamWindowFeatures); + else + streamPopup = window.open(getDomainname() + '/stream','Livestream',streamWindowFeatures); + + streamPopup.focus(); + } + diff --git a/sd-card/html/info.html b/sd-card/html/info.html index 08fd57e6..9ab7d94a 100644 --- a/sd-card/html/info.html +++ b/sd-card/html/info.html @@ -1,9 +1,8 @@ - + - Info - + + -

Runtime Information

- - - - - - - - - -
- Last restart: - -
- -
-
- Uptime: - -
- -
-
+ + + + + + +

Runtime Information

+ + + + + + + + + +
Start time:
Uptime:
-

Build Info

- - - - - - - - - +
- Firmware Version: - -
- -
-
- Firmware Build Time: - -
- -
-
+ + + + + +

Build Info

+ + + + + + + + + - - - - -
Firmware version: + +
Firmware build time: + +
- Web Interface Version: - -
- -
-
+ + Web interface version: + + + + + -

Host Info

- - - - - - - - - - - - - -
- Hostname: - -
- -
-
- IP-Address: - -
- -
-
- WLan-SSID: - -
- -
-
+ + + + + + +

Host Info

+ + + + + + + + + + + + + +
Hostname: + +
IP Address: + +
WLAN SSID: + +
+ + + + + + + +

SD Card Info

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SD card manufacturer: + +
SD card name: + +
SD card size: + +
SD card sector size: + +
Partition size: + +
Partition free space: + +
Partition allocation size: + +
+ + + + + + + +

Memory Info

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Total Free (Int + Ext): + +
Ext. RAM - Free: + +
Ext. RAM - Largest Free Block: + +
Ext. RAM - Min Free: + +
Int. RAM - Free: + +
Int. RAM - Largest Free Block: + +
Int. RAM - Min Free: + +
-

SD Card Info

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- SD Card Manufacturer: - -
- -
-
- SD Card Name: - -
- -
-
- SD Card Size [MB]: - -
- -
-
- SD Card Sector Size [byte]: - -
- -
-
- Partition Size [MB]: - -
- -
-
- Partition Free Space [MB]: - -
- -
-
- Partition Allocation Size [byte]: - -
- -
-

Copyright

Copyright © 2020 - 2023 by Jomjol and others. + + diff --git a/sd-card/html/log.html b/sd-card/html/log.html index cad504f5..503941f4 100644 --- a/sd-card/html/log.html +++ b/sd-card/html/log.html @@ -1,16 +1,19 @@ - + + + Log Viewer +
- - - + + +
-



Loading Logfile, please wait...
+



Loading logfile, please wait...
diff --git a/sd-card/html/ota_page.html b/sd-card/html/ota_page.html index f97bf753..adaf4fa7 100644 --- a/sd-card/html/ota_page.html +++ b/sd-card/html/ota_page.html @@ -1,27 +1,25 @@ - + - OTA Update - + @@ -51,11 +49,11 @@


- +

+

Status: Idle

-

Status: idle

@@ -262,10 +260,10 @@ function progressHandler(event) { _("loaded_n_total").innerHTML = "Uploaded " + (event.loaded / 1024 / 1024).toFixed(2) + - " MBytes of " + (event.total / 1024/ 1024).toFixed(2) + " MBytes."; + " MB of " + (event.total / 1024/ 1024).toFixed(2) + " MB"; var percent = (event.loaded / event.total) * 100; _("progressBar").value = Math.round(percent); - _("status").innerHTML = "Status: " + Math.round(percent) + "% uploaded... please wait"; + _("status").innerHTML = "Status: " + Math.round(percent) + "% uploaded. Please wait..."; } diff --git a/sd-card/html/overview.html b/sd-card/html/overview.html index 4ef17bae..6d22f62c 100644 --- a/sd-card/html/overview.html +++ b/sd-card/html/overview.html @@ -1,77 +1,89 @@ - + - Overview - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Value:
-
-
Previous Value:
-
-
Raw Value:
-
-
Status:
-
-
-
-
-
-
-
- - -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value + +
+
+
Previous Value
+
+
Raw Value
+
+
Value Status
+
+
Process State
+
+
System Info
+
+
+
+
+ + +
+
- - - - + + + + @@ -104,6 +156,7 @@ function setprevalue() { xhttp.send(); response = xhttp.responseText; document.getElementById("result").innerHTML=response; + firework.launch('New \"previous value\" set', 'success', 5000); } catch (error) { @@ -145,11 +198,10 @@ function loadPrevalue(_domainname) { lines.forEach(function(line) { arr = line.split("\t"); if (_number == arr[0]) { - document.getElementById("myInput").value=arr[1]; + document.getElementById("myInput").value = Number(arr[1]); return; } }); - } catch (error) { @@ -190,7 +242,7 @@ function UpdateNUMBERS(_sel){ function init(){ - domainname = getDomainname(); + domainname = getDomainname(); loadConfig(domainname); ParseConfig(); UpdateNUMBERS(); diff --git a/sd-card/html/readconfigcommon.js b/sd-card/html/readconfigcommon.js index f256df8e..34ca12a1 100644 --- a/sd-card/html/readconfigcommon.js +++ b/sd-card/html/readconfigcommon.js @@ -85,6 +85,7 @@ function ZerlegeZeile(input, delimiter = " =\t\r") } + function findDelimiterPos(input, delimiter) { var pos = -1; @@ -131,7 +132,8 @@ function getConfig() } -function loadConfig(_domainname) { +function loadConfig(_domainname) +{ var xhttp = new XMLHttpRequest(); try { url = _domainname + '/fileserver/config/config.ini'; @@ -148,17 +150,17 @@ function loadConfig(_domainname) { } - - -function dataURLtoBlob(dataurl) { +function dataURLtoBlob(dataurl) +{ var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); while(n--){ u8arr[n] = bstr.charCodeAt(n); } return new Blob([u8arr], {type:mime}); - } - +} + + function FileCopyOnServer(_source, _target, _domainname = ""){ url = _domainname + "/editflow?task=copy&in=" + _source + "&out=" + _target; var xhttp = new XMLHttpRequest(); @@ -171,6 +173,7 @@ function FileCopyOnServer(_source, _target, _domainname = ""){ } } + function FileDeleteOnServer(_filename, _domainname = ""){ var xhttp = new XMLHttpRequest(); var okay = false; @@ -201,6 +204,7 @@ function FileDeleteOnServer(_filename, _domainname = ""){ return okay; } + function FileSendContent(_content, _filename, _domainname = ""){ var xhttp = new XMLHttpRequest(); var okay = false; @@ -242,6 +246,7 @@ function SaveCanvasToImage(_canvas, _filename, _delete = true, _domainname = "") FileSendContent(rtn, _filename, _domainname); } + function MakeContrastImageZW(zw, _enhance, _domainname){ _filename = zw["name"].replace("/config/", "/img_tmp/"); url = _domainname + "/editflow?task=cutref&in=/config/reference.jpg&out=" + _filename + "&x=" + zw["x"] + "&y=" + zw["y"] + "&dx=" + zw["dx"] + "&dy=" + zw["dy"]; @@ -260,7 +265,7 @@ function MakeContrastImageZW(zw, _enhance, _domainname){ } if (xhttp.responseText == "CutImage Done") { - firework.launch('Reference Image Contrast got enhanced.', 'success', 5000); + firework.launch('Image Contrast got enhanced', 'success', 5000); return true; } else { @@ -270,7 +275,6 @@ function MakeContrastImageZW(zw, _enhance, _domainname){ } - function MakeRefZW(zw, _domainname){ _filetarget = zw["name"].replace("/config/", "/img_tmp/"); _filetarget = _filetarget.replace(".jpg", "_org.jpg"); @@ -289,7 +293,7 @@ function MakeRefZW(zw, _domainname){ _filetarget2 = zw["name"].replace("/config/", "/img_tmp/"); // _filetarget2 = _filetarget2.replace(".jpg", "_org.jpg"); FileCopyOnServer(_filetarget, _filetarget2, _domainname); - firework.launch('Reference Image got updated.', 'success', 5000); + firework.launch('Marker got updated', 'success', 5000); return true; } else { diff --git a/sd-card/html/readconfigparam.js b/sd-card/html/readconfigparam.js index a2138143..c31c0b4d 100644 --- a/sd-card/html/readconfigparam.js +++ b/sd-card/html/readconfigparam.js @@ -710,9 +710,10 @@ function getNUMBERInfo(){ } function RenameNUMBER(_alt, _neu){ - if ((_neu.indexOf(".") >= 0) || (_neu.indexOf(",") >= 0) || (_neu.indexOf(" ") >= 0) || (_neu.indexOf("\"") >= 0)) + if ((_neu.indexOf(".") >= 0) || (_neu.indexOf(",") >= 0) || + (_neu.indexOf(" ") >= 0) || (_neu.indexOf("\"") >= 0)) { - return "Name must not contain ',', '.', ' ' or '\"' - please change name"; + return "Number sequence name must not contain , . \" or a space"; } index = -1; @@ -725,21 +726,21 @@ function RenameNUMBER(_alt, _neu){ } if (found) - return "Name is already existing - please use another name"; + return "Number sequence name is already existing, please choose another name"; NUMBERS[index]["name"] = _neu; return ""; } -function DeleteNUMBER(_delte){ +function DeleteNUMBER(_delete){ if (NUMBERS.length == 1) - return "The last number cannot be deleted." + return "One number sequence is mandatory. Therefore this cannot be deleted" index = -1; for (i = 0; i < NUMBERS.length; ++i) { - if (NUMBERS[i]["name"] == _delte) + if (NUMBERS[i]["name"] == _delete) index = i; } @@ -758,7 +759,7 @@ function CreateNUMBER(_numbernew){ } if (found) - return "Name does already exist, please choose another one!"; + return "Number sequence name is already existing, please choose another name"; _ret = new Object(); _ret["name"] = _numbernew; @@ -796,24 +797,26 @@ function CreateNUMBER(_numbernew){ function getROIInfo(_typeROI, _number){ - index = 0; + index = -1; for (var i = 0; i < NUMBERS.length; ++i) if (NUMBERS[i]["name"] == _number) index = i; - return NUMBERS[index][_typeROI]; + if (index != -1) + return NUMBERS[index][_typeROI]; + else + return ""; } function RenameROI(_number, _type, _alt, _neu){ if ((_neu.includes("=")) || (_neu.includes(".")) || (_neu.includes(":")) || (_neu.includes(",")) || (_neu.includes(";")) || (_neu.includes(" ")) || - (_neu.includes("\""))) { - return "Name must not contain any of the following characters: . : , ; = \" ' '"; + (_neu.includes("\""))) + { + return "ROI name must not contain . : , ; = \" or space"; } - - index = -1; found = false; _indexnumber = -1; @@ -821,6 +824,9 @@ function RenameROI(_number, _type, _alt, _neu){ if (NUMBERS[j]["name"] == _number) _indexnumber = j; + if (_indexnumber == -1) + return "Number sequence not existing. ROI cannot be renamed" + for (i = 0; i < NUMBERS[_indexnumber][_type].length; ++i) { if (NUMBERS[_indexnumber][_type][i]["name"] == _alt) index = i; @@ -829,18 +835,18 @@ function RenameROI(_number, _type, _alt, _neu){ } if (found) - return "Name is already existing - please use another name"; + return "ROI name is already existing, please choose another name"; NUMBERS[_indexnumber][_type][index]["name"] = _neu; return ""; } + function DeleteNUMBER(_delte){ if (NUMBERS.length == 1) - return "The last number cannot be deleted." + return "The last number cannot be deleted" - index = -1; for (i = 0; i < NUMBERS.length; ++i) { if (NUMBERS[i]["name"] == _delte) @@ -854,21 +860,24 @@ function DeleteNUMBER(_delte){ return ""; } + function CreateROI(_number, _type, _pos, _roinew, _x, _y, _dx, _dy, _CCW){ _indexnumber = -1; for (j = 0; j < NUMBERS.length; ++j) if (NUMBERS[j]["name"] == _number) _indexnumber = j; + if (_indexnumber == -1) + return "Number sequence not existing. ROI cannot be created" found = false; - for (i = 0; i < NUMBERS.length; ++i) { - if (NUMBERS[_indexnumber][_type]["name"] == _roinew) + for (i = 0; i < NUMBERS[_indexnumber][_type].length; ++i) { + if (NUMBERS[_indexnumber][_type][i]["name"] == _roinew) found = true; } if (found) - return "ROI does already exist, please choose another name!"; + return "ROI name is already existing, please choose another name"; _ret = new Object(); _ret["name"] = _roinew; diff --git a/sd-card/html/reboot_page.html b/sd-card/html/reboot_page.html index 3795296f..f58440b7 100644 --- a/sd-card/html/reboot_page.html +++ b/sd-card/html/reboot_page.html @@ -1,9 +1,8 @@ - + - Reboot - + @@ -22,13 +21,13 @@ p {font-size: 1em;} - -

Do you really want to reboot your ESP32 now?

+ +

Do you really want to reboot now?

- +
diff --git a/sd-card/html/setup.html b/sd-card/html/setup.html index c3383794..3196908a 100644 --- a/sd-card/html/setup.html +++ b/sd-card/html/setup.html @@ -1,17 +1,25 @@ - + - AI on the edge - + - + - - - -

Digitizer - Initial Setup

-

An ESP32 all inclusive neural network recognition system for meter digitalization

-
+ + + + + +
+

Digitizer - AI on the edge - Initial setup

+

An ESP32 all inclusive neural network recognition system for meter digitalization

+
- - - - -
- - - If you need support, have a look to the documentation or the discussion pages. -
+ + + + + + + + + + + +
+ + + + + Setup Progress:
+ +
-
- -
+
+ +
-
- -
+
+ + +
- - - - diff --git a/sd-card/html/style.css b/sd-card/html/style.css index c2b6c3e8..60da015e 100644 --- a/sd-card/html/style.css +++ b/sd-card/html/style.css @@ -1,26 +1,39 @@ body, html { - width: 100%; - height: 100%; - min-height: 800px; + max-width: 1022px; + min-width: 688px; + height: 100vh; + min-height: 100vh; margin: 0px 0px 0px 2px; padding: 0; font-family: arial; - width: fit-content; +} + +@media screen and (max-width:687px) { + body, html { + max-width: 687px; + height: 150vh; + min-height: 100vh; + margin: 0px 0px 0px 2px; + padding: 0; + font-family: arial; + } } .main { display: flex; width: 100%; height: 100%; - flex-direction: column; + flex-direction: column; overflow: hidden; + font-family: arial; } .iframe { - flex-grow: 1; - margin: 5px 0px 4px 0px; + flex: 1 1 auto; + margin: 5px 0px 8px 0px; padding: 0; - border: 2px solid #333; /* black */ + border: 0px solid #333; /* black */ + font-family: arial; } h1 { @@ -41,20 +54,13 @@ p { font-size: 1em; } - - - - - - - .menu { margin: 0px; padding: 0px; font-family: "Arial"; font-size: 18px; font-weight: bold; - width: 1008px; + width: 100%; background: #333; /* black */ } @@ -171,13 +177,6 @@ p { color: white; } - - - - - - - .arrow { border: solid #333; /* black */ border-width: 0 3px 3px 0; @@ -187,9 +186,8 @@ p { } .right { - transform: rotate(-45deg); -webkit-transform: rotate(-45deg); - + transform: rotate(-45deg); position: absolute; right: 10px; top: 20px; @@ -198,8 +196,8 @@ p { } .down { - transform: rotate(45deg); -webkit-transform: rotate(45deg); + transform: rotate(45deg); border-bottom: solid white; border-right: solid white; margin: 0px 0px 2px 5px; diff --git a/sd-card/html/test.html b/sd-card/html/test.html deleted file mode 100644 index 8657156d..00000000 --- a/sd-card/html/test.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - testschrift -
- - - - - - diff --git a/sd-card/html/testcnn.html b/sd-card/html/testcnn.html deleted file mode 100644 index ab2b44c2..00000000 --- a/sd-card/html/testcnn.html +++ /dev/null @@ -1 +0,0 @@ -

Not-a-Number

\ No newline at end of file diff --git a/sd-card/html/timezones.html b/sd-card/html/timezones.html index 90cd5249..410c84ce 100644 --- a/sd-card/html/timezones.html +++ b/sd-card/html/timezones.html @@ -1,5 +1,5 @@ - +