프로젝트

일반

사용자정보

개정판 b209ec12

IDb209ec12b4f500af64c34cb184ca13248d27c172
상위 bcfbd2e2
하위 d530f374

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

dev issue #640: 심볼 속성창에서 Line No Text Item의 경우 CONN 설정 가능하게 수젇

차이점 보기:

DTI_PID/DTI_PID/Commands/SelectAttributeCommand.py
36 36
        if 'mouseReleaseEvent' == param[0] and event.button() == Qt.LeftButton:
37 37
            from SymbolSvgItem import SymbolSvgItem
38 38
            from EngineeringTextItem import QEngineeringTextItem
39
            from EngineeringLineItem import QEngineeringLineItem
39 40
            if self._type is not None:
40 41
                item = self.imageViewer.scene.itemAt(scenePos, QTransform())
41 42
                if item is not None and self._type == 'Text Item' and type(item) is QEngineeringTextItem:
42 43
                    self.resultItem = item
43 44
                elif item is not None and self._type == 'Symbol Item' and issubclass(type(item), SymbolSvgItem):
44 45
                    self.resultItem = item
46
                elif item is not None and self._type == 'Line Item' and issubclass(type(item), QEngineeringLineItem):
47
                    self.resultItem = item
45 48
                
46 49
        self.isTreated = True
47 50
        
48 51
    def setType(self, _type):
49 52
        self._type = _type
50 53

  
54
    def getType(self):
55
        return self._type
56

  
51 57
    def undo(self):
52 58
        pass
53 59

  
DTI_PID/DTI_PID/ItemPropertyTableWidget.py
106 106
        if issubclass(type(symbol), SymbolSvgItem):
107 107
            self.symData = symbol
108 108
            self.symbolChanged(symbol)
109
        elif type(symbol) is QEngineeringLineNoTextItem:
110
            self.lineNoChanged(symbol)
109 111

  
110 112
    '''
111 113
        @brief      show drawing' attributes
......
453 455
                        self.attrValueList.append((valueCell, key))
454 456
                        self.stringCell.append(valueCell)
455 457
                    key = keyStr[0][2]
458
                 
456 459
                item = QTableWidgetItem(key)
457 460
                item.setFlags(Qt.ItemIsEnabled)
458 461
                item.setBackground(QColor(220, 220, 220))
......
469 472
                    self.setCellWidget(index, 1, self.streamNoComboBox)
470 473
                    self.streamNoComboBox.setCurrentText(value)
471 474
                else:
475
                    ## 만약 Key 값이 CONN이면
476
                    if key == 'CONN':
477
                        from PyQt5 import QtGui
478
                        icon = QtGui.QIcon()
479
                        icon.addPixmap(QtGui.QPixmap(":/newPrefix/doubleclick.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
480
                        valueCell.setIcon(icon)
472 481
                    self.setItem(index, 1, valueCell)
473 482

  
474 483
    '''
DTI_PID/DTI_PID/MainWindow.py
327 327
                    uid = data[1]
328 328
                    break
329 329
            
330
            items = self.graphicsView.scene.selectedItems()
331
                
330 332
            if uid is not None:
331
                items = self.graphicsView.scene.selectedItems()
332 333
                if items is not None and len(items) == 1:
333 334
                    if issubclass(type(items[0]), SymbolSvgItem):
334 335
                        docData = AppDocData.instance()
......
354 355
                            self.resultPropertyTableWidget.editItem(cell)
355 356
                    else:
356 357
                        self.resultPropertyTableWidget.editItem(cell)
357

  
358
            elif items is not None and len(items) == 1 and type(items[0]) is QEngineeringLineNoTextItem:
359
                connCell = self.resultPropertyTableWidget.item(row, 0)
360
                if connCell.text() == 'CONN':
361
                    ## Line No Text Item의 CONN 속성 초기화
362
                    for index in range(len(items[0]._attrs)):
363
                        if type(items[0]._attrs[index]) is tuple and items[0]._attrs[index][0] == 'CONN':
364
                            items[0]._attrs[index] = (('CONN',''))
365

  
366
                    self.graphicsView.command = SelectAttributeCommand.SelectAttributeCommand(self.graphicsView)
367
                    self.graphicsView.command.setType('Line Item')
368
                    cursor = QCursor(Qt.PointingHandCursor)
369
                    QApplication.instance().setOverrideCursor(cursor)
370
                    
371
                    from PyQt5 import QtGui
372
                    cellItem = QTableWidgetItem('')
373
                    icon = QtGui.QIcon()
374
                    icon.addPixmap(QtGui.QPixmap(":/newPrefix/doubleclick.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
375
                    cellItem.setIcon(icon)
376
                    self.resultPropertyTableWidget.setItem(row, 1, cellItem)
358 377

  
359 378
            #cell = self.resultPropertyTableWidget.item(row, 0)
360 379
            #if cell is not None and self.resultPropertyTableWidget.item(row, 0).text():
DTI_PID/DTI_PID/QtImageViewer.py
328 328
                    # SelectAttribute 경우만 추가
329 329
                    if self.command.name == "SelectAttribute":
330 330
                        items = self.scene.selectedItems()
331
                        if self.command.resultItem is not None and items is not None and len(items) == 1:
331
                        if self.command.resultItem is not None and items is not None and len(items) == 1 and self.command.getType() == 'Line Item':
332
                            items = self.scene.selectedItems()
333
                            for index in range(len(items[0]._attrs)):
334
                                if type(items[0]._attrs[index]) is tuple and items[0]._attrs[index][0] == 'CONN':
335
                                    items[0]._attrs[index] = ('CONN', self.command.resultItem.uid)
336
                                    break
337
                            self.mainWindow.refreshResultPropertyTableWidget()
338
                        elif self.command.resultItem is not None and items is not None and len(items) == 1:
332 339
                            attrItem = self.command.resultItem
333 340
                            self.command.resultItem.attribute = self.currentAttribute
334 341
                            # 기존 연결되있는 다른 SymbolItem의 Attr 제거
DTI_PID/DTI_PID/Shapes/QEngineeringLineNoTextItem.py
34 34
        self._runs = []
35 35

  
36 36
        self._attrs = []
37
        self._attrs.append(('Line No', self.uid))
38
        self._attrs.append(('CONN', ''))
37

  
39 38
        #appDocData = AppDocData.instance()
40 39
        #attributes = appDocData.getSymbolAttribute('Line No Label')
41 40
        #print(attributes)

내보내기 Unified diff

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