프로젝트

일반

사용자정보

개정판 654b4c81

ID654b4c81d65c9774a10a9693e16c0ea4a6cb0fda
상위 33f84426
하위 e8043e3a

함의성이(가) 약 2년 전에 추가함

improve operation

Change-Id: I947fdc368fc09ec973cda06b1e566df4e6c77959

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringEquipmentItem.py
122 122
            App.mainWnd().addMessage.emit(MessageType.Error, message)
123 123
        '''
124 124

  
125
    '''
125 126
    def highlight(self, flag):
126 127
        """ highlight/unhighlight the equpment """
127 128

  
......
141 142
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
142 143
                                                           sys.exc_info()[-1].tb_lineno)
143 144
            App.mainWnd().addMessage.emit(MessageType.Error, message)
145
    '''
144 146

  
145 147
    @property
146 148
    def NameText(self):
DTI_PID/DTI_PID/Shapes/EngineeringInstrumentItem.py
123 123
    def tagSuffix(self, value):
124 124
        self._tagSuffix = value
125 125

  
126
    '''
126 127
    def highlight(self, flag):
127 128
        """ highlight/unhighlight the instrument """
128 129

  
......
142 143
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
143 144
                                                          sys.exc_info()[-1].tb_lineno)
144 145
            App.mainWnd().addMessage.emit(MessageType.Error, message)
146
    '''
145 147

  
146 148
    '''
147 149
        @brief  connect attribute
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py
1382 1382
                                                           sys.exc_info()[-1].tb_lineno)
1383 1383
            App.mainWnd().addMessage.emit(MessageType.Error, message)
1384 1384

  
1385
    def hoverEnterEvent(self, event):
1385
    def hoverEnterEvent(self, event, minimum=False):
1386 1386
        """ hilight item and it's children """
1387
        self.highlight(True)
1387
        self.highlight(True, minimum)
1388 1388

  
1389
    def hoverLeaveEvent(self, event):
1389
    def hoverLeaveEvent(self, event, minimum=False):
1390 1390
        """ restore original color """
1391
        self.highlight(False)
1391
        self.highlight(False, minimum)
1392 1392

  
1393
    def highlight(self, flag):
1393
    def highlight(self, flag, minimum=False):
1394 1394
        self.hover = flag
1395 1395
        self.setZValue(QEngineeringAbstractItem.HOVER_ZVALUE) if flag else self.setZValue(QEngineeringLineItem.ZVALUE)
1396 1396
        self.update()
1397 1397

  
1398
        for assoc in self.associations():
1399
            assoc.highlight(flag)
1398
        if not minimum:
1399
            for assoc in self.associations():
1400
                assoc.highlight(flag)
1400 1401

  
1401
        for connector in self.connectors:
1402
            connector.highlight(flag)
1402
            for connector in self.connectors:
1403
                connector.highlight(flag)
1403 1404

  
1404 1405
    def hoverMoveEvent(self, event):
1405 1406
        pass
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
112 112
            self.hover = True
113 113
            self.update()
114 114

  
115
            add_doc_data = AppDocData.instance()
116

  
115 117
            for run in self.runs:
116 118
                for item in run.items:
117
                    item.hoverEnterEvent(event)
119
                    item.hoverEnterEvent(event, True)
118 120

  
119
                    # display from / to indicator
120
                    add_doc_data = AppDocData.instance()                    
121
                    # display from / to indicator     
121 122
                    if not add_doc_data.lineNoFromToIndicator or len(add_doc_data.lineNoFromToIndicator) < 2:
122 123
                        if run is self.runs[0] and (item is run.items[0] or item is run.items[-1]):
123 124
                            _label = QGraphicsTextItem('{}'.format("F")) if not add_doc_data.lineNoFromToIndicator else QGraphicsTextItem('{}'.format("T"))
......
154 155

  
155 156
            for run in self.runs:
156 157
                for item in run.items:
157
                    item.hoverLeaveEvent(event)
158
                    item.hoverLeaveEvent(event, True)
158 159

  
159 160
            add_doc_data = AppDocData.instance()
160 161
            if add_doc_data.lineNoFromToIndicator:
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
849 849
        @date       2018.05.02
850 850
    '''
851 851

  
852
    def hoverEnterEvent(self, event):
853
        self.highlight(True)
852
    def hoverEnterEvent(self, event, minimum=False):
853
        self.highlight(True, minimum)
854 854

  
855 855
    '''
856 856
        @brief      unhighlight connector and attribute
......
858 858
        @date       2018.05.02
859 859
        @history    kyouho 2018.07.18 edit ArrowCursor
860 860
    '''
861
    def hoverLeaveEvent(self, event):
862
        self.highlight(False)
861
    def hoverLeaveEvent(self, event, minimum=False):
862
        self.highlight(False, minimum)
863 863

  
864
    def highlight(self, flag):
864
    def highlight(self, flag, minimum=False):
865 865
        """ highlight/unhighlight the symbol """
866 866

  
867 867
        try:
......
869 869
            self.setZValue(QEngineeringAbstractItem.HOVER_ZVALUE) if flag else self.setZValue(SymbolSvgItem.ZVALUE)
870 870
            self.update()
871 871

  
872
            for assoc in self.associations():
873
                assoc.highlight(flag)
872
            if not minimum:
873
                for assoc in self.associations():
874
                    assoc.highlight(flag)
874 875

  
875
            for connector in self.connectors:
876
                connector.highlight(flag)
876
                for connector in self.connectors:
877
                    connector.highlight(flag)
877 878
        except Exception as ex:
878 879
            from App import App
879 880
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,

내보내기 Unified diff

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