개정판 b46d1c3b
issue #627: doc list combo box fix
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
2123 | 2123 |
# Close the db connection |
2124 | 2124 |
conn.close() |
2125 | 2125 |
|
2126 |
def getDocumentNameList(self): |
|
2127 |
''' |
|
2128 |
@brief get documentName list |
|
2129 |
@author euisung |
|
2130 |
@date 2018.12.11 |
|
2131 |
''' |
|
2132 |
result = [] |
|
2133 |
|
|
2134 |
try: |
|
2135 |
# Creates or opens a file called mydb with a SQLite3 DB |
|
2136 |
dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db') |
|
2137 |
conn = sqlite3.connect(dbPath) |
|
2138 |
# Get a cursor object |
|
2139 |
cursor = conn.cursor() |
|
2140 |
|
|
2141 |
sql = 'select DISTINCT(PNID_NO) from LINE_DATA_LIST' |
|
2142 |
cursor.execute(sql) |
|
2143 |
sql = 'select DISTINCT(PNID_NO) from EQUIPMENT_DATA_LIST' |
|
2144 |
cursor.execute(sql) |
|
2145 |
sql = 'select DISTINCT(PNID_NO) from INSTRUMENT_DATA_LIST' |
|
2146 |
cursor.execute(sql) |
|
2147 |
sql = 'select DISTINCT(PNID_NO) from NOTE_DATA_LIST' |
|
2148 |
cursor.execute(sql) |
|
2149 |
sql = 'select DISTINCT(PNID_NO) from VALVE_DATA_LIST' |
|
2150 |
cursor.execute(sql) |
|
2151 |
|
|
2152 |
rows = cursor.fetchall() |
|
2153 |
for row in rows: |
|
2154 |
result.append(row[0]) |
|
2155 |
|
|
2156 |
result = list(set(result)) |
|
2157 |
result.sort() |
|
2158 |
# Catch the exception |
|
2159 |
except Exception as ex: |
|
2160 |
# Roll back any change if something goes wrong |
|
2161 |
conn.rollback() |
|
2162 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
2163 |
finally: |
|
2164 |
# Close the db connection |
|
2165 |
conn.close() |
|
2166 |
|
|
2167 |
return result |
|
2168 |
|
|
2169 |
|
|
2126 | 2170 |
''' |
2127 | 2171 |
@brief get line documentName list |
2128 | 2172 |
@author kyouho |
DTI_PID/DTI_PID/ItemDataExportDialog.py | ||
---|---|---|
307 | 307 |
docData = AppDocData.instance() |
308 | 308 |
|
309 | 309 |
documentNameList = [] |
310 |
documentNameData = docData.getLineDocumentNameList()
|
|
310 |
documentNameData = docData.getDocumentNameList() |
|
311 | 311 |
documentNameList.extend(documentNameData) |
312 | 312 |
#documentNameData = docData.getEquipDocumentNameList() |
313 | 313 |
#documentNameList.extend(documentNameData) |
내보내기 Unified diff