개정판 13345412
issue #622: db not yet done
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
2704 | 2704 |
''' |
2705 | 2705 |
@activeDrawing.setter |
2706 | 2706 |
def activeDrawing(self, value): |
2707 |
self._activeDrawing = value |
|
2707 |
self._activeDrawing = value |
|
2708 |
|
|
2709 |
''' |
|
2710 |
@brief delete data list before save |
|
2711 |
@author euisung |
|
2712 |
@date 2018.11.05 |
|
2713 |
''' |
|
2714 |
def deleteDataListBeforeSave(self, removeUID): |
|
2715 |
try: |
|
2716 |
# Creates or opens a file called mydb with a SQLite3 DB |
|
2717 |
dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db') |
|
2718 |
conn = sqlite3.connect(dbPath) |
|
2719 |
# Get a cursor object |
|
2720 |
cursor = conn.cursor() |
|
2721 |
|
|
2722 |
for uid in removeUID: |
|
2723 |
sql = "delete from NOTE_DATA_LIST where uid = '{}'".format(uid) |
|
2724 |
cursor.execute(sql) |
|
2725 |
|
|
2726 |
conn.commit() |
|
2727 |
|
|
2728 |
# Catch the exception |
|
2729 |
except Exception as ex: |
|
2730 |
# Roll back any change if something goes wrong |
|
2731 |
conn.rollback() |
|
2732 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
2733 |
finally: |
|
2734 |
# Close the db connection |
|
2735 |
conn.close() |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
258 | 258 |
files = appDocData.getDrawingFileList() |
259 | 259 |
for file in files: |
260 | 260 |
drawing = [drawing for drawing in drawings if drawing[1] == file] |
261 |
if not drawing or not drawing[0]:
|
|
261 |
if not drawing[0]: |
|
262 | 262 |
drawings.append([None, file, None]) |
263 | 263 |
|
264 |
item = QTreeWidgetItem(self.treeWidgetDrawingList.root, [file, drawing[0][2] if drawing and drawing[0] else ''])
|
|
264 |
item = QTreeWidgetItem(self.treeWidgetDrawingList.root, [file, drawing[0][2] if drawing[0] else '']) |
|
265 | 265 |
item.setIcon(0, QIcon(':newPrefix/image.png')) |
266 | 266 |
|
267 | 267 |
self.treeWidgetDrawingList.root.setText(0, 'P&ID Drawings({})'.format(self.treeWidgetDrawingList.root.childCount())) |
... | ... | |
1164 | 1164 |
''' |
1165 | 1165 |
def drawDetectedItems(self, symbolList, textInfoList, otherTextInfoList): |
1166 | 1166 |
appDocData = AppDocData.instance() |
1167 |
print(appDocData.activeDrawing())
|
|
1167 |
#print(appDocData.activeDrawing.name
|
|
1168 | 1168 |
|
1169 | 1169 |
QApplication.processEvents() |
1170 | 1170 |
self.drawDetectedSymbolItem(symbolList) |
내보내기 Unified diff