프로젝트

일반

사용자정보

개정판 3b8c7e7b

ID3b8c7e7bee8a09c5a164c1f9f5737890f8a0f9cc
상위 71bbe68c
하위 5a27cda6

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

fix from to indicator

Change-Id: I16ebd2c0ce78b357d3a00d67c107419163f6e28e

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
85 85
        self._streamLineListModelDatas = []
86 86
        self._titleBlockProperties = None
87 87
        self.needReOpening = None
88
        self.lineNoFromToIndicator = []
88 89

  
89 90
        # item members are used only recognition except tracerLineNos for trim line no
90 91
        self.equipments = []
DTI_PID/DTI_PID/DetectSymbolDialog.py
104 104

  
105 105
    def currentTextChangedEvent(self, text):
106 106
        self.imageName = text
107
        self.imgPath = self.drawingDir + self.ui.listWidgetDrawings.currentItem().data(32)
107
        self.imgPath = self.drawingDir + "\\" + self.ui.listWidgetDrawings.currentItem().data(32)
108 108
        self.tableSetting()
109 109

  
110 110
    '''
DTI_PID/DTI_PID/MainWindow.py
2629 2629
                        # if done: break
2630 2630

  
2631 2631
                if item.scene() is not None:
2632
                    if type(item) is QEngineeringLineNoTextItem and item._labels:
2633
                        for _label in item._labels:
2634
                            item.scene().removeItem(_label)
2635
                        item._labels = []
2632
                    #if type(item) is QEngineeringLineNoTextItem and item._labels:
2633
                    #    for _label in item._labels:
2634
                    #        item.scene().removeItem(_label)
2635
                    #    item._labels = []
2636 2636

  
2637 2637
                    item.scene().removeItem(item)
2638 2638
        except Exception as ex:
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
48 48
                                SymbolProp(None, 'Config', 'String'): None }  # , SymbolProp(None, 'Freeze', 'Boolean'):False}
49 49
        self._runs = []
50 50

  
51
        self._labels = []
52

  
53 51
        """ create freeze control """
54 52
        # self.freeze_item = QEngineeringFreezeItem(-QEngineeringFreezeItem.FREEZE_SIZE*0.5, -QEngineeringFreezeItem.FREEZE_SIZE*0.5, QEngineeringFreezeItem.FREEZE_SIZE, QEngineeringFreezeItem.FREEZE_SIZE)
55 53
        # self.freeze_item.setParentItem(self)
......
110 108
        """ highlight line no text and run's item """
111 109
        from App import App
112 110

  
113
        self.hover = True
114
        self.update()
111
        try:
112
            self.hover = True
113
            self.update()
114

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

  
119
                    add_doc_data = AppDocData.instance()
120

  
121
                    # display from / to indicator
122
                    if not add_doc_data.lineNoFromToIndicator or len(add_doc_data.lineNoFromToIndicator) < 2:
123
                        if run is self.runs[0] and (item is run.items[0] or item is run.items[-1]):
124
                            _label = QGraphicsTextItem('{}'.format("F")) if item is run.items[0] else QGraphicsTextItem('{}'.format("T"))
125
                            _label.setZValue(500)
126
                            font = QFont('Arial', 45)
127
                            font.setBold(True)
128
                            _label.setFont(font)
129
                            self.scene().addItem(_label)
130
                            _label.setPos(QPointF(item.origin[0] - 25, item.origin[1] - 25))
131
                            _label.setDefaultTextColor(Qt.green)
132
                            add_doc_data.lineNoFromToIndicator.append(_label)
133
                    elif add_doc_data.lineNoFromToIndicator:
134
                        if run is self.runs[0] and (item is run.items[0]):
135
                            add_doc_data.lineNoFromToIndicator[0].setPos(QPointF(item.origin[0] - 25, item.origin[1] - 25))
136
                            add_doc_data.lineNoFromToIndicator[0].setVisible(True)
137
                        elif run is self.runs[0] and (item is run.items[-1]):
138
                            add_doc_data.lineNoFromToIndicator[1].setPos(QPointF(item.origin[0] - 25, item.origin[1] - 25))
139
                            add_doc_data.lineNoFromToIndicator[1].setVisible(True)
140
                    # up to here
141
        except Exception as ex:
142
            from App import App
143
            from AppDocData import MessageType
144

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

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

  
120
                # display from / to indicator
121
                if not self._labels or len(self._labels) < 2:
122
                    if run is self.runs[0] and (item is run.items[0] or item is run.items[-1]):
123
                        _label = QGraphicsTextItem('{}'.format("F")) if item is run.items[0] else QGraphicsTextItem('{}'.format("T"))
124
                        _label.setZValue(500)
125
                        font = QFont('Arial', 45)
126
                        font.setBold(True)
127
                        _label.setFont(font)
128
                        self.scene().addItem(_label)
129
                        _label.setPos(QPointF(item.origin[0] - 25, item.origin[1] - 25))
130
                        _label.setDefaultTextColor(Qt.green)
131
                        self._labels.append(_label)
132
                # up to here
133 149

  
134 150
    def hoverLeaveEvent(self, event):
135 151
        """ unhighlight line no text and run's item """
136
        self.hover = False
137
        self.update()
152
        try:
153
            self.hover = False
154
            self.update()
138 155

  
139
        for run in self.runs:
140
            for item in run.items:
141
                item.hoverLeaveEvent(event)
156
            for run in self.runs:
157
                for item in run.items:
158
                    item.hoverLeaveEvent(event)
159

  
160
            add_doc_data = AppDocData.instance()
161
            if add_doc_data.lineNoFromToIndicator:
162
                for _label in add_doc_data.lineNoFromToIndicator:
163
                    _label.setVisible(False)
164
                    #self.scene().removeItem(_label)
165
                #self._labels = []
166
        except Exception as ex:
167
            from App import App
168
            from AppDocData import MessageType
169

  
170
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
171
                                                           sys.exc_info()[-1].tb_lineno)
172
            App.mainWnd().addMessage.emit(MessageType.Error, message)
142 173

  
143
        if self._labels:
144
            for _label in self._labels:
145
                self.scene().removeItem(_label)
146
            self._labels = []
147 174

  
148 175
    def keyPressEvent(self, event):
149 176
        """ reverse line routine when user press 'C' key """

내보내기 Unified diff

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