Skip to content

Commit 9990c72

Browse files
committed
store full currentView so that view_ind and view_params are both saved
1 parent 635fbf9 commit 9990c72

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

openmc_plotter/main_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ def saveSettings(self):
11561156

11571157
pickle_data = {
11581158
'version': self.model.version,
1159-
'currentView_ind': self.model.currentView.view_ind,
1159+
'currentView': self.model.currentView,
11601160
'statepoint': self.model.statepoint
11611161
}
11621162
with open('plot_settings.pkl', 'wb') as file:

openmc_plotter/plotmodel.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ def __init__(self, use_settings_pkl):
155155
"version of the GUI. They will be ignored.")
156156
wrn_msg = "Existing version: {}, Current GUI version: {}"
157157
print(wrn_msg.format(data['version'], self.version))
158-
view_ind = None
158+
view = None
159159
else:
160-
view_ind = data['currentView_ind']
160+
view = data['currentView']
161161

162162
# restore statepoint file
163163
try:
@@ -171,7 +171,7 @@ def __init__(self, use_settings_pkl):
171171
msg_box.exec_()
172172
self.statepoint = None
173173

174-
self.defaultView = PlotView(restore_view=view_ind)
174+
self.defaultView = PlotView(restore_view=view)
175175

176176
else:
177177
self.defaultView = self.getDefaultView()
@@ -927,7 +927,7 @@ class PlotView:
927927
Width of plot view in model units
928928
height : float
929929
Height of plot view in model units
930-
restore_view : PlotView or PlotViewIndependent or None
930+
restore_view : PlotView or None
931931
view object with specified parameters to restore
932932
933933
Attributes
@@ -948,7 +948,7 @@ def __init__(self, origin=(0, 0, 0), width=10, height=10, restore_view=None):
948948
"""Initialize PlotView attributes"""
949949

950950
if restore_view is not None:
951-
self.view_ind = copy.copy(restore_view)
951+
self.view_ind = copy.copy(restore_view.view_ind)
952952
self.view_params = copy.copy(restore_view.view_params)
953953
else:
954954
self.view_ind = PlotViewIndependent()

0 commit comments

Comments
 (0)