Skip to content

Commit

Permalink
Stop observing ADS while the algorithms are running
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedAlmaki committed Sep 27, 2024
1 parent 98cb2d3 commit 1a1f5c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public slots:
protected:
IDataReduction *m_idrUI;
std::unique_ptr<API::IAlgorithmRunner> m_algorithmRunner;
std::unique_ptr<OutputPlotOptionsPresenter> m_plotOptionsPresenter;

private slots:
void handleNewInstrumentConfiguration();
Expand All @@ -94,8 +95,6 @@ private slots:
virtual void setFileExtensionsByName(bool filter) { UNUSED_ARG(filter); };
virtual void setLoadHistory(bool doLoadHistory) { (void)doLoadHistory; }
virtual void updateInstrumentConfiguration() = 0;

std::unique_ptr<OutputPlotOptionsPresenter> m_plotOptionsPresenter;
};
} // namespace CustomInterfaces
} // namespace MantidQt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ void ISISCalibration::setResolutionSpectraRange(const double &minimum, const dou
* @param error If the algorithms failed.
*/
void ISISCalibration::algorithmComplete(bool error) {
m_plotOptionsPresenter->watchADS(true);
m_runPresenter->setRunEnabled(true);
if (!error) {
std::vector<std::string> outputWorkspaces{m_outputCalibrationName.toStdString()};
Expand Down Expand Up @@ -328,6 +329,7 @@ void ISISCalibration::handleRun() {
m_pythonExportWsName = m_outputResolutionName.toStdString();
}

m_plotOptionsPresenter->watchADS(false);
m_batchAlgoRunner->executeBatchAsync();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ void ISISDiagnostics::handleRun() {
}

connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this, SLOT(algorithmComplete(bool)));
m_plotOptionsPresenter->watchADS(false);
runAlgorithm(sliceAlg);
}

Expand Down Expand Up @@ -202,6 +203,7 @@ void ISISDiagnostics::handleValidation(IUserInputValidator *validator) const {
* @param error If the algorithm failed
*/
void ISISDiagnostics::algorithmComplete(bool error) {
m_plotOptionsPresenter->watchADS(true);
disconnect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this, SLOT(algorithmComplete(bool)));
m_runPresenter->setRunEnabled(true);
m_uiForm.pbSave->setEnabled(!error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ class MANTID_SPECTROSCOPY_DLL OutputPlotOptionsPresenter final : public IOutputP
void setWorkspaces(std::vector<std::string> const &workspaces);
void clearWorkspaces();

void watchADS(bool on);

private:
void setupPresenter(PlotWidget const &plotType, std::string const &fixedIndices);
void watchADS(bool on);

void setPlotting(bool plotting);
void setOptionsEnabled(bool enable);
Expand Down

0 comments on commit 1a1f5c5

Please sign in to comment.