예제 #1
0
 def cal(self):
     from Core.utils import checkFile, checkDir, checkOutputDir, checkOutputFile
     if ((not self.CheckNorm) and (not self.CheckBFC)):
         QMessageBox.information(self, "Warning",
                                 "Please Choose at least one function!",
                                 QMessageBox.Yes)
         return
     if self.RadioSingle.isChecked():
         if checkFile(self.imageFile) == 1 or checkOutputFile(
                 self.outputPath) == 1:
             QMessageBox.information(self, "Warning",
                                     "The image path is not valid!",
                                     QMessageBox.Yes)
             return
     else:
         if len(checkDir(self.imageFile)) == 0 or checkOutputDir(
                 self.outputPath) == 1:
             QMessageBox.information(self, "Warning",
                                     "The image path is not valid!",
                                     QMessageBox.Yes)
             return
     self.thread = calThread(self.imageFile, self.outputPath,
                             self.CheckBFC.isChecked(),
                             self.CheckNorm.isChecked(),
                             self.RadioSingle.isChecked())
     self.thread.signal.connect(self.process)
     self.thread.start()
     self.BtnStart.setDisabled(True)
     self.BtnStart.setText("Calculating...")
예제 #2
0
 def runCal(self):
     from Core.utils import checkFile, checkDir
     self.pbar.setValue(1)
     if (self.fileRadiobtn.isChecked()):
         if checkFile(self.imageFile) == 1:
             QMessageBox.information(self, "Warning",
                                     "The image path is not valid!",
                                     QMessageBox.Yes)
             return
         self.thread = RunThread(self.imageFile,
                                 self.maskFile,
                                 self.fileName,
                                 type='singleFile')
     else:
         if len(checkDir(self.directory1)) == 0:
             QMessageBox.information(self, "Warning",
                                     "The directory path is not valid!",
                                     QMessageBox.Yes)
             return
         self.thread = RunThread(self.directory1,
                                 self.directory2,
                                 self.fileName,
                                 type="dir")
     self.thread.start()
     # self.thread2 = procThread()
     # self.thread2.start()
     self.thread.trigger.connect(self.process)
     self.btnStart.setText("Calculating...")
     self.btnStart.setDisabled(True)
예제 #3
0
 def cal(self):
     if self.RadioSingle.isChecked():
         if checkFile(self.imageFile) == 1 or checkOutputFile(self.outputPath) == 1:
             QMessageBox.information(self, "Warning", "The image path is not valid!", QMessageBox.Yes)
             return
     else:
         if len(checkDir(self.imageFile)) == 0 or checkOutputDir(self.outputPath) == 1:
             QMessageBox.information(self, "Warning", "The image path is not valid!", QMessageBox.Yes)
             return
     if((self.imageFile is None) and (self.outputPath is None)):
         QMessageBox.information(self, "Warning", "Please Choose the path!", QMessageBox.Yes)
         return
     self.thread = calThread(self.imageFile, self.outputPath,self.RadioSingle.isChecked())
     self.thread.signal.connect(self.process)
     self.thread.start()
     self.BtnStart.setDisabled(True)
     self.BtnStart.setText("Calculating...")
예제 #4
0
 def cal(self):
     '''
     这里hd-bet内部自动会判断输入的是文件夹/文件,故没有判断
     :return:
     '''
     from Core.utils import checkDir,checkFile,checkOutputFile,checkOutputDir
     if self.RadioSingle.isChecked():
         if (checkFile(self.imageFile) == 1 or checkOutputFile(self.outputPath) == 1):
             QMessageBox.information(self, "Warning", "The image path is not valid!", QMessageBox.Yes)
             return
     else:
         if (len(checkDir(self.imageFile)) == 0 or checkOutputDir(self.outputPath) == 1):
             QMessageBox.information(self, "Warning", "The image path is not valid!", QMessageBox.Yes)
             return
     self.thread = calThread(self.imageFile,self.outputPath,self.RadioFast.isChecked())
     self.thread.signal.connect(self.process)
     self.thread.start()
     self.BtnStart.setDisabled(True)
     self.BtnStart.setText("Calculating...")
예제 #5
0
 def slot_run0(self):  # 避免UI堵塞,开启新线程
     # self.pb = ProgressBar()     # 进度条显示
     # self.pb.show()
     from Core.utils import checkDir, checkFile
     if self.ui.RadioBtn_Dir.isChecked():
         if len(checkDir(self.filename_input)) == 0:
             QMessageBox.information(self, "Warning",
                                     "The directory path is not valid!",
                                     QMessageBox.Yes)
             return
     else:
         if checkFile(self.filename_input) == 1:
             QMessageBox.information(self, "Warning",
                                     "The image path is not valid!",
                                     QMessageBox.Yes)
             return
     self.ui.run_pushButton.setDisabled(True)
     self.thread = RunThread(self.filename_input,
                             self.directory_output,
                             Type=self.ui.RadioBtn_Dir.isChecked())
     self.thread.trigger.connect(self.process)
     self.thread.start()
예제 #6
0
    def Cal(self):

        from Core.utils import checkFile, checkDir
        if self.RdioSingleFile.isChecked():
            if checkFile(self.Image) == 1:
                QMessageBox.information(self, "Warning",
                                        "The image path is not valid!",
                                        QMessageBox.Yes)
                return
            self.thread = calculate(self.Image, self.RefImage, self.ResImage)
        else:
            if len(checkDir(self.directory1)) == 0:
                QMessageBox.information(self, "Warning",
                                        "The directory path is not valid!",
                                        QMessageBox.Yes)
                return
            self.thread = calculate(self.directory1,
                                    self.RefImage,
                                    self.directory2,
                                    type=1)
        self.BtnStart.setDisabled(True)
        self.thread.start()
        self.thread.signal.connect(self.process)