small cp changes

This commit is contained in:
Ruben van de Ven 2021-10-20 10:03:45 +02:00
parent caf7b59497
commit 752abb0cc6
3 changed files with 45 additions and 5 deletions

View File

@ -225,6 +225,9 @@ class CentralManagement():
if signal.name == 'start':
self.makeHit()
self.lastHitTime = datetime.datetime.now()
elif signal.name == 'stop':
self.logger.warning("Stop request")
self.isRunning.clear()
elif signal.name == 'hit.scan':
# start a scan
if signal.params['id'] != self.currentHit.id:

View File

@ -275,6 +275,8 @@ class ConfigWebSocketHandler(tornado.websocket.WebSocketHandler):
self.plotterQ.put("reconnect")
elif msg['action'] == 'scanner_test':
self.eventQ.put(Signal('scan.test'))
elif msg['action'] == 'stop':
self.eventQ.put(Signal('stop'))
# elif msg['action'] == 'info':
# self.eventQ.put(Signal('assignment.info', dict(

View File

@ -10,10 +10,28 @@
font-family: sans-serif;
background-color: black;
color: white;
font-size: 30px;
}
main{
width: 700px;
margin: 50px auto;
}
a{
background-color:lightblue;
color:white;
text-decoration: none;
cursor: pointer;
padding: 5px;
border-radius: 5px;
}
a:hover{
background-color: blue;
}
a:active{
background-color: red;;
}
li{
margin-top: 50px;
}
</style>
<script src="../worker_specs/reconnecting-websocket.min.js"></script>
@ -41,7 +59,7 @@
app.hits = a;
})
function disablemotors() {
function disablemotors(el) {
ws.send(JSON.stringify({
'action': 'disable_motors',
}));
@ -61,18 +79,35 @@
'action': 'start',
}));
}
function stopServer() {
ws.send(JSON.stringify({
'action': 'stop',
}));
}
</script>
</head>
<body>
<main>
<h1>Guest Worker Control Panel</h1>
<ol>
<li><a onclick="disablemotors()">Disable motors</a> & double check pen position is at 0,0 (bottom right, as seen from the inside)</li>
<li><a onclick="resetPenPosition()">Reset Pen position</a> to make sure it's in start position</li>
<li><a onclick="testScanner()">Test scanner</a></li>
<li><a onclick="startServer()">Start the server!</a></li>
<li><a onclick="disablemotors(this)">Disable motors</a> </li>
<li>Place pen in the holder and move it to position 0,0 (bottom left, as seen from the outside)</li>
<li><a onclick="resetPenPosition()">Pen to start position</a> [pen should now move to top right position]</li>
<li>Power on scanner, verify cog position</li>
<li><a onclick="testScanner()">Test scanner</a> - if it blinks orange: turn it off by holding power; turn on again and retry</li>
<li><a onclick="startServer()">Start the work!</a></li>
<li><a href="/backend">Exit setup</a></li>
</ol>
<br>
<br>
<hr>
<br>
<br>
<h3>Stop</h3>
<ol>
<li><a onclick="stopServer()">Stop the work</a> ... then wait a few minutes before powering off computer</li>
</ol>
</main>
</body>
</html>