edit_check.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <html>
  2. <body>
  3. <table>
  4. <tr><td>Result:</td></tr>
  5. <tr>
  6. <td>
  7. <iframe name="maincontent" id ="maincontent" width="800px" height="800px"></iframe>
  8. </td>
  9. <td>
  10. <p>
  11. <input type="submit" id="take" onclick="doTake()" value="1. Take Picture">
  12. </p>
  13. <p>
  14. <input type="submit" id="align" onclick="doAlign()" value="2. Align Image"><br>
  15. Takes up to 2 Minutes!
  16. </p>
  17. Digits and Analog recognition not yet implemented.
  18. <p>
  19. <input type="submit" id="digits" onclick="doDigits()" value="3a. Analyse Digits">
  20. </p>
  21. <p>
  22. <input type="submit" id="analog" onclick="doAnalog()" value="3b Analyse Analog">
  23. </p>
  24. </td>
  25. </tr>
  26. </table>
  27. <script type="text/javascript" src="./gethost.js"></script>
  28. <script type="text/javascript" src="./readconfig.js"></script>
  29. <script type="text/javascript">
  30. var basepath = "http://192.168.178.26";
  31. function doAnalog(){
  32. var xhttp = new XMLHttpRequest();
  33. url = basepath + "/editflow.html?task=test_analog";
  34. if (basepath.length > 0){
  35. url = url + "&host=" + basepath;
  36. }
  37. xhttp.open("GET", url, false);
  38. xhttp.send();
  39. var html = xhttp.responseText;
  40. html = html.replace("src=\"/", "src=\"" + basepath + "/");
  41. document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
  42. }
  43. function doDigits(){
  44. var xhttp = new XMLHttpRequest();
  45. url = basepath + "/editflow.html?task=test_digits";
  46. if (basepath.length > 0){
  47. url = url + "&host=" + basepath;
  48. }
  49. xhttp.open("GET", url, false);
  50. xhttp.send();
  51. var html = xhttp.responseText;
  52. html = html.replace("src=\"/", "src=\"" + basepath + "/");
  53. document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
  54. }
  55. function doAlign(){
  56. var xhttp = new XMLHttpRequest();
  57. url = basepath + "/editflow.html?task=test_align";
  58. if (basepath.length > 0){
  59. url = url + "&host=" + basepath;
  60. }
  61. xhttp.open("GET", url, false);
  62. xhttp.send();
  63. var html = xhttp.responseText;
  64. html = html.replace("src=\"/", "src=\"" + basepath + "/");
  65. document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
  66. document.getElementById("align").disabled = false;
  67. // document.getElementById("digits").disabled = false;
  68. // document.getElementById("analog").disabled = false;
  69. }
  70. function doTake(){
  71. var xhttp = new XMLHttpRequest();
  72. url = basepath + "/editflow.html?task=test_take";
  73. if (basepath.length > 0){
  74. url = url + "&host=" + basepath;
  75. }
  76. xhttp.open("GET", url, false);
  77. xhttp.send();
  78. var html = xhttp.responseText;
  79. document.getElementById("maincontent").src = 'data:text/html,' + encodeURIComponent(html);
  80. document.getElementById("align").disabled = false;
  81. document.getElementById("digits").disabled = true;
  82. document.getElementById("analog").disabled = true;
  83. }
  84. function Init(){
  85. basepath = getbasepath();
  86. document.getElementById("align").disabled = true;
  87. document.getElementById("digits").disabled = true;
  88. document.getElementById("analog").disabled = true;
  89. }
  90. Init();
  91. </script>
  92. </body>
  93. </html>