프로젝트

일반

사용자정보

개정판 0ae849c3

ID0ae849c307a061f241f99d1d45da4c182d4acd48
상위 afb3132b
하위 1da2ccd2, 55814098

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

issue #901: fix multi line line no

Change-Id: I44ad58c39430c2081225cc894fc764949535a816

차이점 보기:

DTI_PID/DTI_PID/ItemTreeWidget.py
637 637
                if data is not None and data is item:
638 638
                    return foundItem
639 639
        elif type(item) is QEngineeringLineNoTextItem:
640
            foundItems = self.findItems(item.text() , Qt.MatchExactly|Qt.MatchRecursive, 0)
640
            foundItems = self.findItems(item.text().replace('\n', '') , Qt.MatchExactly|Qt.MatchRecursive, 0)
641 641
            for foundItem in foundItems:
642 642
                data = foundItem.data(0, self.TREE_DATA_ROLE)
643 643
                if data is not None and data is item:
DTI_PID/DTI_PID/SymbolThicknessDialog.py
27 27
    def accept(self):
28 28
        size = self.ui.spinBox.value()
29 29
        if size:
30
            try:
31
                project = AppDocData.instance().getCurrentProject()
32
                rootPath = project.getImageFilePath()
33
                rootList = os.listdir(rootPath)
30
            reply = QMessageBox.question(self, self.tr('Continue?'), self.tr('Are you sure to continue?'), QMessageBox.Yes, QMessageBox.Cancel)
31
            if reply == QMessageBox.Yes:
32
                try:
33
                    project = AppDocData.instance().getCurrentProject()
34
                    rootPath = project.getImageFilePath()
35
                    rootList = os.listdir(rootPath)
34 36

  
35
                for folder in rootList:
36
                    path = os.path.join(rootPath, folder)
37
                    imgList = os.listdir(path)
37
                    for folder in rootList:
38
                        path = os.path.join(rootPath, folder)
39
                        imgList = os.listdir(path)
38 40

  
39
                    for imgPath in imgList:
40
                        fullPath = os.path.join(path, imgPath)
41
                        img = cv2.imread(fullPath, cv2.IMREAD_GRAYSCALE)
42
                        kernel = np.ones((size, size), np.uint8)
41
                        for imgPath in imgList:
42
                            fullPath = os.path.join(path, imgPath)
43
                            img = cv2.imread(fullPath, cv2.IMREAD_GRAYSCALE)
44
                            kernel = np.ones((size, size), np.uint8)
43 45

  
44
                        height, width = img.shape[0], img.shape[1]
45
                        new = np.ones((height + 2 * size, width + 2 * size), np.uint8) * 255
46
                        new[size:size+height, size:size+width] = img
46
                            height, width = img.shape[0], img.shape[1]
47
                            new = np.ones((height + 2 * size, width + 2 * size), np.uint8) * 255
48
                            new[size:size+height, size:size+width] = img
47 49

  
48
                        e = cv2.erode(new, kernel, iterations=1)
49
                        cv2.imwrite(fullPath, e)
50
                            e = cv2.erode(new, kernel, iterations=1)
51
                            cv2.imwrite(fullPath, e)
50 52

  
51
                QMessageBox.information(self, self.tr('Information'), self.tr('Succeeded'))
52
            except Exception as ex:
53
                from App import App
54
                from AppDocData import MessageType
53
                    QMessageBox.information(self, self.tr('Information'), self.tr('Succeeded'))
54
                except Exception as ex:
55
                    from App import App
56
                    from AppDocData import MessageType
55 57

  
56
                message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
57
                App.mainWnd().addMessage.emit(MessageType.Error, message)
58
                    message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
59
                    App.mainWnd().addMessage.emit(MessageType.Error, message)
58 60

  
59
        QDialog.accept(self)
61
            QDialog.accept(self)
60 62

  
61 63
    def reject(self):
62 64
        QDialog.reject(self)

내보내기 Unified diff

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