프로젝트

일반

사용자정보

개정판 f319d186

IDf319d18651bf144b7251b8b915ff1af107e5bcb1
상위 b0c1df2e
하위 f36aedff

함의성이(가) 약 5년 전에 추가함

issue #563: sorting run third step on going, now paused

Change-Id: Iaeaa366adc2194a4492727840922c72b0b0a2f8e

차이점 보기:

DTI_PID/DTI_PID/LineNoTracer.py
866 866
        # third step : body connected run sort
867 867
        fixed_merged_run_infos = []
868 868
        waiting_mergerd_run_infos = []
869
        for waiting_run_info in waiting_run_infos:
870
            for waiting_run_info in waiting_run_infos:
871
                pass
869
        for index1 in range(len(waiting_run_infos)):
870
            if waiting_run_info[index1].consumed:
871
                continue
872
            for index2 in range(len(waiting_run_infos)):
873
                if index1 == index2 or waiting_run_info[index2].consumed:
874
                    continue
875

  
876
                result, merged_run, header = QEngineeringLineTracerRunItem.merge_if_possible(waiting_run_info[index1], waiting_run_info[index2])
877
                if result:
878
                    waiting_run_info[index1].consumed = True
879
                    waiting_run_info[index2].consumed = True
880
                    if header:
881
                        waiting_mergerd_run_infos.append([index2, index1], merged_run)
882
                    else:
883
                        waiting_mergerd_run_infos.append([index1, index2], merged_run)
884
                    break
885
        
886
        while False:
887
            for index in range(len(waiting_run_infos)):
888
                if waiting_run_info[index].consumed:
889
                    continue
890

  
891
                for waiting_mergerd_run_info in waiting_mergerd_run_infos:
892
                    result, merged_run, header = QEngineeringLineTracerRunItem.merge_if_possible(waiting_mergerd_run_info[1], waiting_run_info[index1])
893
                    if result:
894
                        waiting_run_info[index].consumed = True
895
                        if header:
896
                            waiting_mergerd_run_infos.append(waiting_mergerd_run_info[0].insert(0, index), merged_run)
897
                        else:
898
                            waiting_mergerd_run_infos.append(waiting_mergerd_run_info[0].append(index), merged_run)
872 899

  
873 900
        # trace special item
874 901
        worker.displayMessage.emit('Find line for special item...')
DTI_PID/DTI_PID/Shapes/EngineeringLineTracerRunItem.py
6 6
from EngineeringLineNoTextItem import QEngineeringLineNoTextItem
7 7
from QEngineeringTrimLineNoTextItem import QEngineeringTrimLineNoTextItem
8 8
from EngineeringRunItem import QEngineeringRunItem
9
from AppDocData import AppDocData
9
from AppDocData import *
10 10

  
11 11
class QEngineeringLineTracerRunItem():
12 12
    """
......
33 33
        if self.not_trim and self.not_secondary:
34 34
            self.lineNo.reverse()
35 35
        else:
36
            self.run.reverse()
36
            self.run.reverse()
37
    
38
    @staticmethod
39
    def merge_if_possible(run_info1, run_info2):
40
        """ return True and merged run items if run is connected, return True if run2 is come first """
41
        return False, [], False
42

  
43
        connected = False
44
        merged_items = []
45
        header = False
46

  
47
        if run_info1.run.items[-1].is_connected(run_info2.run.items[0]):
48
            connected = True
49
            header = False
50
            merged_items = run_info1.run.items + run_info2.run.items
51
        elif run_info1.run.items[-1].is_connected(run_info2.run.items[-1]):
52
            connected = True
53
            header = False
54
            run_info2.reverse()
55
            merged_items = run_info1.run.items + run_info2.run.items
56
        elif run_info1.run.items[0].is_connected(run_info2.run.items[-1]):
57
            connected = True
58
            header = True
59
            merged_items = run_info2.run.items + run_info1.run.items
60
        elif run_info1.run.items[0].is_connected(run_info2.run.items[0]):
61
            connected = True
62
            header = True
63
            run_info2.reverse()
64
            merged_items = run_info2.run.items + run_info1.run.items
65

  
66
        return connected, merged_items, header

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)