프로젝트

일반

사용자정보

개정판 5401554a

ID5401554a8363d7798b9c605dfb0c3fb6397d3116
상위 25879e36
하위 31e27f1c

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

issue #563: size text owner improve

Change-Id: I8726ad720579a17c06f290ed9208890dd33442dc

차이점 보기:

DTI_PID/DTI_PID/LineNoTracer.py
182 182

  
183 183
            configs = app_doc_data.getConfigs('Line No', 'Delimiter')
184 184
            if 1 == len(configs):
185
                configs = app_doc_data.getConfigs('Line No', 'Configuration')
185
                #configs = app_doc_data.getConfigs('Line No', 'Configuration')
186 186

  
187 187
                for line_no in self._lineNos:
188 188
                    _from = line_no.prop('From')
DTI_PID/DTI_PID/MainWindow.py
1773 1773
            @author euisung
1774 1774
            @date   2019.04.29
1775 1775
        '''
1776
        selected = [item for item in self.graphicsView.scene().items() if type(item) is QEngineeringVendorItem]
1776
        selected = [item for item in self.graphicsView.scene().items() if issubclass(type(item), QEngineeringVendorItem)]
1777 1777
        for item in selected:
1778 1778
            item.setVisible(isChecked)
1779 1779

  
......
1787 1787
    '''
1788 1788

  
1789 1789
    def onCreateSymbolClicked(self):
1790
        cmd = FenceCommand.FenceCommand(self.graphicsView)
1791
        cmd.onSuccess.connect(self.onAreaSelected)
1792
        self.graphicsView.command = cmd
1793
        QApplication.setOverrideCursor(Qt.CrossCursor)
1790
        selected = [item for item in self.graphicsView.scene().selectedItems() if issubclass(type(item), QEngineeringVendorItem)]
1791
        if len(selected) == 1:
1792
            symbol_image = AppDocData.instance().activeDrawing.image_origin
1793
            rect = selected[0].sceneBoundingRect()
1794

  
1795
            points = []
1796
            for conn in selected[0].connectors:
1797
                points.append([round(conn.center()[0] - rect.x()), round(conn.center()[1] - rect.y())])
1798
            poly = np.array(points, np.int32)
1799

  
1800
            mask = np.zeros((int(rect.height()), int(rect.width())))
1801
            cv2.fillPoly(mask, [poly], (255))
1802
            poly_copied = np.multiply(mask, symbol_image[round(rect.y()):round(rect.y() + rect.height()),
1803
                               round(rect.x()):round(rect.x() + rect.width())])
1804

  
1805
            #mask = np.ones(src2)
1806
            #cv2.fillPoly(mask,[poly],0)
1807
            #src2 = np.multiply(mask,src2)
1808

  
1809
            #src2 = np.add(poly_copied,src2)
1810
            print('a')
1811
        else:
1812
            cmd = FenceCommand.FenceCommand(self.graphicsView)
1813
            cmd.onSuccess.connect(self.onAreaSelected)
1814
            self.graphicsView.command = cmd
1815
            QApplication.setOverrideCursor(Qt.CrossCursor)
1794 1816

  
1795 1817
    '''
1796 1818
        @brief      show SymbolEditorDialog with image selected by user
DTI_PID/DTI_PID/RecognitionDialog.py
2730 2730
            if issubclass(type(item), QEngineeringVendorItem) and item.pack_type =='Equipment Package':
2731 2731
                points = []
2732 2732
                for conn in item.connectors:
2733
                    points.append([conn.center()[0] - area.x, conn.center()[1] - area.y])
2733
                    points.append([round(conn.center()[0] - area.x), round(conn.center()[1] - area.y)])
2734 2734
                
2735 2735
                points = np.array(points, np.int32)
2736 2736
                cv2.fillConvexPoly(area.img, points, 255)
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py
249 249
            return self.attrs
250 250
        elif findOwner:
251 251
            self._skip = True
252
        else:
253
            self._skip = False
252 254

  
253 255
        _attrs = {}
254 256
        try:
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py
1946 1946

  
1947 1947
        arrow_size = QEngineeringLineItem.ARROW_SIZE * 0.25
1948 1948

  
1949
        if not self.is_piping():
1950
            self.flowMark = None
1949
        # allow flow mark at signal line
1950
        #if not self.is_piping():
1951
        #    self.flowMark = None
1951 1952

  
1952 1953
        if self.flowMark:
1953 1954
            arrow_size *= 2
DTI_PID/DTI_PID/Shapes/QEngineeringSizeTextItem.py
45 45
            center = self.sceneBoundingRect().center()
46 46

  
47 47
            for symbol in symbols:
48
                target = False
49
                attrs = symbol.getAttributes(findOwner=True)
50
                for attr in attrs:
51
                    if attr.AttributeType == 'Size Text Item':
52
                        target = True
53
                        break
54

  
55
                if not target:
56
                    continue
57
                
48 58
                if delimiter in self.text().upper() and type(symbol) is QEngineeringReducerItem:
49 59
                    dx = symbol.origin[0] - center.x()
50 60
                    dy = symbol.origin[1] - center.y()

내보내기 Unified diff

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