프로젝트

일반

사용자정보

개정판 dd835b7b

IDdd835b7bc55d8d343a58ba79fce9e6662f475a3b
상위 1e6d354d
하위 a67e9cc9

함의성이(가) 일년 이상 전에 추가함

add copy between drawings

Change-Id: Ie3f281104f1d45008a9cec866ee74add39bab96f

차이점 보기:

DTI_PID/DTI_PID/QtImageViewerScene.py
137 137
                    if text.find('<DWG>') != -1 and text.find('</DWG>') != -1:
138 138
                        from xml.etree import ElementTree
139 139

  
140
                        root = ElementTree.fromstring(text)
141

  
142
                        fromDrawing = root.find('DWGNAME').text
143
                        fixedPosition = False
144
                        if app_doc_data.activeDrawing.name.replace('.png', '') != fromDrawing:
145
                            fixedPosition = True
146

  
140 147
                        origin = self.views()[0].mapFromGlobal(QCursor.pos())
141 148
                        origin = self.views()[0].mapToScene(origin)
142 149

  
143
                        delta = None
144
                        root = ElementTree.fromstring(text)
150
                        delta = QPointF(0, 0)
145 151
                        for symbol in root.find('SYMBOLS').iter('SYMBOL'):
146 152
                            item = SymbolSvgItem.fromXml(symbol)
147 153
                            svg = QtImageViewer.createSymbolObject(item.name)
148
                            if not delta:
154
                            if not delta and not fixedPosition:
149 155
                                delta = origin - QPointF(item.origin[0], item.origin[1])
150 156

  
151 157
                            if type(svg) is QEngineeringSpecBreakItem:
......
183 189
                            angle = float(text.find('ANGLE').text)
184 190
                            tokens = text.find('LOCATION').text.split(',')
185 191
                            loc = QPointF(float(tokens[0]), float(tokens[1]))
186
                            if not delta:
192
                            if not delta and not fixedPosition:
187 193
                                delta = origin - loc
188 194
                            pos = loc + delta
189 195
                            textInfo = TextInfo(text.find('VALUE').text, pos.x(), pos.y(), width, height, angle)
......
194 200
                            startPoint = [float(x) for x in node.find('STARTPOINT').text.split(',')]
195 201
                            endPoint = [float(x) for x in node.find('ENDPOINT').text.split(',')]
196 202
                            loc = QPointF(startPoint[0], startPoint[1])
197
                            if not delta:
203
                            if not delta and not fixedPosition:
198 204
                                delta = origin - loc
199 205
                            line = QEngineeringLineItem(vertices=[[startPoint[0] + delta.x(), startPoint[1] + delta.y()],
200 206
                                                                  [endPoint[0] + delta.x(), endPoint[1] + delta.y()]]) #.fromXml(node)

내보내기 Unified diff

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