프로젝트

일반

사용자정보

개정판 db9b4d89

IDdb9b4d895c9631777bcd594cf8a8c0e9db990ec2
상위 df8cb1cf
하위 1b0802fb

백흠경이(가) 약 6년 전에 추가함

issue #503: VendorPackage 관련 부분 수정

Change-Id: I84d203cc464c8ba8659b631b9654cbf02244dd07

차이점 보기:

DTI_PID/DTI_PID/LineNoTracer.py
62 62
            connectedItems = self.findConnectedObjects(lineno.conns[0], toler=10)
63 63
            for item in connectedItems: 
64 64
                item.owner = lineno # set item's owner
65
                item.linkedItem = lineno
65
                #item.linkedItem = lineno
66 66
            
67 67
            pipeRun = QEngineeringRunItem()
68 68
            pipeRun.items = connectedItems
69 69
            lineno.runs.append(pipeRun)
70 70

  
71
            lineno.set_property('From', connectedItems[0])
72
            lineno.set_property('To', connectedItems[-1])
73

  
71 74
        return connectedItems
72 75

  
73 76
    '''
......
87 90
                for line in lines:
88 91
                    if line.owner is not None: continue
89 92

  
90
                    matches = [x for x in self._lines if x.owner is not None and x.is_connected(line, QEngineeringAbstractItem.CONNECTED_AT_BODY)]
93
                    matches = [x for x in self._lines if x.owner and line.is_connected(x, QEngineeringAbstractItem.CONNECTED_AT_BODY)]
91 94
                    if matches:
92 95
                        foundCount += 1
93 96
                        connectedItems = self.findConnectedObjects(line, toler=10)
94 97
                        # set connection object
98
                        """
95 99
                        for idx in range(len(line.connectors)):
96 100
                            if line.connectors[idx].connectedItem is None: line.connectors[idx].connectedItem = matches[0]
101
                        """
97 102
                        # up to here
98 103
                        for item in connectedItems:
99 104
                            item.owner = matches[0].owner   # set item's owner
100
                            item.linkedItem = matches[0].owner
105
                            #item.linkedItem = matches[0].owner
101 106

  
102 107
                        pipeRun = QEngineeringRunItem()
103 108
                        pipeRun.items = connectedItems
......
158 163
                    else:
159 164
                        remainLineNos.append(lineno)
160 165
                
166
                """
161 167
                ## lineIndicator
162 168
                extendPixel = 30
163 169
                for lineIndicator in self._lineIndicator:
......
168 174
                        xOverlap = False
169 175
                        yOverlap = False
170 176
                        extendDx = remainLineNo.size[0] if lineIndicator.isVH == 'V' else remainLineNo.size[1]
171
                        #print(remainLineNo.size)
172
                        #print([round(remainLineNo.loc[0] - extendDx), round(remainLineNo.loc[1] - extendDx), round(remainLineNo.loc[0] + remainLineNo.size[0] + extendDx), round(remainLineNo.loc[1] + remainLineNo.size[1] + extendDx)])
173 177
                        reNoRect = [round(remainLineNo.loc[0] - extendDx), round(remainLineNo.loc[1] - extendDx), round(remainLineNo.loc[0] + remainLineNo.size[0] + extendDx), round(remainLineNo.loc[1] + remainLineNo.size[1] + extendDx)]
174 178
                        w, h = 0, 0                        
175 179
                        for x1 in range(reNoRect[0], reNoRect[2] + 1):
......
253 257
                            lineIndicator.setBrush(QBrush(QColor(0, 0, 255, 127)))
254 258
                            #print('connected ' + matchLineNo.text() + ' and ' + matchLine.uid)                     
255 259
                ## up to here
260
                """
256 261
                            
257 262
                # set start line's owner
258 263
                for lineno in docData.tracerLineNos:
......
444 449

  
445 450
        # vendor package
446 451
        configs = AppDocData.instance().getConfigs('Supplied by Tag Rule', 'by Vendor')
447
        vendorTag = configs[0].value if configs else 'by Vendor'
452
        vendorTag = configs[0].value if configs else 'By Vendor'
448 453
        for vendorItem in vendor:
449 454
            for symbol in symbols:
450 455
                if vendorItem.includes(symbol):
451
                    symbol.supplied_by = vendorTag
456
                    matches = [prop for prop,value in symbol.properties.items() if prop.Attribute == 'Supplied By']
457
                    if matches: symbol.properties[matches[0]] = vendorTag
452 458
                else:
453
                    symbol.supplied_by = ''
459
                    matches = [prop for prop,value in symbol.properties.items() if prop.Attribute == 'Supplied By']
460
                    if matches: symbol.properties[matches[0]] = ''
454 461
        # up to here
455 462
    except Exception as ex:
456 463
        from App import App 
DTI_PID/DTI_PID/MainWindow.py
808 808
        if items:
809 809
            item = items[-1]
810 810
            self.itemTreeWidget.findItem(item)
811
            #self.resultPropertyTableWidget.show_item_property(item)
811
            self.resultPropertyTableWidget.show_item_property(item)
812 812
            if type(item) is QEngineeringErrorItem:
813 813
                for index in range(self.tableWidgetInconsistency.rowCount()):
814 814
                    if self.tableWidgetInconsistency.item(index, 1).tag is item:
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
54 54
        """ setter of properties """
55 55
        self._properties = value
56 56

  
57
    def set_property(self, property, value):
58
        """ set property with given value """
59
        matches = [prop for prop,_ in self._properties.items() if prop.Attribute == property]
60
        if matches: self._properties[matches[0]] = value
61

  
57 62
    def setVisible(self, visible):
58 63
        """ override visible value """
59 64
        super(QEngineeringTextItem, self).setVisible(visible)
......
217 222
                    attr = SymbolAttr.fromXml(attr_node)
218 223
                    item.attrs[attr] = attr_node.text
219 224

  
220
                item.uid = uuid.UUID(node.attrib['UID']) if node.attrib['UUID'] else uuid.uuid4()
225
                item.uid = uuid.UUID(node.find('UID').text)
221 226
                item.loc = (x, y)
222 227
                item.size = (width, height)
223 228
                item.angle = angle
DTI_PID/DTI_PID/Shapes/EngineeringVendorItem.py
98 98
            qPoints = []
99 99
            for strPoint in strPoints.split(QEngineeringVendorItem.DELIMITER):
100 100
                point = strPoint.split(',')
101
                points.append([int(point[0]), int(point[1])])
102
                qPoints.append(QPoint(int(point[0]), int(point[1])))
101
                points.append([float(point[0]), float(point[1])])
102
                qPoints.append(QPoint(float(point[0]), float(point[1])))
103 103
            vendorArea = QPolygonF(qPoints)
104 104
            vendorItem = QEngineeringVendorItem(vendorArea, points, uid=uid)
105 105
            vendorItem.area = node.find('AREA').text

내보내기 Unified diff

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