mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-07 12:06:58 +03:00
Rolling 20210611
This commit is contained in:
@@ -36,33 +36,23 @@ input[type=number] {
|
||||
|
||||
</head>
|
||||
|
||||
<script src="/jquery-3.5.1.min.js"></script>
|
||||
<script>
|
||||
$ (document).ready(function() {
|
||||
$("#prevalue").load("/setPreValue.html");
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function setprevalue() {
|
||||
var inputVal = document.getElementById("myInput").value;
|
||||
inputVal = inputVal.replace(",", ".");
|
||||
_value = "<object data=" + "/setPreValue.html?value=" + inputVal + " ></object>";
|
||||
document.getElementById("result").innerHTML=_value;
|
||||
// location.reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body style="font-family: arial; padding: 0px 10px;">
|
||||
<h3>Set the previous value for consistency check and substitution for NaN</h3>
|
||||
|
||||
<class id="Numbers_text" style="font-size: 120%; color:black;"><b>Choose Number: </b>
|
||||
<select id="Numbers_value1" onchange="numberChanged()">
|
||||
<option value="0" selected>default</option>
|
||||
<option value="1" >NT</option>
|
||||
<option value="2" >HT</option>
|
||||
</select>
|
||||
</class>
|
||||
|
||||
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<h2>Current Value:</h2><p>
|
||||
<h3>Current Value:</h3><p>
|
||||
<div id="prevalue"></div>
|
||||
</tr>
|
||||
<tr>
|
||||
<h2>Set Value:</h2><p>
|
||||
<h3>Set Value:</h3><p>
|
||||
Input (Format = 123.456):<p>
|
||||
PreValue:
|
||||
<input type="number" id="myInput" name="myInput"
|
||||
@@ -72,10 +62,100 @@ function setprevalue() {
|
||||
<button class="button" type="button" onclick="setprevalue()">Set PreValue</button>
|
||||
</tr>
|
||||
<tr>
|
||||
<h2>Result:</h2><p>
|
||||
<h3>Result:</h3><p>
|
||||
<div id="result" readonly></div>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</body></html>
|
||||
</body></html>
|
||||
|
||||
|
||||
<script type="text/javascript" src="./gethost.js"></script>
|
||||
<script type="text/javascript" src="./readconfigcommon.js"></script>
|
||||
<script type="text/javascript" src="./readconfigparam.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var basepath = "http://192.168.178.22";
|
||||
var NUMBERS;
|
||||
|
||||
function setprevalue() {
|
||||
var inputVal = document.getElementById("myInput").value;
|
||||
var sel = document.getElementById("Numbers_value1");
|
||||
var _number = sel.options[sel.selectedIndex].text;
|
||||
inputVal = inputVal.replace(",", ".");
|
||||
var xhttp = new XMLHttpRequest();
|
||||
try {
|
||||
url = basepath + "/setPreValue.html?value=" + inputVal + "&numbers=" + _number;
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
response = xhttp.responseText;
|
||||
document.getElementById("result").innerHTML=response;
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
// alert("Deleting Config.ini failed");
|
||||
}
|
||||
}
|
||||
|
||||
function loadPrevalue(_basepath) {
|
||||
var sel = document.getElementById("Numbers_value1");
|
||||
var _number = sel.options[sel.selectedIndex].text;
|
||||
|
||||
var xhttp = new XMLHttpRequest();
|
||||
try {
|
||||
url = _basepath + '/setPreValue.html?numbers=' + _number;
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
response = xhttp.responseText;
|
||||
document.getElementById("prevalue").innerHTML=response;
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
// alert("Deleting Config.ini failed");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function numberChanged(){
|
||||
loadPrevalue(basepath);
|
||||
}
|
||||
|
||||
function UpdateNUMBERS(_sel){
|
||||
zw = getNUMBERInfo();
|
||||
|
||||
index = 0;
|
||||
|
||||
var _index = document.getElementById("Numbers_value1");
|
||||
while (_index.length){
|
||||
_index.remove(0);
|
||||
}
|
||||
|
||||
for (var i = 0; i < zw.length; ++i){
|
||||
var option = document.createElement("option");
|
||||
option.text = zw[i]["name"];
|
||||
option.value = i;
|
||||
_index.add(option);
|
||||
|
||||
if (typeof _sel !== 'undefined') {
|
||||
if (zw[i]["name"] == _sel)
|
||||
index = i
|
||||
}
|
||||
}
|
||||
_index.selectedIndex = index;
|
||||
|
||||
loadPrevalue(basepath);
|
||||
}
|
||||
|
||||
|
||||
function init(){
|
||||
basepath = getbasepath();
|
||||
loadConfig(basepath);
|
||||
ParseConfig();
|
||||
UpdateNUMBERS();
|
||||
loadPrevalue(basepath);
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user