- better logging of drivers

git-svn-id: http://moon:8086/svn/projects/HendiControl@363 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2020-04-19 16:05:53 +00:00
parent b51e2c222d
commit 95afea668f
6 changed files with 48 additions and 22 deletions
+8 -2
View File
@@ -1,11 +1,13 @@
#!/usr/bin/python3
import logging
import argparse
import signal
import json
from controller import Controller, commands
from mass import Mass
from stirrer import Stirrer
#from pololu1376 import Pololu1376
from pololu1376 import Pololu1376
from plant import Plant
from matplotlib.pyplot import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show, subplot
@@ -49,6 +51,10 @@ def results_plot(self):
if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)
FORMAT = '%(asctime)-15s %(user)-8s %(message)s'
logging.basicConfig(format=FORMAT)
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')
@@ -93,7 +99,7 @@ if __name__ == '__main__':
configJson = json.load(fp)
plant_class = globals()[configJson["Controller"]['plant_name']]
plant = plant_class(configJson["WaterSim"])
plant = plant_class()
ruehrer_class = globals()[configJson["Controller"]['stirrer_name']]
ruehrer = ruehrer_class(configJson["Stirrer"])