프로젝트

일반

사용자정보

개정판 8702b3ab

ID8702b3abf611e96d8c4173f64bcee9ed31e4eeaa
상위 4edbb659
하위 558105a1, 5f9a684b

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

issue #571: Template Database 업데이트

차이점 보기:

DTI_PID/DTI_PID/ConfigurationDialog.py
184 184
            self.ui.radioButtonProperty.setChecked(False)
185 185
       
186 186
        # Color Property 선택값 가져옴
187
        self.ui.tableWidgetColorProperty.setHorizontalHeaderLabels(['Value', 'Color', 'ref', 'colorStr'])
187 188
        table = self.ui.tableWidgetColorProperty
189
        index = 0
188 190
        configs = docData.getConfigs('Color Property', 'State')
189
        uid = configs[0].value
190
        lineProp = docData.getLinePropertiesByUID(uid)
191
        selectedOption = lineProp[0].DisplayAttribute if lineProp and self.ui.comboBoxColorOption.findText(lineProp[0].DisplayAttribute) >= 0 else ''
192
        self.ui.tableWidgetColorProperty.setHorizontalHeaderLabels(['Value', 'Color', 'ref', 'colorStr'])
193
        
194
        index = self.ui.comboBoxColorOption.findText(selectedOption)
191
        if configs:
192
            uid = configs[0].value
193
            lineProp = docData.getLinePropertiesByUID(uid)
194
            selectedOption = lineProp[0].DisplayAttribute if lineProp and self.ui.comboBoxColorOption.findText(lineProp[0].DisplayAttribute) >= 0 else ''
195
            
196
            index = self.ui.comboBoxColorOption.findText(selectedOption)
195 197
        self.ui.comboBoxColorOption.setCurrentIndex(index)
196 198
        self.currentIndex = index
197 199

  
DTI_PID/DTI_PID/SymbolEditorDialog.py
21 21

  
22 22

  
23 23
class QSymbolEditorDialog(QDialog):
24
    """
25
    This is symbol editor dialog
26
    """
27

  
24 28
    FILE_NUMBER = 0
25 29

  
26 30
    '''
......
650 654
            directionComboBox = QComboBox(self.ui.tableWidgetConnList)
651 655
            directionComboBox.addItems(['AUTO', 'LEFT', 'RIGHT', 'UP', 'DOWN'])
652 656
            directionComboBox.setCurrentText('AUTO')
653
            #directionComboBox.currentIndexChanged.connect(self.onDirectionComboBoxChanged)
654 657
            self.ui.tableWidgetConnList.setCellWidget(rows, 1, directionComboBox)
655 658

  
659
            # add symbol index combobox - 2019.01.07 added by humkyung
660
            symbol_indecies = [str(idx) for idx in range(self.ui.additionalSymbolListWidget.count()+1)]
661
            symbol_idx_combobox = QComboBox(self.ui.tableWidgetConnList)
662
            symbol_idx_combobox.addItems(symbol_indecies)
663
            symbol_idx_combobox.setCurrentText('0')
664
            self.ui.tableWidgetConnList.setCellWidget(rows, 2, symbol_idx_combobox)
665
            # up to here
666

  
656 667
    '''
657 668
        @brief  Original Point Tool Button Clicked
658 669
    '''
DTI_PID/DTI_PID/TextItemFactory.py
138 138
            delimiter = configs[0].value if 1 == len(configs) else '-'
139 139
            # line config
140 140
            configs = docData.getConfigs('Line No', 'Configuration')
141
            lineNoConfig = configs[0].value.split(self.delimiter)
141
            if configs and configs[0].value:
142
                lineNoConfig = configs[0].value.split(self.delimiter)
142 143

  
143
            res = []
144
                res = []
144 145

  
145
            if lineNoConfig is None or len(lineNoConfig) == 0:
146
                return (False,)
147
        
148
            tokens = text.split(delimiter)
149
            patternText = configs[0].value.replace(self.delimiter, '').split(self.delimiter)
150
            #Line Number에 Delimiter가 있을 수 있음
151
            if configs[0].value != 'None' and len(tokens) >= len(patternText):
152
                loopText = text.replace(' ','')
153
                
154
                for propertyName in lineNoConfig:
155
                    isStartWord = False
156
                    loopList = []
157

  
158
                    lineProp = docData.getLinePropertiesByUID(propertyName)
159
                    # Line property인 경우
160
                    if lineProp:
161
                        lineType = lineProp[0].AttributeType
162
                        if lineType == 'Code Table':
163
                            tableName = lineProp[0].Attribute
164
                            if tableName == 'NominalDiameter':
165
                                loopListOri = docData.getCodeTable(tableName, True)
166
                                for loop in loopListOri:
167
                                    loopList.append((loop, loop))
146
                if lineNoConfig is None or len(lineNoConfig) == 0:
147
                    return (False,)
148
            
149
                tokens = text.split(delimiter)
150
                patternText = configs[0].value.replace(self.delimiter, '').split(self.delimiter)
151
                #Line Number에 Delimiter가 있을 수 있음
152
                if configs[0].value != 'None' and len(tokens) >= len(patternText):
153
                    loopText = text.replace(' ','')
154
                    
155
                    for propertyName in lineNoConfig:
156
                        isStartWord = False
157
                        loopList = []
158

  
159
                        lineProp = docData.getLinePropertiesByUID(propertyName)
160
                        # Line property인 경우
161
                        if lineProp:
162
                            lineType = lineProp[0].AttributeType
163
                            if lineType == 'Code Table':
164
                                tableName = lineProp[0].Attribute
165
                                if tableName == 'NominalDiameter':
166
                                    loopListOri = docData.getCodeTable(tableName, True)
167
                                    for loop in loopListOri:
168
                                        loopList.append((loop, loop))
169
                                else:
170
                                    allAllows = docData.getCodeTable(tableName)
171
                                    for index in range(len(allAllows)):
172
                                        loopList.append((allAllows[index][1], allAllows[index][1]))
173
                                        if allAllows[index][3] != '' and allAllows[index][3] != None:
174
                                            allows = allAllows[index][3].split(',')
175
                                            for allow in allows:
176
                                                loopList.append((allow, allAllows[index][1]))
177

  
178
                                isStartWord = True
179

  
180
                            elif lineType == 'Int':
181
                                length = lineProp[0].Length
182
                                loopList.append((length, True))
183

  
184
                            elif lineType == 'String':
185
                                length = lineProp[0].Length
186
                                loopList.append((length, False))
187

  
188
                        # 못찾은 경우 (ex. delimiter)
189
                        else:
190
                            if propertyName == delimiter:
191
                                loopList.append((delimiter, delimiter))
192
                                isStartWord = True
168 193
                            else:
169
                                allAllows = docData.getCodeTable(tableName)
170
                                for index in range(len(allAllows)):
171
                                    loopList.append((allAllows[index][1], allAllows[index][1]))
172
                                    if allAllows[index][3] != '' and allAllows[index][3] != None:
173
                                        allows = allAllows[index][3].split(',')
174
                                        for allow in allows:
175
                                            loopList.append((allow, allAllows[index][1]))
176

  
177
                            isStartWord = True
178

  
179
                        elif lineType == 'Int':
180
                            length = lineProp[0].Length
181
                            loopList.append((length, True))
182

  
183
                        elif lineType == 'String':
184
                            length = lineProp[0].Length
185
                            loopList.append((length, False))
194
                                return (False,)
195
                        
196
                        find = False
197
                        for loop in loopList:
198
                            if isStartWord:
199
                                result = self.isStartWithWord(loopText, loop)
200
                            else:
201
                                result = self.isLimitWord(loopText, loop)
202
                            if result[0]:
203
                                loopText = result[1]
204
                                res.append(result[2])
205
                                find = True
206
                                break
207
                        if not find:
208
                            return (False,)
186 209

  
187
                    # 못찾은 경우 (ex. delimiter)
210
                    if loopText == '':
211
                        return (True, res)
188 212
                    else:
189
                        if propertyName == delimiter:
190
                            loopList.append((delimiter, delimiter))
191
                            isStartWord = True
192
                        else:
193
                            return (False,)
194
                    
195
                    find = False
196
                    for loop in loopList:
197
                        if isStartWord:
198
                            result = self.isStartWithWord(loopText, loop)
199
                        else:
200
                            result = self.isLimitWord(loopText, loop)
201
                        if result[0]:
202
                            loopText = result[1]
203
                            res.append(result[2])
204
                            find = True
205
                            break
206
                    if not find:
207 213
                        return (False,)
208 214

  
209
                if loopText == '':
210
                    return (True, res)
211
                else:
212
                    return (False,)
213

  
214 215
            return (False,)
215 216
        except Exception as ex:
216
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
217
            from App import App
218

  
219
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
220
            App.mainWnd().addMessage.emit(MessageType.Error, message)
221
        finally:
222
            return (False,)
217 223

  
218 224
    '''
219 225
        @brief      Check Text startwith word

내보내기 Unified diff

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