def __init__(self, parent=None):
pyqtgraph.setConfigOption('background', 'w') #before loading widget
super(ExampleApp, self).__init__(parent)
self.setupUi(self)
self.grECG.plotItem.showGrid(True, True, 0.7)
self.btnSave.clicked.connect(self.saveFig)
self.btnSite.clicked.connect(self.website)
stamp="DIY ECG by Scott Harden"
self.stamp = pyqtgraph.TextItem(stamp,anchor=(-.01,1),color=(150,150,150),
fill=pyqtgraph.mkBrush('w'))
self.ear = swhear.Ear(chunk=int(100)) # determines refresh rate
# optionally you can manually set the audio input device to use like this:
# self.ear = swhear.Ear(chunk=int(100), device=5) # use audio input device 5
if len(self.ear.valid_input_devices()):
self.ear.stream_start()
self.lblDevice.setText(self.ear.msg)
self.update()
评论列表
文章目录