Files
AI-on-the-edge-device/sd-card/html/edit_check.html
2020-09-04 18:59:00 +02:00

112 lines
3.5 KiB
HTML

<html>
<body>
<table>
<tr><td>Result:</td></tr>
<tr>
<td>
<iframe name="maincontent" id ="maincontent" width="800px" height="800px"></iframe>
</td>
<td>
<p>
<input type="submit" id="take" onclick="doTake()" value="1. Take Picture">
</p>
<p>
<input type="submit" id="align" onclick="doAlign()" value="2. Align Image"><br>
Takes up to 2 Minutes!
</p>
Digits and Analog recognition not yet implemented.
<p>
<input type="submit" id="digits" onclick="doDigits()" value="3a. Analyse Digits">
</p>
<p>
<input type="submit" id="analog" onclick="doAnalog()" value="3b Analyse Analog">
</p>
</td>
</tr>
</table>
<script type="text/javascript" src="./gethost.js"></script>
<script type="text/javascript" src="./readconfig.js"></script>
<script type="text/javascript">
var basepath = "http://192.168.178.26";
function doAnalog(){
var xhttp = new XMLHttpRequest();
url = basepath + "/editflow.html?task=test_analog";
if (basepath.length > 0){
url = url + "&host=" + basepath;
}
xhttp.open("GET", url, false);
xhttp.send();
var html = xhttp.responseText;
html = html.replace("src=\"/", "src=\"" + basepath + "/");
document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
}
function doDigits(){
var xhttp = new XMLHttpRequest();
url = basepath + "/editflow.html?task=test_digits";
if (basepath.length > 0){
url = url + "&host=" + basepath;
}
xhttp.open("GET", url, false);
xhttp.send();
var html = xhttp.responseText;
html = html.replace("src=\"/", "src=\"" + basepath + "/");
document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
}
function doAlign(){
var xhttp = new XMLHttpRequest();
url = basepath + "/editflow.html?task=test_align";
if (basepath.length > 0){
url = url + "&host=" + basepath;
}
xhttp.open("GET", url, false);
xhttp.send();
var html = xhttp.responseText;
html = html.replace("src=\"/", "src=\"" + basepath + "/");
document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
document.getElementById("align").disabled = false;
// document.getElementById("digits").disabled = false;
// document.getElementById("analog").disabled = false;
}
function doTake(){
var xhttp = new XMLHttpRequest();
url = basepath + "/editflow.html?task=test_take";
if (basepath.length > 0){
url = url + "&host=" + basepath;
}
xhttp.open("GET", url, false);
xhttp.send();
var html = xhttp.responseText;
document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
document.getElementById("align").disabled = false;
document.getElementById("digits").disabled = true;
document.getElementById("analog").disabled = true;
}
function Init(){
basepath = getbasepath();
document.getElementById("align").disabled = true;
document.getElementById("digits").disabled = true;
document.getElementById("analog").disabled = true;
}
Init();
</script>
</body>
</html>