개정판 811c7c26
issue #538: line end break remain xml save, load, manual edit
Change-Id: I7d5fa9f19515b0674b9b1702f15ceea0695a42d4
DTI_PID/DTI_PID/Shapes/EngineeringEndBreakItem.py | ||
---|---|---|
12 | 12 |
from PyQt5.QtWidgets import * |
13 | 13 |
|
14 | 14 |
from SymbolSvgItem import SymbolSvgItem |
15 |
from EngineeringLineItem import QEngineeringLineItem |
|
16 |
from EngineeringConnectorItem import QEngineeringConnectorItem |
|
17 |
from EngineeringTextItem import QEngineeringTextItem |
|
18 |
from UserInputAttribute import UserInputAttribute |
|
15 |
from SymbolAttr import SymbolAttr |
|
19 | 16 |
|
20 | 17 |
class QEngineeringEndBreakItem(SymbolSvgItem): |
21 | 18 |
""" |
... | ... | |
31 | 28 |
self.setZValue(QEngineeringEndBreakItem.ZVALUE) |
32 | 29 |
self.connected_lines = [] |
33 | 30 |
|
31 |
attr = SymbolAttr() |
|
32 |
attr.Attribute = 'End Break Line 1' |
|
33 |
attr.AttributeType = 'Line Item' |
|
34 |
self.attrs[attr] = None |
|
35 |
attr = SymbolAttr() |
|
36 |
attr.Attribute = 'End Break Line 2' |
|
37 |
attr.AttributeType = 'Line Item' |
|
38 |
self.attrs[attr] = None |
|
39 |
|
|
40 |
''' |
|
34 | 41 |
def setPosition(self, loc, origin): |
35 | 42 |
transform = QTransform() |
36 | 43 |
transform.translate(loc[0] - origin[0], loc[1] - origin[1]) |
37 | 44 |
self.origin = origin |
38 | 45 |
self.loc = loc |
39 | 46 |
self.setTransform(transform) |
47 |
''' |
|
48 |
def getAttributes(self): |
|
49 |
""" |
|
50 |
attributes MUST have End Break Line 1, End Break Line 2 attribute |
|
51 |
""" |
|
52 |
return self.attrs |
|
40 | 53 |
|
41 | 54 |
def keyPressEvent(self, event): |
42 | 55 |
if self.isSelected() and event.key() == Qt.Key_Delete: |
43 | 56 |
self.scene().removeItem(self) |
44 | 57 |
|
58 |
def toXml(self): |
|
59 |
'''is not finished, check later in svgitem toxml and item table widget''' |
|
60 |
return None |
|
61 |
''' |
|
45 | 62 |
@staticmethod |
46 | 63 |
def fromXml(node): |
47 | 64 |
import uuid |
... | ... | |
116 | 133 |
|
117 | 134 |
return None |
118 | 135 |
|
119 |
return node |
|
136 |
return node |
|
137 |
''' |
내보내기 Unified diff