From 89fcd759451a2ad757fa04f02c93e8d98326cb56 Mon Sep 17 00:00:00 2001 From: Gemma Guest <gemma.guest@stfc.ac.uk> Date: Fri, 23 Aug 2019 15:49:39 +0100 Subject: [PATCH] Rename notification functions for any batch autoreducing Make these clearer that they are notify functions Re #26536 --- .../ISISReflectometry/GUI/Batch/BatchPresenter.cpp | 8 ++++---- .../ISISReflectometry/GUI/Batch/BatchPresenter.h | 4 ++-- .../ISISReflectometry/GUI/Batch/IBatchPresenter.h | 4 ++-- .../GUI/MainWindow/MainWindowPresenter.cpp | 8 ++++---- .../ISISReflectometry/GUI/Runs/IRunsPresenter.h | 4 ++-- .../ISISReflectometry/GUI/Runs/RunsPresenter.cpp | 4 ++-- .../ISISReflectometry/GUI/Runs/RunsPresenter.h | 4 ++-- .../test/ISISReflectometry/Batch/BatchPresenterTest.h | 9 +++++---- .../MainWindow/MainWindowPresenterTest.h | 6 +++--- .../test/ISISReflectometry/ReflMockObjects.h | 8 ++++---- .../test/ISISReflectometry/Runs/RunsPresenterTest.h | 4 ++-- 11 files changed, 32 insertions(+), 31 deletions(-) diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchPresenter.cpp index 05ac6c5f0e5..522f579f259 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchPresenter.cpp @@ -257,12 +257,12 @@ void BatchPresenter::autoreductionCompleted() { m_runsPresenter->notifyRowStateChanged(); } -void BatchPresenter::anyBatchAutoreductionResumed() { - m_runsPresenter->anyBatchAutoreductionResumed(); +void BatchPresenter::notifyAnyBatchAutoreductionResumed() { + m_runsPresenter->notifyAnyBatchAutoreductionResumed(); } -void BatchPresenter::anyBatchAutoreductionPaused() { - m_runsPresenter->anyBatchAutoreductionPaused(); +void BatchPresenter::notifyAnyBatchAutoreductionPaused() { + m_runsPresenter->notifyAnyBatchAutoreductionPaused(); } Mantid::Geometry::Instrument_const_sptr BatchPresenter::instrument() const { diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchPresenter.h index 3a1cf22e2e9..ca1fdf399bf 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchPresenter.h @@ -66,8 +66,8 @@ public: void notifyInstrumentChanged(const std::string &instrumentName) override; void notifyUpdateInstrumentRequested() override; void notifySettingsChanged() override; - void anyBatchAutoreductionResumed() override; - void anyBatchAutoreductionPaused() override; + void notifyAnyBatchAutoreductionResumed() override; + void notifyAnyBatchAutoreductionPaused() override; void notifyReductionPaused() override; bool requestClose() const override; bool isProcessing() const override; diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/IBatchPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/IBatchPresenter.h index 0baa5b10bf2..a7bf85c1185 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/IBatchPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/IBatchPresenter.h @@ -42,8 +42,8 @@ public: virtual void notifyInstrumentChanged(const std::string &instrumentName) = 0; virtual void notifyUpdateInstrumentRequested() = 0; virtual void notifySettingsChanged() = 0; - virtual void anyBatchAutoreductionResumed() = 0; - virtual void anyBatchAutoreductionPaused() = 0; + virtual void notifyAnyBatchAutoreductionResumed() = 0; + virtual void notifyAnyBatchAutoreductionPaused() = 0; virtual void notifyReductionPaused() = 0; /// Data processing check for all groups diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp index 9fc01c1dc1a..5d216f1f863 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp @@ -79,13 +79,13 @@ void MainWindowPresenter::notifyCloseBatchRequested(int batchIndex) { void MainWindowPresenter::notifyResumeAutoreductionRequested() { for (const auto &batchPresenter : m_batchPresenters) { - batchPresenter->anyBatchAutoreductionResumed(); + batchPresenter->notifyAnyBatchAutoreductionResumed(); } } void MainWindowPresenter::notifyPauseAutoreductionRequested() { for (const auto &batchPresenter : m_batchPresenters) { - batchPresenter->anyBatchAutoreductionPaused(); + batchPresenter->notifyAnyBatchAutoreductionPaused(); } } @@ -149,9 +149,9 @@ void MainWindowPresenter::initNewBatch(IBatchPresenter *batchPresenter, // Ensure autoreduce button is enabled/disabled correctly for the new batch if (isAnyBatchAutoreducing()) - batchPresenter->anyBatchAutoreductionResumed(); + batchPresenter->notifyAnyBatchAutoreductionResumed(); else - batchPresenter->anyBatchAutoreductionPaused(); + batchPresenter->notifyAnyBatchAutoreductionPaused(); } void MainWindowPresenter::showHelp() { diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/IRunsPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/IRunsPresenter.h index be611ba14e5..db858490aeb 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/IRunsPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/IRunsPresenter.h @@ -44,8 +44,8 @@ public: virtual void notifyAutoreductionPaused() = 0; virtual void autoreductionCompleted() = 0; virtual void notifyAutoreductionResumed() = 0; - virtual void anyBatchAutoreductionResumed() = 0; - virtual void anyBatchAutoreductionPaused() = 0; + virtual void notifyAnyBatchAutoreductionResumed() = 0; + virtual void notifyAnyBatchAutoreductionPaused() = 0; virtual void notifyInstrumentChanged(std::string const &instrumentName) = 0; virtual void settingsChanged() = 0; diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/RunsPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/RunsPresenter.cpp index 620a33d65e8..51073efe4c6 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/RunsPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/RunsPresenter.cpp @@ -225,11 +225,11 @@ void RunsPresenter::notifyAutoreductionPaused() { tablePresenter()->notifyAutoreductionPaused(); } -void RunsPresenter::anyBatchAutoreductionResumed() { +void RunsPresenter::notifyAnyBatchAutoreductionResumed() { updateWidgetEnabledState(); } -void RunsPresenter::anyBatchAutoreductionPaused() { +void RunsPresenter::notifyAnyBatchAutoreductionPaused() { updateWidgetEnabledState(); } diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/RunsPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/RunsPresenter.h index 57098564e3c..f97bd1d4cd1 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/RunsPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/RunsPresenter.h @@ -90,8 +90,8 @@ public: void notifyAutoreductionResumed() override; void notifyAutoreductionPaused() override; void autoreductionCompleted() override; - void anyBatchAutoreductionResumed() override; - void anyBatchAutoreductionPaused() override; + void notifyAnyBatchAutoreductionResumed() override; + void notifyAnyBatchAutoreductionPaused() override; void notifyInstrumentChanged(std::string const &instrumentName) override; void settingsChanged() override; diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Batch/BatchPresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/Batch/BatchPresenterTest.h index 62ff82db5ad..84a1bb43641 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Batch/BatchPresenterTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/Batch/BatchPresenterTest.h @@ -120,15 +120,16 @@ public: void testChildPresentersUpdatedWhenAnyBatchAutoreductionResumed() { auto presenter = makePresenter(); - EXPECT_CALL(*m_runsPresenter, anyBatchAutoreductionResumed()).Times(1); - presenter.anyBatchAutoreductionResumed(); + EXPECT_CALL(*m_runsPresenter, notifyAnyBatchAutoreductionResumed()) + .Times(1); + presenter.notifyAnyBatchAutoreductionResumed(); verifyAndClear(); } void testChildPresentersUpdatedWhenAnyBatchAutoreductionPaused() { auto presenter = makePresenter(); - EXPECT_CALL(*m_runsPresenter, anyBatchAutoreductionPaused()).Times(1); - presenter.anyBatchAutoreductionPaused(); + EXPECT_CALL(*m_runsPresenter, notifyAnyBatchAutoreductionPaused()).Times(1); + presenter.notifyAnyBatchAutoreductionPaused(); verifyAndClear(); } diff --git a/qt/scientific_interfaces/test/ISISReflectometry/MainWindow/MainWindowPresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/MainWindow/MainWindowPresenterTest.h index c4e709b32cd..01da039deaa 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/MainWindow/MainWindowPresenterTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/MainWindow/MainWindowPresenterTest.h @@ -139,7 +139,7 @@ public: void testAutoreductionResumedNotifiesAllBatchPresenters() { auto presenter = makePresenter(); for (auto batchPresenter : m_batchPresenters) - EXPECT_CALL(*batchPresenter, anyBatchAutoreductionResumed()); + EXPECT_CALL(*batchPresenter, notifyAnyBatchAutoreductionResumed()); presenter.notifyResumeAutoreductionRequested(); verifyAndClear(); } @@ -147,7 +147,7 @@ public: void testAutoreductionPausedNotifiesAllBatchPresenters() { auto presenter = makePresenter(); for (auto batchPresenter : m_batchPresenters) - EXPECT_CALL(*batchPresenter, anyBatchAutoreductionPaused()); + EXPECT_CALL(*batchPresenter, notifyAnyBatchAutoreductionPaused()); presenter.notifyPauseAutoreductionRequested(); verifyAndClear(); } @@ -286,7 +286,7 @@ private: EXPECT_CALL(*batchPresenter, initInstrumentList()).Times(1); EXPECT_CALL(*batchPresenter, notifyInstrumentChanged(_)).Times(1); EXPECT_CALL(*batchPresenter, notifyReductionPaused()).Times(1); - EXPECT_CALL(*batchPresenter, anyBatchAutoreductionPaused()).Times(1); + EXPECT_CALL(*batchPresenter, notifyAnyBatchAutoreductionPaused()).Times(1); } void expectBatchCanBeClosed(int batchIndex) { diff --git a/qt/scientific_interfaces/test/ISISReflectometry/ReflMockObjects.h b/qt/scientific_interfaces/test/ISISReflectometry/ReflMockObjects.h index 05582694361..b2fb0eb5920 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/ReflMockObjects.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/ReflMockObjects.h @@ -61,8 +61,8 @@ public: MOCK_METHOD0(notifyResumeAutoreductionRequested, void()); MOCK_METHOD0(notifyPauseAutoreductionRequested, void()); MOCK_METHOD0(notifyAutoreductionCompleted, void()); - MOCK_METHOD0(anyBatchAutoreductionResumed, void()); - MOCK_METHOD0(anyBatchAutoreductionPaused, void()); + MOCK_METHOD0(notifyAnyBatchAutoreductionResumed, void()); + MOCK_METHOD0(notifyAnyBatchAutoreductionPaused, void()); MOCK_METHOD0(notifyReductionPaused, void()); MOCK_METHOD1(notifyChangeInstrumentRequested, void(const std::string &)); @@ -99,8 +99,8 @@ public: MOCK_METHOD0(notifyAutoreductionPaused, void()); MOCK_METHOD0(notifyAutoreductionResumed, void()); MOCK_METHOD0(autoreductionCompleted, void()); - MOCK_METHOD0(anyBatchAutoreductionPaused, void()); - MOCK_METHOD0(anyBatchAutoreductionResumed, void()); + MOCK_METHOD0(notifyAnyBatchAutoreductionPaused, void()); + MOCK_METHOD0(notifyAnyBatchAutoreductionResumed, void()); MOCK_METHOD1(notifyInstrumentChanged, void(std::string const &)); MOCK_METHOD0(settingsChanged, void()); MOCK_CONST_METHOD0(isProcessing, bool()); diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Runs/RunsPresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/Runs/RunsPresenterTest.h index 555e1e1fcee..0469cf666ae 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Runs/RunsPresenterTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/Runs/RunsPresenterTest.h @@ -301,14 +301,14 @@ public: void testAutoreductionDisabledWhenAnotherBatchAutoreducing() { auto presenter = makePresenter(); expectAutoreduceButtonDisabledWhenAnotherBatchAutoreducing(); - presenter.anyBatchAutoreductionResumed(); + presenter.notifyAnyBatchAutoreductionResumed(); verifyAndClear(); } void testAutoreductionDisabledWhenAnotherBatchNotAutoreducing() { auto presenter = makePresenter(); expectAutoreduceButtonEnabledWhenAnotherBatchNotAutoreducing(); - presenter.anyBatchAutoreductionPaused(); + presenter.notifyAnyBatchAutoreductionPaused(); verifyAndClear(); } -- GitLab