From 6466266cb0475552762796c57b3bf21fae5d4d67 Mon Sep 17 00:00:00 2001 From: Slider0007 Date: Fri, 11 Oct 2024 15:13:45 +0200 Subject: [PATCH] refactor(webui): Combine digit ROI and analog ROI page to one page --- sd-card/html/edit_analog.html | 1099 --------------------- sd-card/html/edit_digit.html | 1178 ---------------------- sd-card/html/edit_sequence.html | 1613 +++++++++++++++++++++++++++++++ sd-card/html/global_data.js | 74 -- sd-card/html/index.html | 7 +- 5 files changed, 1614 insertions(+), 2357 deletions(-) delete mode 100644 sd-card/html/edit_analog.html delete mode 100644 sd-card/html/edit_digit.html create mode 100644 sd-card/html/edit_sequence.html diff --git a/sd-card/html/edit_analog.html b/sd-card/html/edit_analog.html deleted file mode 100644 index 4f704288a..000000000 --- a/sd-card/html/edit_analog.html +++ /dev/null @@ -1,1099 +0,0 @@ - - - - - Analog ROI - - - - - - - - - - -

Analog ROI

-
- CLICK HERE for usage description. Further documentation: - ROI Configuration - -

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

-

- By default one number sequence (a number seqence contains of digit ROIs and/or analog counter ROIs which are - processed together) is predefined and already selected in the drop down "Number Sequence". If more than - one number sequence is needed 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 counters on the reference image. To have proper ROI placement and sizes please check the - documentation in detail because it's very important to be really precise to have reliable processing: - ROI Configuration. - With the drop down "ROI" the different ROIs in the respective number sequence can be selected.
- - To create new ROIs use "New ROI". The new ROIs are automatically named uniquely and in ascending order - (e.g. ana1, ana2, ...). Deleting a ROI between exisitung ones will rename the remaining ROIs in ascending order - without keeping any naming gap. -

-

- The order of the ROI defines the position (and therefore the multiplication factor) within the number sequence. - The position in the number sequence can be changed with the buttons "Move Lower" and "Move 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 - (Parameter: Decimal Shift, default: 0). -

-

- After the definition of analog ROIs is completed don't forget to save the new configuration with the button - "Save And Apply". The new configuration gets automatically applied. No reboot is required. -

-
-
- - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - - - - -
- Reference Image - - -
- - -
- - - - - - - - diff --git a/sd-card/html/edit_digit.html b/sd-card/html/edit_digit.html deleted file mode 100644 index dd24462cb..000000000 --- a/sd-card/html/edit_digit.html +++ /dev/null @@ -1,1178 +0,0 @@ - - - - - Digit ROI - - - - - - - - - - -

Digit ROI

-
- CLICK HERE for usage description. Further documentation: - ROI Configuration - -

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

-

- By default one number sequence (a number seqence contains of digit ROIs and/or analog counter ROIs which are - processed together) is predefined and already selected in the drop down "Number Sequence". If more than - one number sequence is needed 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 placement and sizes please check the - documentation in detail because it's very important to be really precise to have reliable processing: - ROI Configuration. - With the drop down "ROI" the different ROIs in the respective number sequence can be selected.
- - To create new ROIs use "New ROI". The new ROIs are automatically named uniquely and in ascending order - (e.g. dig1, dig2, ...). Deleting a ROI between exisitung ones will rename the remaining ROIs in ascending order - without keeping any naming gap. -

-

- The order of the ROI defines the position (and therefore the multiplication factor) within the number sequence. - The position in the number sequence can be changed with the buttons "Move Lower" and "Move 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 - (Parameter: Decimal Shift, default: 0). -

-

- After the definition of digit ROIs is completed don't forget to save the new configuration with the button - "Save And Apply". The new configuration gets automatically applied. No reboot is required. -

-
-
- - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - - - - -
- Reference Image - - -
- - -
- - - - - - - - diff --git a/sd-card/html/edit_sequence.html b/sd-card/html/edit_sequence.html new file mode 100644 index 000000000..b5872ce7d --- /dev/null +++ b/sd-card/html/edit_sequence.html @@ -0,0 +1,1613 @@ + + + + + Number Sequences + + + + + + + + + + +

Number Sequences

+
+ CLICK HERE for usage description. Further documentation: + ROI Configuration + +

+ This page is dedicated to defining number sequences. Each number sequence consists of digital ROIs and/or analog + ROIs that are processed together. After defining the number sequence, you need to specify the corresponding digit + and/or analog Region Of Interest (ROI). These ROIs are processed by the algorithm to digitize + the content.
+ By default, one number sequence ("main") is already predefined and selected in the Number Sequence dropdown. + If additional number sequences are required, they can be added using the buttons next to the dropdown. +

+

+ The ROI type can be switched using the Digit ROI / Analog ROI selection box. Individual ROIs in the selected + number sequence can be toggled using the selection box next to the ROI type selector.
+ To create new ROIs, click New. The new ROI will automatically be assigned a unique name in ascending order + based on the type selected (dig1, dig2, ... / ana1, ana2, ...). Deleting an ROI from the existing ones will + rename the remaining ROIs in ascending order, without leaving any gaps.
+ + ROIs can be positioned either by dragging and dropping with the mouse or by manually entering parameters into the + designated fields. For accurate ROI placement and sizing, please consult the documentation thoroughly, as precise + configurations are essential for reliable processing: + ROI Configuration.
+ The order of the ROIs determines their position (and thus the multiplication factor) within the number sequence. + The position in the sequence can be changed using the Move Lower and Move Higher buttons. Below + the selection boxes, the resulting multiplication factors are displayed: one based solely on the position/order + in the number sequence, and another adjusted by the decimal shift setting (Parameter: Decimal Shift, default: 0). +

+

+ Once the sequences and ROIs are defined, don't forget to save the new configuration by clicking the Save And Apply + button. The new configuration will be applied automatically, and no reboot is required. +

+
+
+ + + + + + + + + + + + +
Global Configuration + + + + + +
+ + + + + + + + + + + + + + + + + +
Number Sequence
+ +
+ + + + + + + + + + + + + + + + + +
Reference Image
+ + +
+ + + + + + + + diff --git a/sd-card/html/global_data.js b/sd-card/html/global_data.js index ca5e9923f..d1397be1e 100644 --- a/sd-card/html/global_data.js +++ b/sd-card/html/global_data.js @@ -460,77 +460,3 @@ function SaveCanvasToImage(_canvas, _filename, _delete = true, _domainname = "") uploadContent(rtn, _filename, _domainname); } - - -function CreateNumberSequence(type, sequenceName) -{ - if (sequenceName.length == 0) { - return "Number sequence name must not be empty"; - } - - if ((sequenceName.indexOf(".") >= 0) || (sequenceName.indexOf(",") >= 0) || - (sequenceName.indexOf(" ") >= 0) || (sequenceName.indexOf("\"") >= 0)) { - return "Number sequence name must not contain , . \" or a space"; - } - - for (i = 0; i < jsonConfigModifiedDelta[type]["sequence"].length; ++i) { - if (jsonConfigModifiedDelta[type]["sequence"][i]["sequencename"] == sequenceName) - return "Number sequence name is already existing"; - } - - jsonConfigModifiedDelta[type]["sequence"].push({"sequenceid": -1, "sequencename": sequenceName, "roi": []}); - jsonConfigModifiedDelta.numbersequences.sequence.push({"sequenceid": -1, "sequencename": sequenceName}); - return ""; -} - - -function RenameNumberSequence(type, idx, sequenceNameNew) -{ - if (sequenceNameNew.length == 0) { - return "Number sequence name must not be empty"; - } - - if ((sequenceNameNew.indexOf(".") >= 0) || (sequenceNameNew.indexOf(",") >= 0) || - (sequenceNameNew.indexOf(" ") >= 0) || (sequenceNameNew.indexOf("\"") >= 0)) { - return "Number sequence name must not contain , . \" or a space"; - } - - for (i = 0; i < jsonConfigModifiedDelta[type]["sequence"].length; ++i) { - if (jsonConfigModifiedDelta[type]["sequence"][i]["sequencename"] == sequenceNameNew) - return "Number sequence name is already existing"; - } - - if (idx == -1) - return "Invalid number sequence index"; - - jsonConfigModifiedDelta[type]["sequence"][idx]["sequencename"] = sequenceNameNew; - jsonConfigModifiedDelta.numbersequences.sequence[idx].sequencename = sequenceNameNew; - return ""; -} - - -function DeleteNumberSequence(type, idx) -{ - if (jsonConfigModifiedDelta[type]["sequence"].length == 1) - return "One number sequence is mandatory. Therefore this cannot be deleted" - - jsonConfigModifiedDelta[type]["sequence"].splice(idx, 1); - jsonConfigModifiedDelta.numbersequences.sequence.splice(idx, 1); - - return ""; -} - - -function CreateROI(type, sequenceName, x, y, dx, dy) -{ - for (i = 0; i < jsonConfigModifiedDelta[type]["sequence"].length; ++i) { - if (jsonConfigModifiedDelta[type]["sequence"][i]["sequencename"] == sequenceName) { - jsonConfigModifiedDelta[type]["sequence"][i]["roi"].push({"x": parseInt(x), - "y": parseInt(y), "dx": parseInt(dx), "dy": parseInt(dy), "ccw": false, "ar": dx/dy}); - - return ""; - } - } - - return "Number sequence not existing. ROI cannot be created" -} \ No newline at end of file diff --git a/sd-card/html/index.html b/sd-card/html/index.html index a93776831..731ab0c1e 100644 --- a/sd-card/html/index.html +++ b/sd-card/html/index.html @@ -95,12 +95,7 @@

A Neural Network Recognition Sy
  • Configuration
  • Reference Image
  • Alignment Marker
  • -
  • Regions Of Interest - -
  • +
  • Number Sequences