개정판 8a48a60b
issue #563: stop primary line tracing when meet equipment
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
309 | 309 |
''' |
310 | 310 |
def findConnectedObjects(self, startLine, toler): |
311 | 311 |
from EngineeringLineItem import QEngineeringLineItem |
312 |
from EngineeringEquipmentItem import QEngineeringEquipmentItem |
|
312 | 313 |
from SymbolSvgItem import SymbolSvgItem |
313 | 314 | |
314 | 315 |
visited = [startLine] |
... | ... | |
329 | 330 | |
330 | 331 |
# order connected objects |
331 | 332 |
matches = [] |
332 |
matches.extend(symbolMatches)
|
|
333 |
matches.extend([x for x in symbolMatches if not issubclass(type(x), QEngineeringEquipmentItem)]) # except equipment
|
|
333 | 334 |
matches.extend(lineMatches) |
334 | 335 | |
335 | 336 |
# specBreak 확인 |
DTI_PID/DTI_PID/Shapes/EngineeringEquipmentItem.py | ||
---|---|---|
108 | 108 |
else: |
109 | 109 |
_attrs[attr] = '' |
110 | 110 |
else: |
111 |
_attrs[attr] = ''#self.attrs[attr[1]] if attr[1] in self.attrs.keys() else '' |
|
111 |
matches = [prop for prop in self.attrs if prop.UID == attr.UID] |
|
112 |
if len(matches) == 1: |
|
113 |
_attrs[matches[0]] = self.attrs[matches[0]] |
|
114 |
else: |
|
115 |
_attrs[attr] = '' |
|
112 | 116 |
except Exception as ex: |
113 | 117 |
from App import App |
114 | 118 |
from AppDocData import MessageType |
DTI_PID/DTI_PID/potrace.py | ||
---|---|---|
74 | 74 |
svgFile.write(ET.tostring(svg, encoding='utf-8').decode('utf-8').replace('ns0:', '').replace(':ns0', '')) |
75 | 75 |
svgFile.close() |
76 | 76 |
except Exception as ex: |
77 |
print(ex) |
|
77 |
from App import App |
|
78 |
from AppDocData import MessageType |
|
79 | ||
80 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
81 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
78 | 82 | |
79 | 83 |
if __name__ == '__main__': |
80 | 84 |
execpath = os.path.dirname(os.path.realpath(__file__)) |
내보내기 Unified diff