[BrewPi]
- added command line arguments for receipe and config file - added receipe "sud_0010" git-svn-id: http://moon:8086/svn/projects/HendiControl@282 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
import argparse
|
||||||
import signal
|
import signal
|
||||||
import json
|
import json
|
||||||
from controller import Controller, commands
|
from controller import Controller, commands
|
||||||
@@ -49,6 +49,20 @@ def results_plot(self):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description='Brew some beer.')
|
||||||
|
parser.add_argument('--receipe', help='the name of the receipe')
|
||||||
|
parser.add_argument('--config', help='the name of the configuration file')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.receipe is None:
|
||||||
|
raise Exception("Invalid receipe")
|
||||||
|
|
||||||
|
config = "brewpi.json"
|
||||||
|
if args.config is not None:
|
||||||
|
config = args.config
|
||||||
|
|
||||||
|
|
||||||
stirr_isOn = False
|
stirr_isOn = False
|
||||||
|
|
||||||
def handler(signum, frame):
|
def handler(signum, frame):
|
||||||
@@ -75,7 +89,7 @@ if __name__ == '__main__':
|
|||||||
signal.signal(signal.SIGUSR1, handler)
|
signal.signal(signal.SIGUSR1, handler)
|
||||||
signal.signal(signal.SIGHUP, handler)
|
signal.signal(signal.SIGHUP, handler)
|
||||||
|
|
||||||
fp = open("brewpi.json")
|
fp = open(config)
|
||||||
configJson = json.load(fp)
|
configJson = json.load(fp)
|
||||||
|
|
||||||
plant_class = globals()[configJson["Controller"]['plant_name']]
|
plant_class = globals()[configJson["Controller"]['plant_name']]
|
||||||
@@ -85,7 +99,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
ablauf = Controller(configJson["Controller"], plant, ruehrer)
|
ablauf = Controller(configJson["Controller"], plant, ruehrer)
|
||||||
|
|
||||||
fp = open("Rezept-001.json")
|
fp = open(args.receipe)
|
||||||
recipeJson = json.load(fp)
|
recipeJson = json.load(fp)
|
||||||
|
|
||||||
ablauf.setRecipe(recipeJson)
|
ablauf.setRecipe(recipeJson)
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"Name" : "Sud-0010",
|
||||||
|
"Description" : "Rotfränkisch, Dunkles Lager",
|
||||||
|
"pot_weight_kg" : 5.960,
|
||||||
|
"pot_material" : "Edelstahl 18/10",
|
||||||
|
"Schuettung_kg" : 5.21,
|
||||||
|
"Wasser_kg" : 22,
|
||||||
|
"stirrSpeedHeat" : 30,
|
||||||
|
"stirrSpeedRast" : 30,
|
||||||
|
"stirrDutyRast" : 1.0,
|
||||||
|
"stirrCycleTime" : 120,
|
||||||
|
"Rasten" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"time" : 0,
|
||||||
|
"temp" : 57.0,
|
||||||
|
"heatRate" : 2.00,
|
||||||
|
"waitForUser" : true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time" : 40,
|
||||||
|
"temp" : 63.0,
|
||||||
|
"heatRate" : 1.00,
|
||||||
|
"waitForUser" : false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time" : 30,
|
||||||
|
"temp" : 72.0,
|
||||||
|
"heatRate" : 1.00,
|
||||||
|
"waitForUser" : false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time" : 0,
|
||||||
|
"temp" : 76.0,
|
||||||
|
"heatRate" : 1.00,
|
||||||
|
"waitForUser" : true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user