- use thread for controller
- leave plot stuff in main thread git-svn-id: http://moon:8086/svn/projects/HendiControl@127 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -2,11 +2,37 @@
|
||||
|
||||
import time
|
||||
import json
|
||||
import configparser
|
||||
from pid import Pid
|
||||
from controller import Controller
|
||||
from mass import Mass
|
||||
from stirrer import Stirrer
|
||||
from matplotlib.pyplot import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show, subplot
|
||||
|
||||
def results_plot(self):
|
||||
|
||||
figure(1)
|
||||
subplot(4, 1, 1)
|
||||
plot(self.time_v, self.theta_v, 'b-', linewidth=1)
|
||||
title('Temperature')
|
||||
grid(True)
|
||||
ylabel('°C')
|
||||
subplot(4, 1, 2)
|
||||
plot(self.time_v, self.power_v, 'r-', linewidth=1)
|
||||
title('Power')
|
||||
grid(True)
|
||||
ylabel('W')
|
||||
subplot(4, 1, 3)
|
||||
plot(self.time_v, self.error_v, 'b-', linewidth=1)
|
||||
title('Error')
|
||||
grid(True)
|
||||
ylabel('°C')
|
||||
subplot(4, 1, 4)
|
||||
plot(self.time_v, self.heatrate_v, 'r-', linewidth=1)
|
||||
title('Heatrate')
|
||||
grid(True)
|
||||
ylabel('°C/min')
|
||||
xlabel('t/min')
|
||||
show()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -21,7 +47,9 @@ if __name__ == '__main__':
|
||||
recipeJson = json.load(fp)
|
||||
|
||||
ablauf.start(recipeJson)
|
||||
ablauf.stop()
|
||||
ablauf.wait_finished()
|
||||
|
||||
results_plot(ablauf)
|
||||
|
||||
print ("End of program.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user