-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html(non-compressed)
75 lines (75 loc) · 3.74 KB
/
index.html(non-compressed)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name=viewport content='width=400'>
<style type="text/css">
body{font-family:Arial;margin:0;color:#212f3c}a:link{text-decoration:none;color:#ebedef}a:visited{text-decoration:none;color:#ebedef}a:hover{text-decoration:underline;color:#ebedef}a:active{text-decoration:underline;color:#ebedef}.header{padding:5px;text-align:center;background:#85929e;color:#1c2833;font-size:20px}.footer{position:fixed;left:0;bottom:0;width:100%;background-color:#85929e;color:#ebedef;text-align:center}.table,td,th{border:0 solid #000;border-collapse:collapse;text-align:center}
</style><body style="text-align:center;"><center><div>
<div class="header"><big><i><b>Wash & Cure</big></b></i><br><small>Resin printing post processing station control.</small></div><br><br>
System Status: <span id="status"></span>
<br><br><br><table>
<tr><th>Wash Minutes</th><th></th><th>Cure Minutes</th></tr>
<tr><td><button onclick="send(1)">∆ Wash ∆</button></td><td></td><td><button onclick="send(3)">∆ Cure ∆</button></td></tr>
<tr><td><span id="wash_val">0</span></td><td></td><td><span id="cure_val">0</span></td></tr>
<tr><td><button onclick="send(2)">∇ Wash ∇</button></td><td></td><td><button onclick="send(4)">∇ Cure ∇</button></td></tr>
<tr><td></td><td><br></td><td></td></tr></table>
<br><br><table><tr><td><button onclick="send(6)">▣ PAUSE ▣</button></td></tr><tr><td><button onclick="send(7)">∎ STOP ∎</button></td></tr><tr><td><button onclick="send(5)">↯ SAVE ↯</button></td></tr></table></div>
<script>
document.addEventListener("DOMContentLoaded", function() {
getData();
});
function send(data)
{
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "wncchange?go="+data, true);
xhttp.send();
setTimeout(function() { getData(); }, 3);
}
setInterval(function()
{
getData();
}, 2000);
function getData() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myArr = JSON.parse(this.responseText);
document.getElementById("wash_val").innerHTML = myArr[0];
document.getElementById("cure_val").innerHTML = myArr[1];
if (myArr[2] == 50) {
document.getElementById("status").innerHTML = "Ready.";
}
if (myArr[2] == 202) {
document.getElementById("status").innerHTML = "Currently curing, 1 minute remaining.";
}
if (myArr[2] > 202) {
var mleft = myArr[2] - 201;
document.getElementById("status").innerHTML = "Currently curing, " + mleft + " minutes remaining.";
}
if (myArr[2] == 302) {
document.getElementById("status").innerHTML = "Currently washing, 1 minute remaining.";
}
if (myArr[2] > 302) {
var mleft = myArr[2] - 301;
document.getElementById("status").innerHTML = "Currently washing, " + mleft + " minutes remaining.";
}
if (myArr[2] > 400) {
var mleft = myArr[2] - 401;
document.getElementById("status").innerHTML = "Paused curing, " + mleft + " minutes remaining.";
}
if (myArr[2] > 500) {
var mleft = myArr[2] - 501;
document.getElementById("status").innerHTML = "Paused washing, " + mleft + " minutes remaining.";
}
this.responseText;
}
};
xhttp.open("GET", "wncinfo", true);
xhttp.send();
}
</script>
<div class="footer"><p><script>document.write('<a href="' + window.location.protocol + '//' + window.location.hostname + ':777' + window.location.pathname + 'update" >revision: 0.9.3</a> ' );</script></p></div>
</center>
</body>
</html>