프로젝트

일반

사용자정보

개정판 e46783af

IDe46783afdb3c95db71dfa47461b2969919f445f0
상위 e2194a0c
하위 d60622f8, 96df8663

백흠경이(가) 약 6년 전에 추가함

issue #587: support size text item for symbol

Change-Id: I454fdd5e02027fbb57eeb8fa3825d4a8e98651a2

차이점 보기:

DTI_PID/DTI_PID/Commands/SelectAttributeCommand.py
77 77
                        self._item.owner = item
78 78
                        self.onSuccess.emit()
79 79
                    elif item is not None and self._attr.AttributeType == QEngineeringAbstractItem.assoc_type(item):
80
                        """
81
                        self._item.removeSelfAttr(self._attr.UID)
82
                        
83
                        # 기존 연결되있는 다른 SymbolItem의 Attr 제거
84
                        self._item.removeAttr(item)
85
                        """
80
                        if self._attr.AttributeType not in self._item._associations:
81
                            self._item._associations[self._attr.AttributeType] = []
82

  
86 83
                        while len(self._item._associations[self._attr.AttributeType]) <= self._attr.AttrAt:
87 84
                            self._item._associations[self._attr.AttributeType].append(None)
88 85
                        self._item._associations[self._attr.AttributeType][self._attr.AttrAt] = item
DTI_PID/DTI_PID/ItemPropertyTableWidget.py
657 657
            keyCell = self.item(row, 0)
658 658
            if hasattr(keyCell, 'tag') and type(items[0]) is not QEngineeringSpecBreakItem:
659 659
                attr = keyCell.tag
660
                if attr.AttributeType == "Symbol Item" or attr.AttributeType == 'Valve Oper Code' or attr.AttributeType == "Text Item":
660
                if attr.is_selectable:
661 661
                    cmd = SelectAttributeCommand.SelectAttributeCommand(items[0], attr, self.mainWindow.graphicsView)
662 662
                    cmd.onSuccess.connect(self.onSuccessSelectAttribute)
663 663
                    self.mainWindow.graphicsView.command = cmd
664
                elif self.item(row, column).flags() != Qt.ItemIsEnabled:
665 664
                    self.editItem(self.item(row, column))
666 665
            elif keyCell.text() == 'CONN' and type(items[0]) is QEngineeringLineNoTextItem:
667 666
                from SymbolAttr import SymbolAttr
......
704 703

  
705 704
            #elif Qt.ItemIsEnabled is not self.item(row, column).flags():
706 705
            #    self.editItem(self.item(row, column))
707
            
708 706

  
709 707
    '''
710 708
        @brief      success select attribute 
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
59 59
    def runs(self, value):
60 60
        self._runs = value
61 61
    
62
    def hoverEnterEvent(self, event):
63
        """ highlight line no text and run's item """
64
        self.hover = True
65
        self.update()
66

  
67
        for run in self.runs:
68
            for item in run.items:
69
                item.hoverEnterEvent(event)
70

  
71
    def hoverLeaveEvent(self, event):
72
        """ unhighlight line no text and run's item """
73
        self.hover = False
74
        self.update()
75

  
76
        for run in self.runs:
77
            for item in run.items:
78
                item.hoverLeaveEvent(event)
79

  
62 80
    def getLongestTwoPoints(self, pts):
63 81
        import math
64 82
        res = [None, None]
......
294 312
        sql = "insert or replace into LINE_DATA_LIST(UID, LINE_SIZE, LINE_SYMBOL, LINE_NO, LINE_CLASS, LINE_ROUTING_FROM, LINE_ROUTING_TO, SERVICE_FLUID, SERVICE_DENSITY, SERVICE_STATE, OPERATION_CONDITION_TEMP, OPERATION_CONDITION_PRESS, DESIGN_CONDITION_TEMP, DESIGN_CONDITION_PRESS, TEST_CONDITION_TEMP, TEST_CONDITION_PRESS, INSUL_CODE, PAINT_CODE, NDE_CODE, PWHT, PNID_NO) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
295 313
        param = tuple(data)
296 314
        return (sql, tuple(param))
297

  
298
    ''''
299
    def saveLineData(self):
300
        try:
301
            docData = AppDocData.instance()
302
            docData.setLineDataList([self.getLineDataList()])
303
        except Exception as ex:
304
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
305
            return str(self.uid)
306
    '''
307

  
315
    
308 316
    '''
309 317
        @brief      return Line Data List
310 318
        @author     kyouho
DTI_PID/DTI_PID/SymbolAttrEditorDialog.py
21 21
    This is symbol attribute editor dialog class
22 22
    """
23 23
    
24
    SYMBOL_ATTR_DATA_TYPES = {'Symbol Item':-1, 'Text Item':-1, 'Tag No':-1, 'Valve Oper Code':-1, 'Comp Item':-1, 'Int':1, 'String':1}
24
    SYMBOL_ATTR_DATA_TYPES = {'Symbol Item':-1, 'Size Text Item':-1, 'Text Item':-1, 'Tag No':-1, 'Valve Oper Code':-1, 'Comp Item':-1, 'Int':1, 'String':1}
25 25

  
26 26
    def __init__(self, parent, symbolType = None):
27 27
        QDialog.__init__(self, parent)
......
113 113

  
114 114
        row = 0
115 115
        for attr in attrs:
116
            item = QTableWidgetItem(attr.UID)    # UID
116
            item = QTableWidgetItem(attr.UID)                   # UID
117 117
            self.ui.tableWidgetAttr.setItem(row, 0, item)
118
            item = QTableWidgetItem(attr.Attribute)    # Name
118
            item = QTableWidgetItem(attr.Attribute)             # Name
119 119
            self.ui.tableWidgetAttr.setItem(row, 1, item)
120
            item = QTableWidgetItem(attr.DisplayAttribute)    # Display Name
120
            item = QTableWidgetItem(attr.DisplayAttribute)      # Display Name
121 121
            self.ui.tableWidgetAttr.setItem(row, 2, item)
122 122

  
123 123
            attrTypeComboBox = QComboBox()

내보내기 Unified diff

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