diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflSaveTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/IReflSaveTabPresenter.h index 81c387769151f0bf3d58a4e57539e07714e5c9ae..c29a79761473ddc6e876f57dc261774292014c68 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflSaveTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflSaveTabPresenter.h @@ -48,6 +48,8 @@ public: /// Tell the presenter something happened virtual void notify(IReflSaveTabPresenter::Flag flag) = 0; + virtual void onReductionPaused() = 0; + virtual void onReductionResumed() = 0; }; } } diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflSettingsPresenter.h b/qt/scientific_interfaces/ISISReflectometry/IReflSettingsPresenter.h index c809b910200be82f6c0e5c620e9e921a65692db5..f59f24760643ab9f7c947725e35a32ce7b90878a 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflSettingsPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflSettingsPresenter.h @@ -62,6 +62,9 @@ public: virtual void notify(IReflSettingsPresenter::Flag flag) = 0; /// Set current instrument name virtual void setInstrumentName(const std::string &instName) = 0; + + virtual void onReductionPaused() = 0; + virtual void onReductionResumed() = 0; }; } } diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflSettingsTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/IReflSettingsTabPresenter.h index a0ba40b2364e6344602fbaa540bed165779efdd8..f75595cef29f9c0746e77ee08954af79e546dba4 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflSettingsTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflSettingsTabPresenter.h @@ -52,6 +52,8 @@ public: virtual void setInstrumentName(const std::string &instName) = 0; virtual void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) = 0; virtual void settingsChanged(int group) = 0; + virtual void onReductionPaused() = 0; + virtual void onReductionResumed() = 0; }; } } diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflSettingsView.h b/qt/scientific_interfaces/ISISReflectometry/IReflSettingsView.h index 8cd533212452738daa7f1c65574b7d221ce2fb24..f141462666f60873527843974c2176f5a687a326 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflSettingsView.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflSettingsView.h @@ -99,6 +99,8 @@ public: /// Set polarisation corrections and parameters enabled/disabled virtual void setPolarisationOptionsEnabled(bool enable) = 0; virtual void setDetectorCorrectionEnabled(bool enable) = 0; + virtual void disableAll() = 0; + virtual void enableAll() = 0; }; } } diff --git a/qt/scientific_interfaces/ISISReflectometry/QtReflSettingsView.cpp b/qt/scientific_interfaces/ISISReflectometry/QtReflSettingsView.cpp index 80f4cc04f8a32dece3eee2e18d000f27038f50af..e527b393e9b53529eff0eed52dbf98df5cd84300 100644 --- a/qt/scientific_interfaces/ISISReflectometry/QtReflSettingsView.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/QtReflSettingsView.cpp @@ -89,6 +89,16 @@ void QtReflSettingsView::connectInstrumentSettingsChangeListeners() { connectSettingsChange(m_ui.summationTypeComboBox); } +void QtReflSettingsView::disableAll() { + m_ui.instSettingsGroup->setEnabled(false); + m_ui.expSettingsGroup->setEnabled(false); +} + +void QtReflSettingsView::enableAll() { + m_ui.instSettingsGroup->setEnabled(true); + m_ui.expSettingsGroup->setEnabled(true); +} + void QtReflSettingsView::connectExperimentSettingsChangeListeners() { connectSettingsChange(m_ui.expSettingsGroup); connectSettingsChange(m_ui.analysisModeComboBox); diff --git a/qt/scientific_interfaces/ISISReflectometry/QtReflSettingsView.h b/qt/scientific_interfaces/ISISReflectometry/QtReflSettingsView.h index a75c1b76dbdec96b4c00cfdac8f602fa7deab867..28348739c38de4596be57c2d1c79732ea7e472c5 100644 --- a/qt/scientific_interfaces/ISISReflectometry/QtReflSettingsView.h +++ b/qt/scientific_interfaces/ISISReflectometry/QtReflSettingsView.h @@ -108,6 +108,8 @@ public: /// Creates hints for 'Stitch1DMany' void createStitchHints(const std::map<std::string, std::string> &hints) override; + void disableAll() override; + void enableAll() override; void showOptionLoadErrors( std::vector<InstrumentParameterTypeMissmatch> const &errors, diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp index 95742d9cc1535dda55ed35b6e862356d20572054..e7cb0af74ebc39a8e54144c37990333001304fd7 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp @@ -48,16 +48,28 @@ void ReflMainWindowPresenter::notify(IReflMainWindowPresenter::Flag flag) { switch (flag) { case Flag::ConfirmReductionPausedFlag: - m_isProcessing = false; + onReductionPaused(); break; case Flag::ConfirmReductionResumedFlag: - m_isProcessing = true; + onReductionResumed(); break; } // Not having a 'default' case is deliberate. gcc issues a warning if there's // a flag we aren't handling. } +void ReflMainWindowPresenter::onReductionPaused() { + m_isProcessing = false; + m_savePresenter->onReductionPaused(); + m_settingsPresenter->onReductionPaused(); +} + +void ReflMainWindowPresenter::onReductionResumed() { + m_isProcessing = true; + m_settingsPresenter->onReductionResumed(); + m_savePresenter->onReductionResumed(); +} + void ReflMainWindowPresenter::settingsChanged(int group) { m_runsPresenter->settingsChanged(group); } diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h index b6c75d20c6c7013fbd5db05b7042171fef06a2b1..87de82157eb0ad881d8f1ebebd417838a1257a6f 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h @@ -94,6 +94,9 @@ private: void pauseReduction() const; /// Resumes reduction in the Runs Tab void resumeReduction() const; + + void onReductionPaused(); + void onReductionResumed(); /// The view we are handling IReflMainWindowView *m_view; /// The presenter of tab 'Runs' diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.cpp index 316fa0dd725496b88c6156ebb94becf12b1546ef..2488a88cf4915dd494fd9b63e843ba8098d18060 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.cpp @@ -41,6 +41,10 @@ void ReflSaveTabPresenter::acceptMainPresenter( m_mainPresenter = mainPresenter; } +void ReflSaveTabPresenter::onReductionPaused() { populateWorkspaceList(); } + +void ReflSaveTabPresenter::onReductionResumed() {} + void ReflSaveTabPresenter::notify(IReflSaveTabPresenter::Flag flag) { switch (flag) { case populateWorkspaceListFlag: @@ -212,4 +216,4 @@ std::vector<std::string> ReflSaveTabPresenter::getAvailableWorkspaceNames() { return validNames; } } -} \ No newline at end of file +} diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.h index 640f616a13ad4baa3a50c731e44ee58f21e2fd3a..28ca6bd6c49eea1c2973791fbb17d0588de165b7 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabPresenter.h @@ -49,6 +49,8 @@ public: /// Accept a main presenter void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override; void notify(IReflSaveTabPresenter::Flag flag) override; + void onReductionPaused() override; + void onReductionResumed() override; private: /// Adds all workspace names to the list of workspaces diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget.ui b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget.ui index 682e164994229219e68b5d9ad16d79c631e5d099..f90507e4f7646bd62dcdf69741ca4a13b84607c3 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget.ui +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSaveTabWidget.ui @@ -266,7 +266,7 @@ </item> </layout> </widget> - </item> + </item> <item row ="5" column="0"> <widget class="QLabel" name="fileFormatLabel"> <property name="text"> @@ -335,7 +335,7 @@ </size> </property> </spacer> - </item> + </item> </layout> </widget> </item> diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSettingsPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflSettingsPresenter.cpp index 1b61f927670caa2f1d442a3b10238a1b515c416e..c82cbb1be6a4f1711c7f243c0a0944fe1ba58b8a 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSettingsPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSettingsPresenter.cpp @@ -184,6 +184,14 @@ QString ReflSettingsPresenter::asAlgorithmPropertyBool(bool value) { return value ? "1" : "0"; } +void ReflSettingsPresenter::onReductionResumed() { + m_view->disableAll(); +} + +void ReflSettingsPresenter::onReductionPaused() { + m_view->enableAll(); +} + /** Returns global options for 'ReflectometryReductionOneAuto' * @return :: Global options for 'ReflectometryReductionOneAuto' */ diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSettingsPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflSettingsPresenter.h index f222877be6a0ae1ccd54899309d792aae5eb1926..3e7119285e050e6cd61be531b7e9b980f8c866e7 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSettingsPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSettingsPresenter.h @@ -63,6 +63,8 @@ public: std::string getTransmissionRuns() const override; void acceptTabPresenter(IReflSettingsTabPresenter *tabPresenter) override; + void onReductionPaused() override; + void onReductionResumed() override; private: void createStitchHints(); diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSettingsTabPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflSettingsTabPresenter.cpp index e98bce91d02cda612971866158fb6179d9927391..71c417c7a0f66ffbc1ddcf3738be0e4535c7296c 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSettingsTabPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSettingsTabPresenter.cpp @@ -51,6 +51,16 @@ void ReflSettingsTabPresenter::setInstrumentName(const std::string &instName) { presenter->setInstrumentName(instName); } +void ReflSettingsTabPresenter::onReductionResumed() { + for(auto presenter : m_settingsPresenters) + presenter->onReductionResumed(); +} + +void ReflSettingsTabPresenter::onReductionPaused() { + for(auto presenter : m_settingsPresenters) + presenter->onReductionPaused(); +} + /** Returns values passed for 'Transmission run(s)' * * @param group :: The group from which to get the values diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflSettingsTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflSettingsTabPresenter.h index 978aeb548b4fe4d1df5ce22a41bd514018d70a55..22ccf979f3e6d79d7f552673ae0c523bab86d238 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflSettingsTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflSettingsTabPresenter.h @@ -49,6 +49,8 @@ public: void setInstrumentName(const std::string &instName) override; void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override; void settingsChanged(int group) override; + void onReductionPaused() override; + void onReductionResumed() override; void passSelfToChildren(std::vector<IReflSettingsPresenter *> const &children);