Skip to content

Commit a992ca4

Browse files
committed
Simplifcations
1 parent 9519617 commit a992ca4

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

openmc_plotter/main_window.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,13 +1217,6 @@ def closeEvent(self, event):
12171217
def requestPlotUpdate(self, view=None):
12181218
if self.model is None:
12191219
return
1220-
if self.plot_manager is None:
1221-
self.plot_manager = self.model.plot_manager
1222-
self.plot_manager.plot_started.connect(self._on_plot_started)
1223-
self.plot_manager.plot_queued.connect(self._on_plot_queued)
1224-
self.plot_manager.plot_finished.connect(self._on_plot_finished)
1225-
self.plot_manager.plot_error.connect(self._on_plot_error)
1226-
self.plot_manager.plot_idle.connect(self._on_plot_idle)
12271220
if view is None:
12281221
view = self.model.activeView
12291222
view_snapshot = copy.deepcopy(view)
@@ -1246,12 +1239,10 @@ def waitForPlotIdle(self, timeout_ms=None):
12461239
return True
12471240

12481241
def _on_plot_started(self):
1249-
if hasattr(self, "plotIm") and self.plotIm is not None:
1250-
self.plotIm.showUpdatingOverlay("Generating Plot...")
1242+
self.plotIm.showUpdatingOverlay("Generating Plot...")
12511243

12521244
def _on_plot_queued(self):
1253-
if hasattr(self, "plotIm") and self.plotIm is not None:
1254-
self.plotIm.showUpdatingOverlay("Generating Plot... (update queued)")
1245+
self.plotIm.showUpdatingOverlay("Generating Plot... (update queued)")
12551246

12561247
def _on_plot_finished(self, view_snapshot, view_params, ids_map, properties):
12571248
if view_params != self.plot_manager.latest_view_params:
@@ -1268,8 +1259,7 @@ def _on_plot_error(self, error_msg):
12681259
msg_box.exec()
12691260

12701261
def _on_plot_idle(self):
1271-
if hasattr(self, "plotIm") and self.plotIm is not None:
1272-
self.plotIm.hideUpdatingOverlay()
1262+
self.plotIm.hideUpdatingOverlay()
12731263

12741264
def saveSettings(self):
12751265
if self.model.statepoint:

0 commit comments

Comments
 (0)