本文整理汇总了Python中detector.Detector.isRunning方法的典型用法代码示例。如果您正苦于以下问题:Python Detector.isRunning方法的具体用法?Python Detector.isRunning怎么用?Python Detector.isRunning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类detector.Detector
的用法示例。
在下文中一共展示了Detector.isRunning方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DetectorUI
# 需要导入模块: from detector import Detector [as 别名]
# 或者: from detector.Detector import isRunning [as 别名]
class DetectorUI(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_Form()
self.ui.setupUi(self)
QtCore.QObject.connect(self.ui.startButton,QtCore.SIGNAL("clicked()"), self.start)
QtCore.QObject.connect(self.ui.pathButton,QtCore.SIGNAL("clicked()"), self.set_source_file_path)
QtCore.QObject.connect(self.ui.patternCheckBox,QtCore.SIGNAL("clicked()"), self.patternClicked)
self.detector = Detector()
def start(self):
if self.detector.isRunning():
self.setWindowTitle('Stopped')
self.detector.stop()
self.ui.startButton.setText("Start")
else:
self.setWindowTitle('Running')
self.detector.start()
self.ui.startButton.setText("Stop")
def set_source_file_path(self):
dir = os.path.dirname(".")
fileName = QtGui.QFileDialog.getOpenFileName (self, "Open data file", dir , "Image Files (*.txt)")
#Todo set the txt file as the data source
self.ui.pathEdit.setText(fileName)
def patternClicked(self):
if self.ui.patternCheckBox.isChecked() :
#output data pattern
print "patern enabeled"
else:
#output data source
print "patern disable"