개정판 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 = [] |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
52 | 52 |
# attributeType uid |
53 | 53 |
self.attribute = '' |
54 | 54 |
self._properties = {SymbolProp(None, 'Supplied By', 'String'):None} |
55 |
self.supplied_by = '' |
|
56 | 55 |
|
57 | 56 |
self.setAcceptDrops(True) |
58 | 57 |
self.setAcceptHoverEvents(True) |
... | ... | |
348 | 347 |
def is_connected(self, item, at=QEngineeringAbstractItem.CONNECTED_AT_PT): |
349 | 348 |
""" check if given item is connected to self """ |
350 | 349 |
|
351 |
_connectors = [connector for connector in self.connectors if (connector.connectedItem == item and connector._connected_at == at)]
|
|
350 |
_connectors = [connector for connector in self.connectors if (connector.connectedItem == item and (connector._connected_at == at if at else True))]
|
|
352 | 351 |
return len(_connectors) > 0 |
353 | 352 |
|
354 | 353 |
''' |
내보내기 Unified diff