개정판 1224dd69
issue #622: save speed fix
Change-Id: I25fd60f9be5e1bb3cd3b7883b1c3fa297b52cd8d
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
94 | 94 |
self._titleBlockProperties = None |
95 | 95 |
self.needReOpening = None |
96 | 96 |
|
97 |
# caches |
|
97 | 98 |
self._configs = None |
98 | 99 |
self._symbolBase = {} |
99 | 100 |
self._symbolType = {} |
100 | 101 |
self._lineNoPropertiesUID = {} |
102 |
self._attributeByType = {} |
|
101 | 103 |
|
104 |
# for load drawing data from database |
|
102 | 105 |
self._connecterss = {} |
103 | 106 |
self._associationss = {} |
104 | 107 |
self._attributess = {} |
... | ... | |
160 | 163 |
self._symbolBase = {} |
161 | 164 |
self._symbolType = {} |
162 | 165 |
self._lineNoPropertiesUID = {} |
166 |
self._attributeByType = {} |
|
163 | 167 |
|
164 | 168 |
self._connecterss = {} |
165 | 169 |
self._associationss = {} |
... | ... | |
923 | 927 |
@date 2018.11.09 |
924 | 928 |
''' |
925 | 929 |
res = None |
926 |
if True: # self._titleBlockProperties is None:
|
|
930 |
if self._titleBlockProperties is None: |
|
927 | 931 |
self._titleBlockProperties = [] |
928 | 932 |
|
929 | 933 |
# Creates or opens a file called mydb with a SQLite3 DB |
... | ... | |
1986 | 1990 |
|
1987 | 1991 |
with self.project.database.connect() as conn: |
1988 | 1992 |
try: |
1993 |
if self._attributeByType and _type in self._attributeByType: |
|
1994 |
return self._attributeByType[_type] |
|
1995 |
|
|
1989 | 1996 |
# Get a cursor object |
1990 | 1997 |
cursor = conn.cursor() |
1991 | 1998 |
|
... | ... | |
2012 | 2019 |
sys.exc_info()[-1].tb_lineno) |
2013 | 2020 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
2014 | 2021 |
|
2022 |
self._attributeByType[_type] = result |
|
2015 | 2023 |
return result |
2016 | 2024 |
|
2017 | 2025 |
''' |
... | ... | |
2103 | 2111 |
sys.exc_info()[-1].tb_lineno) |
2104 | 2112 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
2105 | 2113 |
|
2114 |
self._attributeByType = {} |
|
2115 |
|
|
2106 | 2116 |
''' |
2107 | 2117 |
@brief save symbol attributes |
2108 | 2118 |
@author humkyung |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
677 | 677 |
from SaveWorkCommand import SaveWorkCommand |
678 | 678 |
|
679 | 679 |
try: |
680 |
self.actionSave.setEnabled(False) |
|
680 | 681 |
app_doc_data = AppDocData.instance() |
681 | 682 |
if app_doc_data.imgName is None: |
682 | 683 |
self.showImageSelectionMessageBox() |
... | ... | |
711 | 712 |
message = 'error occurred({}) in {}:{}'.format(repr(ex), sys.exc_info()[-1].tb_frame.f_code.co_filename, |
712 | 713 |
sys.exc_info()[-1].tb_lineno) |
713 | 714 |
self.addMessage.emit(MessageType.Error, message) |
715 |
finally: |
|
716 |
self.actionSave.setEnabled(True) |
|
714 | 717 |
|
715 | 718 |
def save_finished(self): |
716 | 719 |
"""reload drawing list""" |
내보내기 Unified diff