def __init__(self): super(MainWindow, self).__init__() Ui_MainWindow.__init__(self) self.setupUi(self) self.n = 1 # 執行緒自定義訊號連線的槽函式 self.work = WorkThread() self.work.start() self.work.changePixmap.connect(self.img_output.setPixmap) self.start_btn.clicked.connect(self.execute) self.close_btn.clicked.connect(QCoreApplication.instance().quit)
def __init__(self): global Admin super(MainWindow,self).__init__() # RUN __init__ Ui_MainWindow.__init__(self) self.setupUi(self) self.dd = [] Admin =1 self.step = 0 self.Base = 0 self.pathData_csv = '/home/pi/Desktop/Project_PA/data_csv/' self.tdfn = str(datetime.date.today()) self.csvHorizenTitle=({'Date':[],'Time':[],'0.2':[],'0.5':[],'0.7':[]}) self.try_tdcsvexist() self.Loadcsv_2history() # Timer self.timer_sysTime = QTimer(self) self.timer_sysTime.timeout.connect(self.SystemTime) self.timer_sysTime.start(1000) self.Bimg = []### bnuffer save img-bas self.ProcessCam = Camera() self.ProcessCam.rawimg.connect(self.showData2) # 槽功能:取得並顯示影像 self.openCam() self.workerSP = systemProcessing() try: # Restart machine to avoid error-rotate self.workerSP.GPIO_reStart() except: print('GPIO reStart failed.') return self.pushButton_Stop.setEnabled(False) self.pushButton_AUTO.clicked.connect(self.work_AUTO) self.pushButton_Stop.clicked.connect(self.work_STOP) self.pushButton_Catch.clicked.connect(self.work_Catch) self.Button_init.clicked.connect(self.bacereset) self.Button_SW.clicked.connect(self.RGB_SW)