개정판 53099302
issue #641: improve opeing speed
Change-Id: Ib4b658819756d98581a7b1dee1cf00630886f259
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
2823 | 2823 |
lines = [] |
2824 | 2824 |
|
2825 | 2825 |
components = app_doc_data.get_components(drawing.UID) |
2826 |
maxValue = len(components) |
|
2826 |
maxValue = len(components) * 2
|
|
2827 | 2827 |
self.progress.setMaximum(maxValue) if maxValue > 0 else None |
2828 | 2828 |
|
2829 | 2829 |
""" parsing all symbols """ |
... | ... | |
2983 | 2983 |
""" update scene """ |
2984 | 2984 |
self.graphicsView.scene.update(self.graphicsView.sceneRect()) |
2985 | 2985 |
for item in self.graphicsView.scene.items(): |
2986 |
item.setVisible(True) |
|
2987 |
|
|
2986 |
up_progress = False |
|
2988 | 2987 |
# binding items |
2989 | 2988 |
if hasattr(item, 'owner'): |
2990 | 2989 |
item.owner |
2990 |
up_progress = True |
|
2991 | 2991 |
if hasattr(item, 'connectors'): |
2992 | 2992 |
for connector in item.connectors: |
2993 | 2993 |
connector.connectedItem |
2994 |
up_progress = True |
|
2995 |
|
|
2996 |
if up_progress: |
|
2997 |
self.progress.setValue(self.progress.value() + 1) |
|
2998 |
|
|
2999 |
for item in self.graphicsView.scene.items(): |
|
3000 |
item.setVisible(True) |
|
2994 | 3001 |
|
2995 | 3002 |
except Exception as ex: |
2996 | 3003 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
... | ... | |
3053 | 3060 |
maxValue = maxValue + len(list(root.iter('UNKNOWN'))) |
3054 | 3061 |
# maxValue = maxValue + len(list(root.iter('SIZETEXT'))) |
3055 | 3062 |
maxValue = maxValue + len(list(root.iter('TRIM_LINE_NO'))) |
3063 |
maxValue *= 2 |
|
3056 | 3064 |
self.progress.setMaximum(maxValue) if maxValue > 0 else None |
3057 | 3065 |
|
3058 | 3066 |
""" parsing all symbols """ |
... | ... | |
3226 | 3234 |
""" update scene """ |
3227 | 3235 |
self.graphicsView.scene.update(self.graphicsView.sceneRect()) |
3228 | 3236 |
for item in self.graphicsView.scene.items(): |
3229 |
item.setVisible(True) |
|
3230 |
|
|
3237 |
up_progress = False |
|
3231 | 3238 |
# binding items |
3232 | 3239 |
if hasattr(item, 'owner'): |
3233 | 3240 |
item.owner |
3241 |
up_progress = True |
|
3234 | 3242 |
if hasattr(item, 'connectors'): |
3235 | 3243 |
for connector in item.connectors: |
3236 | 3244 |
connector.connectedItem |
3245 |
up_progress = True |
|
3246 |
|
|
3247 |
if up_progress: |
|
3248 |
self.progress.setValue(self.progress.value() + 1) |
|
3249 |
|
|
3250 |
for item in self.graphicsView.scene.items(): |
|
3251 |
item.setVisible(True) |
|
3237 | 3252 |
|
3238 | 3253 |
except Exception as ex: |
3239 | 3254 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
내보내기 Unified diff