- reworked
git-svn-id: http://moon:8086/svn/projects/HendiControl@113 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
+14
-18
@@ -3,29 +3,25 @@
|
||||
import time
|
||||
import json
|
||||
import configparser
|
||||
from pid import Pid
|
||||
from controller import Controller
|
||||
from mass import Mass
|
||||
|
||||
def getValue(s):
|
||||
|
||||
v = s.split(' ')[0]
|
||||
|
||||
return v
|
||||
|
||||
def getUnit(s):
|
||||
|
||||
u = s.split(' ')[1]
|
||||
|
||||
return u
|
||||
|
||||
if __name__ == '__main__':
|
||||
config = configparser.RawConfigParser()
|
||||
config.read('brewpi.cfg')
|
||||
print (getValue(config.get('Global', 'samplerate')))
|
||||
print (getValue(config.get('Controller', 'cont_ctrl')))
|
||||
print (getValue(config.get('Controller', 'heatrate')))
|
||||
|
||||
fp = open("brewpi.cfg.json")
|
||||
configJson = json.load(fp)
|
||||
print (json.dumps({'config' : configJson}, indent=4, sort_keys=True))
|
||||
|
||||
plant = Mass(configJson["Simulation"])
|
||||
temp = plant.getTemperature()
|
||||
|
||||
fp = open("Rezept-001.json")
|
||||
recipeJson = json.load(fp)
|
||||
|
||||
ablauf = Controller(configJson["Controller"], plant)
|
||||
ablauf.start(recipeJson)
|
||||
ablauf.stop()
|
||||
|
||||
print ("End of program.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user