프로젝트

일반

사용자정보

개정판 7a1f9cf0

ID7a1f9cf0f597cd5e764188eb804b9c2a8a75a3ac
상위 6d998bd3
하위 228fd9b3

백흠경이(가) 5년 이상 전에 추가함

issue #567: 연계 아이템에서 속성을 가져오는 부분 수정

Change-Id: I1623ca8088222b411fa5fa14193604dbea027179

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py
163 163
                if assoc and type(assoc) is uuid.UUID:
164 164
                    matches = [x for x in self.scene().items() if hasattr(x, 'uid') and str(x.uid) == str(assoc)]
165 165
                    if matches:
166
                        res.append(matches[0]) # TODO: need to update association with instance
166
                        res.append(matches[0])
167 167
                        self._associations[key][index] = matches[0]
168 168
                    index += 1
169 169
                # up to here
......
178 178

  
179 179
        return res
180 180

  
181
    def get_assoc_item(self, assoc):
182
        """ get associated item of given object """
183
        import uuid
184

  
185
        if assoc and type(assoc) is uuid.UUID:
186
            matches = [x for x in self.scene().items() if hasattr(x, 'uid') and str(x.uid) == str(assoc)]
187
            if matches: return matches[0]
188

  
189
        return assoc
190

  
181 191
    def texts(self):
182 192
        """ return text type of associations """
183 193
        from EngineeringTextItem import QEngineeringTextItem
......
255 265
                        item = attr.AssocItem
256 266
                        _attrs[attr] = eval(attr.Expression) if attr.Expression else ''
257 267
                    elif attr.AssocItem:
258
                        item = attr.AssocItem
268
                        item = attr.AssocItem = self.get_assoc_item(attr.AssocItem)
259 269
                        _attrs[attr] = eval(attr.Expression) if attr.Expression else ''
260 270
                    else:
261 271
                        _attrs[attr] = ''
......
267 277
                        item = attr.AssocItem
268 278
                        _attrs[attr] = eval(attr.Expression) if attr.Expression else ''
269 279
                    else:
270
                        item = attr.AssocItem
280
                        item = attr.AssocItem = self.get_assoc_item(attr.AssocItem)
271 281
                        _attrs[attr] = eval(attr.Expression) if attr.Expression and ((item and 'item' in attr.Expression) or 'self' in attr.Expression) else ''
272 282
                elif attr.AttributeType == 'Symbol Item' or attr.AttributeType == 'Comp Item':
273 283
                    at = int(attr.AttrAt)
......
276 286
                        item = attr.AssocItem
277 287
                        _attrs[attr] = eval(attr.Expression) if attr.Expression else ''
278 288
                    elif attr.AssocItem:
279
                        item = attr.AssocItem
289
                        item = attr.AssocItem = self.get_assoc_item(attr.AssocItem)
280 290
                        _attrs[attr] = eval(attr.Expression) if attr.Expression else ''
281 291
                    else:
282 292
                        _attrs[attr] = ''
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
1445 1445
                for prop_node in node.iter('PROPERTY'):
1446 1446
                    matches = [prop for prop in item._properties.keys() if prop.Attribute == prop_node.attrib['Attribute']]
1447 1447
                    if matches:
1448
                        #matches[0].parse_xml(prop_node)
1449 1448
                        item._properties[matches[0]] = matches[0].parse_value(prop_node.text) if prop_node.text else ''
1450 1449

  
1451 1450
                ## assign area
......
1497 1496
                currentPointModeIndex = node.find('CURRENTPOINTMODEINDEX')
1498 1497
                if currentPointModeIndex is not None:
1499 1498
                    item.currentPointModeIndex = int(currentPointModeIndex.text)
1500

  
1501
                #if type(item) is QEngineeringEndBreakItem:
1502
                #    item.freeze_item.update_freeze(item.prop('Freeze'))
1503
                
1504
                #if type(item) is QEngineeringSpecBreakItem:
1505
                #    item.connectors[0].setPos((item.connectors[0].connectPoint[0], item.connectors[0].connectPoint[1]))
1506 1499
        except Exception as ex:
1507 1500
            from App import App 
1508 1501
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
DTI_PID/DTI_PID/SymbolAttr.py
1 1
# coding: utf-8
2
"""
3
    This is Symbol Attribute module
4
"""
2
""" This is Symbol Attribute module """
5 3

  
6 4
class SymbolProp:
7 5
    """ This is symbol property class """

내보내기 Unified diff

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