프로젝트

일반

사용자정보

개정판 adea5912

IDadea5912c30203bd58ca05568d8f0c4f4d18876a
상위 7bc24847
하위 34f1ff36, 81b23d8d

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

fixed issue #581: fixed bug and remove unused method

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
1176 1176

  
1177 1177
        return res
1178 1178
    
1179
    '''
1180
        @brief      get Color
1181
        @author     kyouho
1182
        @date       2018.07.03
1183
    '''
1184
    def getPropertyColor(self, property):
1185
        result = []
1186

  
1187
        try:
1188
            # Creates or opens a file called mydb with a SQLite3 DB
1189
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1190
            conn = sqlite3.connect(dbPath)
1191
            # Get a cursor object
1192
            cursor = conn.cursor()
1193

  
1194
            sql = "select UID,RED,GREEN,BLUE,PROPERTY,VALUE from Colors WHERE PROPERTY = '{}'".format(property)
1195
            cursor.execute(sql)
1196
            rows = cursor.fetchall()
1197
            for row in rows:
1198
                result.append(Color(int(row[0]), int(row[1]), int(row[2]), int(row[3]), row[4], row[5]))
1199
            # Catch the exception
1200
        except Exception as ex:
1201
            # Roll back any change if something goes wrong
1202
            conn.rollback()
1203
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
1204
        finally:
1205
            # Close the db connection
1206
            conn.close()
1207

  
1208
        return result
1209 1179

  
1210 1180
    '''
1211 1181
        @brief      convert inch to metric
......
1239 1209
        return result
1240 1210

  
1241 1211
    '''
1242
        @brief      get one color
1243
        @author     kyouho
1244
        @date       2018.07.09
1245
    '''
1246
    def getColor(self, property, value):
1247
        result = None
1248

  
1249
        try:
1250
            # Creates or opens a file called mydb with a SQLite3 DB
1251
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1252
            conn = sqlite3.connect(dbPath)
1253
            # Get a cursor object
1254
            cursor = conn.cursor()
1255

  
1256
            sql = "select UID,RED,GREEN,BLUE,PROPERTY,VALUE from Colors WHERE PROPERTY = '{}' AND VALUE = '{}'".format(property, value)
1257
            cursor.execute(sql)
1258
            row = cursor.fetchall()
1259
            if row:
1260
                result = Color(int(row[0][0]), int(row[0][1]), int(row[0][2]), int(row[0][3]), row[0][4], row[0][5])
1261
            # Catch the exception
1262
        except Exception as ex:
1263
            # Roll back any change if something goes wrong
1264
            conn.rollback()
1265
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
1266
        finally:
1267
            # Close the db connection
1268
            conn.close()
1269

  
1270
        return result
1271
    '''
1272 1212
        @brief      get Color MaxUID
1273 1213
        @author     kyouho
1274 1214
        @date       2018.07.03
DTI_PID/DTI_PID/ConfigurationDialog.py
196 196
            self.ui.spinBoxFontSize.setValue(10)
197 197
            self.ui.spinBoxFontSize.setEnabled(self.ui.radioButtonFixedSize.isChecked())
198 198
        
199
        # default Color 
200
        defaultColor = docData.getPropertyColor('default')
201
        if defaultColor:
202
            self.defaultColor = defaultColor[0]
203

  
204 199
        # Line Color Visible Option 가져옴
205 200
        configs = docData.getConfigs('Line Color', 'Visible Option')
206 201
        if configs:

내보내기 Unified diff

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