- 前面的例子中再扫描过程中按键响应后的扫描过程阻塞了主线程
def onScanClicked( self ):
dev = mrq.MRQ.MRQ( self.ui_deviceCombox.currentText() )
fileName = os.path.split(__file__)[0] + "/" + "inverse.dat"
(fAngle, fRange) = mrq.mrq_microstep_diagnosis.inverseScan( dev,
self.ui_chCombox.currentIndex(),
fileName )
self.plotFile( fileName, fAngle, fRange )
import threading
def scanProc( self ):
dev = mrq.MRQ.MRQ( self.ui_deviceCombox.currentText() )
fileName = os.path.split(__file__)[0] + "/" + "inverse.dat"
(fAngle, fRange) = mrq.mrq_microstep_diagnosis.inverseScan( dev,
self.ui_chCombox.currentIndex(),
fileName )
self.plotFile( fileName, fAngle, fRange )
def onScanClicked( self ):
t = threading.Thread( target = self.scanProc )
t.start()