- added pause, continue, restart of receipe
- added signal handler for controlling the controller git-svn-id: http://moon:8086/svn/projects/HendiControl@148 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import time
|
||||
import signal
|
||||
import json
|
||||
from controller import Controller
|
||||
from mass import Mass
|
||||
@@ -38,6 +38,24 @@ def results_plot(self):
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
def handler(signum, frame):
|
||||
print('Signal handler called with signal', signum)
|
||||
|
||||
if signum == signal.SIGABRT:
|
||||
ablauf.stop()
|
||||
if signum == signal.SIGINT:
|
||||
ablauf.pause()
|
||||
if signum == signal.SIGCONT:
|
||||
ablauf.cont()
|
||||
if signum == signal.SIGHUP:
|
||||
ablauf.restart()
|
||||
|
||||
# Set the signal handler and a 5-second alarm
|
||||
signal.signal(signal.SIGABRT, handler)
|
||||
signal.signal(signal.SIGINT, handler)
|
||||
signal.signal(signal.SIGCONT, handler)
|
||||
signal.signal(signal.SIGHUP, handler)
|
||||
|
||||
fp = open("brewpi.json")
|
||||
configJson = json.load(fp)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user