|
|
|
@ -19,7 +19,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<table id="controls"></table>
|
|
|
|
<div class="float">
|
|
|
|
|
|
|
|
<h2>Controls</h2><hr>
|
|
|
|
|
|
|
|
<table id="controls"></table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="float">
|
|
|
|
|
|
|
|
<h2>Infos</h2><hr>
|
|
|
|
|
|
|
|
<table id="variables"></table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
@ -32,7 +39,8 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
let ctrls;
|
|
|
|
let ctrls;
|
|
|
|
|
|
|
|
let variables;
|
|
|
|
|
|
|
|
|
|
|
|
function reloadImage() {
|
|
|
|
function reloadImage() {
|
|
|
|
const img1 = document.getElementById('webcamimage');
|
|
|
|
const img1 = document.getElementById('webcamimage');
|
|
|
|
const filterimage1 = document.getElementById('floatimage');
|
|
|
|
const filterimage1 = document.getElementById('floatimage');
|
|
|
|
@ -59,7 +67,34 @@ function refreshCtrls() {
|
|
|
|
ctrls.ctrls.forEach(function (elm, idx) {
|
|
|
|
ctrls.ctrls.forEach(function (elm, idx) {
|
|
|
|
t += "<tr><td>"+elm.name+"</td><td>"+elm.min+"</td>"+
|
|
|
|
t += "<tr><td>"+elm.name+"</td><td>"+elm.min+"</td>"+
|
|
|
|
"<td>"+elm.max+"</td><td>" +
|
|
|
|
"<td>"+elm.max+"</td><td>" +
|
|
|
|
"<input class=\"ctrlvalue\" dataid=\""+elm.id+"\" value=\""+elm.value+"\"></td></tr>";
|
|
|
|
"<input class=\"ctrlvalue\" dataid=\""+elm.id+"\" value=\""+elm.value+"\" size=\"6\"></td></tr>";
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
t += "</tbody>";
|
|
|
|
|
|
|
|
table.innerHTML = t;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
error: function(error) {
|
|
|
|
|
|
|
|
debug.innerHTML = "ERROR";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function refreshVariables() {
|
|
|
|
|
|
|
|
let debug = document.getElementById("debug");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
type: "POST",
|
|
|
|
|
|
|
|
url: 'get/variables',
|
|
|
|
|
|
|
|
data: "",
|
|
|
|
|
|
|
|
success: function(response)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let jsonData = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
variables = JSON.parse(response);
|
|
|
|
|
|
|
|
let table = document.getElementById("variables");
|
|
|
|
|
|
|
|
let t = "<tbody>";
|
|
|
|
|
|
|
|
variables.variables.forEach(function (elm, idx) {
|
|
|
|
|
|
|
|
t += "<tr><td>"+elm.name+"</td><td><input class=\"variablevalue\" dataid=\""+elm.name+"\" value=\""+elm.value+"\" size=\"6\"></td></tr>";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
t += "</tbody>";
|
|
|
|
t += "</tbody>";
|
|
|
|
table.innerHTML = t;
|
|
|
|
table.innerHTML = t;
|
|
|
|
@ -70,12 +105,14 @@ function refreshCtrls() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setCtrl(id, value) {
|
|
|
|
function setCtrl(id, value) {
|
|
|
|
let debug = document.getElementById("debug");
|
|
|
|
let debug = document.getElementById("debug");
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
type: "POST",
|
|
|
|
url: 'set/ctrl/'+id+"/"+value,
|
|
|
|
url: 'set/ctrl/'+id+"="+value,
|
|
|
|
data: "",
|
|
|
|
data: "",
|
|
|
|
success: function(response)
|
|
|
|
success: function(response)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -86,9 +123,30 @@ function setCtrl(id, value) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setVariable(id, value) {
|
|
|
|
|
|
|
|
let debug = document.getElementById("debug");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
type: "POST",
|
|
|
|
|
|
|
|
url: 'set/var/'+id+"="+value,
|
|
|
|
|
|
|
|
data: "",
|
|
|
|
|
|
|
|
success: function(response)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
refreshCtrls();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
error: function(error) {
|
|
|
|
|
|
|
|
debug.innerHTML = "ERROR";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setInterval(reloadImage, 500);
|
|
|
|
setInterval(reloadImage, 500);
|
|
|
|
refreshCtrls();
|
|
|
|
refreshCtrls();
|
|
|
|
|
|
|
|
refreshVariables();
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on('keypress', '.ctrlvalue', function(e) {
|
|
|
|
$(document).on('keypress', '.ctrlvalue', function(e) {
|
|
|
|
if (e.key === 'Enter' || e.keyCode === 13) {
|
|
|
|
if (e.key === 'Enter' || e.keyCode === 13) {
|
|
|
|
@ -102,6 +160,18 @@ $(document).on('keypress', '.ctrlvalue', function(e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on('keypress', '.variablevalue', function(e) {
|
|
|
|
|
|
|
|
if (e.key === 'Enter' || e.keyCode === 13) {
|
|
|
|
|
|
|
|
// Hier deine Funktion einfügen
|
|
|
|
|
|
|
|
let id = this.getAttribute('dataid');
|
|
|
|
|
|
|
|
let value = this.value;
|
|
|
|
|
|
|
|
setVariable(id, value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Verhindert das Standard-Verhalten (z. B. Formular absenden)
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</html>
|
|
|
|
</html>
|