개정판 22adf874
issue #563: treating 3-way valve when line no tracing
Change-Id: I4b1cacb6c2fb4b8ecc9f346da483eceb393251ad
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
333 | 333 |
pool = [] |
334 | 334 |
pool.append((0, startLine)) |
335 | 335 |
|
336 |
""" check startLine is upstream or downstream of spec break """ |
|
337 |
matches = [spec_break for spec_break in self._spec_breaks if spec_break.is_connected(startLine)] |
|
338 |
if matches: return visited |
|
339 |
|
|
340 | 336 |
while len(pool) > 0: |
341 | 337 |
sign, obj = pool.pop() |
338 |
|
|
339 |
""" check startLine is upstream or downstream of spec break """ |
|
340 |
matches = [spec_break for spec_break in self._spec_breaks if spec_break.is_connected(startLine)] |
|
341 |
if matches: continue |
|
342 |
|
|
342 | 343 |
if type(obj) is QEngineeringLineItem: |
343 | 344 |
symbolMatches = [x for x in self._symbols if (x.owner is None) and (x not in visited) and obj.is_connected(x)] |
344 | 345 |
lineMatches = [x for x in self._lines if (x.owner is None) and (x is not obj) and (x not in visited) and obj.is_connected(x)] |
345 | 346 |
|
346 | 347 |
elif issubclass(type(obj), SymbolSvgItem): |
347 | 348 |
lineMatches = [x for x in self._lines if (x.owner is None) and (x not in visited) and obj.is_connected(x)] |
348 |
symbolMatches = [x for x in self._symbols if (x.owner is None) and (x is not obj) and (x not in visited) and obj.is_connected(x)] |
|
349 |
""" |
|
350 |
if len(lineMatches) > 1: # if 3-way valve |
|
351 |
matches = [x for x in [visited[0], visited[-1]] if obj.is_connected(x)] |
|
352 |
if matches: |
|
353 |
[x for x in lineMatches if obj.next_connected(x, matches[0])] |
|
354 |
""" |
|
355 |
|
|
356 |
symbolMatches = [x for x in self._symbols if (x.owner is None) and (x is not obj) and (x not in visited) and obj.is_connected(x, None)] |
|
349 | 357 |
|
350 | 358 |
# order connected objects |
351 | 359 |
matches = [] |
내보내기 Unified diff