프로젝트

일반

사용자정보

개정판 df4661c5

IDdf4661c529ac7193efe1e9067eff9446addc146e
상위 990644d9
하위 e44ea38a

백흠경이(가) 5년 이상 전에 추가함

issue #503: apply vendor package to item

Change-Id: I75290df20793b0cab759dff140a62d7d5503be8f

차이점 보기:

DTI_PID/DTI_PID/MainWindow.py
192 192
        self.actionRecognition.triggered.connect(self.recognize)
193 193
        self.pushButtonBatchRecognition.clicked.connect(self.recognizeBatch)
194 194
        self.pushButtonRefreshDrawings.clicked.connect(self.load_drawing_list)
195
        self.actionLineRecognition.triggered.connect(self.recognizeLine)
195
        self.actionLineRecognition.triggered.connect(self.connect_attributes)
196 196
        self.actionArea.triggered.connect(self.areaConfiguration)
197 197
        self.actionConfiguration.triggered.connect(self.configuration)
198 198
        self.actionOCR.triggered.connect(self.onAreaOcr)
......
1617 1617
                    Jeongwoo 2018.05.25 Move codes about LineDetector
1618 1618
                    humkyung 2018.06.17 show progress dialog
1619 1619
    '''
1620
    def recognizeLine(self, MainWindow):
1620
    def connect_attributes(self, MainWindow):
1621 1621
        from LineNoTracer import LineNoTracer
1622 1622
        from ConnectAttrDialog import QConnectAttrDialog
1623 1623

  
......
2374 2374
            for line in root.find('LINEINFOS').iter('LINE'):
2375 2375
                item = QEngineeringLineItem.fromXml(line)
2376 2376
                item.transfer.onRemoved.connect(self.itemRemoved)
2377
                if item: self.addLineItemToScene(item)
2377
                if item:
2378
                    self.graphicsView.scene.addItem(item)
2378 2379

  
2379 2380
                self.progress.setValue(self.progress.value() + 1)
2380 2381
                
......
2417 2418
                                uid = uidElement.text
2418 2419
                                run_item = self.graphicsView.findItemByUid(uid)
2419 2420
                                if run_item is not None:
2420
                                    run_item._owner = item
2421
                                    run_item._owner = line_no
2421 2422
                                    line_run.items.append(run_item)
2422 2423
                        line_run.owner = line_no
2423 2424
                        line_no.runs.append(line_run)
......
2462 2463

  
2463 2464
            # up to here
2464 2465

  
2465
            # set symbol's connectItem
2466
            from EngineeringConnectorItem import QEngineeringConnectorItem
2467
            connectors = [item for item in self.graphicsView.scene.items() if type(item) == QEngineeringConnectorItem and item.connectedItem is not None]
2468
            for connector in connectors:
2469
                # 처음에는 UID가 connectedItem에 String으로 들어가있기 때문에
2470
                connector.connectedItem = self.graphicsView.findItemByUid(connector.connectedItem)
2471

  
2472
            symbols = [item for item in self.graphicsView.scene.items() if issubclass(type(item), SymbolSvgItem) and len(item.attrs) > 0 and type(item) is not QEngineeringSpecBreakItem]
2473
            for symbol in symbols:
2474
                # 처음에는 attrs의 uid가 connectedItem에 String으로 들어가있기 때문에
2475
                for key in symbol.attrs.keys():
2476
                    if type(symbol.attrs[key]) is not UserInputAttribute and type(symbol.attrs[key]) is not tuple:
2477
                        symbol.attrs[key] = self.graphicsView.findItemByUid(symbol.attrs[key])
2478
                        
2479 2466
            """ update scene """
2480 2467
            self.graphicsView.scene.update(self.graphicsView.sceneRect())
2481 2468
            for item in self.graphicsView.scene.items():

내보내기 Unified diff

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