edit_check.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>Check</title>
  6. <style>
  7. h1 {font-size: 2em;}
  8. h2 {font-size: 1.5em; margin-block-start: 0.0em; margin-block-end: 0.2em;}
  9. h3 {font-size: 1.2em;}
  10. p {font-size: 1em;}
  11. .button {
  12. padding: 5px 10px;
  13. width: 210px;
  14. font-size: 16px;
  15. }
  16. </style>
  17. </head>
  18. <body style="font-family: arial">
  19. <table>
  20. <tr><td colspan="2">Result:</td></tr>
  21. <tr>
  22. <td>
  23. <iframe name="maincontent" id ="maincontent" width="700px" height="700px"></iframe>
  24. </td>
  25. <td style="padding-left: 15px;">
  26. <p>
  27. <input class="button" type="submit" id="take" onclick="doTake()" value="1. Take Picture">
  28. </p>
  29. <p>
  30. <input class="button" type="submit" id="align" onclick="doAlign()" value="2. Align Image"><br>
  31. </p>
  32. <p>
  33. Takes up to 2 Minutes!
  34. </p>
  35. Digits and Analog recognition not yet implemented.
  36. <p>
  37. <input class="button" type="submit" id="digits" onclick="doDigits()" value="3a. Analyse Digits">
  38. </p>
  39. <p>
  40. <input class="button" type="submit" id="analog" onclick="doAnalog()" value="3b Analyse Analog">
  41. </p>
  42. </td>
  43. </tr>
  44. </table>
  45. <script type="text/javascript" src="./gethost.js"></script>
  46. <script type="text/javascript" src="./readconfig.js"></script>
  47. <script type="text/javascript">
  48. var basepath = "http://192.168.178.26";
  49. function doAnalog(){
  50. var xhttp = new XMLHttpRequest();
  51. url = basepath + "/editflow.html?task=test_analog";
  52. if (basepath.length > 0){
  53. url = url + "&host=" + basepath;
  54. }
  55. xhttp.open("GET", url, false);
  56. xhttp.send();
  57. var html = xhttp.responseText;
  58. html = html.replace("src=\"/", "src=\"" + basepath + "/");
  59. document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
  60. }
  61. function doDigits(){
  62. var xhttp = new XMLHttpRequest();
  63. url = basepath + "/editflow.html?task=test_digits";
  64. if (basepath.length > 0){
  65. url = url + "&host=" + basepath;
  66. }
  67. xhttp.open("GET", url, false);
  68. xhttp.send();
  69. var html = xhttp.responseText;
  70. html = html.replace("src=\"/", "src=\"" + basepath + "/");
  71. document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
  72. }
  73. function doAlign(){
  74. var xhttp = new XMLHttpRequest();
  75. url = basepath + "/editflow.html?task=test_align";
  76. if (basepath.length > 0){
  77. url = url + "&host=" + basepath;
  78. }
  79. xhttp.open("GET", url, false);
  80. xhttp.send();
  81. var html = xhttp.responseText;
  82. html = html.replace("src=\"/", "src=\"" + basepath + "/");
  83. document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
  84. document.getElementById("align").disabled = false;
  85. // document.getElementById("digits").disabled = false;
  86. // document.getElementById("analog").disabled = false;
  87. }
  88. function doTake(){
  89. var xhttp = new XMLHttpRequest();
  90. url = basepath + "/editflow.html?task=test_take";
  91. if (basepath.length > 0){
  92. url = url + "&host=" + basepath;
  93. }
  94. xhttp.open("GET", url, false);
  95. xhttp.send();
  96. var html = xhttp.responseText;
  97. document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
  98. document.getElementById("align").disabled = false;
  99. document.getElementById("digits").disabled = true;
  100. document.getElementById("analog").disabled = true;
  101. }
  102. function Init(){
  103. basepath = getbasepath();
  104. document.getElementById("align").disabled = true;
  105. document.getElementById("digits").disabled = true;
  106. document.getElementById("analog").disabled = true;
  107. }
  108. Init();
  109. </script>
  110. </body>
  111. </html>