프로젝트

일반

사용자정보

개정판 2d0fedb1

ID2d0fedb1a3ffab1b8fb7cd8d087252efd8c8b854
상위 5457da8f
하위 3a04bc04

함의성이(가) 약 5년 전에 추가함

issue #663: fix progress bar

Change-Id: I6b33f5489ee7a996b8b0e5e26b068b53c49100ad

차이점 보기:

DTI_PID/DTI_PID/RecognitionDialog.py
340 340
                    if worker.isTrainingChecked:
341 341
                        import uuid
342 342
                        worker.displayTitle.emit(worker.tr('Generating Data...'))
343
                        listWidget.addItem('Generating Data...')
343 344

  
344 345
                        for item in searchedSymbolList:
345 346
                            path = os.path.join(project.getTempPath(), 'Tile', item.getBaseSymbol())
......
348 349
                            _img = app_doc_data.imgSrc[round(item.getSp()[1]):round(item.getSp()[1] + item.getHeight()),
349 350
                                   round(item.getSp()[0]):round(item.getSp()[0] + item.getWidth())]
350 351
                            cv2.imwrite(os.path.join(path, str(uuid.uuid4()) + '.png'), _img)
352
                        worker.updateBatchProgress.emit(len(srcList), 4)
351 353
                        continue
352 354

  
353 355
                    pool = futures.ThreadPoolExecutor(max_workers=THREAD_MAX_WORKER)
......
1735 1737
        self.ui.lineCheckBox.stateChanged.connect(self.checkBoxChanged)
1736 1738
        self.ui.checkBoxSymbol.stateChanged.connect(self.checkBoxChanged)
1737 1739
        self.ui.checkBoxText.stateChanged.connect(self.checkBoxChanged)
1738
        # self.ui.checkBoxTraining.stateChanged.connect(self.checkBoxChanged)
1740
        self.ui.checkBoxTraining.stateChanged.connect(self.checkBoxChanged)
1739 1741
        self.isAccepted = False
1740 1742
        self.batch = batch
1741 1743

  
......
1761 1763
        self.ui.lineCheckBox.setCheckState(Qt.Unchecked)
1762 1764
        self.ui.checkBoxText.setCheckState(Qt.Unchecked)
1763 1765

  
1766
        self.ui.progressBarBatch.setFormat('{}/{}'.format('0', str(len(self.path))))
1767

  
1764 1768
    def checkBoxChanged(self, checkState):
1765 1769
        '''
1766 1770
        @brief      line and text cannot be reocognized alone
1767 1771
        @author     euisung
1768 1772
        @date       2019.05.14
1769 1773
        '''
1774
        if self.ui.checkBoxTraining.isChecked():
1775
            self.ui.lineCheckBox.setCheckState(Qt.Unchecked)
1776
            self.ui.checkBoxText.setCheckState(Qt.Unchecked)
1777
            self.ui.checkBoxSymbol.setCheckState(Qt.Checked)
1778
            self.ui.lineCheckBox.setEnabled(False)
1779
            self.ui.checkBoxText.setEnabled(False)
1780
            self.ui.checkBoxSymbol.setEnabled(False)
1781
            return
1782
        else:
1783
            self.ui.lineCheckBox.setEnabled(True)
1784
            self.ui.checkBoxText.setEnabled(True)
1785
            self.ui.checkBoxSymbol.setEnabled(True)
1786

  
1770 1787
        if checkState is int(Qt.Checked):
1771 1788
            if self.ui.lineCheckBox.isChecked() and not self.ui.checkBoxSymbol.isChecked():
1772 1789
                self.ui.checkBoxSymbol.setCheckState(Qt.Checked)
......
1843 1860
            @date   2018.11.28
1844 1861
        '''
1845 1862
        self.ui.progressBarBatch.setMaximum(maxValue * 5)
1846
        self.ui.progressBarBatch.setValue(self.ui.progressBarBatch.value() + weight)
1863
        value = self.ui.progressBarBatch.value() + weight
1864
        self.ui.progressBarBatch.setValue(value)        
1865
        self.ui.progressBarBatch.setFormat('{}/{}'.format(str(int(value/(maxValue * 5))), str(maxValue)))
1847 1866

  
1848 1867
    '''
1849 1868
        @brief      display title

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)