- 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:
2019-03-27 21:51:22 +00:00
parent e74e5fd6f8
commit ce0cb93c14
2 changed files with 52 additions and 5 deletions
+19 -1
View File
@@ -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)