개정판 b811793e
issue #000: fix spec break
Change-Id: I7a8164fb991071458608c28c1d2345dc06b97265
DTI_PID/DTI_PID/Shapes/EngineeringSpecBreakItem.py | ||
---|---|---|
67 | 67 |
@author humkyung |
68 | 68 |
@date 2018.07.19 |
69 | 69 |
''' |
70 |
''' |
|
70 | 71 |
def toXml(self): |
71 | 72 |
from xml.etree.ElementTree import Element, SubElement, dump, ElementTree |
72 | 73 |
from EngineeringTextItem import QEngineeringTextItem |
... | ... | |
174 | 175 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
175 | 176 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
176 | 177 |
return None |
177 |
|
|
178 |
return node |
|
178 |
|
|
179 |
return node |
|
180 |
''' |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
823 | 823 |
for attr in _attrs: |
824 | 824 |
if type(attr) is SymbolAttr: |
825 | 825 |
_node = attr.toXml() |
826 |
_node.text = _attrs[attr] |
|
826 |
if attr.AttributeType != 'Spec': |
|
827 |
_node.text = _attrs[attr] |
|
828 |
elif attr.AttributeType == 'Spec': |
|
829 |
_node.text = str(self.attrs[attr][0]) + ',' + str(self.attrs[attr][1]) |
|
827 | 830 |
attributesNode.append(_node) |
828 |
elif type(attr) is tuple and type(self) is QEngineeringSpecBreakItem: |
|
829 |
attributeNode = Element(attr[0].upper().replace(' ','')) |
|
830 |
attributeNode.text = str(attr[1] if attr[1] is not None else '') |
|
831 |
attributesNode.append(attributeNode) |
|
831 |
#elif type(attr) is tuple and type(self) is QEngineeringSpecBreakItem:
|
|
832 |
# attributeNode = Element(attr[0].upper().replace(' ',''))
|
|
833 |
# attributeNode.text = str(attr[1] if attr[1] is not None else '')
|
|
834 |
# attributesNode.append(attributeNode)
|
|
832 | 835 |
|
833 | 836 |
node.append(attributesNode) |
834 | 837 |
|
DTI_PID/DTI_PID/SymbolAttr.py | ||
---|---|---|
81 | 81 |
import uuid |
82 | 82 |
|
83 | 83 |
attr = SymbolAttr() |
84 |
attr.UID = uuid.UUID(node.attrib['UID'], version=4) |
|
84 |
if node.attrib['UID'] != '': |
|
85 |
attr.UID = uuid.UUID(node.attrib['UID'], version=4) |
|
86 |
else: |
|
87 |
attr.UID = '' |
|
85 | 88 |
attr.Attribute = node.attrib['Attribute'] |
86 | 89 |
attr.DisplayAttribute = node.attrib['DisplayAttribute'] |
87 | 90 |
attr.AttributeType = node.attrib['AttributeType'] |
내보내기 Unified diff