diff --git a/Control/brewpi/brewpi.py b/Control/brewpi/brewpi.py index 8e9e598..241f2a8 100644 --- a/Control/brewpi/brewpi.py +++ b/Control/brewpi/brewpi.py @@ -5,6 +5,8 @@ import json from controller import Controller from mass import Mass from stirrer import Stirrer +from pololu1376 import Pololu1376 + from matplotlib.pyplot import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show, subplot def results_plot(self): @@ -36,11 +38,13 @@ def results_plot(self): if __name__ == '__main__': - fp = open("brewpi.cfg.json") + fp = open("brewpi.json") configJson = json.load(fp) - plant = Mass(configJson["WaterSim"]) - ruehrer = Stirrer(configJson["Controller"]['dt']) + plant_class = globals()[configJson["Controller"]['plant_name']] + plant = plant_class(configJson["WaterSim"]) + ruehrer_class = globals()[configJson["Controller"]['stirrer_name']] + ruehrer = ruehrer_class(configJson["Controller"]['dt']) ablauf = Controller(configJson["Controller"], plant, ruehrer)