개정판 d36055d0
issue #563: fix signal run
Change-Id: I7f84c28e245f21618049e870b8f736d3a82b1d75
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
96 | 96 |
@brief find secondary lines |
97 | 97 |
@author humkyung |
98 | 98 |
''' |
99 |
def find_secondary_lines(self, lines_and_symbols, include_signal=True): |
|
99 |
def find_secondary_lines(self, lines_and_symbols, include_signal=True, is_trim=False):
|
|
100 | 100 |
from EngineeringAbstractItem import QEngineeringAbstractItem |
101 | 101 |
from EngineeringLineItem import QEngineeringLineItem |
102 | 102 |
from EngineeringRunItem import QEngineeringRunItem |
103 |
from QEngineeringTrimLineNoTextItem import QEngineeringTrimLineNoTextItem |
|
103 | 104 |
|
104 | 105 |
try: |
105 | 106 |
foundCount = 1 |
... | ... | |
108 | 109 |
notMatches = [] |
109 | 110 |
for line in lines_and_symbols: |
110 | 111 |
if line.owner is not None: continue |
111 |
if not include_signal and type(line) is QEngineeringLineItem and not line.is_piping(): continue |
|
112 | 112 |
|
113 |
line_matches = [x for x in self._lines if x.owner and line.is_connected(x, QEngineeringAbstractItem.CONNECTED_AT_BODY)] |
|
114 |
symbol_matches = [x for x in self._symbols if x.owner and line.is_connected(x) and x.canBeSecondary(line)] |
|
113 |
if not include_signal and type(line) is QEngineeringLineItem and not line.is_piping(): continue |
|
114 |
|
|
115 |
if not is_trim: |
|
116 |
line_matches = [x for x in self._lines if x.owner and line.is_connected(x, QEngineeringAbstractItem.CONNECTED_AT_BODY)] |
|
117 |
symbol_matches = [x for x in self._symbols if x.owner and line.is_connected(x) and x.canBeSecondary(line)] |
|
118 |
else: |
|
119 |
line_matches = [x for x in self._lines if x.owner and type(x.owner) is QEngineeringTrimLineNoTextItem and line.is_connected(x, QEngineeringAbstractItem.CONNECTED_AT_BODY)] |
|
120 |
symbol_matches = [x for x in self._symbols if x.owner and type(x.owner) is QEngineeringTrimLineNoTextItem and line.is_connected(x) and x.canBeSecondary(line)] |
|
121 |
|
|
115 | 122 |
if line_matches or symbol_matches: |
116 | 123 |
foundCount += 1 |
117 | 124 |
connected_items = self.find_connected_objects(line, include_signal=include_signal) |
... | ... | |
168 | 175 |
lineno.conns.clear() |
169 | 176 |
minDist = None |
170 | 177 |
startLine = None |
171 |
for line in [line for line in self._lines if line.owner is None and line.is_piping()]: |
|
178 |
for line in [line for line in self._lines if line.owner is None and line.is_piping(strong=True)]:
|
|
172 | 179 |
dist = line.distanceTo((lineno.center().x(), lineno.center().y())) |
173 | 180 |
if (minDist is None) or (dist < minDist): |
174 | 181 |
minDist = dist |
... | ... | |
208 | 215 |
startLine = None |
209 | 216 |
if len(lineno.runs) is 0: |
210 | 217 |
continue |
211 |
for line in [line for line in lineno.runs[0].items if type(line) is QEngineeringLineItem and (line._lineType == 'Primary' or line._lineType == 'Secondary' or line._lineType == 'Connect To Process')]:
|
|
218 |
for line in [line for line in lineno.runs[0].items if type(line) is QEngineeringLineItem and line.is_piping(strong=True)]:
|
|
212 | 219 |
dist = line.distanceTo((lineno.center().x(), lineno.center().y())) |
213 | 220 |
if (minDist is None) or (dist < minDist): |
214 | 221 |
minDist = dist |
... | ... | |
239 | 246 |
orphans.remove(item) |
240 | 247 |
updateProgress.emit(self.maxValue) |
241 | 248 |
|
242 |
self.find_secondary_lines(orphans) |
|
249 |
self.find_secondary_lines(orphans, is_trim=True)
|
|
243 | 250 |
for item in orphans: |
244 | 251 |
if item.owner is not None: |
245 | 252 |
orphans.remove(item) |
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
582 | 582 |
if indexed == 1 or indexed == 4: |
583 | 583 |
self.reverse() |
584 | 584 |
|
585 |
def is_piping(self): |
|
585 |
def is_piping(self, strong=False):
|
|
586 | 586 |
""" return true if piping line """ |
587 |
return (self._lineType == 'Primary' or self._lineType == 'Secondary') |
|
587 |
if strong: |
|
588 |
return (self._lineType == 'Primary' or self._lineType == 'Secondary') |
|
589 |
else: |
|
590 |
return (self._lineType == 'Primary' or self._lineType == 'Secondary' or self._lineType == 'Connect To Process') |
|
588 | 591 |
|
589 | 592 |
''' |
590 | 593 |
@brief check if two lines are extendable |
내보내기 Unified diff