개정판 dbf5a559
issue #663: fix scene
Change-Id: Ib12f18b9d4e932b2ba7ebfa6d740c1f4345c944c
DTI_PID/DTI_PID/Commands/LoadCommand.py | ||
---|---|---|
301 | 301 |
# connect flow item to line |
302 | 302 |
for line in lines: |
303 | 303 |
line.update_arrow() |
304 |
app_doc_data.lines.append(line) |
|
304 |
#app_doc_data.lines.append(line)
|
|
305 | 305 |
# for flowMark in [item for item in symbols if type(item) is QEngineeringFlowMarkItem]: |
306 | 306 |
# for line in lines: |
307 | 307 |
# if flowMark.owner is line: |
... | ... | |
494 | 494 |
# connect flow item to line |
495 | 495 |
for line in lines: |
496 | 496 |
line.update_arrow() |
497 |
app_doc_data.lines.append(line) |
|
497 |
#app_doc_data.lines.append(line)
|
|
498 | 498 |
# for flowMark in [item for item in symbols if type(item) is QEngineeringFlowMarkItem]: |
499 | 499 |
# for line in lines: |
500 | 500 |
# if flowMark.owner is line: |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
1495 | 1495 |
|
1496 | 1496 |
SymbolSvgItem.DOCUMENTS.clear() |
1497 | 1497 |
|
1498 |
# load data TODO: check below codes
|
|
1498 |
# load data |
|
1499 | 1499 |
cmd = LoadCommand() |
1500 | 1500 |
cmd.display_message.connect(self.onAddMessage) |
1501 | 1501 |
cmd.set_maximum.connect(self.progress.setMaximum) |
... | ... | |
1882 | 1882 |
|
1883 | 1883 |
items.append(lineItem) |
1884 | 1884 |
self.graphicsView.scene().addItem(lineItem) |
1885 |
app_doc_data.lines.append(lineItem) |
|
1885 |
#app_doc_data.lines.append(lineItem)
|
|
1886 | 1886 |
|
1887 | 1887 |
pt = items[-1].end_point() |
1888 | 1888 |
selected = [item for item in self.graphicsView.scene().items(QPointF(pt[0], pt[1])) if |
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
783 | 783 |
textDetector = TextDetector() |
784 | 784 |
|
785 | 785 |
worker.scene.clear() |
786 |
worker.text_scene.clear() |
|
787 |
worker.line_scene.clear() |
|
786 | 788 |
|
787 | 789 |
Worker.initTargetSymbolDataList() |
788 | 790 |
|
... | ... | |
1049 | 1051 |
from TextInfo import TextInfo |
1050 | 1052 |
|
1051 | 1053 |
"""load texts""" |
1052 |
text_scene = QGraphicsScene() |
|
1053 |
worker.add_predata_to_scene.emit(app_doc_data.activeDrawing, text_scene, False, True, False, False, False) |
|
1054 |
worker.add_predata_to_scene.emit(app_doc_data.activeDrawing, worker.text_scene, False, True, False, False, False) |
|
1054 | 1055 |
worker.cond.wait(worker.mutex) |
1055 | 1056 |
"""up to here""" |
1056 |
textItems = [item for item in text_scene.items() if issubclass(type(item), QEngineeringTextItem)] |
|
1057 |
textItems = [item for item in worker.text_scene.items() if issubclass(type(item), QEngineeringTextItem)]
|
|
1057 | 1058 |
app_doc_data.texts.extend(textItems) |
1058 | 1059 |
app_doc_data.allItems.extend(textItems) |
1059 | 1060 |
|
... | ... | |
1125 | 1126 |
if isLineChecked: |
1126 | 1127 |
Worker.recognizeLine(mainRes, listWidget, worker.scene, worker) |
1127 | 1128 |
else: |
1128 |
lineItems = [item for item in worker.scene.items() |
|
1129 |
"""load lines""" |
|
1130 |
worker.add_predata_to_scene.emit(app_doc_data.activeDrawing, worker.line_scene, False, False, True, False, False) |
|
1131 |
worker.cond.wait(worker.mutex) |
|
1132 |
"""up to here""" |
|
1133 |
lineItems = [item for item in worker.line_scene.items() |
|
1129 | 1134 |
if issubclass(type(item), QEngineeringLineItem)] |
1130 | 1135 |
app_doc_data.lines.extend(lineItems) |
1131 | 1136 |
app_doc_data.allItems.extend(lineItems) |
... | ... | |
1134 | 1139 |
lineItem.owner = None |
1135 | 1140 |
for conn in lineItem.connectors: |
1136 | 1141 |
conn.connectedItem = None |
1137 |
worker.scene.removeItem(lineItem) |
|
1142 |
#worker.scene.removeItem(lineItem)
|
|
1138 | 1143 |
|
1139 | 1144 |
# try to detect nozzle from image drawing |
1140 | 1145 |
if worker.isSymbolChecked: |
... | ... | |
2337 | 2342 |
|
2338 | 2343 |
self.parent = parent |
2339 | 2344 |
self._scene = QGraphicsScene() |
2345 |
self._text_scene = QGraphicsScene() |
|
2346 |
self._line_scene = QGraphicsScene() |
|
2340 | 2347 |
self.drawings = drawings |
2341 | 2348 |
self.xmlPath = None |
2342 | 2349 |
self.ui = Recognition_UI.Ui_Recognition() |
... | ... | |
2497 | 2504 |
self.obj.drawings = self.drawings |
2498 | 2505 |
self.obj.listWidget = self.ui.listWidget |
2499 | 2506 |
self.obj.scene = self._scene |
2507 |
self.obj.text_scene = self._text_scene |
|
2508 |
self.obj.line_scene = self._line_scene |
|
2500 | 2509 |
self.obj.scene._end = False # for waiting each drawing finished |
2501 | 2510 |
self.obj.isSymbolChecked = self.ui.checkBoxSymbol.isChecked() |
2502 | 2511 |
self.obj.isTextChecked = self.ui.checkBoxText.isChecked() |
... | ... | |
2601 | 2610 |
try: |
2602 | 2611 |
cmd = LoadCommand() |
2603 | 2612 |
cmd.execute((drawing, scene), symbol=symbol, text=text, line=line, unknown=unknown, |
2604 |
package=package ,update=False)
|
|
2613 |
package=package, update=False)
|
|
2605 | 2614 |
except Exception as ex: |
2606 | 2615 |
from App import App |
2607 | 2616 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
내보내기 Unified diff