Newer
Older
#ifndef MANTID_CUSTOMINTERFACES_QTREFLMAINVIEW_H_
#define MANTID_CUSTOMINTERFACES_QTREFLMAINVIEW_H_
#include "MantidKernel/System.h"
#include "MantidQtAPI/UserSubWindow.h"
#include "MantidQtCustomInterfaces/ReflMainView.h"
#include "MantidQtCustomInterfaces/IReflPresenter.h"
#include "MantidQtCustomInterfaces/ReflSearchModel.h"
#include "MantidQtCustomInterfaces/QReflTableModel.h"
#include "MantidQtMantidWidgets/SlitCalculator.h"
#include <boost/scoped_ptr.hpp>
Harry Jeffery
committed
#include <QSignalMapper>
#include "ui_ReflMainWidget.h"
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
namespace MantidQt {
namespace CustomInterfaces {
/** QtReflMainView : Provides an interface for processing reflectometry data.
Copyright © 2014 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
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 DLLExport QtReflMainView : public MantidQt::API::UserSubWindow,
public ReflMainView {
Q_OBJECT
public:
QtReflMainView(QWidget *parent = 0);
virtual ~QtReflMainView();
/// Name of the interface
static std::string name() { return "ISIS Reflectometry (Polref)"; }
// This interface's categories.
static QString categoryInfo() { return "Reflectometry"; }
// Connect the model
virtual void showTable(QReflTableModel_sptr model);
virtual void showSearch(ReflSearchModel_sptr model);
// Dialog/Prompt methods
virtual std::string askUserString(const std::string &prompt,
const std::string &title,
const std::string &defaultValue);
virtual bool askUserYesNo(std::string prompt, std::string title);
virtual void giveUserInfo(std::string prompt, std::string title);
virtual void giveUserWarning(std::string prompt, std::string title);
virtual void giveUserCritical(std::string prompt, std::string title);
virtual void showAlgorithmDialog(const std::string &algorithm);
virtual std::string requestNotebookPath();
// Plotting
virtual void plotWorkspaces(const std::set<std::string> &workspaces);
// Set the status of the progress bar
virtual void setProgressRange(int min, int max);
virtual void setProgress(int progress);
// Get status of the checkbox which dictates whether an ipython notebook is
// produced
virtual bool getEnableNotebook();
// Settor methods
virtual void setSelection(const std::set<int> &rows);
virtual void setTableList(const std::set<std::string> &tables);
virtual void setInstrumentList(const std::vector<std::string> &instruments,
const std::string &defaultInstrument);
virtual void
setOptionsHintStrategy(MantidQt::MantidWidgets::HintStrategy *hintStrategy);
virtual void setClipboard(const std::string &text);
// Accessor methods
virtual std::set<int> getSelectedRows() const;
virtual std::set<int> getSelectedSearchRows() const;
virtual std::string getSearchInstrument() const;
virtual std::string getProcessInstrument() const;
virtual std::string getWorkspaceToOpen() const;
virtual std::string getClipboard() const;
virtual std::string getSearchString() const;
virtual boost::shared_ptr<IReflPresenter> getPresenter() const;
private:
// initialise the interface
virtual void initLayout();
// the presenter
boost::shared_ptr<IReflPresenter> m_presenter;
// the models
QReflTableModel_sptr m_model;
ReflSearchModel_sptr m_searchModel;
// the interface
Ui::reflMainWidget ui;
// the workspace the user selected to open
std::string m_toOpen;
QSignalMapper *m_openMap;
MantidWidgets::SlitCalculator *m_calculator;
private slots:
void on_actionNewTable_triggered();
void on_actionSaveTable_triggered();
void on_actionSaveTableAs_triggered();
void on_actionAppendRow_triggered();
void on_actionPrependRow_triggered();
void on_actionDeleteRow_triggered();
void on_actionProcess_triggered();
void on_actionGroupRows_triggered();
void on_actionClearSelected_triggered();
void on_actionCopySelected_triggered();
void on_actionCutSelected_triggered();
void on_actionPasteSelected_triggered();
void on_actionExpandSelection_triggered();
void on_actionOptionsDialog_triggered();
void on_actionSearch_triggered();
void on_actionTransfer_triggered();
void on_actionImportTable_triggered();
void on_actionExportTable_triggered();
void on_actionHelp_triggered();
void on_actionPlotRow_triggered();
void on_actionPlotGroup_triggered();
void on_actionSlitCalculator_triggered();
void on_comboSearchInstrument_currentIndexChanged(int index);
void on_comboProcessInstrument_currentIndexChanged(int index);
void setModel(QString name);
void tableUpdated(const QModelIndex &topLeft, const QModelIndex &bottomRight);
void showContextMenu(const QPoint &pos);
void showSearchContextMenu(const QPoint &pos);
};
} // namespace CustomInterfaces
} // namespace Mantid
#endif /* MANTID_CUSTOMINTERFACES_QTREFLMAINVIEW_H_ */