개정판 baeb00a0
issue #538: end break connected line info testing
Change-Id: I41d97c0484d8d003359836785b191324c20a868c
DTI_PID/DTI_PID/Shapes/EngineeringEndBreakItem.py | ||
---|---|---|
27 | 27 |
SymbolSvgItem.__init__(self, path, uid, flip=flip) |
28 | 28 |
self.setZValue(QEngineeringEndBreakItem.ZVALUE) |
29 | 29 |
#self.connected_lines = [] |
30 |
attr = SymbolAttr() |
|
31 |
attr.Attribute = 'Connected Line' |
|
32 |
attr.AttributeType = 'Comp Item' |
|
33 |
self.attrs[attr] = None |
|
30 | 34 |
|
31 | 35 |
''' |
32 | 36 |
def setPosition(self, loc, origin): |
... | ... | |
38 | 42 |
''' |
39 | 43 |
def getAttributes(self): |
40 | 44 |
""" |
41 |
attributes MUST have End Break Line 1, End Break Line 2 attribute
|
|
45 |
attributes MUST have Connected Line attribute
|
|
42 | 46 |
""" |
43 | 47 |
return self.attrs |
44 | 48 |
|
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py | ||
---|---|---|
376 | 376 |
origin = [pt[0] + float(tokens[0]), pt[1] + float(tokens[1])] |
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 |
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) |
|
379 | 383 |
end_break.setToolTip('owner : ' + str(line_to)) |
380 | 384 |
end_break.area = 'Drawing' |
381 | 385 |
end_break.owner = line_to |
... | ... | |
390 | 394 |
origin = [pt[0] + float(tokens[0]), pt[1] + float(tokens[1])] |
391 | 395 |
end_break.buildItem(svgFileName, symbol.getType(), 5.7, pt, [end_break.boundingRect().width(), end_break.boundingRect().height()], origin, [], symbol.getBaseSymbol(), symbol.getAdditionalSymbol(), symbol.getHasInstrumentLabel()) |
392 | 396 |
#end_break.connected_lines = [line_to.uid, line_to.connectors[1].connectedItem.uid] |
397 |
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) |
|
393 | 401 |
end_break.setToolTip('owner : ' + str(line_to)) |
394 | 402 |
end_break.area = 'Drawing' |
395 | 403 |
end_break.owner = line_to |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
866 | 866 |
def fromXml(node): |
867 | 867 |
import uuid |
868 | 868 |
from EngineeringSpecBreakItem import QEngineeringSpecBreakItem |
869 |
from EngineeringEndBreakItem import QEngineeringEndBreakItem |
|
869 | 870 |
from SymbolAttr import SymbolAttr |
870 | 871 |
item = [None, None] |
871 | 872 |
|
... | ... | |
947 | 948 |
if attributes is not None: |
948 | 949 |
for attr in attributes.iter('ATTRIBUTE'): |
949 | 950 |
_attr = SymbolAttr.fromXml(attr) |
950 |
if type(item[0]) is not QEngineeringSpecBreakItem: |
|
951 |
if type(item[0]) is not QEngineeringSpecBreakItem and type(item[0]) is not QEngineeringEndBreakItem:
|
|
951 | 952 |
item[0].attrs[_attr] = attr.text |
952 | 953 |
else: |
953 | 954 |
if _attr.AttributeType == 'Spec': |
... | ... | |
960 | 961 |
for initKey in item[0].attrs.keys(): |
961 | 962 |
if initKey.Attribute == 'DownStream': |
962 | 963 |
item[0].attrs[initKey] = attr.text |
964 |
elif _attr.Attribute == 'Connected Line': |
|
965 |
for initKey in item[0].attrs.keys(): |
|
966 |
if initKey.Attribute == 'Connected Line': |
|
967 |
item[0].attrs[initKey] = attr.text |
|
963 | 968 |
for attr in attributes.iter('USERINPUTATTRIBUTE'): |
964 | 969 |
typeUID = attr.find('TYPEUID').text |
965 | 970 |
typeValue = attr.find('TYPEVALUE').text |
내보내기 Unified diff