프로젝트

일반

사용자정보

개정판 29426641

ID29426641ed850e16f59233992bca7f6a9b932e71
상위 8c8887e4
하위 f8f80cba

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

issue #663: fix preset, symbol tree

Change-Id: I1eb0025bbeaab7cd1c744383917abe5550cea5c3

차이점 보기:

DTI_PID/DTI_PID/RecognitionDialog.py
1577 1577
                    symGray = cv2.flip(symGray, 1)
1578 1578

  
1579 1579
                symbolRotatedAngle = 0
1580
                #for rc in range((symbolRotateCount + 1) * 2):  # Rotation count를 사용자 기준으로 받아서 1을 더한 후 사용
1580 1581
                for rc in range(symbolRotateCount + 1):  # Rotation count를 사용자 기준으로 받아서 1을 더한 후 사용
1581 1582
                    sw, sh = symGray.shape[::-1]
1582 1583
                    roiw = (roiItemEp[0] - roiItemSp[0])
1583 1584
                    roih = (roiItemEp[1] - roiItemSp[1])
1584 1585

  
1586
                    # get Rotated Original Point
1587
                    originalPoint = Worker.getCalculatedOriginalPoint(additionalSymbol, symbolOriginalPoint,
1588
                                                                      symbolRotatedAngle, sw, sh, sow, soh, flipped)
1589
                    connectionPoint = Worker.getCalculatedConnectionPoint(symbolConnectionPoint, symbolRotatedAngle, sw,
1590
                                                                          sh, sow, soh, flipped)
1591

  
1585 1592
                    # Case : symbol is bigger than roi
1586 1593
                    if roiw < sw or roih < sh:
1587 1594
                        symGray = cv2.rotate(symGray, cv2.ROTATE_90_CLOCKWISE)
1588 1595
                        symbolRotatedAngle = (symbolRotatedAngle + 90) % 360
1596
                        #cX, cY = originalPoint[0], originalPoint[0]
1597
                        #M = cv2.getRotationMatrix2D((cX, cY), 45, 1.0)
1598
                        #symGray = cv2.warpAffine(symGray, M, (sw, sh))
1599
                        #symbolRotatedAngle = (symbolRotatedAngle + 45) % 360
1589 1600

  
1590 1601
                        if baseSymbol is not None and additionalSymbol is not None:
1591 1602
                            additionalSymbol = Worker.getRotatedChildInfo(additionalSymbol)
1592 1603
                        continue
1593 1604

  
1594
                    # get Rotated Original Point
1595
                    originalPoint = Worker.getCalculatedOriginalPoint(additionalSymbol, symbolOriginalPoint,
1596
                                                                      symbolRotatedAngle, sw, sh, sow, soh, flipped)
1597
                    connectionPoint = Worker.getCalculatedConnectionPoint(symbolConnectionPoint, symbolRotatedAngle, sw,
1598
                                                                          sh, sow, soh, flipped)
1599

  
1600 1605
                    # For OPC
1601 1606
                    drawing_area = app_doc_data.getArea('Drawing')
1602 1607
                    if drawing_area is not None and (symbolType == "Piping OPC\'s" or symbolType == "Instrument OPC\'s"):
......
1777 1782
                    # rotate symbol
1778 1783
                    symGray = cv2.rotate(symGray, cv2.ROTATE_90_CLOCKWISE)
1779 1784
                    symbolRotatedAngle = (symbolRotatedAngle + 90) % 360
1785
                    #cX, cY = originalPoint[0], originalPoint[0]
1786
                    #M = cv2.getRotationMatrix2D((cX, cY), 45, 1.0)
1787
                    #symGray = cv2.warpAffine(symGray, M, (sw, sh))
1788
                    #symbolRotatedAngle = (symbolRotatedAngle + 45) % 360
1780 1789

  
1781 1790
                    if additionalSymbol is not None:
1782 1791
                        additionalSymbol = Worker.getRotatedChildInfo(additionalSymbol)
......
1924 1933
        # 검은색 점을 찾는 범위
1925 1934
        search_length = 10
1926 1935
        # Line 최소 Length
1927
        checkLineLength = 20;
1936
        checkLineLength = 20
1928 1937
        # Line 최대 Width
1929
        line_width = 8;
1938
        line_width = 18
1930 1939
        # flange min length
1931 1940
        flange_min = 30
1932 1941
        # flange max length
1933 1942
        flange_max = 50
1934 1943
        # 임시
1935
        temp_count = 0;
1944
        temp_count = 0
1936 1945
        find_list_x = []
1937 1946
        find_list_y = []
1938 1947
        for i in loopRange:
......
2045 2054
                    c_x, c_y, c_w, c_h = cv2.boundingRect(contour)
2046 2055
                    area = cv2.contourArea(contour)
2047 2056
                    if c_x <= x and c_x + c_w >= x and c_y <= y and c_y + c_h >= y:
2048
                        if flange_count * flange_max >= area:
2057
                        if flange_count * flange_max * 2 >= area:
2049 2058
                            #not_image[y, x] = 0
2050 2059
                            #from PIL import Image
2051 2060
                            #Image.fromarray(not_image).show()
......
2430 2439
                    symGray = cv2.flip(symGray, 1)
2431 2440

  
2432 2441
                symbolRotatedAngle = 0
2442
                #for rc in range((symbolRotateCount + 1) * 2):
2433 2443
                for rc in range(symbolRotateCount + 1):
2434 2444
                    sw, sh = symGray.shape[::-1]
2435 2445

  
......
2442 2452
                    if r_w < sw or r_h < sh:
2443 2453
                        symGray = cv2.rotate(symGray, cv2.ROTATE_90_CLOCKWISE)
2444 2454
                        symbolRotatedAngle = (symbolRotatedAngle + 90) % 360
2455
                        #cX, cY = originalPoint[0], originalPoint[0]
2456
                        #M = cv2.getRotationMatrix2D((cX, cY), 45, 1.0)
2457
                        #symGray = cv2.warpAffine(symGray, M, (sw, sh))
2458
                        #symbolRotatedAngle = (symbolRotatedAngle + 45) % 360
2445 2459
                        continue
2446 2460

  
2447 2461
                    tmRes = cv2.matchTemplate(roiItem, symGray, cv2.TM_CCOEFF_NORMED)
......
2455 2469

  
2456 2470
                    symGray = cv2.rotate(symGray, cv2.ROTATE_90_CLOCKWISE)
2457 2471
                    symbolRotatedAngle = (symbolRotatedAngle + 90) % 360
2472
                    #cX, cY = originalPoint[0], originalPoint[0]
2473
                    #M = cv2.getRotationMatrix2D((cX, cY), 45, 1.0)
2474
                    #symGray = cv2.warpAffine(symGray, M, (sw, sh))
2475
                    #symbolRotatedAngle = (symbolRotatedAngle + 45) % 360
2458 2476

  
2459 2477
            if searchedInfos:
2460 2478
                searchedInfos = sorted(searchedInfos, key=lambda param: param[0], reverse=True)
DTI_PID/DTI_PID/ReplaceSymbolDialog.py
151 151
        find_symbol = self.ui.comboBoxFind.currentText()
152 152
        replace_symbol = self.ui.comboBoxReplace.currentText()
153 153

  
154
        replace_action = self.ui.radioButtonReplace.isChecked()
154
        replace_action = 'Replace' if self.ui.radioButtonReplace.isChecked() else 'Insert'
155 155

  
156 156
        condition = self.ui.buttonGroup_2.checkedButton().objectName().replace('radioButton', '')
157 157

  
DTI_PID/DTI_PID/SymbolTreeWidget.py
99 99
        indexes = self.selectedIndexes()
100 100
        if data is not None and type(data) is symbol.SymbolBase:
101 101
            sym = self.getSymbolByItemName(item, 0)
102
            text = item.text(0)
102
            text = item.text()
103 103
            if len(indexes) > 0:
104 104
                level = 0
105 105
                index = indexes[0]
DTI_PID/DTI_PID/TextItemFactory.py
359 359
                return False
360 360
            index += 1
361 361

  
362
        if len(tokens) == 2:
363
            if float(tokens[0]) < float(tokens[1]):
364
                tokens[0], tokens[1] = tokens[1], tokens[0]
362 365
        return delimiter.join(tokens)
363 366

  
364 367
    '''

내보내기 Unified diff

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