Commit d4280884 authored by Anthony Lim's avatar Anthony Lim
Browse files

refs #26904 moved basic custom instrument view to instrumentView

parent 78056c58
......@@ -9,8 +9,8 @@
#include "PlotFitAnalysisPaneModel.h"
#include "PlotFitAnalysisPaneView.h"
#include "BaseInstrumentModel.h"
#include "BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
// will need these later
#include "MantidQtWidgets/Common/FunctionBrowser.h"
#include "MantidQtWidgets/InstrumentView/InstrumentWidget.h"
......
......@@ -7,7 +7,7 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_ALFVIEWMODEL_H_
#define MANTIDQT_CUSTOMINTERFACES_ALFVIEWMODEL_H_
#include "BaseInstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidAPI/CompositeFunction.h"
#include "MantidAPI/FunctionFactory.h"
......@@ -17,7 +17,7 @@
namespace MantidQt {
namespace CustomInterfaces {
class ALFView_model : public BaseInstrumentModel {
class ALFView_model : public MantidWidgets::BaseInstrumentModel {
public:
ALFView_model();
......
......@@ -7,7 +7,7 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_ALFVIEWPRESENTER_H_
#define MANTIDQT_CUSTOMINTERFACES_ALFVIEWPRESENTER_H_
#include "BaseInstrumentPresenter.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h"
#include "PlotFitAnalysisPanePresenter.h"
#include "ALFView_model.h"
......@@ -21,7 +21,7 @@
namespace MantidQt {
namespace CustomInterfaces {
class MANTIDQT_DIRECT_DLL ALFView_presenter : public BaseInstrumentPresenter {
class MANTIDQT_DIRECT_DLL ALFView_presenter : public MantidWidgets::BaseInstrumentPresenter {
Q_OBJECT
public:
......
......@@ -7,7 +7,7 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_ALFVIEW_VIEW_H_
#define MANTIDQT_CUSTOMINTERFACES_ALFVIEW_VIEW_H_
#include "BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
#include "DllConfig.h"
#include "MantidQtWidgets/Common/MWRunFiles.h"
#include "MantidQtWidgets/Common/ObserverPattern.h"
......@@ -22,7 +22,7 @@
namespace MantidQt {
namespace CustomInterfaces {
class ALFView_view : public BaseInstrumentView {
class ALFView_view : public MantidWidgets::BaseInstrumentView {
Q_OBJECT
public:
......
......@@ -3,9 +3,9 @@ set(SRC_FILES
ALFView_view.cpp
ALFView_presenter.cpp
ALFView_model.cpp
BaseInstrumentModel.cpp
BaseInstrumentView.cpp
BaseInstrumentPresenter.cpp
#BaseInstrumentModel.cpp
#BaseInstrumentView.cpp
#BaseInstrumentPresenter.cpp
PlotFitAnalysisPaneView.cpp
PlotFitAnalysisPanePresenter.cpp
PlotFitAnalysisPaneModel.cpp)
......@@ -14,9 +14,8 @@ set(MOC_FILES
ALFView.h
ALFView_view.h
ALFView_presenter.h
BaseInstrumentView.h
BaseInstrumentView.h
BaseInstrumentPresenter.h
#BaseInstrumentView.h
#BaseInstrumentPresenter.h
PlotFitAnalysisPaneView.h
PlotFitAnalysisPanePresenter.h)
......
......@@ -6,6 +6,9 @@ set(
SRC_FILES
src/BankRenderingHelpers.cpp
src/BankTextureBuilder.cpp
src/BaseInstrumentModel.cpp
src/BaseInstrumentView.cpp
src/BaseInstrumentPresenter.cpp
src/BinDialog.cpp
src/CollapsiblePanel.cpp
src/DetXMLFile.cpp
......@@ -52,6 +55,8 @@ set(QT5_SRC_FILES src/MiniPlotMpl.cpp)
set(
MOC_FILES
inc/MantidQtWidgets/InstrumentView/BinDialog.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentView.h
inc/MantidQtWidgets/InstrumentView/CollapsiblePanel.h
inc/MantidQtWidgets/InstrumentView/InstrumentActor.h
inc/MantidQtWidgets/InstrumentView/InstrumentTreeModel.h
......@@ -81,6 +86,9 @@ set(
INC_FILES
inc/MantidQtWidgets/InstrumentView/BankRenderingHelpers.h
inc/MantidQtWidgets/InstrumentView/BankTextureBuilder.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentModel.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h
inc/MantidQtWidgets/InstrumentView/BaseInstrumentView.h
inc/MantidQtWidgets/InstrumentView/BinDialog.h
inc/MantidQtWidgets/InstrumentView/CollapsiblePanel.h
inc/MantidQtWidgets/InstrumentView/ColorMap.h
......
......@@ -4,15 +4,16 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTMODEL_H_
#define MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTMODEL_H_
#ifndef MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTMODEL_H_
#define MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTMODEL_H_
#include <map>
#include <string>
#include "DllOption.h"
namespace MantidQt {
namespace CustomInterfaces {
namespace MantidWidgets {
class BaseInstrumentModel {
class EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW BaseInstrumentModel {
public:
BaseInstrumentModel();
......@@ -35,7 +36,7 @@ protected:
std::string m_wsName;
};
} // namespace CustomInterfaces
} // namespace MantidWidgets
} // namespace MantidQt
#endif /* MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTMODEL_H_ */
#endif /* MANTIDQT_INSTRUMENTVIEW_BASEINSTRUMENTMODEL_H_ */
......@@ -6,22 +6,21 @@
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTPRESENTER_H_
#define MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTPRESENTER_H_
#include "DllOption.h"
#include "BaseInstrumentModel.h"
#include "BaseInstrumentView.h"
#include "PlotFitAnalysisPaneView.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
#include "ALFView_view.h"
#include "DllConfig.h"
#include "MantidQtWidgets/Common/ObserverPattern.h"
#include "MantidQtWidgets/Common/UserSubWindow.h"
#include <string>
namespace MantidQt {
namespace CustomInterfaces {
namespace MantidWidgets {
class BaseInstrumentPresenter : public QObject {
class EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW BaseInstrumentPresenter
: public QObject {
Q_OBJECT
public:
......@@ -60,7 +59,7 @@ private:
VoidObserver *m_loadRunObserver;
QWidget *m_analysisPaneView;
};
} // namespace CustomInterfaces
} // namespace MantidWidgets
} // namespace MantidQt
#endif /* MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTPRESENTER_H_ */
......@@ -7,12 +7,11 @@
#ifndef MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTVIEW_H_
#define MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTVIEW_H_
#include "DllConfig.h"
#include "DllOption.h"
#include "MantidQtWidgets/Common/FunctionBrowser.h"
#include "MantidQtWidgets/Common/MWRunFiles.h"
#include "MantidQtWidgets/Common/ObserverPattern.h"
#include "MantidQtWidgets/InstrumentView/InstrumentWidget.h"
#include "MantidQtWidgets/Plotting/PreviewPlot.h"
#include <QObject>
#include <QPushButton>
......@@ -21,9 +20,9 @@
#include <string>
namespace MantidQt {
namespace CustomInterfaces {
namespace MantidWidgets {
class BaseInstrumentView : public QSplitter {
class EXPORT_OPT_MANTIDQT_INSTRUMENTVIEW BaseInstrumentView : public QSplitter {
Q_OBJECT
public:
......@@ -66,7 +65,7 @@ private:
MantidWidgets::InstrumentWidget *m_instrumentWidget;
QPushButton *m_help;
};
} // namespace CustomInterfaces
} // namespace MantidWidgets
} // namespace MantidQt
#endif /* MANTIDQT_CUSTOMINTERFACES_BASEINSTRUMENTVIEW_H_ */
......@@ -5,7 +5,7 @@
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "BaseInstrumentModel.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/AnalysisDataService.h"
......@@ -22,7 +22,7 @@ const int ERRORCODE = -999;
using namespace Mantid::API;
namespace MantidQt {
namespace CustomInterfaces {
namespace MantidWidgets {
BaseInstrumentModel::BaseInstrumentModel()
: m_currentRun(0), m_tmpName("tmp"), m_instrumentName("MUSR"),
......@@ -82,5 +82,5 @@ bool BaseInstrumentModel::isErrorCode(const int run) {
return (run == ERRORCODE);
}
} // namespace CustomInterfaces
} // namespace MantidWidgets
} // namespace MantidQt
......@@ -4,18 +4,19 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "BaseInstrumentPresenter.h"
#include "BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentPresenter.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentModel.h"
#include "MantidAPI/FileFinder.h"
#include <functional>
#include <tuple>
namespace MantidQt {
namespace CustomInterfaces {
namespace MantidWidgets {
BaseInstrumentPresenter::BaseInstrumentPresenter(BaseInstrumentView *view,
BaseInstrumentModel *model,
MantidWidgets::BaseInstrumentModel *model,
QWidget *analysisPaneView)
: m_view(view), m_model(model), m_currentRun(0), m_currentFile(""),
m_loadRunObserver(nullptr), m_analysisPaneView(analysisPaneView) {
......@@ -110,5 +111,5 @@ BaseInstrumentPresenter::setupInstrument() {
return std::make_pair(setUpContextConditions, customInstrumentOptions);
}
} // namespace CustomInterfaces
} // namespace MantdWidgets
} // namespace MantidQt
......@@ -4,7 +4,7 @@
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "BaseInstrumentView.h"
#include "MantidQtWidgets/InstrumentView/BaseInstrumentView.h"
#include "MantidQtWidgets/Common/HelpWindow.h"
#include "MantidQtWidgets/InstrumentView/InstrumentWidgetPickTab.h"
......@@ -15,7 +15,7 @@
#include <QVBoxLayout>
namespace MantidQt {
namespace CustomInterfaces {
namespace MantidWidgets {
BaseInstrumentView::BaseInstrumentView(const std::string &instrument,
QWidget *parent)
......@@ -27,13 +27,13 @@ BaseInstrumentView::BaseInstrumentView(const std::string &instrument,
this->addWidget(loadWidget);
}
void MantidQt::CustomInterfaces::BaseInstrumentView::setUpInstrument(
void BaseInstrumentView::setUpInstrument(
const std::string &fileName,
std::vector<std::function<bool(std::map<std::string, bool>)>> &instrument) {
(void)instrument;
auto instrumentWidget =
new MantidWidgets::InstrumentWidget(QString::fromStdString(fileName));
new InstrumentWidget(QString::fromStdString(fileName));
instrumentWidget->hideHelp();
setInstrumentWidget(instrumentWidget);
}
......@@ -119,5 +119,5 @@ void BaseInstrumentView::warningBox(const QString &message) {
QMessageBox::warning(this, m_instrument + " view", message);
}
} // namespace CustomInterfaces
} // namespace MantidWidgets
} // namespace MantidQt
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment