diff --git a/qt/scientific_interfaces/CMakeLists.txt b/qt/scientific_interfaces/CMakeLists.txt index 91cea3962d95d8d8b9ea689b4663215a1f804d8d..d043399d347a9124a376c7cd0ee296478e3886a4 100644 --- a/qt/scientific_interfaces/CMakeLists.txt +++ b/qt/scientific_interfaces/CMakeLists.txt @@ -53,10 +53,12 @@ set ( TEST_FILES test/ISISReflectometry/Reduction/GroupTest.h test/ISISReflectometry/Reduction/ValidateRowTest.h test/ISISReflectometry/Reduction/ReductionJobsMergeTest.h - test/ISISReflectometry/Presenters/RunsTablePresenterGroupDeletionTest.h - test/ISISReflectometry/Presenters/RunsTablePresenterGroupInsertionTest.h - test/ISISReflectometry/Presenters/RunsTablePresenterRowInsertionTest.h - test/ISISReflectometry/Presenters/RunsTablePresenterRowDeletionTest.h + + test/ISISReflectometry/RunsTable/RunsTablePresenterGroupDeletionTest.h + test/ISISReflectometry/RunsTable/RunsTablePresenterGroupInsertionTest.h + test/ISISReflectometry/RunsTable/RunsTablePresenterRowInsertionTest.h + test/ISISReflectometry/RunsTable/RunsTablePresenterRowDeletionTest.h + test/ISISReflectometry/Event/EventPresenterTest.h ) mtd_add_qt_tests (TARGET_NAME MantidQtScientificInterfacesTest diff --git a/qt/scientific_interfaces/ISISReflectometry/CMakeLists.txt b/qt/scientific_interfaces/ISISReflectometry/CMakeLists.txt index 651734c724ea616b763d6415584cec83737d6a0d..8407490d321d14e6820bc41ead67103587dd1df0 100644 --- a/qt/scientific_interfaces/ISISReflectometry/CMakeLists.txt +++ b/qt/scientific_interfaces/ISISReflectometry/CMakeLists.txt @@ -3,12 +3,14 @@ FUNCTION(PREPEND var prefix) FOREACH(f ${ARGN}) LIST(APPEND listVar "${prefix}/${f}") ENDFOREACH(f) - SET(${var} "${listVar}" PARENT_SCOPE) + SET(${var} ${listVar} PARENT_SCOPE) ENDFUNCTION(PREPEND) add_subdirectory(GUI) add_subdirectory(Reduction) +message(${GUI_SRC_FILES}) + set ( SRC_FILES ${GUI_SRC_FILES} ${REDUCTION_SRC_FILES} @@ -16,7 +18,6 @@ set ( SRC_FILES InstrumentOptionDefaults.cpp InstrumentParameters.cpp ExperimentOptionDefaults.cpp - QtReflEventTabView.cpp QtReflMainWindowView.cpp QtReflBatchView.cpp QtReflRunsTabView.cpp @@ -26,7 +27,6 @@ set ( SRC_FILES ReflAsciiSaver.cpp IReflAsciiSaver.cpp ReflAutoreduction.cpp - ReflEventTabPresenter.cpp ReflFromStdStringMap.cpp ReflMainWindowPresenter.cpp ReflBatchPresenter.cpp @@ -48,7 +48,6 @@ set ( INC_FILES ${REDUCTION_INC_FILES} DllConfig.h InstrumentParameters.h - IReflEventTabPresenter.h IReflMainWindowPresenter.h IReflBatchPresenter.h IReflMainWindowView.h @@ -61,7 +60,6 @@ set ( INC_FILES IReflSettingsTabPresenter.h MeasurementItem.h PrecompiledHeader.h - QtReflEventTabView.h QtReflMainWindowView.h QtReflBatchView.h QtReflRunsTabView.h @@ -72,7 +70,6 @@ set ( INC_FILES ReflCatalogSearcher.h ReflAsciiSaver.h IReflAsciiSaver.h - ReflEventTabPresenter.h ReflFromStdStringMap.h ReflMainWindowPresenter.h ReflBatchPresenter.h @@ -93,7 +90,6 @@ set ( INC_FILES set ( MOC_FILES ${GUI_MOC_FILES} ReflSearchModel.h - QtReflEventTabView.h QtReflRunsTabView.h QtReflSaveTabView.h QtReflSettingsTabView.h @@ -103,7 +99,6 @@ set ( MOC_FILES set ( UI_FILES ${GUI_UI_FILES} - ReflEventTabWidget.ui ReflMainWindowWidget.ui ReflBatchWidget.ui ReflRunsTabWidget.ui diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/CMakeLists.txt b/qt/scientific_interfaces/ISISReflectometry/GUI/CMakeLists.txt index 014d3bed08e2ab506663795b48089d3cd3701339..2cf889fa4b247c82a2e9f88c1048982900dcd24c 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/CMakeLists.txt +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/CMakeLists.txt @@ -1,16 +1,34 @@ -#add_subdirectory(Event) +add_subdirectory( Event ) #add_subdirectory(Experiment) #add_subdirectory(Instrument) #add_subdirectory(Runs) +message("Event after folder ${EVENT_SRC_FILES}") add_subdirectory( RunsTable ) +message("RUN TABLE after folder: ${RUNS_TABLE_SRC_FILES}") +message("Event after run table: ${EVENT_SRC_FILES}") #add_subdirectory(Save) -PREPEND( RUNS_TABLE_SRC_FILES GUI/RunsTable ${RUNS_TABLE_SRC_FILES}) -PREPEND( RUNS_TABLE_INC_FILES GUI/RunsTable ${RUNS_TABLE_INC_FILES}) -PREPEND( RUNS_TABLE_MOC_FILES GUI/RunsTable ${RUNS_TABLE_MOC_FILES}) -PREPEND( RUNS_TABLE_UI_FILES GUI/RunsTable ${RUNS_TABLE_UI_FILES}) -set ( GUI_SRC_FILES ${RUNS_TABLE_SRC_FILES} PARENT_SCOPE ) -set ( GUI_INC_FILES ${RUNS_TABLE_INC_FILES} PARENT_SCOPE ) -set ( GUI_MOC_FILES ${RUNS_TABLE_MOC_FILES} PARENT_SCOPE ) -set ( GUI_UI_FILES ${RUNS_TABLE_UI_FILES} PARENT_SCOPE ) +set (GUI_SRC_FILES + ${RUNS_TABLE_SRC_FILES} + ${EVENT_SRC_FILES} + PARENT_SCOPE +) + +set (GUI_INC_FILES + ${RUNS_TABLE_INC_FILES} + ${EVENT_INC_FILES} + PARENT_SCOPE +) + +set ( GUI_MOC_FILES + ${RUNS_TABLE_MOC_FILES} + ${EVENT_MOC_FILES} + PARENT_SCOPE +) + +set ( GUI_UI_FILES + ${RUNS_TABLE_UI_FILES} + ${EVENT_UI_FILES} + PARENT_SCOPE +) diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Event/CMakeLists.txt b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..afd34e1bddb20b48c10649761ec1c702f40457e9 --- /dev/null +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/CMakeLists.txt @@ -0,0 +1,32 @@ +set ( EVENT_SRC_FILES + EventPresenter.cpp + EventView.cpp +) + +# Include files aren't required, but this makes them appear in Visual Studio +# IMPORTANT: Include files are required in the MOC_FILES set. Scroll down to find it. +set ( EVENT_INC_FILES + EventPresenter.h + IEventPresenter.h + IEventView.h + EventView.h + EventPresenterFactory.h +) + +set ( EVENT_MOC_FILES + EventView.h +) + +set ( EVENT_UI_FILES + EventWidget.ui +) + +PREPEND( EVENT_SRC_FILES GUI/Event ${EVENT_SRC_FILES}) +PREPEND( EVENT_INC_FILES GUI/Event ${EVENT_INC_FILES}) +PREPEND( EVENT_MOC_FILES GUI/Event ${EVENT_MOC_FILES}) +PREPEND( EVENT_UI_FILES GUI/Event ${EVENT_UI_FILES}) + +set (EVENT_SRC_FILES ${EVENT_SRC_FILES} PARENT_SCOPE) +set (EVENT_INC_FILES ${EVENT_INC_FILES} PARENT_SCOPE) +set (EVENT_MOC_FILES ${EVENT_MOC_FILES} PARENT_SCOPE) +set (EVENT_UI_FILES ${EVENT_UI_FILES} PARENT_SCOPE) diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflEventTabPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenter.cpp similarity index 51% rename from qt/scientific_interfaces/ISISReflectometry/ReflEventTabPresenter.cpp rename to qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenter.cpp index cf9864df7ce10337155869c693abe01f71dc094a..eb7e6a4ca3bc7a7475eeac49a3da01ad28a96b43 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflEventTabPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenter.cpp @@ -1,6 +1,6 @@ -#include "ReflEventTabPresenter.h" -#include "IReflEventTabPresenter.h" -#include "IReflEventTabView.h" +#include "EventPresenter.h" +#include "IEventPresenter.h" +#include "IEventView.h" #include "Parse.h" #include <boost/algorithm/string.hpp> @@ -11,90 +11,57 @@ namespace CustomInterfaces { * @param view :: The view we are handling * @param group :: The group on the parent tab this belongs to */ -ReflEventTabPresenter::ReflEventTabPresenter(IReflEventTabView *view) +EventPresenter::EventPresenter(IEventView *view) : m_view(view), m_sliceType(SliceType::None) { m_view->subscribe(this); } -void ReflEventTabPresenter::acceptMainPresenter( +void EventPresenter::acceptMainPresenter( IReflBatchPresenter *mainPresenter) { m_mainPresenter = mainPresenter; } -Slicing const &ReflEventTabPresenter::slicing() const { return m_slicing; } +Slicing const &EventPresenter::slicing() const { return m_slicing; } -void ReflEventTabPresenter::notifyUniformSliceCountChanged(int) { +void EventPresenter::notifyUniformSliceCountChanged(int) { setUniformSlicingByNumberOfSlicesFromView(); } -void ReflEventTabPresenter::notifyUniformSecondsChanged(double) { +void EventPresenter::notifyUniformSecondsChanged(double) { setUniformSlicingByTimeFromView(); } -void ReflEventTabPresenter::notifyCustomSliceValuesChanged(std::string) { +void EventPresenter::notifyCustomSliceValuesChanged(std::string) { setCustomSlicingFromView(); } -void ReflEventTabPresenter::notifyLogSliceBreakpointsChanged(std::string) { +void EventPresenter::notifyLogSliceBreakpointsChanged(std::string) { setLogValueSlicingFromView(); } -void ReflEventTabPresenter::notifyLogBlockNameChanged(std::string) { +void EventPresenter::notifyLogBlockNameChanged(std::string) { setLogValueSlicingFromView(); } -/** Returns the time-slicing values -* @return :: The time-slicing values -*/ -std::string ReflEventTabPresenter::getTimeSlicingValues() const { return {}; } - -std::string ReflEventTabPresenter::logFilterAndSliceValues( - std::string const &slicingValues, std::string const &logFilter) const { - if (!slicingValues.empty() && !logFilter.empty()) - return "Slicing=\"" + slicingValues + "\",LogFilter=" + logFilter; - else - return ""; -} - -/** Returns the time-slicing type -* @return :: The time-slicing type -*/ -std::string ReflEventTabPresenter::getTimeSlicingType() const { - switch (m_sliceType) { - case SliceType::UniformEven: - return "UniformEven"; - case SliceType::Uniform: - return "Uniform"; - case SliceType::Custom: - return "Custom"; - case SliceType::LogValue: - return "LogValue"; - case SliceType::None: - return "None"; - default: - throw std::runtime_error("B Unrecognized slice type."); - } -} - -void ReflEventTabPresenter::onReductionPaused() { +void EventPresenter::onReductionPaused() { m_view->enableSliceType(m_sliceType); m_view->enableSliceTypeSelection(); } -void ReflEventTabPresenter::onReductionResumed() { +void EventPresenter::onReductionResumed() { m_view->disableSliceType(m_sliceType); m_view->disableSliceTypeSelection(); } -void ReflEventTabPresenter::setUniformSlicingByTimeFromView() { +void EventPresenter::setUniformSlicingByTimeFromView() { m_slicing = UniformSlicingByTime(m_view->uniformSliceLength()); } -void ReflEventTabPresenter::setUniformSlicingByNumberOfSlicesFromView() { +void EventPresenter::setUniformSlicingByNumberOfSlicesFromView() { m_slicing = UniformSlicingByNumberOfSlices(m_view->uniformSliceCount()); } -void ReflEventTabPresenter::setCustomSlicingFromView() { +void EventPresenter::setCustomSlicingFromView() { auto maybeCustomBreakpoints = parseList(m_view->customBreakpoints(), parseNonNegativeDouble); if (maybeCustomBreakpoints.is_initialized()) { @@ -102,10 +69,11 @@ void ReflEventTabPresenter::setCustomSlicingFromView() { m_slicing = CustomSlicingByList(maybeCustomBreakpoints.get()); } else { m_view->showCustomBreakpointsInvalid(); + m_slicing = InvalidSlicing(); } } -void ReflEventTabPresenter::setLogValueSlicingFromView() { +void EventPresenter::setLogValueSlicingFromView() { auto maybeBreakpoints = parseList(m_view->logBreakpoints(), parseNonNegativeDouble); auto blockName = m_view->logBlockName(); @@ -114,10 +82,11 @@ void ReflEventTabPresenter::setLogValueSlicingFromView() { m_slicing = SlicingByEventLog(maybeBreakpoints.get(), blockName); } else { m_view->showLogBreakpointsInvalid(); + m_slicing = InvalidSlicing(); } } -void ReflEventTabPresenter::setSlicingFromView() { +void EventPresenter::setSlicingFromView() { switch (m_sliceType) { case SliceType::UniformEven: setUniformSlicingByNumberOfSlicesFromView(); @@ -139,7 +108,7 @@ void ReflEventTabPresenter::setSlicingFromView() { } } -void ReflEventTabPresenter::notifySliceTypeChanged(SliceType newSliceType) { +void EventPresenter::notifySliceTypeChanged(SliceType newSliceType) { m_view->disableSliceType(m_sliceType); m_view->enableSliceType(newSliceType); m_sliceType = newSliceType; diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflEventTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenter.h similarity index 74% rename from qt/scientific_interfaces/ISISReflectometry/ReflEventTabPresenter.h rename to qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenter.h index ec00d7983176bb6da37cadab7ccc2414a22dfdef..1db322037e136b5024876304db972cae7fcbe6ca 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflEventTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenter.h @@ -1,18 +1,18 @@ #ifndef MANTID_ISISREFLECTOMETRY_REFLEVENTPRESENTER_H #define MANTID_ISISREFLECTOMETRY_REFLEVENTPRESENTER_H -#include "DllConfig.h" -#include "IReflEventTabPresenter.h" +#include "../../DllConfig.h" +#include "IEventPresenter.h" #include "IReflBatchPresenter.h" -#include "IReflEventTabView.h" -#include "Reduction/Slicing.h" +#include "IEventView.h" +#include "../../Reduction/Slicing.h" namespace MantidQt { namespace CustomInterfaces { -/** @class ReflEventTabPresenter +/** @class EventPresenter -ReflEventTabPresenter is a presenter class for the widget 'Event' in the +EventPresenter is a presenter class for the widget 'Event' in the ISIS Reflectometry Interface. Copyright © 2011-16 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge @@ -36,21 +36,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. File change history is stored at: <https://github.com/mantidproject/mantid>. Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class MANTIDQT_ISISREFLECTOMETRY_DLL ReflEventTabPresenter - : public IReflEventTabPresenter, +class MANTIDQT_ISISREFLECTOMETRY_DLL EventPresenter + : public IEventPresenter, public EventTabViewSubscriber { public: - /// Constructor - ReflEventTabPresenter(IReflEventTabView *view); - /// Returns time-slicing values - std::string getTimeSlicingValues() const override; - /// Returns time-slicing type - std::string getTimeSlicingType() const override; + EventPresenter(IEventView *view); void onReductionPaused() override; void onReductionResumed() override; - void notifySliceTypeChanged(SliceType newSliceType) override; + void notifySliceTypeChanged(SliceType newSliceType) override; void notifyUniformSliceCountChanged(int sliceCount) override; void notifyUniformSecondsChanged(double sliceLengthInSeconds) override; void @@ -70,10 +65,8 @@ private: void setCustomSlicingFromView(); void setLogValueSlicingFromView(); void setSlicingFromView(); - std::string logFilterAndSliceValues(std::string const &slicingValues, - std::string const &logFilter) const; /// The view we are managing - IReflEventTabView *m_view; + IEventView *m_view; IReflBatchPresenter *m_mainPresenter; SliceType m_sliceType; }; diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflEventPresenterFactory.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenterFactory.h similarity index 58% rename from qt/scientific_interfaces/ISISReflectometry/ReflEventPresenterFactory.h rename to qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenterFactory.h index 31ef17453a44f4693529ad47580d561b1c2275c3..391499d0929f7d44d4b0ada5192d996ca0b6c49f 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflEventPresenterFactory.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventPresenterFactory.h @@ -1,9 +1,9 @@ #ifndef MANTID_ISISREFLECTOMETRY_REFLEVENTPRESENTERFACTORY_H #define MANTID_ISISREFLECTOMETRY_REFLEVENTPRESENTERFACTORY_H #include "DllConfig.h" -#include "IReflEventTabView.h" -#include "IReflEventTabPresenter.h" -#include "ReflEventTabPresenter.h" +#include "IEventView.h" +#include "IEventPresenter.h" +#include "EventPresenter.h" #include <memory> namespace MantidQt { @@ -11,8 +11,8 @@ namespace CustomInterfaces { class EventPresenterFactory { public: - std::unique_ptr<IReflEventTabPresenter> make(IReflEventTabView *view) { - return std::make_unique<ReflEventTabPresenter>(view); + std::unique_ptr<IEventPresenter> make(IEventView *view) { + return std::make_unique<EventPresenter>(view); } }; } diff --git a/qt/scientific_interfaces/ISISReflectometry/QtReflEventTabView.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventView.cpp similarity index 70% rename from qt/scientific_interfaces/ISISReflectometry/QtReflEventTabView.cpp rename to qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventView.cpp index 34573f5019ad36ed462b564b8f926b3408d6152d..dc55893e8098740a30cc7a7cb0bcdb157d661cc8 100644 --- a/qt/scientific_interfaces/ISISReflectometry/QtReflEventTabView.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventView.cpp @@ -1,5 +1,5 @@ -#include "QtReflEventTabView.h" -#include "ReflEventTabPresenter.h" +#include "EventView.h" +#include "EventPresenter.h" namespace MantidQt { namespace CustomInterfaces { @@ -8,16 +8,16 @@ namespace CustomInterfaces { * @param group :: [input] The group on the parent tab this belongs to * @param parent :: [input] The parent of this widget */ -QtReflEventTabView::QtReflEventTabView(QWidget *parent) { +EventView::EventView(QWidget *parent) { UNUSED_ARG(parent); initLayout(); } -void QtReflEventTabView::subscribe(EventTabViewSubscriber *notifyee) { +void EventView::subscribe(EventTabViewSubscriber *notifyee) { m_notifyee = notifyee; } -void QtReflEventTabView::initLayout() { +void EventView::initLayout() { m_ui.setupUi(this); initUniformSliceTypeLayout(); initUniformEvenSliceTypeLayout(); @@ -31,7 +31,7 @@ void QtReflEventTabView::initLayout() { m_ui.customButton, m_ui.disabledSlicingButton); } -void QtReflEventTabView::initUniformSliceTypeLayout() { +void EventView::initUniformSliceTypeLayout() { m_uniformGroup = makeQWidgetGroup(m_ui.uniformEdit, m_ui.uniformLabel); connect(m_ui.uniformButton, SIGNAL(toggled(bool)), this, SLOT(toggleUniform(bool))); @@ -49,42 +49,42 @@ void QtReflEventTabView::initUniformSliceTypeLayout() { SLOT(onLogValueTypeChanged(QString const &))); } -void QtReflEventTabView::onUniformEvenChanged(int numberOfSlices) { +void EventView::onUniformEvenChanged(int numberOfSlices) { m_notifyee->notifyUniformSliceCountChanged(numberOfSlices); } -void QtReflEventTabView::onUniformSecondsChanged(double numberOfSeconds) { +void EventView::onUniformSecondsChanged(double numberOfSeconds) { m_notifyee->notifyUniformSecondsChanged(numberOfSeconds); } -void QtReflEventTabView::onCustomChanged(QString const &listOfSlices) { +void EventView::onCustomChanged(QString const &listOfSlices) { m_notifyee->notifyCustomSliceValuesChanged(listOfSlices.toStdString()); } -void QtReflEventTabView::onLogValuesChanged( +void EventView::onLogValuesChanged( QString const &listOfSliceBreakpoints) { m_notifyee->notifyLogSliceBreakpointsChanged( listOfSliceBreakpoints.toStdString()); } -void QtReflEventTabView::onLogValueTypeChanged(QString const &logBlockName) { +void EventView::onLogValueTypeChanged(QString const &logBlockName) { m_notifyee->notifyLogBlockNameChanged(logBlockName.toStdString()); } -void QtReflEventTabView::initUniformEvenSliceTypeLayout() { +void EventView::initUniformEvenSliceTypeLayout() { m_uniformEvenGroup = makeQWidgetGroup(m_ui.uniformEvenEdit, m_ui.uniformEvenLabel); connect(m_ui.uniformEvenButton, SIGNAL(toggled(bool)), this, SLOT(toggleUniformEven(bool))); } -void QtReflEventTabView::initCustomSliceTypeLayout() { +void EventView::initCustomSliceTypeLayout() { m_customGroup = makeQWidgetGroup(m_ui.customEdit, m_ui.customLabel); connect(m_ui.customButton, SIGNAL(toggled(bool)), this, SLOT(toggleCustom(bool))); } -void QtReflEventTabView::initLogValueSliceTypeLayout() { +void EventView::initLogValueSliceTypeLayout() { m_logValueGroup = makeQWidgetGroup(m_ui.logValueTypeEdit, m_ui.logValueTypeLabel, m_ui.logValueEdit, m_ui.logValueLabel); @@ -92,7 +92,7 @@ void QtReflEventTabView::initLogValueSliceTypeLayout() { SLOT(toggleLogValue(bool))); } -void QtReflEventTabView::enableSliceType(SliceType sliceType) { +void EventView::enableSliceType(SliceType sliceType) { switch (sliceType) { case SliceType::Uniform: m_uniformGroup.enable(); @@ -111,7 +111,7 @@ void QtReflEventTabView::enableSliceType(SliceType sliceType) { } } -void QtReflEventTabView::disableSliceType(SliceType sliceType) { +void EventView::disableSliceType(SliceType sliceType) { switch (sliceType) { case SliceType::Uniform: m_uniformGroup.disable(); @@ -130,15 +130,15 @@ void QtReflEventTabView::disableSliceType(SliceType sliceType) { } } -std::string QtReflEventTabView::logBlockName() const { +std::string EventView::logBlockName() const { return textFrom(m_ui.logValueTypeEdit); } -std::string QtReflEventTabView::logBreakpoints() const { +std::string EventView::logBreakpoints() const { return textFrom(m_ui.logValueEdit); } -std::string QtReflEventTabView::customBreakpoints() const { +std::string EventView::customBreakpoints() const { return textFrom(m_ui.customEdit); } @@ -154,63 +154,63 @@ void showAsValid(QLineEdit &lineEdit) { lineEdit.setPalette(palette); } -void QtReflEventTabView::showCustomBreakpointsInvalid() { +void EventView::showCustomBreakpointsInvalid() { showAsInvalid(*m_ui.customEdit); } -void QtReflEventTabView::showCustomBreakpointsValid() { +void EventView::showCustomBreakpointsValid() { showAsValid(*m_ui.customEdit); } -void QtReflEventTabView::showLogBreakpointsInvalid() { +void EventView::showLogBreakpointsInvalid() { showAsInvalid(*m_ui.logValueEdit); } -void QtReflEventTabView::showLogBreakpointsValid() { +void EventView::showLogBreakpointsValid() { showAsValid(*m_ui.logValueEdit); } -int QtReflEventTabView::uniformSliceCount() const { +int EventView::uniformSliceCount() const { return m_ui.uniformEvenEdit->value(); } -double QtReflEventTabView::uniformSliceLength() const { +double EventView::uniformSliceLength() const { return m_ui.uniformEdit->value(); } -std::string QtReflEventTabView::textFrom(QLineEdit const *const widget) const { +std::string EventView::textFrom(QLineEdit const *const widget) const { return widget->text().toStdString(); } -void QtReflEventTabView::disableSliceTypeSelection() { +void EventView::disableSliceTypeSelection() { m_sliceTypeRadioButtons.disable(); } -void QtReflEventTabView::enableSliceTypeSelection() { +void EventView::enableSliceTypeSelection() { m_sliceTypeRadioButtons.enable(); } -void QtReflEventTabView::toggleUniform(bool isChecked) { +void EventView::toggleUniform(bool isChecked) { if (isChecked) m_notifyee->notifySliceTypeChanged(SliceType::Uniform); } -void QtReflEventTabView::toggleUniformEven(bool isChecked) { +void EventView::toggleUniformEven(bool isChecked) { if (isChecked) m_notifyee->notifySliceTypeChanged(SliceType::UniformEven); } -void QtReflEventTabView::toggleCustom(bool isChecked) { +void EventView::toggleCustom(bool isChecked) { if (isChecked) m_notifyee->notifySliceTypeChanged(SliceType::Custom); } -void QtReflEventTabView::toggleLogValue(bool isChecked) { +void EventView::toggleLogValue(bool isChecked) { if (isChecked) m_notifyee->notifySliceTypeChanged(SliceType::LogValue); } -void QtReflEventTabView::toggleDisabledSlicing(bool isChecked) { +void EventView::toggleDisabledSlicing(bool isChecked) { if (isChecked) m_notifyee->notifySliceTypeChanged(SliceType::None); } diff --git a/qt/scientific_interfaces/ISISReflectometry/QtReflEventTabView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventView.h similarity index 92% rename from qt/scientific_interfaces/ISISReflectometry/QtReflEventTabView.h rename to qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventView.h index 5d934e8a27505436f5effc209fd0025ec016617f..f36191e8051764d7875f3682115a8f0605423101 100644 --- a/qt/scientific_interfaces/ISISReflectometry/QtReflEventTabView.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventView.h @@ -1,7 +1,7 @@ #ifndef MANTID_CUSTOMINTERFACES_QTREFLEVENTVIEW_H_ #define MANTID_CUSTOMINTERFACES_QTREFLEVENTVIEW_H_ -#include "IReflEventTabView.h" +#include "IEventView.h" #include "ui_ReflEventTabWidget.h" #include "QWidgetGroup.h" #include <memory> @@ -9,7 +9,7 @@ namespace MantidQt { namespace CustomInterfaces { -/** QtReflEventTabView : Provides an interface for the "Event Handling" widget +/** EventView : Provides an interface for the "Event Handling" widget in the ISIS Reflectometry interface. @@ -34,11 +34,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. File change history is stored at: <https://github.com/mantidproject/mantid> Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class QtReflEventTabView : public QWidget, public IReflEventTabView { +class EventView : public QWidget, public IEventView { Q_OBJECT public: /// Constructor - explicit QtReflEventTabView(QWidget *parent = nullptr); + explicit EventView(QWidget *parent = nullptr); /// Returns time-slicing values void initUniformSliceTypeLayout(); void initUniformEvenSliceTypeLayout(); diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflEventTabWidget.ui b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventWidget.ui similarity index 99% rename from qt/scientific_interfaces/ISISReflectometry/ReflEventTabWidget.ui rename to qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventWidget.ui index 7ab1c9f4eac5198178d4dfa1efb76fc9272e64bb..aecd9b7ff2fb313a29070b6fcfcb2cf413cad0a8 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflEventTabWidget.ui +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/EventWidget.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>ReflEventTabWidget</class> - <widget class="QWidget" name="ReflEventTabWidget"> + <class>EventWidget</class> + <widget class="QWidget" name="EventWidget"> <property name="geometry"> <rect> <x>0</x> diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflEventTabPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/IEventPresenter.h similarity index 84% rename from qt/scientific_interfaces/ISISReflectometry/IReflEventTabPresenter.h rename to qt/scientific_interfaces/ISISReflectometry/GUI/Event/IEventPresenter.h index b81d075b34dff11564a35a4e6a34358250ef173b..d65cd662c4941c8657df60629bd4f4b2ac40269d 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflEventTabPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/IEventPresenter.h @@ -2,12 +2,12 @@ #define MANTID_ISISREFLECTOMETRY_IREFLEVENTPRESENTER_H #include <string> -#include "IReflBatchPresenter.h" +#include "../../IReflBatchPresenter.h" namespace MantidQt { namespace CustomInterfaces { -/** @class IReflEventTabPresenter +/** @class IEventPresenter IReflEventPresenter is an interface which defines the functions that need to be implemented by a concrete 'Event' presenter @@ -36,13 +36,13 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> enum class SliceType { None, UniformEven, Uniform, Custom, LogValue }; -class IReflEventTabPresenter { +class IEventPresenter { public: - virtual ~IReflEventTabPresenter() = default; + virtual ~IEventPresenter() = default; /// Time-slicing values - virtual std::string getTimeSlicingValues() const = 0; - /// Time-slicing type - virtual std::string getTimeSlicingType() const = 0; +// virtual std::string getTimeSlicingValues() const = 0; +// /// Time-slicing type +// virtual std::string getTimeSlicingType() const = 0; virtual void acceptMainPresenter(IReflBatchPresenter *mainPresenter) =0; virtual void onReductionPaused() = 0; diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflEventTabView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/IEventView.h similarity index 88% rename from qt/scientific_interfaces/ISISReflectometry/IReflEventTabView.h rename to qt/scientific_interfaces/ISISReflectometry/GUI/Event/IEventView.h index e07a5828e36c6aaf22d5c6ee4b76bde29618a3a6..3bb1988b12de8eaab67d67a0b22af312c090cee8 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflEventTabView.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Event/IEventView.h @@ -1,16 +1,15 @@ #ifndef MANTID_ISISREFLECTOMETRY_IREFLEVENTVIEW_H #define MANTID_ISISREFLECTOMETRY_IREFLEVENTVIEW_H -#include "DllConfig.h" +#include "../../DllConfig.h" #include <string> -#include "IReflEventTabPresenter.h" +#include "IEventPresenter.h" namespace MantidQt { namespace CustomInterfaces { -/** @class IReflEventTabView - -IReflEventTabView is the base view class for the Reflectometry "Event Handling" +/** +IEventView is the base view class for the Reflectometry "Event Handling" tab. It contains no QT specific functionality as that should be handled by a subclass. @@ -47,10 +46,10 @@ public: virtual void notifyLogBlockNameChanged(std::string blockName) = 0; }; -class MANTIDQT_ISISREFLECTOMETRY_DLL IReflEventTabView { +class MANTIDQT_ISISREFLECTOMETRY_DLL IEventView { public: virtual void subscribe(EventTabViewSubscriber *notifyee) = 0; - virtual ~IReflEventTabView() = default; + virtual ~IEventView() = default; virtual std::string logBlockName() const = 0; virtual std::string logBreakpoints() const = 0; @@ -70,4 +69,4 @@ public: }; } } -#endif /* MANTID_ISISREFLECTOMETRY_IREFLEVENTVIEW_H */ +#endif // MANTID_ISISREFLECTOMETRY_IREFLEVENTVIEW_H diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ReflExperimentWidget.ui b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui similarity index 99% rename from qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ReflExperimentWidget.ui rename to qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui index 3cb4a09962c672789c48bac3e7cb88bd3bd1fd5f..f305fe0d5e816da24b5617c3641c5abda557b52c 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ReflExperimentWidget.ui +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>ReflExperimentWidget</class> - <widget class="QWidget" name="ReflExperimentWidget"> + <class>ExperimentWidget</class> + <widget class="QWidget" name="ExperimentWidget"> <property name="geometry"> <rect> <x>0</x> diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/ReflInstrumentWidget.ui b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentWidget.ui similarity index 99% rename from qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/ReflInstrumentWidget.ui rename to qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentWidget.ui index a58c46589024b960421dc31b3905f0f9ad37c920..c088028c5c3e614e2452d6975ddc385f8c772dd0 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/ReflInstrumentWidget.ui +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentWidget.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>ReflSettingsTabWidget</class> - <widget class="QWidget" name="ReflSettingsTabWidget"> + <class>InstrumentWidget</class> + <widget class="QWidget" name="InstrumentWidget"> <property name="geometry"> <rect> <x>0</x> diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/CMakeLists.txt b/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/CMakeLists.txt index d6779462f1bf23e16e88908dd52183216b400a07..4edf498168eeecdd40ed4cf756ca64df3a998aad 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/CMakeLists.txt +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/CMakeLists.txt @@ -6,7 +6,6 @@ set ( RUNS_TABLE_SRC_FILES RunsTableView.cpp IRunsTableView.h RunsTableView.h - PARENT_SCOPE ) # Include files aren't required, but this makes them appear in Visual Studio @@ -18,15 +17,22 @@ set ( RUNS_TABLE_INC_FILES RowLocation.h RunsTablePresenter.h RunsTablePresenterFactory.h - PARENT_SCOPE ) set ( RUNS_TABLE_MOC_FILES RunsTableView.h - PARENT_SCOPE ) set ( RUNS_TABLE_UI_FILES RunsTableView.ui - PARENT_SCOPE ) + +PREPEND( RUNS_TABLE_SRC_FILES GUI/RunsTable ${RUNS_TABLE_SRC_FILES}) +PREPEND( RUNS_TABLE_INC_FILES GUI/RunsTable ${RUNS_TABLE_INC_FILES}) +PREPEND( RUNS_TABLE_MOC_FILES GUI/RunsTable ${RUNS_TABLE_MOC_FILES}) +PREPEND( RUNS_TABLE_UI_FILES GUI/RunsTable ${RUNS_TABLE_UI_FILES}) + +set(RUNS_TABLE_SRC_FILES ${RUNS_TABLE_SRC_FILES} PARENT_SCOPE) +set(RUNS_TABLE_INC_FILES ${RUNS_TABLE_INC_FILES} PARENT_SCOPE) +set(RUNS_TABLE_MOC_FILES ${RUNS_TABLE_MOC_FILES} PARENT_SCOPE) +set(RUNS_TABLE_UI_FILES ${RUNS_TABLE_UI_FILES} PARENT_SCOPE) diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflBatchPresenter.h b/qt/scientific_interfaces/ISISReflectometry/IReflBatchPresenter.h index 30f66b1076c7e5f3021769e0891f40eaba99eb4b..0bd71dcf2c9c0c8f775f031f8699b2f301d91e2c 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflBatchPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflBatchPresenter.h @@ -65,17 +65,12 @@ public: getReductionOptions() const = 0; /// Post-processing virtual std::string getStitchOptions() const = 0; - /// Time-slicing values - virtual std::string getTimeSlicingValues() const = 0; - /// Time-slicing type - virtual std::string getTimeSlicingType() const = 0; + /// Set the instrument name virtual void setInstrumentName(const std::string &instName) const = 0; /// Data processing check for all groups virtual bool isProcessing() const = 0; - virtual bool requestClose() const = 0; - virtual void settingsChanged() = 0; }; } diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflBatchView.h b/qt/scientific_interfaces/ISISReflectometry/IReflBatchView.h index af68a20ca04ac8b81149d278c4a3b9701361e74b..b9b53e5a17418024668cc7bed314f288dc7d77a2 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflBatchView.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflBatchView.h @@ -4,7 +4,7 @@ #include <string> #include "IReflRunsTabView.h" #include "IReflSettingsTabView.h" -#include "IReflEventTabView.h" +#include "GUI/Event/IEventView.h" #include "IReflSaveTabView.h" namespace MantidQt { @@ -41,7 +41,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> class IReflBatchView { public: virtual IReflRunsTabView* runs() const = 0; - virtual IReflEventTabView* eventHandling() const = 0; + virtual IEventView* eventHandling() const = 0; virtual IReflSettingsTabView* settings() const = 0; virtual IReflSaveTabView* save() const = 0; virtual ~IReflBatchView() = default; diff --git a/qt/scientific_interfaces/ISISReflectometry/IReflSettingsTabView.h b/qt/scientific_interfaces/ISISReflectometry/IReflSettingsTabView.h index 42ab03ed79aeac0b877bdda3573a203420fd9285..4f4c1c1535e9a37de71aaf4b228096d3432971c4 100644 --- a/qt/scientific_interfaces/ISISReflectometry/IReflSettingsTabView.h +++ b/qt/scientific_interfaces/ISISReflectometry/IReflSettingsTabView.h @@ -16,7 +16,7 @@ namespace MantidQt { namespace CustomInterfaces { -/** @class IReflEventTabView +/** @class IEventView IReflSettingsView is the base view class for the Reflectometry settings. It contains no QT specific functionality as that should be handled by a subclass. diff --git a/qt/scientific_interfaces/ISISReflectometry/QtReflBatchView.cpp b/qt/scientific_interfaces/ISISReflectometry/QtReflBatchView.cpp index 60cf6eb178abd4d33632b2ff122e0638469dc2eb..87bc10d76fa5e1cf37f47a563aa08093145e30e8 100644 --- a/qt/scientific_interfaces/ISISReflectometry/QtReflBatchView.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/QtReflBatchView.cpp @@ -1,5 +1,5 @@ #include "QtReflBatchView.h" -#include "QtReflEventTabView.h" +#include "GUI/Event/EventView.h" #include "QtReflRunsTabView.h" #include "QtReflSaveTabView.h" #include "QtReflSettingsTabView.h" @@ -37,7 +37,7 @@ void QtReflBatchView::initLayout() { IReflRunsTabView *QtReflBatchView::runs() const { return m_runs.get(); } -IReflEventTabView *QtReflBatchView::eventHandling() const { +IEventView *QtReflBatchView::eventHandling() const { return m_eventHandling.get(); } @@ -54,8 +54,8 @@ std::unique_ptr<QtReflRunsTabView> QtReflBatchView::createRunsTab() { this, RunsTableViewFactory(instruments)); } -std::unique_ptr<QtReflEventTabView> QtReflBatchView::createEventTab() { - return Mantid::Kernel::make_unique<QtReflEventTabView>(this); +std::unique_ptr<EventView> QtReflBatchView::createEventTab() { + return Mantid::Kernel::make_unique<EventView>(this); } Mantid::API::IAlgorithm_sptr QtReflBatchView::createReductionAlg() { diff --git a/qt/scientific_interfaces/ISISReflectometry/QtReflBatchView.h b/qt/scientific_interfaces/ISISReflectometry/QtReflBatchView.h index 36572f646b55a9a1a275a792d2394bed68a1a5e8..71a4cbc2c672c8718582198611ef410c31785db1 100644 --- a/qt/scientific_interfaces/ISISReflectometry/QtReflBatchView.h +++ b/qt/scientific_interfaces/ISISReflectometry/QtReflBatchView.h @@ -6,7 +6,7 @@ #include "ui_ReflBatchWidget.h" #include <memory> #include "QtReflSaveTabView.h" -#include "QtReflEventTabView.h" +#include "GUI/Event/EventView.h" #include "QtReflSettingsTabView.h" #include "QtReflRunsTabView.h" #include "MantidAPI/IAlgorithm.h" @@ -45,7 +45,7 @@ public: void subscribe(IReflBatchPresenter *notifyee); IReflRunsTabView *runs() const override; - IReflEventTabView *eventHandling() const override; + IEventView *eventHandling() const override; IReflSettingsTabView *settings() const override; IReflSaveTabView *save() const override; @@ -54,14 +54,14 @@ private: Mantid::API::IAlgorithm_sptr createReductionAlg(); std::unique_ptr<QtReflRunsTabView> createRunsTab(); - std::unique_ptr<QtReflEventTabView> createEventTab(); + std::unique_ptr<EventView> createEventTab(); std::unique_ptr<QtReflSettingsTabView> createSettingsTab(); std::unique_ptr<QtReflSaveTabView> createSaveTab(); Ui::ReflBatchWidget m_ui; IReflBatchPresenter *m_notifyee; std::unique_ptr<QtReflRunsTabView> m_runs; - std::unique_ptr<QtReflEventTabView> m_eventHandling; + std::unique_ptr<EventView> m_eventHandling; std::unique_ptr<QtReflSettingsTabView> m_settings; std::unique_ptr<QtReflSaveTabView> m_save; }; diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/Slicing.cpp b/qt/scientific_interfaces/ISISReflectometry/Reduction/Slicing.cpp index e4bdba50a2f7ceee67949e63e77d7ba24a163ae1..d4288e239a58c2495bd65339426632a99b9f3494 100644 --- a/qt/scientific_interfaces/ISISReflectometry/Reduction/Slicing.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/Slicing.cpp @@ -7,16 +7,71 @@ namespace CustomInterfaces { UniformSlicingByTime::UniformSlicingByTime(double secondsPerSlice) : m_secondsPerSlice(secondsPerSlice) {} +double UniformSlicingByTime::sliceLengthInSeconds() const { + return m_secondsPerSlice; +} + +bool operator==(UniformSlicingByTime const &lhs, + UniformSlicingByTime const &rhs) { + return lhs.sliceLengthInSeconds() == rhs.sliceLengthInSeconds(); +} + +MANTIDQT_ISISREFLECTOMETRY_DLL bool isNoSlicing(Slicing const &slicing) { + return slicing.which() == 0; +} + +MANTIDQT_ISISREFLECTOMETRY_DLL bool isInvalid(Slicing const &slicing) { + return slicing.which() == 1; +} + +MANTIDQT_ISISREFLECTOMETRY_DLL bool isValid(Slicing const &slicing) { + return !isInvalid(slicing); +} + +MANTIDQT_ISISREFLECTOMETRY_DLL bool operator==(InvalidSlicing const &, + InvalidSlicing const &) { + return true; +} + UniformSlicingByNumberOfSlices::UniformSlicingByNumberOfSlices( int numberOfSlices) : m_numberOfSlices(numberOfSlices) {} +int UniformSlicingByNumberOfSlices::numberOfSlices() const { + return m_numberOfSlices; +} + +bool operator==(UniformSlicingByNumberOfSlices const &lhs, + UniformSlicingByNumberOfSlices const &rhs) { + return lhs.numberOfSlices() == rhs.numberOfSlices(); +} + CustomSlicingByList::CustomSlicingByList(std::vector<double> sliceTimes) : m_sliceTimes(std::move(sliceTimes)) {} +std::vector<double> const &CustomSlicingByList::sliceTimes() const { + return m_sliceTimes; +} + +bool operator==(CustomSlicingByList const &lhs, + CustomSlicingByList const &rhs) { + return lhs.sliceTimes() == rhs.sliceTimes(); +} + SlicingByEventLog::SlicingByEventLog(std::vector<double> sliceAtValues, std::string blockValue) : m_sliceAtValues(std::move(sliceAtValues)), m_blockName(std::move(blockValue)) {} + +std::vector<double> const &SlicingByEventLog::sliceAtValues() const { + return m_sliceAtValues; +} + +std::string const &SlicingByEventLog::blockName() const { return m_blockName; } + +bool operator==(SlicingByEventLog const &lhs, SlicingByEventLog const &rhs) { + return lhs.blockName() == rhs.blockName() && + lhs.sliceAtValues() == rhs.sliceAtValues(); +} } } diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/Slicing.h b/qt/scientific_interfaces/ISISReflectometry/Reduction/Slicing.h index cafde79a4882395d0f72c53ecedaa40ae6306566..67fff11a95e4772e3f2620344a107938bb72ef16 100644 --- a/qt/scientific_interfaces/ISISReflectometry/Reduction/Slicing.h +++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/Slicing.h @@ -25,46 +25,74 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> #include <boost/variant.hpp> #include <vector> #include <string> +#include "../DllConfig.h" namespace MantidQt { namespace CustomInterfaces { -class UniformSlicingByTime { +class MANTIDQT_ISISREFLECTOMETRY_DLL UniformSlicingByTime { public: explicit UniformSlicingByTime(double secondsPerSlice); + double sliceLengthInSeconds() const; private: double m_secondsPerSlice; }; -class UniformSlicingByNumberOfSlices { +MANTIDQT_ISISREFLECTOMETRY_DLL bool operator==(UniformSlicingByTime const &lhs, + UniformSlicingByTime const &rhs); + +class MANTIDQT_ISISREFLECTOMETRY_DLL UniformSlicingByNumberOfSlices { public: explicit UniformSlicingByNumberOfSlices(int numberOfSlices); + int numberOfSlices() const; private: int m_numberOfSlices; }; -class CustomSlicingByList { +MANTIDQT_ISISREFLECTOMETRY_DLL bool +operator==(UniformSlicingByNumberOfSlices const &lhs, + UniformSlicingByNumberOfSlices const &rhs); + +class MANTIDQT_ISISREFLECTOMETRY_DLL CustomSlicingByList { public: explicit CustomSlicingByList(std::vector<double> sliceTimes); + std::vector<double> const &sliceTimes() const; private: std::vector<double> m_sliceTimes; }; -class SlicingByEventLog { +MANTIDQT_ISISREFLECTOMETRY_DLL bool operator==(CustomSlicingByList const &lhs, + CustomSlicingByList const &rhs); + +class MANTIDQT_ISISREFLECTOMETRY_DLL SlicingByEventLog { public: SlicingByEventLog(std::vector<double> sliceAtValues, std::string blockValue); + std::vector<double> const &sliceAtValues() const; + std::string const &blockName() const; private: std::vector<double> m_sliceAtValues; std::string m_blockName; }; -using Slicing = boost::variant<boost::blank, UniformSlicingByTime, - UniformSlicingByNumberOfSlices, - CustomSlicingByList, SlicingByEventLog>; +MANTIDQT_ISISREFLECTOMETRY_DLL bool operator==(SlicingByEventLog const &lhs, + SlicingByEventLog const &rhs); + +class InvalidSlicing {}; +MANTIDQT_ISISREFLECTOMETRY_DLL bool operator==(InvalidSlicing const &lhs, + InvalidSlicing const &rhs); + +using Slicing = + boost::variant<boost::blank, InvalidSlicing, UniformSlicingByTime, + UniformSlicingByNumberOfSlices, CustomSlicingByList, + SlicingByEventLog>; + +MANTIDQT_ISISREFLECTOMETRY_DLL bool isInvalid(Slicing const &slicing); +MANTIDQT_ISISREFLECTOMETRY_DLL bool isValid(Slicing const &slicing); +MANTIDQT_ISISREFLECTOMETRY_DLL bool isNoSlicing(Slicing const &slicing); } } diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenter.cpp index d773f1c1c7a1a6122f6441319f154c4150d27c1b..645812655f636a5cb40c89c6cbf88846e540f418 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenter.cpp @@ -1,7 +1,7 @@ #include "ReflBatchPresenter.h" #include "IReflBatchView.h" #include "IReflRunsTabPresenter.h" -#include "IReflEventTabPresenter.h" +#include "GUI/Event/IEventPresenter.h" #include "IReflSettingsTabPresenter.h" #include "IReflSaveTabPresenter.h" #include "MantidQtWidgets/Common/HelpWindow.h" @@ -21,7 +21,7 @@ namespace CustomInterfaces { */ ReflBatchPresenter::ReflBatchPresenter( IReflBatchView *view, std::unique_ptr<IReflRunsTabPresenter> runsPresenter, - std::unique_ptr<IReflEventTabPresenter> eventPresenter, + std::unique_ptr<IEventPresenter> eventPresenter, std::unique_ptr<IReflSettingsTabPresenter> settingsPresenter, std::unique_ptr<IReflSaveTabPresenter> savePresenter) : m_view(view), m_runsPresenter(std::move(runsPresenter)), @@ -97,28 +97,6 @@ std::string ReflBatchPresenter::getStitchOptions() const { return m_settingsPresenter->getStitchOptions(); } -/** Returns time-slicing values -* -* @param group :: Index of the group in 'Event Handling' tab from which to get -*the values -* @return :: Time-slicing values -*/ -std::string ReflBatchPresenter::getTimeSlicingValues() const { - // Request global time-slicing values to 'Event Handling' presenter - return m_eventPresenter->getTimeSlicingValues(); -} - -/** Returns time-slicing type -* -* @param group :: Index of the group in 'Event Handling' tab from which to get -*the type -* @return :: Time-slicing type -*/ -std::string ReflBatchPresenter::getTimeSlicingType() const { - // Request time-slicing type to 'Event Handling' presenter - return m_eventPresenter->getTimeSlicingType(); -} - /** Returns default values specified for 'Transmission run(s)' for the * given angle * diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenter.h index e27efa33e9cb5768c6964c68821cbba384bdbf11..46062d0df679ce0169fc1a44d4b962711d9d9403 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenter.h @@ -10,7 +10,7 @@ namespace CustomInterfaces { class IReflBatchView; class IReflRunsTabPresenter; -class IReflEventTabPresenter; +class IEventPresenter; class IReflSettingsTabPresenter; class IReflSaveTabPresenter; @@ -46,7 +46,7 @@ public: /// Constructor ReflBatchPresenter(IReflBatchView *view, std::unique_ptr<IReflRunsTabPresenter> runsPresenter, - std::unique_ptr<IReflEventTabPresenter> eventPresenter, + std::unique_ptr<IEventPresenter> eventPresenter, std::unique_ptr<IReflSettingsTabPresenter> settingsPresenter, std::unique_ptr<IReflSaveTabPresenter> savePresenter); @@ -63,11 +63,6 @@ public: getReductionOptions() const override; /// Returns global options for 'Stitch1DMany' std::string getStitchOptions() const override; - /// Returns time-slicing values - std::string getTimeSlicingValues() const override; - /// Returns time-slicing type - std::string getTimeSlicingType() const override; - /// Set the instrument name void setInstrumentName(const std::string &instName) const override; @@ -95,7 +90,7 @@ private: /// The presenter of tab 'Runs' std::unique_ptr<IReflRunsTabPresenter> m_runsPresenter; /// The presenter of tab 'Event Handling' - std::unique_ptr<IReflEventTabPresenter> m_eventPresenter; + std::unique_ptr<IEventPresenter> m_eventPresenter; /// The presenter of tab 'Settings' std::unique_ptr<IReflSettingsTabPresenter> m_settingsPresenter; /// The presenter of tab 'Save ASCII' diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenterFactory.h b/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenterFactory.h index ef47c3f437f35fa386ec3cfbf9bb516564921bb5..630ee4c8e84e8fbc859597f2a5b541de6675d025 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenterFactory.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflBatchPresenterFactory.h @@ -6,7 +6,7 @@ #include "ReflRunsPresenterFactory.h" #include "ReflSavePresenterFactory.h" #include "ReflSettingsPresenterFactory.h" -#include "ReflEventPresenterFactory.h" +#include "GUI/Event/EventPresenterFactory.h" #include "ReflBatchPresenter.h" #include <memory> diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp index a0a85473411ae30be436fe5a50dc53f1fe9a37f6..8eeb4112174c65cf603f5f49bc290dae4aaa5678 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.cpp @@ -1,7 +1,7 @@ #include "ReflMainWindowPresenter.h" #include "IReflMainWindowView.h" #include "IReflRunsTabPresenter.h" -#include "IReflEventTabPresenter.h" +#include "GUI/Event/IEventPresenter.h" #include "IReflSettingsTabPresenter.h" #include "IReflSaveTabPresenter.h" #include "MantidQtWidgets/Common/HelpWindow.h" diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h index 502a0215c6d341ed31f8a4c9d738fa3fd24a353f..63a7989bc051d45cc7ef1c252b5437404305eb7c 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflMainWindowPresenter.h @@ -11,7 +11,7 @@ namespace CustomInterfaces { class IReflMainWindowView; class IReflRunsTabPresenter; -class IReflEventTabPresenter; +class IEventPresenter; class IReflSettingsTabPresenter; class IReflSaveTabPresenter; diff --git a/qt/scientific_interfaces/ISISReflectometry/ReflRunsPresenterFactory.h b/qt/scientific_interfaces/ISISReflectometry/ReflRunsPresenterFactory.h index 91030abcfea4fa3d4905f141bb5160f8fa038e52..1a1a822d30f358863b66e1adce56b2489900f509 100644 --- a/qt/scientific_interfaces/ISISReflectometry/ReflRunsPresenterFactory.h +++ b/qt/scientific_interfaces/ISISReflectometry/ReflRunsPresenterFactory.h @@ -1,7 +1,7 @@ #ifndef MANTID_ISISREFLECTOMETRY_REFLRUNSPRESENTERFACTORY_H #define MANTID_ISISREFLECTOMETRY_REFLRUNSPRESENTERFACTORY_H #include "DllConfig.h" -#include "IReflEventTabPresenter.h" +#include "GUI/Event/IEventPresenter.h" #include "IReflRunsTabPresenter.h" #include "IReflRunsTabView.h" #include "ReflRunsTabPresenter.h" diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Event/EventPresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/Event/EventPresenterTest.h new file mode 100644 index 0000000000000000000000000000000000000000..d1f8692cf5e52d5cae8bb5e0a9d369a795930524 --- /dev/null +++ b/qt/scientific_interfaces/test/ISISReflectometry/Event/EventPresenterTest.h @@ -0,0 +1,174 @@ +#ifndef MANTID_CUSTOMINTERFACES_REFLEVENTPRESENTERTEST_H_ +#define MANTID_CUSTOMINTERFACES_REFLEVENTPRESENTERTEST_H_ + +#include "MockEventView.h" +#include "../../../ISISReflectometry/GUI/Event/EventPresenter.h" +#include <cxxtest/TestSuite.h> +#include <gmock/gmock.h> +#include <gtest/gtest.h> + +using namespace MantidQt::CustomInterfaces; +using testing::Return; +using testing::Mock; +using testing::NiceMock; + +class EventPresenterTest : public CxxTest::TestSuite { +public: + static EventPresenterTest *createSuite() { return new EventPresenterTest(); } + static void destroySuite(EventPresenterTest *suite) { delete suite; } + + EventPresenterTest() : m_view() {} + + EventPresenter makePresenter() { return EventPresenter(&m_view); } + + bool verifyAndClear() { + return Mock::VerifyAndClearExpectations(&m_view); + } + + void testNoEventSlicingByDefault() { + auto presenter = makePresenter(); + TS_ASSERT(isNoSlicing(presenter.slicing())); + TS_ASSERT(verifyAndClear()); + } + + void testInitializesWithStateFromViewWhenChangingToUniformSlicingByTime() { + auto presenter = makePresenter(); + auto const secondsPerSlice = 10.0; + + EXPECT_CALL(m_view, uniformSliceLength()).WillOnce(Return(secondsPerSlice)); + + presenter.notifySliceTypeChanged(SliceType::Uniform); + auto const &uniformSlicingByTime = + boost::get<UniformSlicingByTime>(presenter.slicing()); + TS_ASSERT(uniformSlicingByTime == UniformSlicingByTime(secondsPerSlice)); + TS_ASSERT(verifyAndClear()); + } + + void + testInitializesWithStateFromViewWhenChangingToUniformSlicingByNumberOfSlices() { + auto presenter = makePresenter(); + auto const numberOfSlices = 11; + + EXPECT_CALL(m_view, uniformSliceCount()).WillOnce(Return(numberOfSlices)); + + presenter.notifySliceTypeChanged(SliceType::UniformEven); + auto const &uniformSlicingByNumberOfSlices = + boost::get<UniformSlicingByNumberOfSlices>(presenter.slicing()); + TS_ASSERT(uniformSlicingByNumberOfSlices == + UniformSlicingByNumberOfSlices(numberOfSlices)); + TS_ASSERT(verifyAndClear()); + } + + void testInitializesWithStateFromViewWhenChangingToCustomSlicing() { + auto presenter = makePresenter(); + auto const expectedSliceTimes = + std::vector<double>({11.0, 12.0, 33.0, 23.2}); + auto const sliceTimeList = std::string("11, 12,33, 23.2"); + + EXPECT_CALL(m_view, customBreakpoints()).WillOnce(Return(sliceTimeList)); + + presenter.notifySliceTypeChanged(SliceType::Custom); + auto const &sliceTimes = + boost::get<CustomSlicingByList>(presenter.slicing()); + TS_ASSERT(sliceTimes == CustomSlicingByList(expectedSliceTimes)); + TS_ASSERT(verifyAndClear()); + } + + void testInitializedWithStateFromViewWhenChangingToSlicingByEventLog() { + auto presenter = makePresenter(); + auto const logBlockName = std::string("Param"); + auto const expectedSliceValues = + std::vector<double>({11.0, 0.1, 12.0, 33.0, 23.2}); + auto const sliceValuesList = std::string("11,0.1, 12,33, 23.2"); + + EXPECT_CALL(m_view, logBreakpoints()).WillOnce(Return(sliceValuesList)); + EXPECT_CALL(m_view, logBlockName()).WillOnce(Return(logBlockName)); + + presenter.notifySliceTypeChanged(SliceType::LogValue); + auto const &sliceValues = + boost::get<SlicingByEventLog>(presenter.slicing()); + TS_ASSERT(sliceValues == + SlicingByEventLog(expectedSliceValues, logBlockName)); + TS_ASSERT(verifyAndClear()); + } + + void testChangingSliceCountUpdatesModel() { + auto presenter = makePresenter(); + auto const expectedSliceCount = 10; + + EXPECT_CALL(m_view, uniformSliceCount()) + .WillOnce(Return(0)) + .WillOnce(Return(expectedSliceCount)); + + presenter.notifySliceTypeChanged(SliceType::UniformEven); + presenter.notifyUniformSliceCountChanged(expectedSliceCount); + auto const &sliceValues = + boost::get<UniformSlicingByNumberOfSlices>(presenter.slicing()); + TS_ASSERT(sliceValues == + UniformSlicingByNumberOfSlices(expectedSliceCount)); + TS_ASSERT(verifyAndClear()); + } + + void testViewUpdatedWhenInvalidSliceValuesEntered() { + auto presenter = makePresenter(); + auto const invalidCustomBreakpoints = std::string("1,"); + + EXPECT_CALL(m_view, customBreakpoints()) + .WillOnce(Return("1")) + .WillOnce(Return(invalidCustomBreakpoints)); + + presenter.notifySliceTypeChanged(SliceType::Custom); + + EXPECT_CALL(m_view, showCustomBreakpointsInvalid()); + presenter.notifyCustomSliceValuesChanged(invalidCustomBreakpoints); + TS_ASSERT(verifyAndClear()); + } + + void testModelUpdatedWhenInvalidSliceValuesEntered() { + auto presenter = makePresenter(); + auto const invalidCustomBreakpoints = std::string("1,"); + + EXPECT_CALL(m_view, customBreakpoints()) + .WillOnce(Return("1")) + .WillOnce(Return(invalidCustomBreakpoints)); + + presenter.notifySliceTypeChanged(SliceType::Custom); + presenter.notifyCustomSliceValuesChanged(invalidCustomBreakpoints); + auto const &slicing = boost::get<InvalidSlicing>(presenter.slicing()); + TS_ASSERT(slicing == InvalidSlicing()); + TS_ASSERT(verifyAndClear()); + } + + void testModelUpdatedWhenInvalidSliceValuesCorrected() { + auto presenter = makePresenter(); + auto const validCustomBreakpoints = std::string("1"); + + EXPECT_CALL(m_view, customBreakpoints()) + .WillOnce(Return("1,")) + .WillOnce(Return(validCustomBreakpoints)); + + presenter.notifySliceTypeChanged(SliceType::Custom); + presenter.notifyCustomSliceValuesChanged(validCustomBreakpoints); + TS_ASSERT(!isInvalid(presenter.slicing())); + TS_ASSERT(verifyAndClear()); + } + + void testViewUpdatedWhenInvalidSliceValuesCorrected() { + auto presenter = makePresenter(); + auto const validCustomBreakpoints = std::string("1"); + + EXPECT_CALL(m_view, customBreakpoints()) + .WillOnce(Return("1,")) + .WillOnce(Return(validCustomBreakpoints)); + + presenter.notifySliceTypeChanged(SliceType::Custom); + + EXPECT_CALL(m_view, showCustomBreakpointsValid()); + presenter.notifyCustomSliceValuesChanged(validCustomBreakpoints); + TS_ASSERT(verifyAndClear()); + } + +private: + MockEventView m_view; +}; +#endif // MANTID_CUSTOMINTERFACES_REFLEVENTPRESENTERTEST_H_ diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Event/MockEventView.h b/qt/scientific_interfaces/test/ISISReflectometry/Event/MockEventView.h new file mode 100644 index 0000000000000000000000000000000000000000..f41c28f70ce55c93754759e1b7881217610a6db3 --- /dev/null +++ b/qt/scientific_interfaces/test/ISISReflectometry/Event/MockEventView.h @@ -0,0 +1,32 @@ +#include "../../../ISISReflectometry/GUI/Event/IEventView.h" +#include <gmock/gmock.h> +#include "MantidKernel/WarningSuppressions.h" + +GCC_DIAG_OFF_SUGGEST_OVERRIDE + +namespace MantidQt { +namespace CustomInterfaces { + +class MockEventView : public IEventView { +public: + MOCK_METHOD1(subscribe, void(EventTabViewSubscriber *)); + + MOCK_CONST_METHOD0(logBlockName, std::string()); + MOCK_CONST_METHOD0(logBreakpoints, std::string()); + MOCK_CONST_METHOD0(customBreakpoints, std::string()); + MOCK_CONST_METHOD0(uniformSliceCount, int()); + MOCK_CONST_METHOD0(uniformSliceLength, double()); + + MOCK_METHOD0(showCustomBreakpointsInvalid, void()); + MOCK_METHOD0(showCustomBreakpointsValid, void()); + MOCK_METHOD0(showLogBreakpointsInvalid, void()); + MOCK_METHOD0(showLogBreakpointsValid, void()); + + MOCK_METHOD1(enableSliceType, void(SliceType)); + MOCK_METHOD1(disableSliceType, void(SliceType)); + MOCK_METHOD0(enableSliceTypeSelection, void()); + MOCK_METHOD0(disableSliceTypeSelection, void()); +}; +} +} +GCC_DIAG_ON_SUGGEST_OVERRIDE diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/MockRunsTableView.h b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/MockRunsTableView.h similarity index 87% rename from qt/scientific_interfaces/test/ISISReflectometry/Presenters/MockRunsTableView.h rename to qt/scientific_interfaces/test/ISISReflectometry/RunsTable/MockRunsTableView.h index 21212779b6c6592f6c26008ebdb512a998408421..c34d8e0a5dba018773e29101494519de893b04eb 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/MockRunsTableView.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/MockRunsTableView.h @@ -1,7 +1,6 @@ #ifndef MANTID_CUSTOMINTERFACES_MOCKRUNSTABLEVIEW_H_ #define MANTID_CUSTOMINTERFACES_MOCKRUNSTABLEVIEW_H_ -#include "DllConfig.h" -#include "Views/IRunsTableView.h" +#include "../../../ISISReflectometry/GUI/RunsTable/IRunsTableView.h" #include <gmock/gmock.h> #include "MantidQtWidgets/Common/Batch/MockJobTreeView.h" #include "MantidKernel/WarningSuppressions.h" @@ -11,7 +10,7 @@ GCC_DIAG_OFF_SUGGEST_OVERRIDE namespace MantidQt { namespace CustomInterfaces { -class MANTIDQT_ISISREFLECTOMETRY_DLL MockRunsTableView : public IRunsTableView { +class MockRunsTableView : public IRunsTableView { public: MOCK_METHOD1(subscribe, void(RunsTableViewSubscriber *)); MOCK_METHOD1(setProgress, void(int)); diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterGroupDeletionTest.h b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterGroupDeletionTest.h similarity index 97% rename from qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterGroupDeletionTest.h rename to qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterGroupDeletionTest.h index 6bda978e68e65c48fe1ac608546f38ab22d36a29..fcd271d6e690e3155124512166fa067cddb7eded 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterGroupDeletionTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterGroupDeletionTest.h @@ -1,7 +1,7 @@ #ifndef MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERGROUPDELETETEST_H_ #define MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERGROUPDELETETEST_H_ -#include "../../../ISISReflectometry/Presenters/RunsTablePresenter.h" +#include "../../../ISISReflectometry/GUI/RunsTable/RunsTablePresenter.h" #include "../../../ISISReflectometry/Reduction/ReductionWorkspaces.h" #include "RunsTablePresenterTest.h" diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterGroupInsertionTest.h b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterGroupInsertionTest.h similarity index 98% rename from qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterGroupInsertionTest.h rename to qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterGroupInsertionTest.h index a4437ecb7893a698f2f8a17b248b55e9bf67d2be..6cc88c50e50bceb4f7071469865105d889212a0d 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterGroupInsertionTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterGroupInsertionTest.h @@ -1,7 +1,7 @@ #ifndef MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERGROUPINSERTTEST_H_ #define MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERGROUPINSERTTEST_H_ -#include "../../../ISISReflectometry/Presenters/RunsTablePresenter.h" +#include "../../../ISISReflectometry/GUI/RunsTable/RunsTablePresenter.h" #include "RunsTablePresenterTest.h" #include <cxxtest/TestSuite.h> diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterRowDeletionTest.h b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterRowDeletionTest.h similarity index 97% rename from qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterRowDeletionTest.h rename to qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterRowDeletionTest.h index b3a2a138f6304c2334f55b2194b061f4551543c9..006acc86ab1c3526665981ec7a0c9921c9883f3e 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterRowDeletionTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterRowDeletionTest.h @@ -1,7 +1,7 @@ #ifndef MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERGROUPDELETETEST_H_ #define MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERGROUPDELETETEST_H_ -#include "../../../ISISReflectometry/Presenters/RunsTablePresenter.h" +#include "../../../ISISReflectometry/GUI/RunsTable/RunsTablePresenter.h" #include "../../../ISISReflectometry/Reduction/ReductionWorkspaces.h" #include "RunsTablePresenterTest.h" diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterRowInsertionTest.h b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterRowInsertionTest.h similarity index 97% rename from qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterRowInsertionTest.h rename to qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterRowInsertionTest.h index 8810be484b47227601c05b5b7bb058fb572c33db..b6441104d1152c927db502a891a0d288ba4cc593 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterRowInsertionTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterRowInsertionTest.h @@ -1,7 +1,7 @@ #ifndef MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERGROUPINSERTTEST_H_ #define MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERGROUPINSERTTEST_H_ -#include "../../../ISISReflectometry/Presenters/RunsTablePresenter.h" +#include "../../../ISISReflectometry/GUI/RunsTable/RunsTablePresenter.h" #include "RunsTablePresenterTest.h" #include <cxxtest/TestSuite.h> diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterTest.h similarity index 98% rename from qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterTest.h rename to qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterTest.h index 12392206203e70f5345d8d7b35c2b378669cf6db..f3c77adec494420f5f4d536bfa60b8777bb3405d 100644 --- a/qt/scientific_interfaces/test/ISISReflectometry/Presenters/RunsTablePresenterTest.h +++ b/qt/scientific_interfaces/test/ISISReflectometry/RunsTable/RunsTablePresenterTest.h @@ -1,7 +1,7 @@ #ifndef MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERTEST_H_ #define MANTID_CUSTOMINTERFACES_REFLRUNSTABLEPRESENTERTEST_H_ -#include "../../../ISISReflectometry/Presenters/RunsTablePresenter.h" +#include "../../../ISISReflectometry/GUI/RunsTable/RunsTablePresenter.h" #include "../../../ISISReflectometry/Reduction/Slicing.h" #include "MockRunsTableView.h" #include "MantidQtWidgets/Common/Batch/MockJobTreeView.h" diff --git a/qt/scientific_interfaces/test/ReflMockObjects.h b/qt/scientific_interfaces/test/ReflMockObjects.h index 2701d002267816d4467c48ff8eb8d7c7f193b657..66f6a8ba668ad88c83d3211f92803794862c7919 100644 --- a/qt/scientific_interfaces/test/ReflMockObjects.h +++ b/qt/scientific_interfaces/test/ReflMockObjects.h @@ -3,8 +3,8 @@ #include "../ISISReflectometry/ExperimentOptionDefaults.h" #include "../ISISReflectometry/IReflAsciiSaver.h" -#include "../ISISReflectometry/IReflEventTabPresenter.h" -#include "../ISISReflectometry/IReflEventTabView.h" +#include "../ISISReflectometry/IEventPresenter.h" +#include "../ISISReflectometry/IEventView.h" #include "../ISISReflectometry/IReflMainWindowPresenter.h" #include "../ISISReflectometry/IReflMainWindowView.h" #include "../ISISReflectometry/IReflRunsTabPresenter.h" @@ -235,7 +235,7 @@ class MockEventPresenter : public IReflEventPresenter { public: MOCK_CONST_METHOD0(getTimeSlicingValues, std::string()); MOCK_CONST_METHOD0(getTimeSlicingType, std::string()); - MOCK_METHOD1(acceptTabPresenter, void(IReflEventTabPresenter *)); + MOCK_METHOD1(acceptTabPresenter, void(IEventPresenter *)); MOCK_METHOD0(onReductionPaused, void()); MOCK_METHOD0(onReductionResumed, void()); MOCK_METHOD1(notifySliceTypeChanged, void(SliceType)); @@ -243,7 +243,7 @@ public: ~MockEventPresenter() override{}; }; -class MockEventTabPresenter : public IReflEventTabPresenter { +class MockEventTabPresenter : public IEventPresenter { public: std::string getTimeSlicingValues(int) const override { return std::string(); } std::string getTimeSlicingType(int) const override { return std::string(); }