프로젝트

일반

사용자정보

개정판 148a925b

ID148a925b35d1fc079a8608cf835c1bd0e013b000
상위 3c87b140
하위 b40fde27

humkyung 이(가) 6년 이상 전에 추가함

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

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