
Form.resize(820, 454)
Form.setObjectName("Form")
historyLength=1800
self.graphicsView = PlotWidget(Form)
self.graphicsView.setGeometry(QtCore.QRect(10, 10, 261, 121))
self.graphicsView.setObjectName("graphicsView")
self.graphicsView.setLabel(axis="left",text='sEMG Voltage')
self.graphicsView.setLabel(axis='bottom',text='Time')
self.graphicsView.setMouseEnabled(x=False,y=False)
self.graphicsView.setAntialiasing(True)
self.graphicsView.enableMouse(False)
self.data1 = np.random.normal(size=1800)
self.curve2 = self.graphicsView.plot(self.data1)
self.ptr1 = 0
def update1():
global data1, ptr1
self.graphicsView.setRange(xRange=[self.ptr1,self.ptr1+historyLength],yRange=[0,500],padding=0)
self.data1[:-1] = self.data1[1:] # shift data in the array one sample left
self.data1[-1] = random.uniform(0,500)
self.ptr1 += 1
self.curve2.setData(self.data1)
self.curve2.setPos(self.ptr1, 0)
self.timer = pg.QtCore.QTimer()
self.timer.timeout.connect(update1)
self.timer.start(10)
设置了 buttonsHidden = True 还是去不掉
