개정판 228fd9b3
issue #1190: MSSQL에서 도면 데이터를 로딩할때 오류 수정
Change-Id: I885f9531cc1cd09a57805da22f769d0eab912020
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
2383 | 2383 |
self.progress.setMaximum(maxValue) |
2384 | 2384 |
|
2385 | 2385 |
""" parsing all symbols """ |
2386 |
for symbol in [component for component in components if component['SymbolType_UID'] != '-1']:
|
|
2386 |
for symbol in [component for component in components if component['SymbolType_UID'] != -1]:
|
|
2387 | 2387 |
item = SymbolSvgItem.from_database(symbol) |
2388 | 2388 |
if item is not None: |
2389 | 2389 |
item.transfer.onRemoved.connect(self.itemRemoved) |
... | ... | |
2406 | 2406 |
QApplication.processEvents() |
2407 | 2407 |
|
2408 | 2408 |
# parse texts |
2409 |
for text in [component for component in components if component['Name'] == 'Text' and component['SymbolType_UID'] == '-1']:
|
|
2409 |
for text in [component for component in components if component['Name'] == 'Text' and component['SymbolType_UID'] == -1]:
|
|
2410 | 2410 |
item = QEngineeringTextItem.from_database(text) |
2411 | 2411 |
if item is not None: |
2412 | 2412 |
item.uid = text['UID'] |
... | ... | |
2420 | 2420 |
QApplication.processEvents() |
2421 | 2421 |
|
2422 | 2422 |
# note |
2423 |
for note in [component for component in components if component['Name'] == 'Note' and component['SymbolType_UID'] == '-1']:
|
|
2423 |
for note in [component for component in components if component['Name'] == 'Note' and component['SymbolType_UID'] == -1]:
|
|
2424 | 2424 |
item = QEngineeringTextItem.from_database(note) |
2425 | 2425 |
if item is not None: |
2426 | 2426 |
item.uid = note['UID'] |
... | ... | |
2433 | 2433 |
|
2434 | 2434 |
QApplication.processEvents() |
2435 | 2435 |
|
2436 |
for line in [component for component in components if component['Name'] == 'Line' and component['SymbolType_UID'] == '-1']:
|
|
2436 |
for line in [component for component in components if component['Name'] == 'Line' and component['SymbolType_UID'] == -1]:
|
|
2437 | 2437 |
item = QEngineeringLineItem.from_database(line) |
2438 | 2438 |
if item: |
2439 | 2439 |
item.transfer.onRemoved.connect(self.itemRemoved) |
... | ... | |
2444 | 2444 |
|
2445 | 2445 |
QApplication.processEvents() |
2446 | 2446 |
|
2447 |
for unknown in [component for component in components if component['Name'] == 'Unknown' and component['SymbolType_UID'] == '-1']:
|
|
2447 |
for unknown in [component for component in components if component['Name'] == 'Unknown' and component['SymbolType_UID'] == -1]:
|
|
2448 | 2448 |
item = QEngineeringUnknownItem.from_database(unknown) |
2449 | 2449 |
item.transfer.onRemoved.connect(self.itemRemoved) |
2450 | 2450 |
if item is not None: |
... | ... | |
2455 | 2455 |
|
2456 | 2456 |
QApplication.processEvents() |
2457 | 2457 |
|
2458 |
#""" add tree widget """ |
|
2459 |
#for item in symbols: |
|
2460 |
# docData.symbols.append(item) |
|
2461 |
# self.addSvgItemToScene(item) |
|
2462 |
# self.itemTreeWidget.addTreeItem(self.itemTreeWidget.root, item) |
|
2463 |
|
|
2464 |
for component in [component for component in components if component['Name'] == 'Line NO' and component['SymbolType_UID'] == '-1']: |
|
2458 |
for component in [component for component in components if component['Name'] == 'Line NO' and component['SymbolType_UID'] == -1]: |
|
2465 | 2459 |
line_no = QEngineeringLineNoTextItem.from_database(component) |
2466 |
if line_no is None: continue |
|
2467 |
|
|
2468 |
line_no.transfer.onRemoved.connect(self.itemRemoved) |
|
2469 |
self.addTextItemToScene(line_no) |
|
2470 |
line_no_tree_item = self.itemTreeWidget.addTreeItem(self.itemTreeWidget.root, line_no) |
|
2471 |
|
|
2472 |
runs = app_doc_data.get_pipe_runs(str(line_no.uid)) |
|
2473 |
if not runs: continue |
|
2474 |
for run in runs: |
|
2475 |
line_run = QEngineeringRunItem() |
|
2476 |
run_items = app_doc_data.get_pipe_run_items(run['UID']) |
|
2477 |
for record in run_items: |
|
2478 |
uid = record['Components_UID'] |
|
2479 |
run_item = self.graphicsView.findItemByUid(uid) |
|
2480 |
if run_item is not None: |
|
2481 |
run_item._owner = line_no |
|
2482 |
line_run.items.append(run_item) |
|
2483 |
line_run.owner = line_no |
|
2484 |
line_no.runs.append(line_run) |
|
2460 |
if type(line_no) is QEngineeringLineNoTextItem: |
|
2461 |
line_no.transfer.onRemoved.connect(self.itemRemoved) |
|
2462 |
self.addTextItemToScene(line_no) |
|
2463 |
line_no_tree_item = self.itemTreeWidget.addTreeItem(self.itemTreeWidget.root, line_no) |
|
2485 | 2464 |
|
2486 |
for run_item in line_run.items: |
|
2487 |
if issubclass(type(run_item), SymbolSvgItem): self.itemTreeWidget.addTreeItem(line_no_tree_item, run_item) |
|
2465 |
runs = app_doc_data.get_pipe_runs(str(line_no.uid)) |
|
2466 |
if not runs: continue |
|
2467 |
for run in runs: |
|
2468 |
line_run = QEngineeringRunItem() |
|
2469 |
run_items = app_doc_data.get_pipe_run_items(run['UID']) |
|
2470 |
for record in run_items: |
|
2471 |
uid = record['Components_UID'] |
|
2472 |
run_item = self.graphicsView.findItemByUid(uid) |
|
2473 |
if run_item is not None: |
|
2474 |
run_item._owner = line_no |
|
2475 |
line_run.items.append(run_item) |
|
2476 |
line_run.owner = line_no |
|
2477 |
line_no.runs.append(line_run) |
|
2488 | 2478 |
|
2489 |
#docData.tracerLineNos.append(line_no) |
|
2479 |
for run_item in line_run.items: |
|
2480 |
if issubclass(type(run_item), SymbolSvgItem): self.itemTreeWidget.addTreeItem(line_no_tree_item, run_item) |
|
2490 | 2481 |
|
2491 | 2482 |
self.progress.setValue(self.progress.value() + 1) |
2492 | 2483 |
QApplication.processEvents() |
2493 | 2484 |
|
2494 |
for component in [component for component in components if component['Name'] == 'Trim Line NO' and component['SymbolType_UID'] == '-1']:
|
|
2485 |
for component in [component for component in components if component['Name'] == 'Trim Line NO' and component['SymbolType_UID'] == -1]:
|
|
2495 | 2486 |
line_no = QEngineeringTrimLineNoTextItem() |
2496 | 2487 |
line_no.uid = uuid.UUID(component['UID'], version=4) |
2497 | 2488 |
|
... | ... | |
2516 | 2507 |
|
2517 | 2508 |
self.progress.setValue(self.progress.value() + 1) |
2518 | 2509 |
|
2519 |
for component in [component for component in components if component['Name'] == 'VendorPackage' and component['SymbolType_UID'] == '-1']:
|
|
2510 |
for component in [component for component in components if component['Name'] == 'VendorPackage' and component['SymbolType_UID'] == -1]:
|
|
2520 | 2511 |
item = QEngineeringVendorItem.from_database(component) |
2521 | 2512 |
item.transfer.onRemoved.connect(self.itemRemoved) |
2522 | 2513 |
self.graphicsView.scene.addItem(item) |
내보내기 Unified diff