개정판 c1d7640c
issue #563: set run batch for inst command added, refresh item tree added test, LineNoTracer line no run tracing for inst added
Change-Id: I29ed2b2851ca28cda71327f10925e1e952d8a400
DTI_PID/DTI_PID/Commands/SelectAttributeBatchCommand.py | ||
---|---|---|
21 | 21 |
class SelectAttributeBatchCommand(AbstractCommand.AbstractCommand): |
22 | 22 |
onSuccess = pyqtSignal(QGraphicsItem) |
23 | 23 |
|
24 |
def __init__(self, item, imageViewer): |
|
24 |
def __init__(self, item, imageViewer, lineNo=False):
|
|
25 | 25 |
super(SelectAttributeBatchCommand, self).__init__(imageViewer) |
26 | 26 |
self.name = 'SelectAttributeBatch' |
27 | 27 |
self.imageViewer.setCursor(QCursor(Qt.ArrowCursor)) |
28 | 28 |
|
29 |
self.lineNo = lineNo |
|
30 |
|
|
29 | 31 |
#self.imageViewer.scene().clearSelection() |
30 | 32 |
self.selection_order = [item] |
31 | 33 |
|
... | ... | |
40 | 42 |
|
41 | 43 |
try: |
42 | 44 |
self.isTreated = False |
43 |
if 'mouseReleaseEvent' == param[0] and event.button() == Qt.LeftButton and event.modifiers() == Qt.ControlModifier: |
|
44 |
items = [item for item in self.imageViewer.scene().items(scenePos) \ |
|
45 |
if issubclass(type(item), SymbolSvgItem) or issubclass(type(item), QEngineeringTextItem) or type(item) is QEngineeringLineItem] |
|
46 |
if not items: |
|
47 |
return |
|
48 |
else: |
|
49 |
item = items[0] |
|
50 |
|
|
51 |
selected_items = self.imageViewer.scene().selectedItems() |
|
52 |
selected_items.append(item) |
|
53 |
|
|
54 |
if len(selected_items) == len(self.selection_order) + 1: |
|
55 |
self.selection_order.append([item for item in selected_items if item not in self.selection_order][0]) |
|
56 |
|
|
57 |
elif 'mouseReleaseEvent' == param[0]: |
|
58 |
self.isTreated = True |
|
59 |
elif ('keyPressEvent' == param[0] and Qt.Key_Return == event.key()): |
|
60 |
self.isTreated = True |
|
61 |
|
|
62 |
app_doc_data = AppDocData.instance() |
|
63 |
|
|
64 |
item = self.selection_order.pop(0) |
|
65 |
stream = [item for item in self.selection_order if issubclass(type(item), SymbolSvgItem) or type(item) is QEngineeringLineItem] |
|
66 |
values = [item for item in self.selection_order if issubclass(type(item), QEngineeringTextItem)] |
|
67 |
if len(stream) != 2 or len(values) % 2 !=0: |
|
68 |
return |
|
69 |
|
|
70 |
spec = [stream[0], stream[1]] |
|
71 |
|
|
72 |
specBreakAttrsFull = [attr for attr in app_doc_data.getSymbolAttribute('Segment Breaks') if \ |
|
73 |
attr.Target == 'ALL' and (attr.AttributeType == 'Spec' or attr.AttributeType == 'String')] |
|
74 |
|
|
75 |
for attr in specBreakAttrsFull: |
|
76 |
if attr.AttributeType != 'Spec' or attr.Attribute == 'NominalDiameter': |
|
77 |
continue |
|
78 |
|
|
79 |
table = CodeTable.instance(attr.Attribute) |
|
80 |
for index in range(0, len(values), 2): |
|
81 |
up_value = table.find_match_exactly(values[index].text()) |
|
82 |
down_value = table.find_match_exactly(values[index + 1].text()) |
|
83 |
if up_value and down_value: |
|
84 |
values[index].setPlainText(up_value) |
|
85 |
values[index + 1].setPlainText(down_value) |
|
86 |
spec.append([attr.Attribute, values[index], values[index + 1]]) |
|
87 |
break |
|
88 |
|
|
89 |
if len(spec) < 3: |
|
90 |
return |
|
91 |
|
|
92 |
attrs = item.getAttributes() |
|
93 |
for key in attrs.keys(): |
|
94 |
if key.Attribute == 'UpStream': |
|
95 |
attrs[key] = str(spec[0]) |
|
96 |
item.add_assoc_item(spec[0], key.AttrAt, force=True) |
|
97 |
key.AssocItem = spec[0] |
|
98 |
elif key.Attribute == 'DownStream': |
|
99 |
attrs[key] = str(spec[1]) |
|
100 |
item.add_assoc_item(spec[1], key.AttrAt, force=True) |
|
101 |
key.AssocItem = spec[1] |
|
102 |
|
|
103 |
for attr, value, value2 in spec[2:]: |
|
104 |
for full in specBreakAttrsFull: |
|
105 |
if full.Attribute == attr: |
|
106 |
attrs[full] = [value.text(), value2.text()] |
|
107 |
|
|
108 |
#matches = [(prop, value) for prop, value in item.properties.items() if prop.Attribute == 'Freeze'] |
|
109 |
#matches[0][0].Freeze = True |
|
110 |
item.set_property('Freeze', True) |
|
111 |
item.set_property('Show', True) |
|
112 |
|
|
113 |
stream_line = [spec[0], spec[1]] |
|
114 |
stream_track = [spec[1], spec[0]] |
|
115 |
stream_res = [False, False] |
|
116 |
for index in range(len(stream_line)): |
|
117 |
while True: |
|
118 |
if type(stream_line[index]) is QEngineeringLineItem: |
|
119 |
stream_res[index] = True |
|
120 |
break |
|
121 |
else: |
|
122 |
find_next = False |
|
123 |
connected_count = 0 |
|
124 |
for connectorr in stream_line[index].connectors: |
|
125 |
connected_count += 1 |
|
126 |
if connectorr.connectedItem and stream_track[ |
|
127 |
index] is not connectorr.connectedItem and stream_line[ |
|
128 |
index].next_connected(stream_track[index], |
|
129 |
connectorr.connectedItem): |
|
130 |
stream_track[index] = stream_line[index] |
|
131 |
stream_line[index] = connectorr.connectedItem |
|
132 |
find_next = True |
|
133 |
break |
|
134 |
|
|
135 |
if not find_next: |
|
136 |
# prevent infinite loop |
|
137 |
if connected_count == 2: |
|
138 |
for connectorr in stream_line[index].connectors: |
|
139 |
if connectorr.connectedItem and not connectorr.connectedItem is \ |
|
140 |
stream_track[index]: |
|
141 |
stream_line[index] = connectorr.connectedItem |
|
142 |
stream_track[index] = stream_line[index] |
|
143 |
find_next = True |
|
45 |
|
|
46 |
if not self.lineNo: |
|
47 |
# spec break |
|
48 |
if 'mouseReleaseEvent' == param[0] and event.button() == Qt.LeftButton and event.modifiers() == Qt.ControlModifier: |
|
49 |
items = [item for item in self.imageViewer.scene().items(scenePos) \ |
|
50 |
if issubclass(type(item), SymbolSvgItem) or issubclass(type(item), QEngineeringTextItem) or type(item) is QEngineeringLineItem] |
|
51 |
if not items: |
|
52 |
return |
|
53 |
else: |
|
54 |
item = items[0] |
|
55 |
|
|
56 |
selected_items = self.imageViewer.scene().selectedItems() |
|
57 |
selected_items.append(item) |
|
58 |
|
|
59 |
if len(selected_items) == len(self.selection_order) + 1: |
|
60 |
self.selection_order.append([item for item in selected_items if item not in self.selection_order][0]) |
|
61 |
|
|
62 |
elif 'mouseReleaseEvent' == param[0]: |
|
63 |
self.isTreated = True |
|
64 |
elif ('keyPressEvent' == param[0] and Qt.Key_Return == event.key()): |
|
65 |
self.isTreated = True |
|
66 |
|
|
67 |
app_doc_data = AppDocData.instance() |
|
68 |
|
|
69 |
item = self.selection_order.pop(0) |
|
70 |
stream = [item for item in self.selection_order if issubclass(type(item), SymbolSvgItem) or type(item) is QEngineeringLineItem] |
|
71 |
values = [item for item in self.selection_order if issubclass(type(item), QEngineeringTextItem)] |
|
72 |
if len(stream) != 2 or len(values) % 2 !=0: |
|
73 |
return |
|
74 |
|
|
75 |
spec = [stream[0], stream[1]] |
|
76 |
|
|
77 |
specBreakAttrsFull = [attr for attr in app_doc_data.getSymbolAttribute('Segment Breaks') if \ |
|
78 |
attr.Target == 'ALL' and (attr.AttributeType == 'Spec' or attr.AttributeType == 'String')] |
|
79 |
|
|
80 |
for attr in specBreakAttrsFull: |
|
81 |
if attr.AttributeType != 'Spec' or attr.Attribute == 'NominalDiameter': |
|
82 |
continue |
|
83 |
|
|
84 |
table = CodeTable.instance(attr.Attribute) |
|
85 |
for index in range(0, len(values), 2): |
|
86 |
up_value = table.find_match_exactly(values[index].text()) |
|
87 |
down_value = table.find_match_exactly(values[index + 1].text()) |
|
88 |
if up_value and down_value: |
|
89 |
values[index].setPlainText(up_value) |
|
90 |
values[index + 1].setPlainText(down_value) |
|
91 |
spec.append([attr.Attribute, values[index], values[index + 1]]) |
|
92 |
break |
|
93 |
|
|
94 |
if len(spec) < 3: |
|
95 |
return |
|
96 |
|
|
97 |
attrs = item.getAttributes() |
|
98 |
for key in attrs.keys(): |
|
99 |
if key.Attribute == 'UpStream': |
|
100 |
attrs[key] = str(spec[0]) |
|
101 |
item.add_assoc_item(spec[0], key.AttrAt, force=True) |
|
102 |
key.AssocItem = spec[0] |
|
103 |
elif key.Attribute == 'DownStream': |
|
104 |
attrs[key] = str(spec[1]) |
|
105 |
item.add_assoc_item(spec[1], key.AttrAt, force=True) |
|
106 |
key.AssocItem = spec[1] |
|
107 |
|
|
108 |
for attr, value, value2 in spec[2:]: |
|
109 |
for full in specBreakAttrsFull: |
|
110 |
if full.Attribute == attr: |
|
111 |
attrs[full] = [value.text(), value2.text()] |
|
112 |
|
|
113 |
#matches = [(prop, value) for prop, value in item.properties.items() if prop.Attribute == 'Freeze'] |
|
114 |
#matches[0][0].Freeze = True |
|
115 |
item.set_property('Freeze', True) |
|
116 |
item.set_property('Show', True) |
|
117 |
|
|
118 |
stream_line = [spec[0], spec[1]] |
|
119 |
stream_track = [spec[1], spec[0]] |
|
120 |
stream_res = [False, False] |
|
121 |
for index in range(len(stream_line)): |
|
122 |
while True: |
|
123 |
if type(stream_line[index]) is QEngineeringLineItem: |
|
124 |
stream_res[index] = True |
|
125 |
break |
|
126 |
else: |
|
127 |
find_next = False |
|
128 |
connected_count = 0 |
|
129 |
for connectorr in stream_line[index].connectors: |
|
130 |
connected_count += 1 |
|
131 |
if connectorr.connectedItem and stream_track[ |
|
132 |
index] is not connectorr.connectedItem and stream_line[ |
|
133 |
index].next_connected(stream_track[index], |
|
134 |
connectorr.connectedItem): |
|
135 |
stream_track[index] = stream_line[index] |
|
136 |
stream_line[index] = connectorr.connectedItem |
|
137 |
find_next = True |
|
138 |
break |
|
139 |
|
|
140 |
if not find_next: |
|
141 |
# prevent infinite loop |
|
142 |
if connected_count == 2: |
|
143 |
for connectorr in stream_line[index].connectors: |
|
144 |
if connectorr.connectedItem and not connectorr.connectedItem is \ |
|
145 |
stream_track[index]: |
|
146 |
stream_line[index] = connectorr.connectedItem |
|
147 |
stream_track[index] = stream_line[index] |
|
148 |
find_next = True |
|
149 |
break |
|
150 |
if not find_next: |
|
144 | 151 |
break |
145 |
if not find_next:
|
|
152 |
else:
|
|
146 | 153 |
break |
147 |
else: |
|
148 |
break |
|
149 | 154 |
|
150 |
if stream_res[0] and stream_res[1]: |
|
151 |
for attr, value, value2 in spec[2:]: |
|
152 |
up_down_find = [value, value2] |
|
153 |
for index in range(len(stream_line)): |
|
154 |
attrs = stream_line[index].getAttributes() |
|
155 |
for key in attrs.keys(): |
|
156 |
if key.Attribute == attr: |
|
157 |
attrs[key] = up_down_find[index].text() |
|
158 |
key.AssocItem = up_down_find[index] |
|
159 |
stream_line[index].add_assoc_item(up_down_find[index], |
|
160 |
key.AttrAt, force=True) |
|
161 |
up_down_find[index].owner = stream_line[index] |
|
162 |
key.Freeze = True |
|
163 |
break |
|
164 |
|
|
165 |
|
|
166 |
self.onSuccess.emit(item) |
|
155 |
if stream_res[0] and stream_res[1]: |
|
156 |
for attr, value, value2 in spec[2:]: |
|
157 |
up_down_find = [value, value2] |
|
158 |
for index in range(len(stream_line)): |
|
159 |
attrs = stream_line[index].getAttributes() |
|
160 |
for key in attrs.keys(): |
|
161 |
if key.Attribute == attr: |
|
162 |
attrs[key] = up_down_find[index].text() |
|
163 |
key.AssocItem = up_down_find[index] |
|
164 |
stream_line[index].add_assoc_item(up_down_find[index], |
|
165 |
key.AttrAt, force=True) |
|
166 |
up_down_find[index].owner = stream_line[index] |
|
167 |
key.Freeze = True |
|
168 |
break |
|
169 |
|
|
170 |
self.onSuccess.emit(item) |
|
171 |
|
|
172 |
else: |
|
173 |
# line No for instrument |
|
174 |
from EngineeringRunItem import QEngineeringRunItem |
|
175 |
|
|
176 |
if 'mouseReleaseEvent' == param[0] and event.button() == Qt.LeftButton and event.modifiers() == Qt.ControlModifier: |
|
177 |
items = [item for item in self.imageViewer.scene().items(scenePos) if issubclass(type(item), SymbolSvgItem)] |
|
178 |
if not items: |
|
179 |
return |
|
180 |
else: |
|
181 |
item = items[0] |
|
182 |
|
|
183 |
selected_items = self.imageViewer.scene().selectedItems() |
|
184 |
selected_items.append(item) |
|
185 |
|
|
186 |
if len(selected_items) == len(self.selection_order) + 1: |
|
187 |
self.selection_order.append([item for item in selected_items if item not in self.selection_order][0]) |
|
188 |
|
|
189 |
elif 'mouseReleaseEvent' == param[0]: |
|
190 |
self.isTreated = True |
|
191 |
elif ('keyPressEvent' == param[0] and Qt.Key_Return == event.key()): |
|
192 |
self.isTreated = True |
|
193 |
|
|
194 |
app_doc_data = AppDocData.instance() |
|
195 |
|
|
196 |
item = self.selection_order.pop(0) |
|
197 |
stream = [item for item in self.selection_order if issubclass(type(item), SymbolSvgItem)] |
|
198 |
if len(stream) == 0: |
|
199 |
return |
|
200 |
|
|
201 |
line_run = QEngineeringRunItem() |
|
202 |
line_run.items = stream |
|
203 |
|
|
204 |
for _item in stream: |
|
205 |
_item.owner = item |
|
206 |
|
|
207 |
if line_run.items is not None and len(line_run.items) > 0: |
|
208 |
line_run.owner = item |
|
209 |
item.runs.append(line_run) |
|
210 |
|
|
211 |
self.onSuccess.emit(item) |
|
167 | 212 |
|
168 | 213 |
except Exception as ex: |
169 | 214 |
from App import App |
DTI_PID/DTI_PID/ItemPropertyTableWidget.py | ||
---|---|---|
384 | 384 |
self.setItem(0, 1, QTableWidgetItem(self.tr("Note No"))) |
385 | 385 |
self.setItem(1, 1, QTableWidgetItem(self.tr("Desc."))) |
386 | 386 |
elif type(item) is QEngineeringLineNoTextItem: |
387 |
self.setRowCount(1)
|
|
387 |
self.setRowCount(2)
|
|
388 | 388 |
self.setItem(0, 1, QTableWidgetItem(self.tr("UID"))) |
389 |
configs = AppDocData.instance().getConfigs('Project', 'Operation') |
|
390 |
if int(configs[0].value) if configs else 1: |
|
391 |
self.setItem(1, 1, QTableWidgetItem(self.tr("Set Batch"))) |
|
389 | 392 |
elif type(item) is QEngineeringLineItem: |
390 | 393 |
self.setRowCount(5) |
391 | 394 |
self.setItem(0, 1, QTableWidgetItem(self.tr('UID'))) |
... | ... | |
837 | 840 |
item.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable) |
838 | 841 |
self.setItem(0, 3, item) |
839 | 842 |
|
843 |
# for set batch |
|
844 |
configs = appDocData.getConfigs('Project', 'Operation') |
|
845 |
if int(configs[0].value) if configs else 1: |
|
846 |
owner_item = QTableWidgetItem('None') |
|
847 |
self.setItem(1, 3, owner_item) |
|
848 |
attr = SymbolAttr() |
|
849 |
attr.AttributeType = "OWNER" |
|
850 |
self.show_icon_item(1, 2, attr) |
|
851 |
self.item(1, 1).setData(Qt.UserRole, attr) |
|
852 |
|
|
840 | 853 |
self.show_item_properties(lineNoItem) |
841 | 854 |
|
842 | 855 |
row = self.rowCount() |
... | ... | |
1146 | 1159 |
cmd = SelectAttributeCommand.SelectAttributeCommand(items[0], attr, self.mainWindow.graphicsView) |
1147 | 1160 |
cmd.onSuccess.connect(self.onSuccessSelectAttribute) |
1148 | 1161 |
self.mainWindow.graphicsView.command = cmd |
1162 |
|
|
1163 |
elif keyCell.text() == 'Set Batch': |
|
1164 |
cmd = SelectAttributeBatchCommand.SelectAttributeBatchCommand(items[0], self.mainWindow.graphicsView, True if type(items[0]) is QEngineeringLineNoTextItem else False) |
|
1165 |
cmd.onSuccess.connect(self.onSuccessSelectAttribute) |
|
1166 |
self.mainWindow.graphicsView.command = cmd |
|
1149 | 1167 |
elif type(items[0]) is QEngineeringSpecBreakItem: |
1150 | 1168 |
if keyCell.text() == 'UpStream' or keyCell.text() == 'DownStream': |
1151 | 1169 |
attr = keyCell.data(Qt.UserRole) |
... | ... | |
1162 | 1180 |
except Exception as ex: |
1163 | 1181 |
print('error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
1164 | 1182 |
sys.exc_info()[-1].tb_lineno)) |
1165 |
elif keyCell.text() == 'Set Batch': |
|
1166 |
cmd = SelectAttributeBatchCommand.SelectAttributeBatchCommand(items[0], self.mainWindow.graphicsView) |
|
1167 |
cmd.onSuccess.connect(self.onSuccessSelectAttribute) |
|
1168 |
self.mainWindow.graphicsView.command = cmd |
|
1169 | 1183 |
|
1170 | 1184 |
elif issubclass(type(attr), SymbolProp): |
1171 | 1185 |
attr = keyCell.data(Qt.UserRole) |
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
1584 | 1584 |
elif issubclass(type(item), QEngineeringTextItem): |
1585 | 1585 |
item.owner = None |
1586 | 1586 |
|
1587 |
lineNo_run = {} |
|
1588 |
for lineNo in lineNos: |
|
1589 |
lineNo_run[lineNo] = [] |
|
1590 |
|
|
1587 | 1591 |
QApplication.processEvents() |
1588 | 1592 |
|
1589 | 1593 |
# trace connected items |
... | ... | |
1592 | 1596 |
|
1593 | 1597 |
items = symbols + lines |
1594 | 1598 |
|
1599 |
## find onwer line no |
|
1600 |
for item in symbols: |
|
1601 |
if item.owner is not None: |
|
1602 |
continue |
|
1603 |
|
|
1604 |
selected = None |
|
1605 |
minDist = None |
|
1606 |
for lineNo in lineNos: |
|
1607 |
dx = item.sceneBoundingRect().center().x() - lineNo.sceneBoundingRect().center().x() |
|
1608 |
dy = item.sceneBoundingRect().center().y() - lineNo.sceneBoundingRect().center().y() |
|
1609 |
length = math.sqrt(dx * dx + dy * dy) |
|
1610 |
|
|
1611 |
if minDist is None or length < minDist: |
|
1612 |
minDist = length |
|
1613 |
selected = lineNo |
|
1614 |
|
|
1615 |
if selected: |
|
1616 |
lineNo_run[selected].append(item) |
|
1617 |
|
|
1618 |
for lineNo, run in lineNo_run.items(): |
|
1619 |
for item in run: |
|
1620 |
item.owner = lineNo |
|
1621 |
|
|
1622 |
line_run = QEngineeringRunItem() |
|
1623 |
line_run.items = run |
|
1624 |
if line_run.items is not None and len(line_run.items) > 0: |
|
1625 |
line_run.owner = lineNo |
|
1626 |
lineNo.runs.append(line_run) |
|
1627 |
|
|
1628 |
## find connected runs |
|
1595 | 1629 |
while items: |
1596 | 1630 |
connected_items_list = [items[0]] |
1597 | 1631 |
connected_items_count = 0 |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
230 | 230 |
self.actionLine.triggered.connect(self.onPlaceLine) |
231 | 231 |
self.actionRecognition.triggered.connect(self.recognize) |
232 | 232 |
self.pushButtonRefreshDrawings.clicked.connect(self.load_drawing_list) |
233 |
self.pushButtonRefreshTree.clicked.connect(self.refresh_item_list) |
|
233 | 234 |
self.actionLineRecognition.triggered.connect(self.connect_attributes) |
234 | 235 |
self.actionArea.triggered.connect(self.areaConfiguration) |
235 | 236 |
self.actionConfiguration.triggered.connect(self.configuration) |
... | ... | |
527 | 528 |
self.retranslateUi(self) |
528 | 529 |
self.propertyTableWidget.retranslateUi() |
529 | 530 |
|
531 |
def refresh_item_list(self): |
|
532 |
"""refresh item tree""" |
|
533 |
self.itemTreeWidget.InitLineNoItems() |
|
534 |
|
|
535 |
line_nos = AppDocData.instance().tracerLineNos |
|
536 |
for line_no in line_nos: |
|
537 |
item = self.itemTreeWidget.addTreeItem(self.itemTreeWidget.root, line_no) |
|
538 |
connectedItems = line_no.getConnectedItems() |
|
539 |
for connectedItem in connectedItems: |
|
540 |
if issubclass(type(connectedItem), SymbolSvgItem): |
|
541 |
self.itemTreeWidget.addTreeItem(item, connectedItem) |
|
542 |
|
|
530 | 543 |
def load_drawing_list(self): |
531 | 544 |
"""load p&id drawing list""" |
532 | 545 |
from Drawing import Drawing |
... | ... | |
2522 | 2535 |
dlg.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint & ~Qt.WindowContextHelpButtonHint) |
2523 | 2536 |
dlg.exec_() |
2524 | 2537 |
if dlg.isRunned: |
2525 |
self.itemTreeWidget.InitLineNoItems() |
|
2526 |
|
|
2527 |
# construct line no item |
|
2528 |
line_nos = AppDocData.instance().tracerLineNos |
|
2529 |
for line_no in line_nos: |
|
2530 |
item = self.itemTreeWidget.addTreeItem(self.itemTreeWidget.root, line_no) |
|
2531 |
connectedItems = line_no.getConnectedItems() |
|
2532 |
for connectedItem in connectedItems: |
|
2533 |
if issubclass(type(connectedItem), SymbolSvgItem): |
|
2534 |
self.itemTreeWidget.addTreeItem(item, connectedItem) |
|
2535 |
# up to here |
|
2538 |
self.refresh_item_list() |
|
2536 | 2539 |
|
2537 | 2540 |
if dlg.validation_checked: |
2538 | 2541 |
self.onValidation() |
DTI_PID/DTI_PID/MainWindow_UI.py | ||
---|---|---|
172 | 172 |
self.gridLayout_6.setObjectName("gridLayout_6") |
173 | 173 |
self.symbolExplorerVerticalLayout = QtWidgets.QVBoxLayout() |
174 | 174 |
self.symbolExplorerVerticalLayout.setObjectName("symbolExplorerVerticalLayout") |
175 |
self.horizontalLayout_2 = QtWidgets.QHBoxLayout() |
|
176 |
self.horizontalLayout_2.setObjectName("horizontalLayout_2") |
|
177 |
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) |
|
178 |
self.horizontalLayout_2.addItem(spacerItem) |
|
179 |
self.pushButtonRefreshTree = QtWidgets.QPushButton(self.tabItemProperty) |
|
180 |
self.pushButtonRefreshTree.setObjectName("pushButtonRefreshTree") |
|
181 |
self.horizontalLayout_2.addWidget(self.pushButtonRefreshTree) |
|
182 |
self.symbolExplorerVerticalLayout.addLayout(self.horizontalLayout_2) |
|
175 | 183 |
self.gridLayout_6.addLayout(self.symbolExplorerVerticalLayout, 0, 0, 1, 1) |
176 | 184 |
self.tabWidgetItemExplorer.addTab(self.tabItemProperty, "") |
177 | 185 |
self.tabDrawingList = QtWidgets.QWidget() |
... | ... | |
182 | 190 |
self.verticalLayoutDrawingList.setObjectName("verticalLayoutDrawingList") |
183 | 191 |
self.horizontalLayout_4 = QtWidgets.QHBoxLayout() |
184 | 192 |
self.horizontalLayout_4.setObjectName("horizontalLayout_4") |
185 |
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) |
|
186 |
self.horizontalLayout_4.addItem(spacerItem) |
|
193 |
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
194 |
self.horizontalLayout_4.addItem(spacerItem1)
|
|
187 | 195 |
self.pushButtonRefreshDrawings = QtWidgets.QPushButton(self.tabDrawingList) |
188 | 196 |
self.pushButtonRefreshDrawings.setObjectName("pushButtonRefreshDrawings") |
189 | 197 |
self.horizontalLayout_4.addWidget(self.pushButtonRefreshDrawings) |
... | ... | |
232 | 240 |
self.verticalLayout_3.setObjectName("verticalLayout_3") |
233 | 241 |
self.horizontalLayout_5 = QtWidgets.QHBoxLayout() |
234 | 242 |
self.horizontalLayout_5.setObjectName("horizontalLayout_5") |
235 |
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
236 |
self.horizontalLayout_5.addItem(spacerItem1)
|
|
243 |
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
244 |
self.horizontalLayout_5.addItem(spacerItem2)
|
|
237 | 245 |
self.pushButtonClearLog = QtWidgets.QPushButton(self.tabTerminal) |
238 | 246 |
self.pushButtonClearLog.setEnabled(True) |
239 | 247 |
self.pushButtonClearLog.setMaximumSize(QtCore.QSize(32, 16777215)) |
... | ... | |
698 | 706 |
self.tabWidgetSymbolProperty.setTabText(self.tabWidgetSymbolProperty.indexOf(self.tabLibrary), _translate("MainWindow", "Library")) |
699 | 707 |
self.tabWidgetSymbolProperty.setTabText(self.tabWidgetSymbolProperty.indexOf(self.tabSymbolProperty), _translate("MainWindow", "Property")) |
700 | 708 |
self.dockWidgetObjectExplorer.setWindowTitle(_translate("MainWindow", "Object Explorer")) |
709 |
self.pushButtonRefreshTree.setText(_translate("MainWindow", "Refresh Item List")) |
|
701 | 710 |
self.tabWidgetItemExplorer.setTabText(self.tabWidgetItemExplorer.indexOf(self.tabItemProperty), _translate("MainWindow", "Object Explorer")) |
702 | 711 |
self.pushButtonRefreshDrawings.setText(_translate("MainWindow", "Refresh Drawing List")) |
703 | 712 |
self.treeWidgetDrawingList.setSortingEnabled(True) |
DTI_PID/DTI_PID/QtImageViewer.py | ||
---|---|---|
415 | 415 |
from TrainingSymbolEditorDialog import QTrainingSymbolEditorDialog |
416 | 416 |
|
417 | 417 |
try: |
418 |
if event.key() == Qt.Key_Escape: |
|
418 |
if event.key() == Qt.Key_Escape or event.key() == Qt.Key_Return:
|
|
419 | 419 |
if self.command is not None: |
420 | 420 |
self.command.execute(['keyPressEvent', event, []]) |
421 |
if self.command.isTreated: return |
|
421 |
if self.command.isTreated: |
|
422 |
self.command = DefaultCommand.DefaultCommand(self) |
|
423 |
return |
|
422 | 424 |
else: |
423 | 425 |
if self.command is not None: |
424 | 426 |
self.command.execute(['keyPressEvent', event, []]) |
DTI_PID/DTI_PID/UI/MainWindow.ui | ||
---|---|---|
400 | 400 |
</attribute> |
401 | 401 |
<layout class="QGridLayout" name="gridLayout_6"> |
402 | 402 |
<item row="0" column="0"> |
403 |
<layout class="QVBoxLayout" name="symbolExplorerVerticalLayout"/> |
|
403 |
<layout class="QVBoxLayout" name="symbolExplorerVerticalLayout"> |
|
404 |
<item> |
|
405 |
<layout class="QHBoxLayout" name="horizontalLayout_2"> |
|
406 |
<item> |
|
407 |
<spacer name="horizontalSpacer"> |
|
408 |
<property name="orientation"> |
|
409 |
<enum>Qt::Horizontal</enum> |
|
410 |
</property> |
|
411 |
<property name="sizeHint" stdset="0"> |
|
412 |
<size> |
|
413 |
<width>40</width> |
|
414 |
<height>20</height> |
|
415 |
</size> |
|
416 |
</property> |
|
417 |
</spacer> |
|
418 |
</item> |
|
419 |
<item> |
|
420 |
<widget class="QPushButton" name="pushButtonRefreshTree"> |
|
421 |
<property name="text"> |
|
422 |
<string>Refresh Item List</string> |
|
423 |
</property> |
|
424 |
</widget> |
|
425 |
</item> |
|
426 |
</layout> |
|
427 |
</item> |
|
428 |
</layout> |
|
404 | 429 |
</item> |
405 | 430 |
</layout> |
406 | 431 |
</widget> |
내보내기 Unified diff