개정판 148a925b
fixed to findConnectedObjects method try to connect both symbol and line
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
112 | 112 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
113 | 113 |
|
114 | 114 |
''' |
115 |
@brief find objects connected to given line |
|
115 |
@brief find objects connected to given line while loop
|
|
116 | 116 |
@author humkyung |
117 | 117 |
@date 2018.04.16 |
118 | 118 |
@history humkyung 2018.05.08 find symbol or line connected to given object |
119 | 119 |
humkyung 2018.05.10 set found object's owner |
120 |
humkyung 2018.05.17 try to connect both symbol and line |
|
120 | 121 |
''' |
121 | 122 |
def findConnectedObjects(self, startLine, toler): |
122 | 123 |
from QEngineeringLineItem import QEngineeringLineItem |
... | ... | |
129 | 130 |
while len(pool) > 0: |
130 | 131 |
obj = pool.pop() |
131 | 132 |
if type(obj) is QEngineeringLineItem: |
132 |
matches = [x for x in self._symbols if (x.owner is None) and (x not in visited) and len(obj.connectIfPossible(x, toler)) > 0] |
|
133 |
if not matches: |
|
134 |
matches = [x for x in self._lines if (x.owner is None) and (x is not obj) and (x not in visited) and (len(obj.connectIfPossible(x, toler)) > 0)] |
|
133 |
symbolMatches = [x for x in self._symbols if (x.owner is None) and (x not in visited) and len(obj.connectIfPossible(x, toler)) > 0] |
|
134 |
lineMatches = [x for x in self._lines if (x.owner is None) and (x is not obj) and (x not in visited) and (len(obj.connectIfPossible(x, toler)) > 0)] |
|
135 | 135 |
elif issubclass(type(obj), SymbolSvgItem): |
136 |
matches = [x for x in self._lines if (x.owner is None) and (x not in visited) and len(obj.connectIfPossible(x, toler)) > 0] |
|
137 |
if not matches: |
|
138 |
matches = [x for x in self._symbols if (x.owner is None) and (x is not obj) and (x not in visited) and (len(obj.connectIfPossible(x, toler)) > 0)] |
|
136 |
lineMatches = [x for x in self._lines if (x.owner is None) and (x not in visited) and len(obj.connectIfPossible(x, toler)) > 0] |
|
137 |
symbolMatches = [x for x in self._symbols if (x.owner is None) and (x is not obj) and (x not in visited) and (len(obj.connectIfPossible(x, toler)) > 0)] |
|
139 | 138 |
|
140 |
for match in matches: |
|
139 |
for match in symbolMatches: |
|
140 |
pool.append(match) |
|
141 |
visited.append(match) |
|
142 |
|
|
143 |
for match in lineMatches: |
|
141 | 144 |
pool.append(match) |
142 | 145 |
visited.append(match) |
143 | 146 |
|
내보내기 Unified diff