Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve html roi disablement #1825

Merged
merged 3 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sd-card/html/common.js
Original file line number Diff line number Diff line change
@@ -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";



Expand Down
16 changes: 12 additions & 4 deletions sd-card/html/edit_analog.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,13 @@ <h2><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'En
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?")) {
Expand Down Expand Up @@ -185,6 +188,10 @@ <h2><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'En
}

sah1(document.getElementById("div1"), !isEnabled);


cofcat["Analog"]["enabled"] = isEnabled;

if (isEnabled)
{
UpdateROIs();
Expand Down Expand Up @@ -279,8 +286,8 @@ <h2><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'En
}

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);
Expand All @@ -293,9 +300,9 @@ <h2><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'En
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();
Expand Down Expand Up @@ -408,6 +415,7 @@ <h2><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'En
loadConfig(domainname);
ParseConfig();
param = getConfigParameters();
cofcat = getConfigCategory();
UpdateNUMBERS();
drawImage();
draw();
Expand Down
14 changes: 10 additions & 4 deletions sd-card/html/edit_digits.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ <h2><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'En
drag = false,
aktindex = 0,
ROIInfo,
cofcat,
param,
enhanceCon = false;
lockAR = true;
lockSizes = true;
Expand Down Expand Up @@ -179,6 +181,9 @@ <h2><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'En
}

sah1(document.getElementById("div1"), !isEnabled);

cofcat["Digits"]["enabled"] = isEnabled;

if (isEnabled)
{
UpdateROIs();
Expand Down Expand Up @@ -282,8 +287,8 @@ <h2><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'En
}

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);
Expand All @@ -296,9 +301,9 @@ <h2><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'En
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();
Expand Down Expand Up @@ -410,6 +415,7 @@ <h2><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'En
loadConfig(domainname);
ParseConfig();
param = getConfigParameters();
cofcat = getConfigCategory();
UpdateNUMBERS();

space = ROIInfo[1].x - parseInt(ROIInfo[0].x) - parseInt(ROIInfo[0].dx);
Expand Down
2 changes: 1 addition & 1 deletion sd-card/html/gethost.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down