From 4a462fb79a00a56e47bb508c2686b664bfc810c8 Mon Sep 17 00:00:00 2001 From: jomjol <30766535+jomjol@users.noreply.github.com> Date: Fri, 13 Jan 2023 20:40:48 +0100 Subject: [PATCH] Improve html roi disablement (#1825) * Improve ROI-Problem * Update * Update common.js --- sd-card/html/common.js | 2 +- sd-card/html/edit_analog.html | 16 ++++++++++++---- sd-card/html/edit_digits.html | 14 ++++++++++---- sd-card/html/gethost.js | 2 +- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/sd-card/html/common.js b/sd-card/html/common.js index 3c73bb51..a4e9cb38 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.1.153"; +var domainname_for_testing = "192.168.178.44"; diff --git a/sd-card/html/edit_analog.html b/sd-card/html/edit_analog.html index 36501d8e..cad1e0b3 100644 --- a/sd-card/html/edit_analog.html +++ b/sd-card/html/edit_analog.html @@ -154,10 +154,13 @@ th, td { drag = false, aktindex = 0, ROIInfo, + cofcat, + param, enhanceCon = false; lockAR = true; lockSizes = true; domainname = getDomainname(); + function doReboot() { if (confirm("Are you sure you want to reboot? Did you save the config?")) { @@ -185,6 +188,10 @@ function EnDisableAnalog() { } sah1(document.getElementById("div1"), !isEnabled); + + + cofcat["Analog"]["enabled"] = isEnabled; + if (isEnabled) { UpdateROIs(); @@ -279,8 +286,8 @@ function ChangeSelection(){ } function SaveToConfig(){ - _zwcat = getConfigCategory(); - _zwcat["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked; +// _zwcat = getConfigCategory(); + cofcat["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked; WriteConfigININew(); SaveConfigToServer(domainname); firework.launch('Configuration got updated. Please reboot to activate changes!', 'success', 5000); @@ -293,9 +300,9 @@ function UpdateROIs(_sel){ var _number = sel.options[sel.selectedIndex].text; ROIInfo = getROIInfo("analog", _number); - _catzw = getConfigCategory(); +// _catzw = getConfigCategory(); - if (_catzw["Analog"]["enabled"] == false) + if (cofcat["Analog"]["enabled"] == false) { document.getElementById("Category_Analog_enabled").checked = false; EnDisableAnalog(); @@ -408,6 +415,7 @@ function UpdateROIs(_sel){ loadConfig(domainname); ParseConfig(); param = getConfigParameters(); + cofcat = getConfigCategory(); UpdateNUMBERS(); drawImage(); draw(); diff --git a/sd-card/html/edit_digits.html b/sd-card/html/edit_digits.html index 24aaf530..94379b46 100644 --- a/sd-card/html/edit_digits.html +++ b/sd-card/html/edit_digits.html @@ -146,6 +146,8 @@ th, td { drag = false, aktindex = 0, ROIInfo, + cofcat, + param, enhanceCon = false; lockAR = true; lockSizes = true; @@ -179,6 +181,9 @@ function EnDisableDigits() { } sah1(document.getElementById("div1"), !isEnabled); + + cofcat["Digits"]["enabled"] = isEnabled; + if (isEnabled) { UpdateROIs(); @@ -282,8 +287,8 @@ function ChangeSelection(){ } function SaveToConfig(){ - _zwcat = getConfigCategory(); - _zwcat["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked; +// _zwcat = getConfigCategory(); + cofcat["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked; WriteConfigININew(); SaveConfigToServer(domainname); firework.launch('Configuration got updated. Please reboot to activate changes!', 'success', 5000); @@ -296,9 +301,9 @@ function UpdateROIs(_sel){ var _number = sel.options[sel.selectedIndex].text; ROIInfo = getROIInfo("digit", _number); - _catzw = getConfigCategory(); +// _catzw = getConfigCategory(); - if (_catzw["Digits"]["enabled"] == false) + if (cofcat["Digits"]["enabled"] == false) { document.getElementById("Category_Digits_enabled").checked = false; EnDisableDigits(); @@ -410,6 +415,7 @@ function UpdateROIs(_sel){ loadConfig(domainname); ParseConfig(); param = getConfigParameters(); + cofcat = getConfigCategory(); UpdateNUMBERS(); space = ROIInfo[1].x - parseInt(ROIInfo[0].x) - parseInt(ROIInfo[0].dx); diff --git a/sd-card/html/gethost.js b/sd-card/html/gethost.js index d838b629..dc84410f 100644 --- a/sd-card/html/gethost.js +++ b/sd-card/html/gethost.js @@ -13,7 +13,7 @@ function getbasepath(){ { // host = "http://192.168.2.219"; // jomjol interner test // host = "http://192.168.178.46"; // jomjol interner test - host = "http://192.168.178.44"; // jomjol interner Real + host = "http://192.168.178.62"; // jomjol interner Real // host = "http://192.168.43.191"; // host = "."; // jomjol interner localhost