def __create_gui(self):
# Add subplots
self.figure = Mat_figure(figsize=(5, 3), dpi=100)
self.subplotTop = self.figure.add_subplot(211)
self.subplotBottom = self.figure.add_subplot(212)
# Add labels
self.subplotTop.set_xlabel('Frames')
self.subplotBottom.set_xlabel('Hz')
# Change font size
matplotlib.rcParams.update({'font.size': 10})
# Create canvas
self.canvas = FigureCanvasTkAgg(self.figure, master=self.root)
self.canvas.show()
self.canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
# We store the data that is interchanged from GuiSignalProcessor to GuiSignalPlotter in a queue
self.dataQueue = LifoQueue()
# Create thread that displays signal
self.signalPlotThread = GuiSignalPlotter(self.root, self.cameraInstance, self.figure, self.canvas,
self.subplotTop, self.subplotBottom, self.statusbar,
self.video_display, self.dataQueue)
# Create thread that processes signal
self.signalProcessorThread = GuiSignalProcessor(self.root, self.cameraInstance, self.figure, self.canvas,
self.subplotTop, self.subplotBottom, self.statusbar,
self.video_display, self.dataQueue)
# Start both threads
self.signalPlotThread.start()
self.signalProcessorThread.start()
评论列表
文章目录