개정판 1228e32c
issue #563: separate make end break
Change-Id: I2953c333a4acee4e1aff111ed080c9adb25779e1
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
634 | 634 |
line.update_line_type() |
635 | 635 |
|
636 | 636 |
QApplication.processEvents() |
637 |
"""make end break""" |
|
637 |
""" make end break """ |
|
638 |
make_end_break(worker, end_breaks, lineNos) |
|
639 |
|
|
640 |
QApplication.processEvents() |
|
641 |
""" update spec break """ |
|
642 |
if update_spec: |
|
643 |
make_spec(worker, spec_breaks, lines, lineNos) |
|
644 |
|
|
645 |
worker.updateProgress.emit(tracer.maxValue) |
|
646 |
|
|
647 |
QApplication.processEvents() |
|
648 |
# trace special item |
|
649 |
worker.display_message.emit('Find line for special item...') |
|
650 |
tracer = SpecialItemTracer([item for item in worker.scene.items() if |
|
651 |
(type(item) is SymbolSvgItem or type(item) is QEngineeringTextItem) and |
|
652 |
item.special_item_type], lines) |
|
653 |
tracer.execute(worker.display_message, worker.updateProgress) |
|
654 |
# up to here |
|
655 |
|
|
656 |
QApplication.processEvents() |
|
657 |
''' sort run flow order ''' |
|
658 |
sort_run_flow(worker) |
|
659 |
|
|
660 |
QApplication.processEvents() |
|
661 |
""" make flow mark """ |
|
662 |
if update_flow_mark: |
|
663 |
make_flow_mark(worker, lines) |
|
664 |
|
|
665 |
''' get line no's from/to equipment ''' |
|
666 |
for lineNo in lineNos: |
|
667 |
lineNo.EvaluatedEQ() |
|
668 |
|
|
669 |
except Exception as ex: |
|
670 |
message = 'error occurred({}) in {}:{}'.format(repr(ex), sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
671 |
sys.exc_info()[-1].tb_lineno) |
|
672 |
worker.display_message.emit(message) |
|
673 |
except: |
|
674 |
(type1, value, traceback) = sys.exc_info() |
|
675 |
sys.excepthook(type1, value, traceback) |
|
676 |
|
|
677 |
def make_end_break(worker, end_breaks, lineNos): |
|
678 |
''' make end break ''' |
|
679 |
|
|
680 |
from App import App |
|
681 |
import os |
|
682 |
|
|
683 |
try: |
|
684 |
docdata = AppDocData.instance() |
|
685 |
|
|
638 | 686 |
end_break_names = docdata.getSymbolListByType('type', 'End Break') |
639 | 687 |
if len(end_break_names) is not 0: |
640 | 688 |
svgFileName = end_break_names[0].sName |
... | ... | |
715 | 763 |
'Connected Item').lineType == 'Primary'))): |
716 | 764 |
end_break.addSvgItemToScene(worker.scene) |
717 | 765 |
|
718 |
QApplication.processEvents() |
|
719 |
""" update spec break """ |
|
720 |
if update_spec: |
|
721 |
make_spec(worker, spec_breaks, lines, lineNos) |
|
722 |
|
|
723 |
worker.updateProgress.emit(tracer.maxValue) |
|
724 |
|
|
725 |
QApplication.processEvents() |
|
726 |
# trace special item |
|
727 |
worker.display_message.emit('Find line for special item...') |
|
728 |
tracer = SpecialItemTracer([item for item in worker.scene.items() if |
|
729 |
(type(item) is SymbolSvgItem or type(item) is QEngineeringTextItem) and |
|
730 |
item.special_item_type], lines) |
|
731 |
tracer.execute(worker.display_message, worker.updateProgress) |
|
732 |
# up to here |
|
733 |
|
|
734 |
QApplication.processEvents() |
|
735 |
# sort run flow order |
|
736 |
sort_run_flow(worker) |
|
737 |
|
|
738 |
QApplication.processEvents() |
|
739 |
""" make flow mark """ |
|
740 |
if update_flow_mark: |
|
741 |
make_flow_mark(worker, lines) |
|
742 |
|
|
743 |
''' get line no's from/to equipment ''' |
|
744 |
for lineNo in lineNos: |
|
745 |
lineNo.EvaluatedEQ() |
|
746 |
|
|
747 | 766 |
except Exception as ex: |
748 | 767 |
message = 'error occurred({}) in {}:{}'.format(repr(ex), sys.exc_info()[-1].tb_frame.f_code.co_filename, |
749 |
sys.exc_info()[-1].tb_lineno)
|
|
768 |
sys.exc_info()[-1].tb_lineno) |
|
750 | 769 |
worker.display_message.emit(message) |
751 |
except: |
|
752 |
(type1, value, traceback) = sys.exc_info() |
|
753 |
sys.excepthook(type1, value, traceback) |
|
754 | 770 |
|
755 | 771 |
def make_spec(worker, spec_breaks, lines, lineNos): |
756 | 772 |
''' update spec break ''' |
내보내기 Unified diff