프로젝트

일반

사용자정보

개정판 6a8b2731

ID6a8b2731f05d557f09f8c10da25c70bcf93ba172
상위 1c11e3b5
하위 d7f96c4e

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

issue #538: change connected item in end break from attrs -> prop

Change-Id: I772c033853d295a81a8e755e8b80bb407ee8b6e7

차이점 보기:

DTI_PID/DTI_PID/Commands/SelectAttributeCommand.py
85 85
                    elif item is not None and (type(self._item) is QEngineeringEndBreakItem) and (type(item) is QEngineeringLineItem) and self._attr.AttributeType == 'OWNER':
86 86
                        self._item.owner = item
87 87
                        self.onSuccess.emit()
88
                    elif item is not None and (type(self._item) is QEngineeringEndBreakItem) and (type(item) is QEngineeringLineItem) and self._attr.Attribute == 'Connected Line':
89
                        self._item.attrs[self._attr] = str(item.uid)
90
                        self.onSuccess.emit()
88
                    #elif item is not None and (type(self._item) is QEngineeringEndBreakItem) and (type(item) is QEngineeringLineItem) and self._attr.Attribute == 'Connected Line':
89
                    #    self._item.attrs[self._attr] = str(item.uid)
90
                    #    self.onSuccess.emit()
91 91
                    elif item is not None and self._attr.AttributeType == QEngineeringAbstractItem.assoc_type(item):
92 92
                        if self._attr.AttributeType not in self._item._associations:
93 93
                            self._item._associations[self._attr.AttributeType] = []
DTI_PID/DTI_PID/Shapes/EngineeringEndBreakItem.py
24 24
    '''
25 25
    ZVALUE = 20
26 26
    def __init__(self, path, uid=None, flip=0):
27
        from SymbolAttr import SymbolProp
28

  
27 29
        SymbolSvgItem.__init__(self, path, uid, flip=flip)
28 30
        self.setZValue(QEngineeringEndBreakItem.ZVALUE)
29 31
        #self.connected_lines = []
30
        attr = SymbolAttr()
31
        attr.Attribute = 'Connected Line'
32
        attr.AttributeType = 'Comp Item'
33
        self.attrs[attr] = None
32
        #attr = SymbolAttr()
33
        #attr.Attribute = 'Connected Line'
34
        #attr.AttributeType = 'Comp Item'
35
        #self.attrs[attr] = None
36

  
37
        self._properties[SymbolProp(None, 'Connected Line', 'Comp Item')] = None
34 38

  
35 39
    '''
36 40
    def setPosition(self, loc, origin):
......
39 43
        self.origin = origin
40 44
        self.loc = loc
41 45
        self.setTransform(transform)
42
    '''
46
    
43 47
    def getAttributes(self):
44 48
        """
45 49
            attributes MUST have Connected Line attribute
......
49 53
    def keyPressEvent(self, event): 
50 54
        if self.isSelected() and event.key() == Qt.Key_Delete:
51 55
            self.scene().removeItem(self)
56
    '''
52 57

  
53 58
    '''
54 59
    @staticmethod 
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
377 377
                end_break.buildItem(svgFileName, symbol.getType(), 5.7, pt, [end_break.boundingRect().width(), end_break.boundingRect().height()], origin, [], symbol.getBaseSymbol(), symbol.getAdditionalSymbol(), symbol.getHasInstrumentLabel())
378 378
                #end_break.connected_lines = [line_from.uid, line_from.connectors[0].connectedItem.uid]
379 379
                attrs = end_break.getAttributes()
380
                for attr in attrs.keys():
381
                    if attr.Attribute == 'Connected Line':
382
                        attrs[attr] = str(line_from.connectors[0].connectedItem.uid)
380
                #for attr in attrs.keys():
381
                #    if attr.Attribute == 'Connected Line':
382
                #        attrs[attr] = str(line_from.connectors[0].connectedItem.uid)
383
                for prop, value in end_break.properties.items():
384
                    if prop.Attribute == 'Connected Line':
385
                        end_break.properties[prop] = line_to.connectors[0].connectedItem
383 386
                end_break.setToolTip('owner : ' + str(line_to))
384 387
                end_break.area = 'Drawing'
385 388
                end_break.owner = line_from
......
395 398
                end_break.buildItem(svgFileName, symbol.getType(), 5.7, pt, [end_break.boundingRect().width(), end_break.boundingRect().height()], origin, [], symbol.getBaseSymbol(), symbol.getAdditionalSymbol(), symbol.getHasInstrumentLabel())
396 399
                #end_break.connected_lines = [line_to.uid, line_to.connectors[1].connectedItem.uid]
397 400
                attrs = end_break.getAttributes()
398
                for attr in attrs.keys():
399
                    if attr.Attribute == 'Connected Line':
400
                        attrs[attr] = str(line_to.connectors[1].connectedItem.uid)
401
                #for attr in attrs.keys():
402
                #    if attr.Attribute == 'Connected Line':
403
                #        attrs[attr] = str(line_to.connectors[1].connectedItem.uid)
404
                for prop, value in end_break.properties.items():
405
                    if prop.Attribute == 'Connected Line':
406
                        end_break.properties[prop] = line_to.connectors[1].connectedItem
401 407
                end_break.setToolTip('owner : ' + str(line_to))
402 408
                end_break.area = 'Drawing'
403 409
                end_break.owner = line_to
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
951 951
                                for initKey in item.attrs.keys():
952 952
                                    if initKey.Attribute == 'DownStream':
953 953
                                        item.attrs[initKey] = attr.text
954
                            elif _attr.Attribute == 'Connected Line':
955
                                for initKey in item.attrs.keys():
956
                                    if initKey.Attribute == 'Connected Line':
957
                                        item.attrs[initKey] = attr.text
954
                            #elif _attr.Attribute == 'Connected Line':
955
                            #    for initKey in item.attrs.keys():
956
                            #        if initKey.Attribute == 'Connected Line':
957
                            #            item.attrs[initKey] = attr.text
958 958
                    """
959 959
                    for attr in attributes.iter('USERINPUTATTRIBUTE'):
960 960
                        typeUID = attr.find('TYPEUID').text

내보내기 Unified diff

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