我想在wxPython(使用matplotlib?)--
到目前为止,我已经有了处理逻辑的代码:我正在创建一个PID控制器,并希望添加一个实时图形(假设两个样本之间有1秒的延迟,目前使用的是伪/随机样本)
到目前为止我的代码在这里(以下)-请告知import wx
import matplotlib as mpl
mpl.use('WXAgg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
# global constants
Kp = 10
Ki = 2
Kd = 1
# functions used
def AttentionBox( self, message ):
dialog = wx.MessageDialog(self, message, 'Attention!', wx.ICON_ERROR)
dialog.ShowModal()
dialog.Destroy()
def StatusBar( self, message=None):
statusMessage = "PID constants( " + str(Kp)+","+str(Ki)+","+str(Kd)+" ): "
self.statusbar.SetStatusText( statusMessage + message )
class PIDFra