개정판 0dc81192
issue #503: fix package area str call error
Change-Id: I5944d1c1bd5a2a2f0d228572dfff99502b280593
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
343 | 343 |
|
344 | 344 |
def eventFilter(self, source, event): |
345 | 345 |
"""display mouse position of graphics view""" |
346 |
if event.type() == QEvent.MouseMove: |
|
347 |
self.current_pos = self.graphicsView.mapToScene(event.pos()) |
|
348 |
self._label_mouse.setText('mouse pos : ({},{})'.format(round(self.current_pos.x()), round(self.current_pos.y()))) |
|
346 |
try: |
|
347 |
if event.type() == QEvent.MouseMove: |
|
348 |
self.current_pos = self.graphicsView.mapToScene(event.pos()) |
|
349 |
self._label_mouse.setText('mouse pos : ({},{})'.format(round(self.current_pos.x()), round(self.current_pos.y()))) |
|
350 |
except Exception as ex: |
|
351 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
352 |
sys.exc_info()[-1].tb_lineno) |
|
353 |
self.addMessage.emit(MessageType.Error, message) |
|
349 | 354 |
|
350 | 355 |
return QWidget.eventFilter(self, source, event) |
351 | 356 |
|
... | ... | |
880 | 885 |
for point in self.actionVendor.tag._polyline._vertices: |
881 | 886 |
points.append(QPoint(round(point[0]), round(point[1]))) |
882 | 887 |
polygon = QPolygonF(points) |
883 |
item = QEngineeringVendorItem(polygon, type=self.packageComboBox.currentText()) |
|
888 |
item = QEngineeringVendorItem(polygon, pack_type=self.packageComboBox.currentText())
|
|
884 | 889 |
item.area = 'Drawing' |
885 | 890 |
item.transfer.onRemoved.connect(self.itemRemoved) |
886 | 891 |
self.graphicsView.scene.addItem(item) |
DTI_PID/DTI_PID/QtImageViewer.py | ||
---|---|---|
88 | 88 |
# Qt.ScrollBarAsNeeded: Shows a scroll bar only when zoomed. |
89 | 89 |
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) |
90 | 90 |
self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) |
91 |
#self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) |
|
92 |
#self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) |
|
91 | 93 |
|
92 | 94 |
# Stack of QRectF zoom boxes in scene coordinates. |
93 | 95 |
self.zoomStack = [] |
DTI_PID/DTI_PID/Shapes/EngineeringVendorItem.py | ||
---|---|---|
28 | 28 |
ZVALUE = 100 |
29 | 29 |
EQUIPMENT_PACKAGE_COLOR = '#78281F' |
30 | 30 |
|
31 |
def __init__(self, polygon, type='Vendor Package', parent=None, uid=None): |
|
31 |
def __init__(self, polygon, pack_type='Vendor Package', parent=None, uid=None):
|
|
32 | 32 |
import uuid |
33 | 33 |
from SymbolAttr import SymbolProp |
34 | 34 |
|
... | ... | |
38 | 38 |
self.uid = str(uuid.uuid4()) if uid is None else uuid.UUID(uid) |
39 | 39 |
|
40 | 40 |
self.isEntered = False |
41 |
self.setColor(self._color if type == 'Vendor Package' else QEngineeringVendorItem.EQUIPMENT_PACKAGE_COLOR) |
|
41 |
self.setColor(self._color if pack_type == 'Vendor Package' else QEngineeringVendorItem.EQUIPMENT_PACKAGE_COLOR)
|
|
42 | 42 |
self._savedColor = None |
43 | 43 |
|
44 | 44 |
#self._properties = {SymbolProp(None, 'Name', 'Text Item', Expression='self.EvaluatedName'): None} |
45 | 45 |
self._properties = {} |
46 |
self._type = type
|
|
46 |
self._pack_type = pack_type
|
|
47 | 47 |
|
48 | 48 |
self.setFlags(QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsFocusable) |
49 | 49 |
self.setToolTip(str(self.uid)) |
... | ... | |
65 | 65 |
index += 1 |
66 | 66 |
|
67 | 67 |
@property |
68 |
def type(self): |
|
68 |
def pack_type(self):
|
|
69 | 69 |
"""return type""" |
70 |
return self._type |
|
70 |
return self._pack_type
|
|
71 | 71 |
|
72 |
@type.setter |
|
73 |
def type(self, value): |
|
72 |
@pack_type.setter
|
|
73 |
def pack_type(self, value):
|
|
74 | 74 |
"""set type with given value""" |
75 |
self._type = value |
|
75 |
self._pack_type = value
|
|
76 | 76 |
|
77 | 77 |
@property |
78 | 78 |
def NameText(self): |
... | ... | |
179 | 179 |
for connector in connectors: |
180 | 180 |
points.append(QPoint(float(connector['X']), float(connector['Y']))) |
181 | 181 |
polygon = QPolygonF(points) |
182 |
item = QEngineeringVendorItem(polygon, type=component['Value'], uid=uid) |
|
182 |
item = QEngineeringVendorItem(polygon, pack_type=component['Value'], uid=uid)
|
|
183 | 183 |
item.area = component['Area'] |
184 | 184 |
|
185 | 185 |
for key in item._properties.keys(): |
... | ... | |
255 | 255 |
point = strPoint.split(',') |
256 | 256 |
points.append(QPoint(float(point[0]), float(point[1]))) |
257 | 257 |
polygon = QPolygonF(points) |
258 |
item = QEngineeringVendorItem(polygon, type=_type, uid=uid) |
|
258 |
item = QEngineeringVendorItem(polygon, pack_type=_type, uid=uid)
|
|
259 | 259 |
item.area = node.find('AREA').text |
260 | 260 |
|
261 | 261 |
for prop_node in node.iter('PROPERTY'): |
minorTools/xmlTextSearcher.py | ||
---|---|---|
3 | 3 |
def finder(): |
4 | 4 |
print("finder start") |
5 | 5 |
|
6 |
targetText = ['Open Drain', 'open drain(1)', 'Open drain(2)', 'Open Drain(3)']
|
|
6 |
targetText = ['Rotameter']
|
|
7 | 7 |
path = 'W:\ID2_Project\REB\Temp' |
8 | 8 |
|
9 | 9 |
print("target : " + str(len(targetText))) |
내보내기 Unified diff