Skip to content
Snippets Groups Projects
Commit 3e3b51df authored by Edward Brown's avatar Edward Brown
Browse files

Re #21674: Disables settings tab when processing.

- Additionally refreshes save tab when reduction paused/finished.
parent 895ca4f1
No related branches found
No related tags found
No related merge requests found
Showing
with 69 additions and 5 deletions
...@@ -48,6 +48,8 @@ public: ...@@ -48,6 +48,8 @@ public:
/// Tell the presenter something happened /// Tell the presenter something happened
virtual void notify(IReflSaveTabPresenter::Flag flag) = 0; virtual void notify(IReflSaveTabPresenter::Flag flag) = 0;
virtual void onReductionPaused() = 0;
virtual void onReductionResumed() = 0;
}; };
} }
} }
......
...@@ -62,6 +62,9 @@ public: ...@@ -62,6 +62,9 @@ public:
virtual void notify(IReflSettingsPresenter::Flag flag) = 0; virtual void notify(IReflSettingsPresenter::Flag flag) = 0;
/// Set current instrument name /// Set current instrument name
virtual void setInstrumentName(const std::string &instName) = 0; virtual void setInstrumentName(const std::string &instName) = 0;
virtual void onReductionPaused() = 0;
virtual void onReductionResumed() = 0;
}; };
} }
} }
......
...@@ -52,6 +52,8 @@ public: ...@@ -52,6 +52,8 @@ public:
virtual void setInstrumentName(const std::string &instName) = 0; virtual void setInstrumentName(const std::string &instName) = 0;
virtual void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) = 0; virtual void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) = 0;
virtual void settingsChanged(int group) = 0; virtual void settingsChanged(int group) = 0;
virtual void onReductionPaused() = 0;
virtual void onReductionResumed() = 0;
}; };
} }
} }
......
...@@ -99,6 +99,8 @@ public: ...@@ -99,6 +99,8 @@ public:
/// Set polarisation corrections and parameters enabled/disabled /// Set polarisation corrections and parameters enabled/disabled
virtual void setPolarisationOptionsEnabled(bool enable) = 0; virtual void setPolarisationOptionsEnabled(bool enable) = 0;
virtual void setDetectorCorrectionEnabled(bool enable) = 0; virtual void setDetectorCorrectionEnabled(bool enable) = 0;
virtual void disableAll() = 0;
virtual void enableAll() = 0;
}; };
} }
} }
......
...@@ -89,6 +89,16 @@ void QtReflSettingsView::connectInstrumentSettingsChangeListeners() { ...@@ -89,6 +89,16 @@ void QtReflSettingsView::connectInstrumentSettingsChangeListeners() {
connectSettingsChange(m_ui.summationTypeComboBox); 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() { void QtReflSettingsView::connectExperimentSettingsChangeListeners() {
connectSettingsChange(m_ui.expSettingsGroup); connectSettingsChange(m_ui.expSettingsGroup);
connectSettingsChange(m_ui.analysisModeComboBox); connectSettingsChange(m_ui.analysisModeComboBox);
......
...@@ -108,6 +108,8 @@ public: ...@@ -108,6 +108,8 @@ public:
/// Creates hints for 'Stitch1DMany' /// Creates hints for 'Stitch1DMany'
void void
createStitchHints(const std::map<std::string, std::string> &hints) override; createStitchHints(const std::map<std::string, std::string> &hints) override;
void disableAll() override;
void enableAll() override;
void showOptionLoadErrors( void showOptionLoadErrors(
std::vector<InstrumentParameterTypeMissmatch> const &errors, std::vector<InstrumentParameterTypeMissmatch> const &errors,
......
...@@ -48,16 +48,28 @@ void ReflMainWindowPresenter::notify(IReflMainWindowPresenter::Flag flag) { ...@@ -48,16 +48,28 @@ void ReflMainWindowPresenter::notify(IReflMainWindowPresenter::Flag flag) {
switch (flag) { switch (flag) {
case Flag::ConfirmReductionPausedFlag: case Flag::ConfirmReductionPausedFlag:
m_isProcessing = false; onReductionPaused();
break; break;
case Flag::ConfirmReductionResumedFlag: case Flag::ConfirmReductionResumedFlag:
m_isProcessing = true; onReductionResumed();
break; break;
} }
// Not having a 'default' case is deliberate. gcc issues a warning if there's // Not having a 'default' case is deliberate. gcc issues a warning if there's
// a flag we aren't handling. // 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) { void ReflMainWindowPresenter::settingsChanged(int group) {
m_runsPresenter->settingsChanged(group); m_runsPresenter->settingsChanged(group);
} }
......
...@@ -94,6 +94,9 @@ private: ...@@ -94,6 +94,9 @@ private:
void pauseReduction() const; void pauseReduction() const;
/// Resumes reduction in the Runs Tab /// Resumes reduction in the Runs Tab
void resumeReduction() const; void resumeReduction() const;
void onReductionPaused();
void onReductionResumed();
/// The view we are handling /// The view we are handling
IReflMainWindowView *m_view; IReflMainWindowView *m_view;
/// The presenter of tab 'Runs' /// The presenter of tab 'Runs'
......
...@@ -41,6 +41,10 @@ void ReflSaveTabPresenter::acceptMainPresenter( ...@@ -41,6 +41,10 @@ void ReflSaveTabPresenter::acceptMainPresenter(
m_mainPresenter = mainPresenter; m_mainPresenter = mainPresenter;
} }
void ReflSaveTabPresenter::onReductionPaused() { populateWorkspaceList(); }
void ReflSaveTabPresenter::onReductionResumed() {}
void ReflSaveTabPresenter::notify(IReflSaveTabPresenter::Flag flag) { void ReflSaveTabPresenter::notify(IReflSaveTabPresenter::Flag flag) {
switch (flag) { switch (flag) {
case populateWorkspaceListFlag: case populateWorkspaceListFlag:
...@@ -212,4 +216,4 @@ std::vector<std::string> ReflSaveTabPresenter::getAvailableWorkspaceNames() { ...@@ -212,4 +216,4 @@ std::vector<std::string> ReflSaveTabPresenter::getAvailableWorkspaceNames() {
return validNames; return validNames;
} }
} }
} }
\ No newline at end of file
...@@ -49,6 +49,8 @@ public: ...@@ -49,6 +49,8 @@ public:
/// Accept a main presenter /// Accept a main presenter
void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override; void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override;
void notify(IReflSaveTabPresenter::Flag flag) override; void notify(IReflSaveTabPresenter::Flag flag) override;
void onReductionPaused() override;
void onReductionResumed() override;
private: private:
/// Adds all workspace names to the list of workspaces /// Adds all workspace names to the list of workspaces
......
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row ="5" column="0"> <item row ="5" column="0">
<widget class="QLabel" name="fileFormatLabel"> <widget class="QLabel" name="fileFormatLabel">
<property name="text"> <property name="text">
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
......
...@@ -184,6 +184,14 @@ QString ReflSettingsPresenter::asAlgorithmPropertyBool(bool value) { ...@@ -184,6 +184,14 @@ QString ReflSettingsPresenter::asAlgorithmPropertyBool(bool value) {
return value ? "1" : "0"; return value ? "1" : "0";
} }
void ReflSettingsPresenter::onReductionResumed() {
m_view->disableAll();
}
void ReflSettingsPresenter::onReductionPaused() {
m_view->enableAll();
}
/** Returns global options for 'ReflectometryReductionOneAuto' /** Returns global options for 'ReflectometryReductionOneAuto'
* @return :: Global options for 'ReflectometryReductionOneAuto' * @return :: Global options for 'ReflectometryReductionOneAuto'
*/ */
......
...@@ -63,6 +63,8 @@ public: ...@@ -63,6 +63,8 @@ public:
std::string getTransmissionRuns() const override; std::string getTransmissionRuns() const override;
void acceptTabPresenter(IReflSettingsTabPresenter *tabPresenter) override; void acceptTabPresenter(IReflSettingsTabPresenter *tabPresenter) override;
void onReductionPaused() override;
void onReductionResumed() override;
private: private:
void createStitchHints(); void createStitchHints();
......
...@@ -51,6 +51,16 @@ void ReflSettingsTabPresenter::setInstrumentName(const std::string &instName) { ...@@ -51,6 +51,16 @@ void ReflSettingsTabPresenter::setInstrumentName(const std::string &instName) {
presenter->setInstrumentName(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)' /** Returns values passed for 'Transmission run(s)'
* *
* @param group :: The group from which to get the values * @param group :: The group from which to get the values
......
...@@ -49,6 +49,8 @@ public: ...@@ -49,6 +49,8 @@ public:
void setInstrumentName(const std::string &instName) override; void setInstrumentName(const std::string &instName) override;
void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override; void acceptMainPresenter(IReflMainWindowPresenter *mainPresenter) override;
void settingsChanged(int group) override; void settingsChanged(int group) override;
void onReductionPaused() override;
void onReductionResumed() override;
void void
passSelfToChildren(std::vector<IReflSettingsPresenter *> const &children); passSelfToChildren(std::vector<IReflSettingsPresenter *> const &children);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment