Skip to content
Snippets Groups Projects
Commit 6b34481f authored by Gemma Guest's avatar Gemma Guest
Browse files

Reorganise files into subdirectories

MainWindow and Batch subdirectories have been created for these GUI components.
A Common subdirectory has been created for miscellaneous shared utilities.
Unused files have been removed
parent 3812eaa8
No related merge requests found
Showing
with 137 additions and 58 deletions
......@@ -7,7 +7,7 @@
#ifndef MANTID_ISISREFLECTOMETRY_EXPERIMENTPRESENTERFACTORY_H
#define MANTID_ISISREFLECTOMETRY_EXPERIMENTPRESENTERFACTORY_H
#include "../../Reduction/Experiment.h"
#include "DllConfig.h"
#include "Common/DllConfig.h"
#include "ExperimentPresenter.h"
#include "IExperimentPresenter.h"
#include "IExperimentView.h"
......
......@@ -7,7 +7,7 @@
#ifndef MANTID_CUSTOMINTERFACES_EXPERIMENTVIEW_H_
#define MANTID_CUSTOMINTERFACES_EXPERIMENTVIEW_H_
#include "DllConfig.h"
#include "Common/DllConfig.h"
#include "IExperimentView.h"
#include "MantidQtWidgets/Common/HintingLineEdit.h"
#include "ui_ExperimentWidget.h"
......
......@@ -7,7 +7,7 @@
#ifndef MANTID_ISISREFLECTOMETRY_IEXPERIMENTPRESENTER_H
#define MANTID_ISISREFLECTOMETRY_IEXPERIMENTPRESENTER_H
#include "../../IReflBatchPresenter.h"
#include "GUI/Batch/IBatchPresenter.h"
#include <string>
namespace MantidQt {
......@@ -16,7 +16,7 @@ class IExperimentPresenter {
public:
virtual ~IExperimentPresenter() = default;
virtual void acceptMainPresenter(IReflBatchPresenter *mainPresenter) = 0;
virtual void acceptMainPresenter(IBatchPresenter *mainPresenter) = 0;
virtual void reductionPaused() = 0;
virtual void reductionResumed() = 0;
virtual void autoreductionPaused() = 0;
......
......@@ -7,9 +7,9 @@
#ifndef MANTID_ISISREFLECTOMETRY_IEXPERIMENTVIEW_H
#define MANTID_ISISREFLECTOMETRY_IEXPERIMENTVIEW_H
#include "DllConfig.h"
#include "GetInstrumentParameter.h"
#include "InstrumentParameters.h"
#include "Common/DllConfig.h"
#include "Common/GetInstrumentParameter.h"
#include "Common/InstrumentParameters.h"
#include "MantidAPI/Algorithm.h"
#include "MantidQtWidgets/Common/DataProcessorUI/OptionsQMap.h"
#include "MantidQtWidgets/Common/Hint.h"
......@@ -21,9 +21,10 @@ namespace CustomInterfaces {
/** @class IExperimentView
IExperimentView is the base view class for the Reflectometry experiment
settings. It
contains no QT specific functionality as that should be handled by a subclass.
IExperimentView is the base view class for the Reflectometry experiment
settings. It
contains no QT specific functionality as that should be handled by a
subclass.
*/
class MANTIDQT_ISISREFLECTOMETRY_DLL ExperimentViewSubscriber {
......
......@@ -6,7 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_ISISREFLECTOMETRY_INVALIDDEFAULTSERROR_H
#define MANTID_ISISREFLECTOMETRY_INVALIDDEFAULTSERROR_H
#include "../../DllConfig.h"
#include "Common/DllConfig.h"
#include <vector>
namespace MantidQt {
......
......@@ -6,8 +6,8 @@
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_ISISREFLECTOMETRY_PERTHETADEFAULTSTABLEVALIDATOR_H
#define MANTID_ISISREFLECTOMETRY_PERTHETADEFAULTSTABLEVALIDATOR_H
#include "../../Reduction/PerThetaDefaults.h"
#include "../../ValidationResult.h"
#include "Common/ValidationResult.h"
#include "Reduction/PerThetaDefaults.h"
#include "PerThetaDefaultsTableValidationError.h"
#include <array>
......
set ( INSTRUMENT_SRC_FILES
InstrumentView.cpp
InstrumentPresenter.cpp
InstrumentOptionDefaults.cpp
)
# Include files aren't required, but this makes them appear in Visual Studio
......@@ -11,6 +12,7 @@ set ( INSTRUMENT_INC_FILES
IInstrumentView.h
InstrumentView.h
InstrumentPresenter.h
InstrumentOptionDefaults.h
)
set ( INSTRUMENT_MOC_FILES
......
......@@ -12,7 +12,7 @@
namespace MantidQt {
namespace CustomInterfaces {
class IReflBatchPresenter;
class IBatchPresenter;
/** @class IInstrumentPresenter
......@@ -23,7 +23,7 @@ class IInstrumentPresenter {
public:
virtual ~IInstrumentPresenter() = default;
virtual void acceptMainPresenter(IReflBatchPresenter *mainPresenter) = 0;
virtual void acceptMainPresenter(IBatchPresenter *mainPresenter) = 0;
virtual void reductionPaused() = 0;
virtual void reductionResumed() = 0;
virtual void autoreductionPaused() = 0;
......
......@@ -7,8 +7,8 @@
#ifndef MANTID_ISISREFLECTOMETRY_IINSTRUMENTVIEW_H
#define MANTID_ISISREFLECTOMETRY_IINSTRUMENTVIEW_H
#include "DllConfig.h"
#include "InstrumentParameters.h"
#include "Common/DllConfig.h"
#include "Common/InstrumentParameters.h"
#include "MantidAPI/Algorithm.h"
namespace MantidQt {
......
......@@ -5,7 +5,7 @@
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "InstrumentOptionDefaults.h"
#include "ValueOr.h"
#include "Common/ValueOr.h"
namespace MantidQt {
namespace CustomInterfaces {
......
......@@ -6,7 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_ISISREFLECTOMETRY_INSTRUMENTOPTIONDEFAULTS_H
#define MANTID_ISISREFLECTOMETRY_INSTRUMENTOPTIONDEFAULTS_H
#include "DllConfig.h"
#include "Common/DllConfig.h"
#include "MantidGeometry/Instrument.h"
#include <boost/optional.hpp>
#include <boost/variant.hpp>
......
......@@ -5,7 +5,7 @@
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "InstrumentPresenter.h"
#include "IReflBatchPresenter.h"
#include "GUI/Batch/IBatchPresenter.h"
namespace MantidQt {
namespace CustomInterfaces {
......@@ -26,8 +26,7 @@ InstrumentPresenter::InstrumentPresenter(IInstrumentView *view,
m_view->subscribe(this);
}
void InstrumentPresenter::acceptMainPresenter(
IReflBatchPresenter *mainPresenter) {
void InstrumentPresenter::acceptMainPresenter(IBatchPresenter *mainPresenter) {
m_mainPresenter = mainPresenter;
notifySettingsChanged();
}
......
......@@ -7,7 +7,7 @@
#ifndef MANTID_ISISREFLECTOMETRY_INSTRUMENTPRESENTER_H
#define MANTID_ISISREFLECTOMETRY_INSTRUMENTPRESENTER_H
#include "../../DllConfig.h"
#include "Common/DllConfig.h"
#include "../../Reduction/Instrument.h"
#include "IInstrumentPresenter.h"
#include "IInstrumentView.h"
......@@ -30,7 +30,7 @@ public:
Instrument const &instrument() const;
// IInstrumentPresenver overrides
void acceptMainPresenter(IReflBatchPresenter *mainPresenter) override;
void acceptMainPresenter(IBatchPresenter *mainPresenter) override;
void reductionPaused() override;
void reductionResumed() override;
void autoreductionPaused() override;
......@@ -43,7 +43,7 @@ public:
private:
IInstrumentView *m_view;
Instrument m_model;
IReflBatchPresenter *m_mainPresenter;
IBatchPresenter *m_mainPresenter;
boost::optional<RangeInLambda> wavelengthRangeFromView();
boost::optional<RangeInLambda> monitorBackgroundRangeFromView();
......
......@@ -7,7 +7,7 @@
#ifndef MANTID_ISISREFLECTOMETRY_INSTRUMENTPRESENTERFACTORY_H
#define MANTID_ISISREFLECTOMETRY_INSTRUMENTPRESENTERFACTORY_H
#include "../../Reduction/Instrument.h"
#include "DllConfig.h"
#include "Common/DllConfig.h"
#include "IInstrumentPresenter.h"
#include "IInstrumentView.h"
#include "InstrumentPresenter.h"
......
......@@ -7,7 +7,7 @@
#ifndef MANTID_CUSTOMINTERFACES_INSTRUMENTVIEW_H_
#define MANTID_CUSTOMINTERFACES_INSTRUMENTVIEW_H_
#include "DllConfig.h"
#include "Common/DllConfig.h"
#include "IInstrumentView.h"
#include "ui_InstrumentWidget.h"
#include <QCheckBox>
......
set ( MAINWINDOW_SRC_FILES
MainWindowPresenter.cpp
MainWindowView.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 ( MAINWINDOW_INC_FILES
IMainWindowPresenter.h
IMainWindowView.h
MainWindowPresenter.h
MainWindowView.h
)
set ( MAINWINDOW_MOC_FILES
MainWindowView.h
)
set ( MAINWINDOW_UI_FILES
MainWindowWidget.ui
)
PREPEND( MAINWINDOW_SRC_FILES GUI/MainWindow ${MAINWINDOW_SRC_FILES})
PREPEND( MAINWINDOW_INC_FILES GUI/MainWindow ${MAINWINDOW_INC_FILES})
PREPEND( MAINWINDOW_MOC_FILES GUI/MainWindow ${MAINWINDOW_MOC_FILES})
PREPEND( MAINWINDOW_UI_FILES GUI/MainWindow ${MAINWINDOW_UI_FILES})
set (MAINWINDOW_SRC_FILES ${MAINWINDOW_SRC_FILES} PARENT_SCOPE)
set (MAINWINDOW_INC_FILES ${MAINWINDOW_INC_FILES} PARENT_SCOPE)
set (MAINWINDOW_MOC_FILES ${MAINWINDOW_MOC_FILES} PARENT_SCOPE)
set (MAINWINDOW_UI_FILES ${MAINWINDOW_UI_FILES} PARENT_SCOPE)
......@@ -4,10 +4,10 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_ISISREFLECTOMETRY_IREFLMAINWINDOWPRESENTER_H
#define MANTID_ISISREFLECTOMETRY_IREFLMAINWINDOWPRESENTER_H
#ifndef MANTID_ISISREFLECTOMETRY_IMAINWINDOWPRESENTER_H
#define MANTID_ISISREFLECTOMETRY_IMAINWINDOWPRESENTER_H
#include "IReflMainWindowView.h"
#include "IMainWindowView.h"
#include "MantidQtWidgets/Common/DataProcessorUI/OptionsQMap.h"
#include "MantidQtWidgets/Common/DataProcessorUI/TreeData.h"
#include <string>
......@@ -15,18 +15,18 @@
namespace MantidQt {
namespace CustomInterfaces {
/** @class IReflMainWindowPresenter
/** @class IMainWindowPresenter
IReflMainWindowPresenter is the interface defining the functions that the main
IMainWindowPresenter is the interface defining the functions that the main
window presenter needs to implement. This interface is used by tab presenters to
request information from other tabs.
*/
class IReflMainWindowPresenter : public ReflMainWindowSubscriber {
class IMainWindowPresenter : public MainWindowSubscriber {
public:
virtual std::string runPythonAlgorithm(const std::string &pythonCode) = 0;
virtual bool isProcessing() const = 0;
virtual ~IReflMainWindowPresenter() = default;
virtual ~IMainWindowPresenter() = default;
};
} // namespace CustomInterfaces
} // namespace MantidQt
#endif /* MANTID_ISISREFLECTOMETRY_IREFLMAINWINDOWPRESENTER_H */
#endif /* MANTID_ISISREFLECTOMETRY_IMAINWINDOWPRESENTER_H */
......@@ -4,40 +4,40 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_ISISREFLECTOMETRY_IREFLMAINWINDOWVIEW_H
#define MANTID_ISISREFLECTOMETRY_IREFLMAINWINDOWVIEW_H
#ifndef MANTID_ISISREFLECTOMETRY_IREFLWINDOWVIEW_H
#define MANTID_ISISREFLECTOMETRY_IREFLWINDOWVIEW_H
#include "IReflBatchView.h"
#include "GUI/Batch/IBatchView.h"
#include <string>
#include <vector>
namespace MantidQt {
namespace CustomInterfaces {
/** @class IReflMainWindowView
/** @class IMainWindowView
IReflMainWindowView is the interface defining the functions that the main
IMainWindowView is the interface defining the functions that the main
window view needs to implement. It is empty and not necessary at the moment, but
can be used in the future if widgets common to all tabs are added, for instance,
the help button.
*/
class ReflMainWindowSubscriber {
class MainWindowSubscriber {
public:
virtual void notifyHelpPressed() = 0;
virtual void notifyNewBatchRequested() = 0;
virtual void notifyCloseBatchRequested(int batchIndex) = 0;
virtual ~ReflMainWindowSubscriber() = default;
virtual ~MainWindowSubscriber() = default;
};
class IReflMainWindowView {
class IMainWindowView {
public:
virtual void subscribe(ReflMainWindowSubscriber *notifyee) = 0;
virtual IReflBatchView *newBatch() = 0;
virtual void subscribe(MainWindowSubscriber *notifyee) = 0;
virtual IBatchView *newBatch() = 0;
virtual void removeBatch(int index) = 0;
virtual std::vector<IReflBatchView *> batches() const = 0;
virtual std::vector<IBatchView *> batches() const = 0;
virtual std::string runPythonAlgorithm(const std::string &pythonCode) = 0;
virtual ~IReflMainWindowView() = default;
virtual ~IMainWindowView() = default;
};
} // namespace CustomInterfaces
} // namespace MantidQt
#endif /* MANTID_ISISREFLECTOMETRY_IREFLMAINWINDOWVIEW_H */
#endif /* MANTID_ISISREFLECTOMETRY_IREFLWINDOWVIEW_H */
......@@ -4,9 +4,9 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "ReflMainWindowPresenter.h"
#include "MainWindowPresenter.h"
#include "GUI/Runs/IRunsPresenter.h"
#include "IReflMainWindowView.h"
#include "IMainWindowView.h"
#include "MantidQtWidgets/Common/HelpWindow.h"
using namespace MantidQt::MantidWidgets::DataProcessor;
......@@ -19,20 +19,20 @@ namespace CustomInterfaces {
* @param batchPresenterFactory :: [input] A factory to create the batches
* we will manage
*/
ReflMainWindowPresenter::ReflMainWindowPresenter(
IReflMainWindowView *view, ReflBatchPresenterFactory batchPresenterFactory)
MainWindowPresenter::MainWindowPresenter(
IMainWindowView *view, BatchPresenterFactory batchPresenterFactory)
: m_view(view), m_batchPresenterFactory(std::move(batchPresenterFactory)) {
view->subscribe(this);
for (auto *batchView : m_view->batches())
m_batchPresenters.emplace_back(m_batchPresenterFactory.make(batchView));
}
void ReflMainWindowPresenter::notifyNewBatchRequested() {
void MainWindowPresenter::notifyNewBatchRequested() {
auto *newBatchView = m_view->newBatch();
m_batchPresenters.emplace_back(m_batchPresenterFactory.make(newBatchView));
}
void ReflMainWindowPresenter::notifyCloseBatchRequested(int batchIndex) {
void MainWindowPresenter::notifyCloseBatchRequested(int batchIndex) {
if (m_batchPresenters[batchIndex]->requestClose()) {
m_batchPresenters.erase(m_batchPresenters.begin() + batchIndex);
m_view->removeBatch(batchIndex);
......@@ -42,9 +42,9 @@ void ReflMainWindowPresenter::notifyCloseBatchRequested(int batchIndex) {
/**
Used by the view to tell the presenter something has changed
*/
void ReflMainWindowPresenter::notifyHelpPressed() { showHelp(); }
void MainWindowPresenter::notifyHelpPressed() { showHelp(); }
bool ReflMainWindowPresenter::isProcessing() const {
bool MainWindowPresenter::isProcessing() const {
for (auto batchPresenter : m_batchPresenters) {
if (batchPresenter->isProcessing())
return true;
......@@ -52,7 +52,7 @@ bool ReflMainWindowPresenter::isProcessing() const {
return false;
}
void ReflMainWindowPresenter::showHelp() {
void MainWindowPresenter::showHelp() {
MantidQt::API::HelpWindow::showCustomInterface(nullptr,
QString("ISIS Reflectometry"));
}
......@@ -63,7 +63,7 @@ Tells the view to show the user the dialog for an algorithm
* @return : Result of the execution
*/
std::string
ReflMainWindowPresenter::runPythonAlgorithm(const std::string &pythonCode) {
MainWindowPresenter::runPythonAlgorithm(const std::string &pythonCode) {
return m_view->runPythonAlgorithm(pythonCode);
}
} // namespace CustomInterfaces
......
......@@ -4,30 +4,30 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_ISISREFLECTOMETRY_REFLMAINWINDOWPRESENTER_H
#define MANTID_ISISREFLECTOMETRY_REFLMAINWINDOWPRESENTER_H
#ifndef MANTID_ISISREFLECTOMETRY_MAINWINDOWPRESENTER_H
#define MANTID_ISISREFLECTOMETRY_MAINWINDOWPRESENTER_H
#include "DllConfig.h"
#include "IReflMainWindowPresenter.h"
#include "ReflBatchPresenterFactory.h"
#include "Common/DllConfig.h"
#include "GUI/Batch/BatchPresenterFactory.h"
#include "IMainWindowPresenter.h"
#include <memory>
namespace MantidQt {
namespace CustomInterfaces {
class IReflMainWindowView;
class IMainWindowView;
/** @class ReflMainWindowPresenter
/** @class MainWindowPresenter
ReflMainWindowPresenter is the concrete main window presenter implementing the
functionality defined by the interface IReflMainWindowPresenter.
MainWindowPresenter is the concrete main window presenter implementing the
functionality defined by the interface IMainWindowPresenter.
*/
class MANTIDQT_ISISREFLECTOMETRY_DLL ReflMainWindowPresenter
: public IReflMainWindowPresenter {
class MANTIDQT_ISISREFLECTOMETRY_DLL MainWindowPresenter
: public IMainWindowPresenter {
public:
/// Constructor
ReflMainWindowPresenter(IReflMainWindowView *view,
ReflBatchPresenterFactory batchPresenterFactory);
MainWindowPresenter(IMainWindowView *view,
BatchPresenterFactory batchPresenterFactory);
/// Run a python algorithm
std::string runPythonAlgorithm(const std::string &pythonCode) override;
bool isProcessing() const override;
......@@ -37,10 +37,10 @@ public:
private:
void showHelp();
IReflMainWindowView *m_view;
ReflBatchPresenterFactory m_batchPresenterFactory;
std::vector<std::shared_ptr<IReflBatchPresenter>> m_batchPresenters;
IMainWindowView *m_view;
BatchPresenterFactory m_batchPresenterFactory;
std::vector<std::shared_ptr<IBatchPresenter>> m_batchPresenters;
};
} // namespace CustomInterfaces
} // namespace MantidQt
#endif /* MANTID_ISISREFLECTOMETRY_REFLMAINWINDOWPRESENTER_H */
#endif /* MANTID_ISISREFLECTOMETRY_MAINWINDOWPRESENTER_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment