개정판 4aea94be
update line drafting following
Change-Id: I2bd437ad760d288bae5d7bf603e1a0b0d648b467
DTI_PID/DTI_PID/Commands/PlaceLineCommand.py | ||
---|---|---|
6 | 6 |
import os.path |
7 | 7 |
import sys |
8 | 8 |
import AbstractCommand |
9 |
from AppDocData import AppDocData |
|
9 | 10 |
|
10 | 11 |
try: |
11 | 12 |
from PyQt5.QtCore import * |
... | ... | |
60 | 61 |
|
61 | 62 |
event = param[1] |
62 | 63 |
try: |
64 |
app_doc_data = AppDocData.instance() |
|
65 |
configs = app_doc_data.getConfigs('Line', 'Drafting') |
|
66 |
lineTypeMode = 1 |
|
67 |
if configs: |
|
68 |
lineTypeMode = int(configs[0].value) |
|
69 |
|
|
63 | 70 |
if 'mousePressEvent' == param[0] and event.button() == Qt.LeftButton: |
64 | 71 |
if self._polyline is None: |
65 | 72 |
selected = \ |
... | ... | |
72 | 79 |
if type(selected.parentItem()) is QEngineeringLineItem: |
73 | 80 |
self._line_type = selected.parentItem().lineType |
74 | 81 |
elif issubclass(type(selected.parentItem()), SymbolSvgItem): |
75 |
for idx, conn in enumerate(selected.parentItem().connectors): |
|
76 |
if selected is conn and len(selected.parentItem().conn_type) > idx: |
|
77 |
self._line_type = selected.parentItem().conn_type[idx] |
|
78 |
break |
|
82 |
if lineTypeMode != 2: |
|
83 |
for idx, conn in enumerate(selected.parentItem().connectors): |
|
84 |
if selected is conn and len(selected.parentItem().conn_type) > idx: |
|
85 |
self._line_type = selected.parentItem().conn_type[idx] |
|
86 |
break |
|
87 |
else: |
|
88 |
for conn in selected.parentItem().connectors: |
|
89 |
if conn.connectedItem and type(conn.connectedItem) is QEngineeringLineItem and conn.connectedItem.is_piping(True): |
|
90 |
self._line_type = conn.connectedItem.lineType |
|
91 |
break |
|
79 | 92 |
# up to here |
80 | 93 |
|
81 | 94 |
self.imageViewer.scene().addItem(self._polyline) |
내보내기 Unified diff