diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Measurement.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Measurement.h index bf892cec134bfcc098f48e58cfb0ea18859d6f3c..fa15cd86daaf90e3ac791d43488fe4679961a11a 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Measurement.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Measurement.h @@ -57,6 +57,7 @@ public: std::string type() const; std::string label() const; double angle() const; + std::string angleStr() const; private: /// Constructor diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflMainView.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflMainView.h index 6e90927b72b518c554c79f7874db67c37b2e4501..fe44956dde5cc136e7812d7152e7bbcde7f2cfc9 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflMainView.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/QtReflMainView.h @@ -83,12 +83,13 @@ namespace MantidQt //Get status of the checkbox which dictates whether an ipython notebook is produced virtual bool getEnableNotebook(); - //Settor methods + //Setter methods virtual void setSelection(const std::set<int>& rows); virtual void setTableList(const std::set<std::string>& tables); virtual void setInstrumentList(const std::vector<std::string>& instruments, const std::string& defaultInstrument); virtual void setOptionsHintStrategy(MantidQt::MantidWidgets::HintStrategy* hintStrategy); virtual void setClipboard(const std::string& text); + virtual void setTransferMethods(const std::set<std::string>& methods); //Accessor methods virtual std::set<int> getSelectedRows() const; @@ -98,6 +99,7 @@ namespace MantidQt virtual std::string getWorkspaceToOpen() const; virtual std::string getClipboard() const; virtual std::string getSearchString() const; + virtual std::string getTransferMethod() const; virtual boost::shared_ptr<IReflPresenter> getPresenter() const; diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainView.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainView.h index 2cb9e9afd61badcf01bc5be68a6b7883a7ce557c..df3775fc0100358e636c0f0c72dcf4ecb7070997 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainView.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainView.h @@ -69,12 +69,13 @@ namespace MantidQt //Get status of the checkbox which dictates whether an ipython notebook is produced virtual bool getEnableNotebook() = 0; - //Settor methods + //Setter methods virtual void setSelection(const std::set<int>& rows) = 0; virtual void setTableList(const std::set<std::string>& tables) = 0; virtual void setInstrumentList(const std::vector<std::string>& instruments, const std::string& defaultInstrument) = 0; virtual void setOptionsHintStrategy(MantidQt::MantidWidgets::HintStrategy* hintStrategy) = 0; virtual void setClipboard(const std::string& text) = 0; + virtual void setTransferMethods(const std::set<std::string>& methods) = 0; //Accessor methods virtual std::set<int> getSelectedRows() const = 0; @@ -84,6 +85,7 @@ namespace MantidQt virtual std::string getWorkspaceToOpen() const = 0; virtual std::string getClipboard() const = 0; virtual std::string getSearchString() const = 0; + virtual std::string getTransferMethod() const = 0; virtual boost::shared_ptr<IReflPresenter> getPresenter() const = 0; }; diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainViewPresenter.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainViewPresenter.h index 50cfd8a512bdb62f5f11982deba580119ac44d25..5d03b17845913e50d32db677666ea5a0f050918c 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainViewPresenter.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainViewPresenter.h @@ -12,6 +12,7 @@ #include <Poco/AutoPtr.h> #include <Poco/NObserver.h> +#include <memory> namespace MantidQt { @@ -73,7 +74,6 @@ namespace MantidQt std::map<std::string,QVariant> m_options; //the search implementation boost::shared_ptr<IReflSearcher> m_searcher; - boost::shared_ptr<ReflTransferStrategy> m_transferStrategy; //process selected rows void process(); @@ -159,6 +159,13 @@ namespace MantidQt void saveNotebook(std::map<int,std::set<int>> groups, std::set<int> rows); + private: + + static const std::string LegacyTransferMethod; + static const std::string MeasureTransferMethod; + + std::unique_ptr<ReflTransferStrategy> getTransferStrategy(); + }; } } diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainWidget.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainWidget.ui index fa5fd6c1c7258d0be6383f348bc94773b3967c2d..ddcddcdedc6c9279d19d30517bac2971fea1426b 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainWidget.ui +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflMainWidget.ui @@ -15,7 +15,16 @@ </property> <widget class="QWidget" name="centralwidget"> <layout class="QVBoxLayout" name="layoutMain"> - <property name="margin"> + <property name="leftMargin"> + <number>1</number> + </property> + <property name="topMargin"> + <number>1</number> + </property> + <property name="rightMargin"> + <number>1</number> + </property> + <property name="bottomMargin"> <number>1</number> </property> <item> @@ -40,7 +49,16 @@ <property name="spacing"> <number>1</number> </property> - <property name="margin"> + <property name="leftMargin"> + <number>1</number> + </property> + <property name="topMargin"> + <number>1</number> + </property> + <property name="rightMargin"> + <number>1</number> + </property> + <property name="bottomMargin"> <number>1</number> </property> <item> @@ -185,6 +203,9 @@ </property> </spacer> </item> + <item> + <widget class="QComboBox" name="comboTransferMethod"/> + </item> <item> <widget class="QToolButton" name="buttonTransfer"> <property name="text"> @@ -207,7 +228,16 @@ <property name="spacing"> <number>1</number> </property> - <property name="margin"> + <property name="leftMargin"> + <number>1</number> + </property> + <property name="topMargin"> + <number>1</number> + </property> + <property name="rightMargin"> + <number>1</number> + </property> + <property name="bottomMargin"> <number>1</number> </property> <item> @@ -276,7 +306,16 @@ </item> <item> <layout class="QHBoxLayout" name="layoutRowButtons"> - <property name="margin"> + <property name="leftMargin"> + <number>1</number> + </property> + <property name="topMargin"> + <number>1</number> + </property> + <property name="rightMargin"> + <number>1</number> + </property> + <property name="bottomMargin"> <number>1</number> </property> <item> @@ -348,7 +387,7 @@ <x>0</x> <y>0</y> <width>959</width> - <height>25</height> + <height>22</height> </rect> </property> <property name="nativeMenuBar"> diff --git a/MantidQt/CustomInterfaces/src/Measurement.cpp b/MantidQt/CustomInterfaces/src/Measurement.cpp index e78073ee5516a8471c5b021244a6eb09f8548c53..6b21601cd72a5ce1d73a5880300691e35f7145fb 100644 --- a/MantidQt/CustomInterfaces/src/Measurement.cpp +++ b/MantidQt/CustomInterfaces/src/Measurement.cpp @@ -1,5 +1,6 @@ #include "MantidQtCustomInterfaces/Measurement.h" #include <string> +#include <sstream> namespace MantidQt { namespace CustomInterfaces { @@ -24,9 +25,9 @@ Measurement::Measurement(const Measurement::IDType &measurementId, if (m_measurementId.empty()) { accumulatedProblems += "No measurement id. "; } else if (m_subId.empty()) { - accumulatedProblems += "No sub id. "; + accumulatedProblems += "No sub id. "; } else if (m_run.empty()) { - accumulatedProblems += "No run" ; + accumulatedProblems += "No run"; } m_whyUnuseable = accumulatedProblems; } @@ -34,7 +35,8 @@ Measurement::Measurement(const Measurement::IDType &measurementId, /** * Constructor making an invalid Measurement */ -Measurement::Measurement(const std::string& why) : m_angle(0), m_whyUnuseable(why){} +Measurement::Measurement(const std::string &why) + : m_angle(0), m_whyUnuseable(why) {} /** * Copy constructor @@ -52,7 +54,9 @@ Measurement::~Measurement() {} * InvalidMeasurement static creational method * @return Invalid measurement */ -Measurement Measurement::InvalidMeasurement(const std::string& why) { return Measurement(why); } +Measurement Measurement::InvalidMeasurement(const std::string &why) { + return Measurement(why); +} bool Measurement::isUseable() const { return m_whyUnuseable.empty(); } @@ -68,10 +72,13 @@ double Measurement::angle() const { return m_angle; } std::string Measurement::run() const { return m_run; } -std::string Measurement::whyUnuseable() const -{ - return m_whyUnuseable; +std::string Measurement::angleStr() const { + std::stringstream buffer; + buffer << angle(); + return buffer.str(); } +std::string Measurement::whyUnuseable() const { return m_whyUnuseable; } + } // namespace CustomInterfaces } // namespace Mantid diff --git a/MantidQt/CustomInterfaces/src/QtReflMainView.cpp b/MantidQt/CustomInterfaces/src/QtReflMainView.cpp index 76aee106e5abde4231d0d7ba5738451923621448..18fb47f43c03a295f24eaa5d6901e2038bd51797 100644 --- a/MantidQt/CustomInterfaces/src/QtReflMainView.cpp +++ b/MantidQt/CustomInterfaces/src/QtReflMainView.cpp @@ -78,6 +78,17 @@ namespace MantidQt m_presenter->notify(IReflPresenter::OpenTableFlag); } + /** + * Set all possible tranfer methods + * @param methods : All possible transfer methods. + */ + void QtReflMainView::setTransferMethods(const std::set<std::string>& methods){ + for(auto method = methods.begin(); method != methods.end(); ++method){ + ui.comboTransferMethod->addItem((*method).c_str()); + } + } + + /** Set a new model in the tableview @param model : the model to be attached to the tableview @@ -674,5 +685,12 @@ namespace MantidQt */ void QtReflMainView::clearProgress() { ui.progressBar->reset(); } + /** + * @return the transfer method selected. + */ + std::string QtReflMainView::getTransferMethod() const{ + return ui.comboTransferMethod->currentText().toStdString(); + } + } // namespace CustomInterfaces } // namespace Mantid diff --git a/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp b/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp index 068c448d3c2c15cfa3c58f9acfbcb45f82d0128e..246210109a9302d0ce903b24d4118b427e7991c4 100644 --- a/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp +++ b/MantidQt/CustomInterfaces/src/ReflMainViewPresenter.cpp @@ -6,13 +6,18 @@ #include "MantidAPI/TableRow.h" #include "MantidAPI/NotebookWriter.h" #include "MantidGeometry/Instrument/ParameterMap.h" +#include "MantidKernel/ConfigService.h" +#include "MantidKernel/FacilityInfo.h" #include "MantidKernel/ProgressBase.h" #include "MantidKernel/Strings.h" #include "MantidKernel/TimeSeriesProperty.h" +#include "MantidKernel/UserCatalogInfo.h" #include "MantidKernel/Utils.h" +#include "MantidQtCustomInterfaces/ReflNexusMeasurementSource.h" #include "MantidQtCustomInterfaces/ProgressableView.h" #include "MantidQtCustomInterfaces/ReflCatalogSearcher.h" #include "MantidQtCustomInterfaces/ReflLegacyTransferStrategy.h" +#include "MantidQtCustomInterfaces/ReflMeasureTransferStrategy.h" #include "MantidQtCustomInterfaces/ReflMainView.h" #include "MantidQtCustomInterfaces/ReflSearchModel.h" #include "MantidQtCustomInterfaces/QReflTableModel.h" @@ -30,15 +35,12 @@ #include <fstream> #include <sstream> - using namespace Mantid::API; using namespace Mantid::Geometry; using namespace Mantid::Kernel; using namespace MantidQt::MantidWidgets; - -namespace -{ +namespace { class ReflProgress : public Mantid::Kernel::ProgressBase { private: @@ -138,7 +140,6 @@ ReflMainViewPresenter::ReflMainViewPresenter( boost::shared_ptr<IReflSearcher> searcher) : m_view(mainView), m_progressView(progressView), m_tableDirty(false), m_searcher(searcher), - m_transferStrategy(new ReflLegacyTransferStrategy()), m_addObserver(*this, &ReflMainViewPresenter::handleAddEvent), m_remObserver(*this, &ReflMainViewPresenter::handleRemEvent), m_clearObserver(*this, &ReflMainViewPresenter::handleClearEvent), @@ -218,6 +219,12 @@ ReflMainViewPresenter::ReflMainViewPresenter( if (!m_searcher) m_searcher.reset(new ReflCatalogSearcher()); + // Set the possible tranfer methods + std::set<std::string> methods; + methods.insert(LegacyTransferMethod); + methods.insert(MeasureTransferMethod); + m_view->setTransferMethods(methods); + // Start with a blank table newTable(); } @@ -1470,7 +1477,7 @@ void ReflMainViewPresenter::search() { try { auto results = m_searcher->search(searchString); m_searchModel = ReflSearchModel_sptr( - new ReflSearchModel(*m_transferStrategy, results, searchInstr)); + new ReflSearchModel(*getTransferStrategy(), results, searchInstr)); m_view->showSearch(m_searchModel); } catch (std::runtime_error &e) { m_view->giveUserCritical("Error running search:\n" + std::string(e.what()), @@ -1505,7 +1512,7 @@ void ReflMainViewPresenter::transfer() { ReflProgress progress(0, selectedRows.size(), selectedRows.size(), this->m_progressView); - auto newRows = m_transferStrategy->transferRuns(runs, progress); + auto newRows = getTransferStrategy()->transferRuns(runs, progress); std::map<std::string, int> groups; // Loop over the rows (vector elements) @@ -1655,9 +1662,9 @@ void ReflMainViewPresenter::setOptions( for (auto it = options.begin(); it != options.end(); ++it) m_options[it->first] = it->second; - //Save any changes to disk - m_view->saveSettings(m_options); - } + // Save any changes to disk + m_view->saveSettings(m_options); +} /** Load options from disk if possible, or set to defaults */ void ReflMainViewPresenter::initOptions() { @@ -1676,8 +1683,50 @@ void ReflMainViewPresenter::initOptions() { m_options["RoundQMaxPrecision"] = 3; m_options["RoundDQQPrecision"] = 3; - //Load saved values from disk - m_view->loadSettings(m_options); - } + // Load saved values from disk + m_view->loadSettings(m_options); +} + +/** + * Select and make a transfer strategy on demand based. Pick up the + *user-provided + * transfer strategy to do this. + * + * @return new TransferStrategy + */ +std::unique_ptr<ReflTransferStrategy> +ReflMainViewPresenter::getTransferStrategy() { + const std::string currentMethod = m_view->getTransferMethod(); + if (currentMethod == MeasureTransferMethod) { + + // We need catalog info overrides from the user-based config service + std::unique_ptr<CatalogConfigService> catConfigService( + makeCatalogConfigServiceAdapter(ConfigService::Instance())); + + // We make a user-based Catalog Info object for the transfer + auto catInfo = std::unique_ptr<ICatalogInfo>(new UserCatalogInfo( + ConfigService::Instance().getFacility().catalogInfo(), + *catConfigService)); + + // We are going to load from disk to pick up the meta data, so provide the + // right repository to do this. + auto source = + std::unique_ptr<ReflMeasurementSource>(new ReflNexusMeasurementSource); + + // Finally make and return the Measure based transfer strategy. + return std::unique_ptr<ReflTransferStrategy>( + new ReflMeasureTransferStrategy(std::move(catInfo), std::move(source))); + } else if (currentMethod == LegacyTransferMethod) { + return std::unique_ptr<ReflTransferStrategy>( + new ReflLegacyTransferStrategy); + + } else { + throw std::runtime_error("Unknown tranfer method selected: " + + currentMethod); } } + +const std::string ReflMainViewPresenter::MeasureTransferMethod = "Measurement"; +const std::string ReflMainViewPresenter::LegacyTransferMethod = "Description"; +} +} diff --git a/MantidQt/CustomInterfaces/src/ReflMeasureTransferStrategy.cpp b/MantidQt/CustomInterfaces/src/ReflMeasureTransferStrategy.cpp index 6976db501c0cce4c24968db07c1ef7214219cb1b..c9aa8782cbf6bb3a37e1c7ee49b326653ee078a3 100644 --- a/MantidQt/CustomInterfaces/src/ReflMeasureTransferStrategy.cpp +++ b/MantidQt/CustomInterfaces/src/ReflMeasureTransferStrategy.cpp @@ -95,7 +95,7 @@ MantidQt::CustomInterfaces::ReflMeasureTransferStrategy::transferRuns( } else { std::map<std::string, std::string> row; row[ReflTableSchema::RUNS] = measurement.run(); - row[ReflTableSchema::ANGLE] = measurement.angle(); + row[ReflTableSchema::ANGLE] = measurement.angleStr(); row[ReflTableSchema::GROUP] = nextGroupId; subIdMap.insert(std::make_pair(measurement.subId(), i)); output.push_back(row); diff --git a/MantidQt/CustomInterfaces/src/ReflSearchModel.cpp b/MantidQt/CustomInterfaces/src/ReflSearchModel.cpp index 7ff70a841d49ac2174eefeadba36ed9c7404daa3..be5934f82d2da082ebfefa645d021df48d6f425a 100644 --- a/MantidQt/CustomInterfaces/src/ReflSearchModel.cpp +++ b/MantidQt/CustomInterfaces/src/ReflSearchModel.cpp @@ -43,7 +43,7 @@ namespace MantidQt m_runs.push_back(run); const std::string description = tableWorkspace->String(i, 6); m_descriptions[run] = description; - const std::string location = tableWorkspace->String(i, 2); + const std::string location = tableWorkspace->String(i, 1); m_locations[run] = location; } } diff --git a/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h b/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h index cab4af2569ff3e9dca5d5d86de0e5909f8c2cc77..38aee56b033b72f9e9defc7368e38f32af348d2e 100644 --- a/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h +++ b/MantidQt/CustomInterfaces/test/ReflMainViewMockObjects.h @@ -52,6 +52,9 @@ public: MOCK_CONST_METHOD0(getSearchString, std::string()); MOCK_CONST_METHOD0(getSearchInstrument, std::string()); MOCK_METHOD0(getEnableNotebook, bool()); + MOCK_CONST_METHOD0(getTransferMethod, std::string()); + + MOCK_METHOD1(setTransferMethods, void(const std::set<std::string>&)); //Calls we don't care about virtual void showTable(QReflTableModel_sptr) {}; diff --git a/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h b/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h index 6b02de26d6e9b28a37b3fa9c6e7748d4539e3bfa..04959b243189cc503404c67b2c8b7f8fa384eac1 100644 --- a/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h +++ b/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h @@ -124,8 +124,22 @@ public: ReflMainViewPresenterTest() { FrameworkManager::Instance(); } + void test_constructor_sets_possible_transfer_methods(){ + NiceMock<MockView> mockView; + MockProgressableView mockProgress; + + // Expect that the transfer methods get initialized on the view + EXPECT_CALL(mockView, setTransferMethods(_)).Times(Exactly(1)); + + // Constructor + ReflMainViewPresenter presenter(&mockView, &mockProgress); + + // Verify expectations + TS_ASSERT(Mock::VerifyAndClearExpectations(&mockView)); + } + void testSaveNew() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -143,7 +157,7 @@ public: } void testSaveExisting() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -162,7 +176,7 @@ public: } void testSaveAs() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -193,7 +207,7 @@ public: } void testAppendRow() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -236,7 +250,7 @@ public: } void testAppendRowSpecify() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -282,7 +296,7 @@ public: } void testAppendRowSpecifyPlural() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -327,7 +341,7 @@ public: } void testPrependRow() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -369,7 +383,7 @@ public: } void testPrependRowSpecify() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -414,7 +428,7 @@ public: } void testPrependRowSpecifyPlural() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -460,7 +474,7 @@ public: } void testDeleteRowNone() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -494,7 +508,7 @@ public: } void testDeleteRowSingle() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -532,7 +546,7 @@ public: } void testDeleteRowPlural() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -573,7 +587,7 @@ public: } void testProcess() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -627,7 +641,7 @@ public: } void testProcessWithNotebook() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -695,7 +709,7 @@ public: createTOFWorkspace("dataA"); createTOFWorkspace("dataB", "12346"); - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); EXPECT_CALL(mockView, getWorkspaceToOpen()) @@ -752,7 +766,7 @@ public: AnalysisDataService::Instance().addOrReplace("TestWorkspace", ws); - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -770,7 +784,7 @@ public: } void testBadWorkspaceLength() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -807,7 +821,7 @@ public: } void testPromptSaveAfterAppendRow() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -837,7 +851,7 @@ public: } void testPromptSaveAfterDeleteRow() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -879,7 +893,7 @@ public: } void testPromptSaveAndDiscard() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -902,7 +916,7 @@ public: } void testPromptSaveOnOpen() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1009,7 +1023,7 @@ public: << "" << "" << 1.0 << 5 << ""; // Row 9 - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1101,7 +1115,7 @@ public: } void testClearRows() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1163,7 +1177,7 @@ public: } void testCopyRow() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1189,7 +1203,7 @@ public: } void testCopyRows() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1221,7 +1235,7 @@ public: } void testCutRow() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1258,7 +1272,7 @@ public: } void testCutRows() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1297,7 +1311,7 @@ public: } void testPasteRow() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1347,7 +1361,7 @@ public: } void testPasteNewRow() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1395,7 +1409,7 @@ public: } void testPasteRows() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1456,7 +1470,7 @@ public: } void testPasteNewRows() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1515,7 +1529,7 @@ public: } void testImportTable() { - MockView mockView; + NiceMock<MockView> mockView; NiceMock<MockProgressableView> mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); EXPECT_CALL(mockView, showAlgorithmDialog("LoadReflTBL")); @@ -1525,7 +1539,7 @@ public: } void testExportTable() { - MockView mockView; + NiceMock<MockView> mockView; MockProgressableView mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); EXPECT_CALL(mockView, showAlgorithmDialog("SaveReflTBL")); @@ -1535,7 +1549,7 @@ public: } void testPlotRowWarn() { - MockView mockView; + NiceMock<MockView> mockView; MockProgressableView mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress); @@ -1569,7 +1583,7 @@ public: } void testPlotGroupWarn() { - MockView mockView; + NiceMock<MockView> mockView; MockProgressableView mockProgress; ReflMainViewPresenter presenter(&mockView, &mockProgress);