개정판 ebf14a7c
add PKG copy
Change-Id: Icfcd40837ad4cc85a922966fc470bb2d47268a30
DTI_PID/DTI_PID/QtImageViewerScene.py | ||
---|---|---|
71 | 71 |
from EngineeringLineItem import QEngineeringLineItem |
72 | 72 |
from QEngineeringTrimLineNoTextItem import QEngineeringLineNoTextItem |
73 | 73 |
from EngineeringSpecBreakItem import QEngineeringSpecBreakItem |
74 |
from EngineeringVendorItem import QEngineeringVendorItem |
|
74 | 75 |
from DeleteCommand import DeleteCommand |
75 | 76 |
from RotateCommand import RotateCommand |
76 | 77 |
from FlipCommand import FlipCommand |
... | ... | |
208 | 209 |
line.setVisible(True)''' |
209 | 210 |
self.addItem(line) |
210 | 211 |
|
212 |
for vendor in root.find('VENDORS').iter('VENDOR'): |
|
213 |
_type = vendor.attrib['Type'] if 'Type' in vendor.attrib else 'Vendor Package' |
|
214 |
pointNode = vendor.find('POINT') |
|
215 |
strPoints = pointNode.text |
|
216 |
points = [] |
|
217 |
for strPoint in strPoints.split(QEngineeringVendorItem.DELIMITER): |
|
218 |
point = strPoint.split(',') |
|
219 |
points.append(QPoint(float(point[0]), float(point[1]))) |
|
220 |
polygon = QPolygonF(points) |
|
221 |
item = QEngineeringVendorItem(polygon, pack_type=_type) |
|
222 |
item.area = vendor.find('AREA').text |
|
223 |
|
|
224 |
self.addItem(item) |
|
225 |
|
|
211 | 226 |
elif event.key() == Qt.Key_Z and event.modifiers() & Qt.ControlModifier: |
212 | 227 |
#self._undo_stack.undo() |
213 | 228 |
pass |
... | ... | |
221 | 236 |
|
222 | 237 |
super(QtImageViewerScene, self).keyPressEvent(event) |
223 | 238 |
except Exception as ex: |
224 |
print('error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
225 |
sys.exc_info()[-1].tb_lineno)) |
|
239 |
from App import App |
|
240 |
from AppDocData import MessageType |
|
241 |
|
|
242 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
243 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
244 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
226 | 245 |
|
227 | 246 |
def keyReleaseEvent(self, event: QKeyEvent): |
228 | 247 |
from MoveCommand import MoveCommand |
내보내기 Unified diff