개정판 807dc29a
issue #663: line type change tracing fail
Change-Id: Ie9014e9d32c17232f195bdb527e85850fccf72f4
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
1649 | 1649 |
''' |
1650 | 1650 |
|
1651 | 1651 |
line_runs = [] |
1652 |
for line_found in lines_found: |
|
1653 |
inserted = False |
|
1654 |
for line_run in line_runs: |
|
1655 |
if line_found[0] in line_run: |
|
1656 |
inserted = True |
|
1652 |
items = [item for item in app_doc_data.lines] |
|
1653 |
while items: |
|
1654 |
connected_items_list = [items[0]] |
|
1655 |
connected_items_count = 0 |
|
1656 |
while True: |
|
1657 |
if connected_items_count == len(connected_items_list): |
|
1657 | 1658 |
break |
1659 |
else: |
|
1660 |
connected_items_count = len(connected_items_list) |
|
1658 | 1661 |
|
1659 |
if inserted: |
|
1660 |
continue |
|
1661 |
else: |
|
1662 |
run = [line_found[0]] |
|
1663 |
Worker.find_connected_line(run, line_found[0]) |
|
1664 |
line_runs.append(run) |
|
1662 |
for item in items: |
|
1663 |
if item in connected_items_list: |
|
1664 |
matches = [conn.connectedItem for conn in item.connectors if conn.connectedItem and type(conn.connectedItem) is QEngineeringLineItem \ |
|
1665 |
and conn.connectedItem not in connected_items_list] |
|
1666 |
if matches: |
|
1667 |
connected_items_list.extend(matches) |
|
1668 |
break |
|
1669 |
else: |
|
1670 |
matches = [conn for conn in item.connectors if conn.connectedItem and conn.connectedItem in connected_items_list] |
|
1671 |
if matches and type(item) is QEngineeringLineItem: |
|
1672 |
connected_items_list.append(item) |
|
1673 |
break |
|
1674 |
|
|
1675 |
for item in connected_items_list: |
|
1676 |
items.remove(item) |
|
1677 |
|
|
1678 |
line_runs.append(connected_items_list) |
|
1665 | 1679 |
|
1666 | 1680 |
for line_run in line_runs: |
1667 | 1681 |
_lines_found = [] |
1682 |
_line_found = None |
|
1668 | 1683 |
for _line in line_run: |
1669 | 1684 |
_lines = [line_found[0] for line_found in lines_found] |
1670 | 1685 |
if _line in _lines: |
1671 | 1686 |
index = _lines.index(_line) |
1672 | 1687 |
_lines_found.append(lines_found[index]) |
1673 |
_line_found = sorted(_lines_found, key=lambda param:param[1][1])[0] |
|
1674 |
Worker.changeConnectedLineType(_line_found[0], _line_found[1][0]) |
|
1688 |
if _lines_found: |
|
1689 |
_line_found = sorted(_lines_found, key=lambda param:param[1][1])[0] |
|
1690 |
|
|
1691 |
if _line_found: |
|
1692 |
for _line in line_run: |
|
1693 |
_line.lineType = _line_found[1][0] |
|
1675 | 1694 |
except Exception as ex: |
1676 | 1695 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
1677 | 1696 |
sys.exc_info()[-1].tb_lineno) |
내보내기 Unified diff