개정판 adea5912
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