\n";
std::vector htmlinfoana;
@@ -510,7 +510,7 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
/* Full Image
* Only show it after the image got taken and aligned */
- txt = "
Aligned Image (current round)
\n";
+ txt = "
Aligned Image (current round)
\n";
if ((*status == std::string("Initialization")) ||
(*status == std::string("Initialization (delayed)")) ||
(*status == std::string("Take Image"))) {
@@ -657,14 +657,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
string out2 = out.substr(0, out.length() - 4) + "_org.jpg";
- std::string state = *flowctrl.getActStatus();
-
- /* To be able to provide the image, several conditions must be met due to the shared PSRAM usage:
- - Ether the round most be completed or not started yet
- - Or we must be in Setup Mode
- - Additionally, the initialization of the shared PSRAM must be successful */
- if (((state == "Flow finished") || (state == "Initialization") || (state == "Initialization (delayed)") || isSetupModusActive()) &&
- psram_init_shared_memory_for_take_image_step()) {
+ if ((flowctrl.SetupModeActive || (*flowctrl.getActStatus() == "Flow finished")) && psram_init_shared_memory_for_take_image_step()) {
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Taking image for Alignment Mark Update...");
CAlignAndCutImage *caic = new CAlignAndCutImage("cutref", in);
@@ -687,7 +680,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
}
else {
LogFile.WriteToFile(ESP_LOG_WARN, TAG, std::string("Taking image for Alignment Mark not possible while device") +
- " is busy with a round (Current State: '" + state + "')!");
+ " is busy with a round (Current State: '" + *flowctrl.getActStatus() + "')!");
zw = "Device Busy";
}
@@ -897,7 +890,7 @@ esp_err_t handler_prevalue(httpd_req_t *req)
if (httpd_query_key_value(_query, "value", _value, 20) == ESP_OK) {
#ifdef DEBUG_DETAIL_ON
- ESP_LOGD(TAG, "Value: %s", _size);
+ ESP_LOGD(TAG, "Value: %s", _value);
#endif
}
}
diff --git a/code/components/jomjol_influxdb/interface_influxdb.cpp b/code/components/jomjol_influxdb/interface_influxdb.cpp
index e338bf93..1a9ac308 100644
--- a/code/components/jomjol_influxdb/interface_influxdb.cpp
+++ b/code/components/jomjol_influxdb/interface_influxdb.cpp
@@ -116,7 +116,7 @@ static esp_err_t http_event_handler(esp_http_client_event_t *evt)
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client Error encountered");
break;
case HTTP_EVENT_ON_CONNECTED:
- LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client Error encountered");
+ LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client connected");
ESP_LOGI(TAG, "HTTP Client Connected");
break;
case HTTP_EVENT_HEADERS_SENT:
diff --git a/code/components/jomjol_mqtt/interface_mqtt.cpp b/code/components/jomjol_mqtt/interface_mqtt.cpp
index 1ab8f03f..aa21fe7d 100644
--- a/code/components/jomjol_mqtt/interface_mqtt.cpp
+++ b/code/components/jomjol_mqtt/interface_mqtt.cpp
@@ -9,6 +9,11 @@
#include "cJSON.h"
#include "../../include/defines.h"
+#if DEBUG_DETAIL_ON
+#include "esp_timer.h"
+#endif
+
+
static const char *TAG = "MQTT IF";
std::map>* connectFunktionMap = NULL;
diff --git a/code/components/jomjol_wlan/read_wlanini.cpp b/code/components/jomjol_wlan/read_wlanini.cpp
index 1a9af227..7ebca23d 100644
--- a/code/components/jomjol_wlan/read_wlanini.cpp
+++ b/code/components/jomjol_wlan/read_wlanini.cpp
@@ -174,10 +174,12 @@ int LoadWlanFromFile(std::string fn)
}
/* Check if password is empty (mandatory parameter) */
+ /* Disabled see issue #2393
if (wlan_config.password.empty()) {
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Password empty. Device init aborted!");
return -2;
}
+ */
return 0;
}
diff --git a/code/platformio.ini b/code/platformio.ini
index c5a40aca..ea924fb2 100644
--- a/code/platformio.ini
+++ b/code/platformio.ini
@@ -19,7 +19,7 @@
[common:esp32-idf]
extends = common:idf
- platform = platformio/espressif32 @ 6.2.0
+ platform = platformio/espressif32 @ 6.3.2
framework = espidf
lib_deps =
${common:idf.lib_deps}
diff --git a/code/sdkconfig.defaults b/code/sdkconfig.defaults
index e41514a1..8e7fbc64 100644
--- a/code/sdkconfig.defaults
+++ b/code/sdkconfig.defaults
@@ -109,6 +109,11 @@ CONFIG_ESP_INT_WDT_TIMEOUT_MS=300
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
CONFIG_HTTPD_PURGE_BUF_LEN=16
+<<<<<<< Updated upstream
+=======
+CONFIG_HTTPD_WS_SUPPORT=y
+CONFIG_LWIP_MAX_SOCKETS=12
+>>>>>>> Stashed changes
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16
CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=16
diff --git a/images/Flowstate_initialization.xcf b/images/Flowstate_initialization.xcf
index 6a54f159..ddfedf70 100644
Binary files a/images/Flowstate_initialization.xcf and b/images/Flowstate_initialization.xcf differ
diff --git a/images/Flowstate_initialization_delayed.xcf b/images/Flowstate_initialization_delayed.xcf
index 80e61e5d..2e465cf4 100644
Binary files a/images/Flowstate_initialization_delayed.xcf and b/images/Flowstate_initialization_delayed.xcf differ
diff --git a/images/Flowstate_take_image.xcf b/images/Flowstate_take_image.xcf
index 961597d5..1fe747f6 100644
Binary files a/images/Flowstate_take_image.xcf and b/images/Flowstate_take_image.xcf differ
diff --git a/images/icon/logo.png b/images/icon/logo.png
new file mode 100644
index 00000000..194cb4af
Binary files /dev/null and b/images/icon/logo.png differ
diff --git a/sd-card/config/ana-class100_0157_s1_q.tflite b/sd-card/config/ana-class100_0157_s1_q.tflite
deleted file mode 100644
index 0b184b20..00000000
Binary files a/sd-card/config/ana-class100_0157_s1_q.tflite and /dev/null differ
diff --git a/sd-card/config/ana-class100_0169_s1_q.tflite b/sd-card/config/ana-class100_0169_s1_q.tflite
new file mode 100644
index 00000000..cf52e19b
Binary files /dev/null and b/sd-card/config/ana-class100_0169_s1_q.tflite differ
diff --git a/sd-card/config/ana-class100_0170_s1_q.tflite b/sd-card/config/ana-class100_0170_s1_q.tflite
new file mode 100644
index 00000000..8ecddda3
Binary files /dev/null and b/sd-card/config/ana-class100_0170_s1_q.tflite differ
diff --git a/sd-card/config/ana-cont_1105_s2_q.tflite b/sd-card/config/ana-cont_1105_s2_q.tflite
deleted file mode 100644
index e9c2368a..00000000
Binary files a/sd-card/config/ana-cont_1105_s2_q.tflite and /dev/null differ
diff --git a/sd-card/config/ana-cont_1206_s2_q.tflite b/sd-card/config/ana-cont_1206_s2_q.tflite
new file mode 100644
index 00000000..e4e5f5fa
Binary files /dev/null and b/sd-card/config/ana-cont_1206_s2_q.tflite differ
diff --git a/sd-card/config/ana-cont_1207_s2_q.tflite b/sd-card/config/ana-cont_1207_s2_q.tflite
new file mode 100644
index 00000000..3ff05bab
Binary files /dev/null and b/sd-card/config/ana-cont_1207_s2_q.tflite differ
diff --git a/sd-card/config/config.ini b/sd-card/config/config.ini
index 08e35046..dc995556 100644
--- a/sd-card/config/config.ini
+++ b/sd-card/config/config.ini
@@ -12,7 +12,7 @@ FixedExposure = false
Demo = false
[Alignment]
-InitialRotate = 179
+InitialRotate = 0.0
InitialMirror = false
SearchFieldX = 20
SearchFieldY = 20
@@ -22,7 +22,7 @@ FlipImageSize = false
/config/ref1.jpg 442 142
[Digits]
-Model = /config/dig-cont_0611_s3_q.tflite
+Model = /config/dig-cont_0620_s3_q.tflite
CNNGoodThreshold = 0.5
;ROIImagesLocation = /log/digit
;ROIImagesRetention = 3
@@ -31,7 +31,7 @@ main.dig2 343 126 30 54 false
main.dig3 391 126 30 54 false
[Analog]
-Model = /config/ana-cont_1105_s2_q.tflite
+Model = /config/ana-cont_1207_s2_q.tflite
CNNGoodThreshold = 0.5
;ROIImagesLocation = /log/analog
;ROIImagesRetention = 3
@@ -106,6 +106,6 @@ LogfilesRetention = 3
TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
;TimeServer = pool.ntp.org
;Hostname = undefined
-;RSSIThreshold = 0
+RSSIThreshold = -75
CPUFrequency = 160
SetupMode = true
diff --git a/sd-card/config/dig-class100-0165_s2_q.tflite b/sd-card/config/dig-class100-0165_s2_q.tflite
new file mode 100644
index 00000000..4dcc02d1
Binary files /dev/null and b/sd-card/config/dig-class100-0165_s2_q.tflite differ
diff --git a/sd-card/config/dig-class100_0160_s2_q.tflite b/sd-card/config/dig-class100_0160_s2_q.tflite
deleted file mode 100644
index a1769322..00000000
Binary files a/sd-card/config/dig-class100_0160_s2_q.tflite and /dev/null differ
diff --git a/sd-card/config/dig-cont_0611_s3.tflite b/sd-card/config/dig-cont_0611_s3.tflite
deleted file mode 100644
index 0a2314a5..00000000
Binary files a/sd-card/config/dig-cont_0611_s3.tflite and /dev/null differ
diff --git a/sd-card/config/dig-cont_0620_s3_q.tflite b/sd-card/config/dig-cont_0620_s3_q.tflite
new file mode 100644
index 00000000..95932c74
Binary files /dev/null and b/sd-card/config/dig-cont_0620_s3_q.tflite differ
diff --git a/sd-card/html/Flowstate_initialization.jpg b/sd-card/html/Flowstate_initialization.jpg
index b490fc47..54d9ccfd 100644
Binary files a/sd-card/html/Flowstate_initialization.jpg and b/sd-card/html/Flowstate_initialization.jpg differ
diff --git a/sd-card/html/Flowstate_initialization_delayed.jpg b/sd-card/html/Flowstate_initialization_delayed.jpg
index 4be8f74f..bce3d2c5 100644
Binary files a/sd-card/html/Flowstate_initialization_delayed.jpg and b/sd-card/html/Flowstate_initialization_delayed.jpg differ
diff --git a/sd-card/html/Flowstate_take_image.jpg b/sd-card/html/Flowstate_take_image.jpg
index dbc4feee..8ce51e3e 100644
Binary files a/sd-card/html/Flowstate_take_image.jpg and b/sd-card/html/Flowstate_take_image.jpg differ
diff --git a/sd-card/html/backup.html b/sd-card/html/backup.html
index 8e04bc5f..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.
diff --git a/sd-card/html/common.js b/sd-card/html/common.js
index 66b3992c..20d01010 100644
--- a/sd-card/html/common.js
+++ b/sd-card/html/common.js
@@ -1,7 +1,7 @@
/* The UI can also be run locally, but you have to set the IP of your devide accordingly.
* And you also might have to disable CORS in your webbrowser! */
-var domainname_for_testing = "192.168.178.23";
+var domainname_for_testing = "192.168.1.151";
/* Returns the domainname with prepended protocol.
@@ -13,7 +13,7 @@ function getDomainname(){
)
{
- console.log("Using pre-defined domainname for testing: " + domainname_for_testing);
+ //console.log("Using pre-defined domainname for testing: " + domainname_for_testing);
domainname = "http://" + domainname_for_testing
}
else
@@ -139,8 +139,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
+
+
-
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..59a36eb6 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;
-}
-
-
-
-
-
+
+ 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,68 @@ 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;
+ var multiplier_decshift;
+ var fixedDecimals;
+ var fixedDecimals_decshift;
+ var NumberInfo = getNUMBERInfo();
+ var CategoryInfo = getConfigCategory();
+
+ var sel = document.getElementById("Numbers_value1");
+ var _number= sel.options[sel.selectedIndex].text;
+ document.getElementById("decimalShift").value = 0;
+ for (var i = 0; i < NumberInfo.length; ++i) {
+ if (NumberInfo[i]["name"] == _number) {
+ if (NumberInfo[i]["PostProcessing"]["DecimalShift"]["enabled"]) {
+ decimalShift = NumberInfo[i]["PostProcessing"]["DecimalShift"]["value1"];
+ document.getElementById("decimalShift").value=decimalShift;
+ }
+ }
+ }
+
+ if (CategoryInfo["Analog"]["enabled"] == true && CategoryInfo["Digits"]["enabled"] == true) { // Digit + Analog
+ multiplier = fixedDecimals = aktindex + 1;
+ multiplier_decshift = fixedDecimals_decshift = multiplier - Number(decimalShift);
+
+ if (multiplier < 0)
+ fixedDecimals = 0;
+
+ if (multiplier_decshift < 0)
+ fixedDecimals_decshift = 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);
+ }
+ else if (CategoryInfo["Analog"]["enabled"] == true && CategoryInfo["Digits"]["enabled"] == false) { // Only Analog
+ multiplier = ROIInfo.length - 1 - aktindex;
+ multiplier_decshift = fixedDecimals_decshift = multiplier + Number(decimalShift);
+
+ if (multiplier_decshift > 0)
+ fixedDecimals_decshift = 0;
+
+ if (fixedDecimals_decshift < 0) {
+ fixedDecimals_decshift = -1 * fixedDecimals_decshift;
+ }
+
+ document.getElementById("multiplier").value="x" + Number(10 ** multiplier).toFixed(0);
+ document.getElementById("multiplier_decshift").value="x" + Number(10 ** multiplier_decshift).toFixed(fixedDecimals_decshift);
+ }
}
@@ -305,19 +449,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 +479,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 +497,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 +520,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 +537,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 +567,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 +613,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 +657,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 +671,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 +685,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 +759,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);
@@ -586,7 +773,8 @@ function drawTextBG(context, txt, x, y, padding) {
context.strokeRect(x0, y0, dx, dy);
context.lineWidth = lw;
context.beginPath();
- context.arc(x0+dx/2, y0+dy/2, dx/2, 0, 2 * Math.PI);
+// context.arc (x0+dx/2, y0+dy/2, dx/2, 0, 2 * Math.PI);
+ context.ellipse(x0+dx/2, y0+dy/2, dx/2, dy/2, 0, 0, 2 * Math.PI);
context.moveTo(x0+dx/2, y0);
context.lineTo(x0+dx/2, y0+dy);
context.moveTo(x0, y0+dy/2);
@@ -602,11 +790,17 @@ 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);
+// context.arc(x0+dx/2, y0+dy/2, dx/2, 0, 2 * Math.PI);
+ context.ellipse(x0+dx/2, y0+dy/2, dx/2, dy/2, 0, 0, 2 * Math.PI);
context.moveTo(x0+dx/2, y0);
context.lineTo(x0+dx/2, y0+dy);
context.moveTo(x0, y0+dy/2);
@@ -706,6 +900,7 @@ function drawTextBG(context, txt, x, y, padding) {
rect.startY = document.getElementById("refy").value;
draw();
}
+ document.getElementById("saveroi").disabled = false;
}
function valuemanualchangeddx(){
@@ -721,6 +916,7 @@ function drawTextBG(context, txt, x, y, padding) {
rect.startY = document.getElementById("refy").value;
draw();
}
+ document.getElementById("saveroi").disabled = false;
}
@@ -730,8 +926,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 +940,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.
-
+
+ CLICK HERE for usage description. More infos in documentation:
+ Parameter
+
+
+ This page lists all available configuration parameters of the device.
+ The description of each parameter can be shown by hovering over or by clicking the icon.
+
+
+ The page gets opened with the default view which should be sufficient for regular configuration tasks. Enabling the "Expert View"
+ some expert parameters (light red background color) will be added to the parameter list. Additionally the button "Edit "Config.ini" File"
+ to edit the underlaying configuration file (config.ini) manually is now shown on top of the page. This function should be only used for special cases.
+
+
+ Sections (entire functionality) or single parameters having a checkbox can be enabled or disabled.
+ Disabling a complete section results in a disabled functionality. Whenever only a single parameter of a section is disabled
+ the hard-coded default value is used for the disabled parameter.
+
+
+ Don't forget to save the changes with the button "Save Config" at the bottom of this page.
+
+
+
+
-
-
-
- Parameter
-
-
- Value
-
-
- Documentation
-
-
+
-
-
TakeImage
+
+
+
+
+
+
+
+
+
+
Configuration View
-
+
+
+
+
+
+
+
+
+
+
+
Take Image
+
+
+
+
+
-
+
$TOOLTIP_TakeImage_RawImagesLocation
+
-
+
- Days
+ Days
$TOOLTIP_TakeImage_RawImagesRetention
-
+
+
@@ -172,25 +264,31 @@ textarea {
$TOOLTIP_TakeImage_Demo
+
Wait Before Taking Picture
- Seconds
+ Seconds
$TOOLTIP_TakeImage_WaitBeforeTakingPicture
+
Image Quality
-
+
$TOOLTIP_TakeImage_ImageQuality
+
Image Size
@@ -209,7 +307,9 @@ textarea {
LED Intensity
The discovery topics and the static topics (IP, MAC, Hostname, Interval, ...) only get sent on startup.
- To send them again, you can call the following URL: http://<IP>/mqtt_publish_discovery
+
+
+
+ Homeassistant Discovery (using MQTT)
+ If activated, the discovery topics gets automatically scheduled to sent once after device startup during state "Publish to MQTT".
+ To schedule a retransmission: Use "Manual Control > Resend HA Discovery" or call REST API:
+ http://<IP>/mqtt_publish_discovery
-
-
-
+
+
+
+
@@ -637,13 +787,14 @@ textarea {
$TOOLTIP_MQTT_HomeassistantDiscovery
-
-
+
+
+
-
+
@@ -661,34 +812,38 @@ textarea {
-
-
+
+
+
-
For InfluxDB v2.x see below [InfluxDBv2]
+
-
-
+
+
+
-
+
$TOOLTIP_InfluxDB_Uri
-
+
+
-
+
$TOOLTIP_InfluxDB_Database
-
+
+
@@ -698,7 +853,8 @@ textarea {
$TOOLTIP_InfluxDB_user
-
+
+
@@ -708,66 +864,71 @@ textarea {
$TOOLTIP_InfluxDB_password
-
-
-
- InfluxDB Individual Parameters:
-
-
+
+
+
+ Parameter per number sequence:
+
+
-
-
+
+
+
-
+
$TOOLTIP_InfluxDB_NUMBER.Measurement
-
-
+
+
+
-
+
$TOOLTIP_InfluxDB_NUMBER.Field
-
-
-
-
+
+
+
-
For InfluxDB v1.x see above [InfluxDBv1]
+
-
-
+
+
+
-
+
$TOOLTIP_InfluxDBv2_Uri
-
+
+
-
+
$TOOLTIP_InfluxDBv2_Database
-
+
+
@@ -777,7 +938,8 @@ textarea {
$TOOLTIP_InfluxDBv2_Org
-
+
+
@@ -787,51 +949,52 @@ textarea {
$TOOLTIP_InfluxDBv2_Token
-
-
-
- InfluxDB v2 Individual Parameters:
-
-
+
+
+
+ Parameter per number sequence:
+
+
-
-
+
+
+
-
+
$TOOLTIP_InfluxDBv2_NUMBER.Measurement
-
-
+
+
+
-
+
$TOOLTIP_InfluxDBv2_NUMBER.Field
-
-
+
+
+
+
-
-
-
By default GPIO4 is used for the built-in flash LED! If you enable the GPIO Settings,
- you have to explicitely enable it again on GPIO4 or on GPIO12 with an external LED!
+ IMPORTANT NOTE:
+ If you'd like to use the built-in flash LED in parallel with other GPIO functionality,
+ you have to explicitely activate the "built-in LED flash light" option on GPIO4. The light
+ intensity control (PWM) of the LED flash light is not functional anymore (only 100%).
+
+
+ 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,51 @@ 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 multiplier;
+ var multiplier_decshift;
+ var fixedDecimals_decshift;
+ var NumberInfo = getNUMBERInfo();
+
+ var sel = document.getElementById("Numbers_value1");
+ var _number= sel.options[sel.selectedIndex].text;
+ document.getElementById("decimalShift").value = 0;
+ for (var i = 0; i < NumberInfo.length; ++i) {
+ if (NumberInfo[i]["name"] == _number) {
+ if (NumberInfo[i]["PostProcessing"]["DecimalShift"]["enabled"]) {
+ decimalShift = NumberInfo[i]["PostProcessing"]["DecimalShift"]["value1"];
+ document.getElementById("decimalShift").value = decimalShift;
+ }
+ }
+ }
+
+ multiplier = ROIInfo.length - 1 - aktindex;
+ multiplier_decshift = fixedDecimals_decshift = multiplier + Number(decimalShift);
+
+ if (multiplier_decshift > 0)
+ fixedDecimals_decshift = 0;
+
+ if (fixedDecimals_decshift < 0) {
+ fixedDecimals_decshift = -1*fixedDecimals_decshift;
+ }
+
+ 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 +439,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 +469,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 +487,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 +510,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 +533,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 +563,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 +636,8 @@ function UpdateROIs(_sel){
document.getElementById("space").value = space;
}
+ document.getElementById("saveroi").disabled = true;
+
drawImage();
draw();
}
@@ -523,10 +680,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 +694,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 +921,7 @@ function draw() {
}
draw();
}
+ document.getElementById("saveroi").disabled = false;
}
function valuemanualchangeddx(){
@@ -780,6 +947,7 @@ function draw() {
draw();
}
+ document.getElementById("saveroi").disabled = false;
}
function valuemanualchangedspace(){
@@ -821,8 +989,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 +1003,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.
+
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 a new image will be taken
+ all configured parameter will be applied to the shown image. With the button "Update Image" you can update the image again (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.
+
@@ -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 @@
-
+
+
-
-
\ 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 @@
-
+