개정판 9371b0cf
issue #563: add line group break at break connector
Change-Id: I0cfebbf1779e847d584abdf8dc3b74d932b5d30b
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
266 | 266 |
from EngineeringEquipmentItem import QEngineeringEquipmentItem |
267 | 267 |
from SymbolSvgItem import SymbolSvgItem |
268 | 268 |
|
269 |
#if start.owner is not None: |
|
270 |
# return [] |
|
271 | 269 |
visited = [start] |
272 | 270 |
|
273 | 271 |
try: |
... | ... | |
321 | 319 |
nextMatches = next_connected |
322 | 320 |
else: |
323 | 321 |
nextMatches = [] |
322 |
|
|
323 |
# if obj symbol has break connector and nextMatch connected that connector than break line group |
|
324 |
if nextMatches and obj.break_connector and [index for index in obj.break_connector if obj.connectors[index].connectedItem is nextMatches[0]]: |
|
325 |
match = True |
|
326 |
break |
|
327 |
|
|
328 |
# if obj item connected symbol that has break connector then break line group |
|
329 |
if nextMatches: |
|
330 |
pop_index = [] |
|
331 |
index = 0 |
|
332 |
for nextMatch in nextMatches: |
|
333 |
if hasattr(nextMatch, 'break_connector'): |
|
334 |
if [index for index in nextMatch.break_connector if nextMatch.connectors[index].connectedItem is obj]: |
|
335 |
pop_index.append(index) |
|
336 |
index += 1 |
|
337 |
|
|
338 |
for index in reversed(pop_index): |
|
339 |
nextMatches.pop(index) |
|
324 | 340 |
|
325 | 341 |
# order connected objects |
326 | 342 |
matches = [] |
... | ... | |
548 | 564 |
if connector.connectedItem is not None and type(connector.connectedItem.owner) is QEngineeringLineNoTextItem and connector.connectedItem.owner is not line_end.owner: |
549 | 565 |
end_break = SymbolSvgItem.createItem(symbol.getType(), svgFilePath) |
550 | 566 |
pt = [connector.center()[0] - float(symbol.getOriginalPoint().split(',')[0]), connector.center()[1] - float(symbol.getOriginalPoint().split(',')[1])] |
551 |
origin = [0,0] |
|
567 |
origin = [0, 0]
|
|
552 | 568 |
if 2 == len(symbol.getOriginalPoint().split(',')): |
553 | 569 |
tokens = symbol.getOriginalPoint().split(',') |
554 | 570 |
origin = [pt[0] + float(tokens[0]), pt[1] + float(tokens[1])] |
... | ... | |
655 | 671 |
for connector in spec[0].connectors: |
656 | 672 |
if connector.connectedItem is spec[1]: |
657 | 673 |
spec_break = SymbolSvgItem.createItem(symbol.getType(), svgFilePath) |
658 |
pt = [60 + connector.center()[0] - float(symbol.getOriginalPoint().split(',')[0]), 30 + connector.center()[1] - float(symbol.getOriginalPoint().split(',')[1])]
|
|
674 |
pt = [60 + connector.center()[0] - float(symbol.getOriginalPoint().split(',')[0]), 90 + connector.center()[1] - float(symbol.getOriginalPoint().split(',')[1])]
|
|
659 | 675 |
origin = [0, 0] |
660 | 676 |
if 2 == len(symbol.getOriginalPoint().split(',')): |
661 | 677 |
tokens = symbol.getOriginalPoint().split(',') |
내보내기 Unified diff