개정판 28e98239
issue #563: fix update line type
Change-Id: I6eaf71bc266d3f1cf93b0362682d7bb21ad26b48
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
552 | 552 |
""" update line type """ |
553 | 553 |
if update_line_type: |
554 | 554 |
worker.displayMessage.emit('Updating Line Type...') |
555 |
for line in lines: line.update_line_type() |
|
555 |
for line in lines: |
|
556 |
line.update_line_type() |
|
556 | 557 |
|
557 | 558 |
"""make end break""" |
558 | 559 |
end_break_names = docdata.getSymbolListByType('type', 'End Break') |
DTI_PID/DTI_PID/LineTypeConditions.py | ||
---|---|---|
36 | 36 |
def conditions(self, value): |
37 | 37 |
self._conditions = value |
38 | 38 |
|
39 |
def eval(self, items):
|
|
39 |
def eval(self, _items, reverse=False):
|
|
40 | 40 |
""" return the result of evaluate """ |
41 | 41 |
from SymbolSvgItem import SymbolSvgItem |
42 | 42 |
from EngineeringLineItem import QEngineeringLineItem |
43 | 43 |
|
44 | 44 |
try: |
45 |
items = [] |
|
46 |
for item in _items: |
|
47 |
items.append(item) |
|
48 |
|
|
49 |
if reverse: |
|
50 |
self._conditions = (self._conditions[1], self._conditions[0]) |
|
51 |
|
|
45 | 52 |
if (self.conditions[0][0] is None or self.conditions[0][0] == '') and (self.conditions[1][0] is None or self.conditions[1][0] == ''): return False |
46 | 53 |
|
47 | 54 |
if len(items) is not 0 and len(items) == len([condition for condition in self.conditions if condition[0] and condition[0] != '']): |
... | ... | |
81 | 88 |
|
82 | 89 |
return True |
83 | 90 |
except Exception as ex: |
84 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
85 |
print(message) |
|
91 |
from App import App |
|
92 |
from AppDocData import MessageType |
|
93 |
|
|
94 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
95 |
sys.exc_info()[-1].tb_lineno) |
|
96 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
86 | 97 |
|
87 | 98 |
return False |
88 | 99 |
|
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1196 | 1196 |
if condition.eval(items): |
1197 | 1197 |
self.lineType = condition.name |
1198 | 1198 |
break |
1199 |
if condition.eval(items, reverse=True): |
|
1200 |
self.lineType = condition.name |
|
1201 |
break |
|
1199 | 1202 |
except Exception as ex: |
1200 | 1203 |
from App import App |
1201 | 1204 |
from AppDocData import MessageType |
내보내기 Unified diff