Skip to content

Commit

Permalink
Run Gudrun after Purging (#323)
Browse files Browse the repository at this point in the history
* feat: automatically run gudrun after purging (when the purge is induced following a prompt).

* fix: issue with task label not being set correctly.
  • Loading branch information
jswift-stfc authored Apr 11, 2022
1 parent fdff865 commit 525fd2b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/gui/widgets/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,8 +1111,8 @@ def purgeBeforeRunning(self, default=True):
self.mainWidget,
"GudPy Error", "Couldn't find purge_det binary."
)
self.setControlsEnabled(True)
return
self.setControlsEnabled(True)
return
else:
self.runPurge_()
dcs = self.gudrunFile.dcs(
Expand All @@ -1129,6 +1129,7 @@ def purgeBeforeRunning(self, default=True):
self.mainWidget, "GudPy Error",
"Couldn't find gudrun_dcs binary."
)
self.setControlsEnabled(True)
return
self.queue.put((dcs, self.progressDCS, func, args))

Expand Down Expand Up @@ -1593,8 +1594,6 @@ def procFinished(self):
self.error = ""
self.queue = Queue()
if not self.queue.empty():
self.makeProc(*self.queue.get())
else:
if self.warning:
QMessageBox.warning(
self.mainWidget, "GudPy Warning",
Expand All @@ -1619,6 +1618,8 @@ def procFinished(self):
self.output = ""
self.mainWidget.currentTaskLabel.setText("No task running.")
self.mainWidget.progressBar.setValue(0)
if not self.queue.empty():
self.makeProc(*self.queue.get())

def stopProc(self):
self.queue = Queue()
Expand Down

0 comments on commit 525fd2b

Please sign in to comment.