개정판 eceb0ba0
add spec break copy paste
Change-Id: Id75208dfb9dd7d851ba6595cfeb74d2da3a38177
DTI_PID/DTI_PID/QtImageViewerScene.py | ||
---|---|---|
70 | 70 |
from EngineeringTextItem import QEngineeringTextItem |
71 | 71 |
from EngineeringLineItem import QEngineeringLineItem |
72 | 72 |
from QEngineeringTrimLineNoTextItem import QEngineeringLineNoTextItem |
73 |
from EngineeringSpecBreakItem import QEngineeringSpecBreakItem |
|
73 | 74 |
from DeleteCommand import DeleteCommand |
74 | 75 |
from RotateCommand import RotateCommand |
75 | 76 |
from FlipCommand import FlipCommand |
77 |
from AppDocData import AppDocData |
|
76 | 78 |
|
77 | 79 |
try: |
78 | 80 |
#print('scene : ' + str(event.key())) |
... | ... | |
114 | 116 |
elif event.key() == Qt.Key_C and event.modifiers() & Qt.ControlModifier: |
115 | 117 |
from xml.etree import ElementTree |
116 | 118 |
import XmlGenerator as xg |
117 |
from AppDocData import AppDocData |
|
118 | 119 |
|
119 | 120 |
app_doc_data = AppDocData.instance() |
120 | 121 |
xml, result = xg.write_to_xml(app_doc_data.activeDrawing.file_path, app_doc_data.activeDrawing.width, |
... | ... | |
127 | 128 |
from QtImageViewer import QtImageViewer |
128 | 129 |
from TextInfo import TextInfo |
129 | 130 |
|
131 |
app_doc_data = AppDocData.instance() |
|
130 | 132 |
clipboard = QApplication.clipboard() |
131 | 133 |
mime_data = clipboard.mimeData() |
132 | 134 |
if mime_data.hasText(): |
... | ... | |
144 | 146 |
svg = QtImageViewer.createSymbolObject(item.name) |
145 | 147 |
if not delta: |
146 | 148 |
delta = origin - QPointF(item.origin[0], item.origin[1]) |
149 |
|
|
150 |
if type(svg) is QEngineeringSpecBreakItem: |
|
151 |
specBreakAttrsFull = [attr for attr in app_doc_data.getSymbolAttribute('Segment Breaks') if attr.AttributeType == 'Spec' or attr.AttributeType == 'String'] |
|
152 |
|
|
153 |
from_attrs = item.getAttributes() |
|
154 |
to_attrs = svg.getAttributes() |
|
155 |
|
|
156 |
for key in from_attrs.keys(): |
|
157 |
if key.Attribute == 'UpStream' or key.Attribute == 'DownStream': |
|
158 |
continue |
|
159 |
for full in specBreakAttrsFull: |
|
160 |
if full.Attribute == key.Attribute: |
|
161 |
to_attrs[full] = from_attrs[key].copy() |
|
162 |
|
|
163 |
if item.prop('Freeze'): |
|
164 |
svg.set_property('Freeze', True) |
|
165 |
if item.prop('Show'): |
|
166 |
svg.set_property('Show', True) |
|
167 |
|
|
147 | 168 |
QtImageViewer.matchSymbolToLine(self, svg, QPointF(item.origin[0], item.origin[1]) + delta, item.angle) |
148 | 169 |
''' |
149 | 170 |
# uid 새로 할당 |
내보내기 Unified diff