Mantid
Loading...
Searching...
No Matches
AddWorkspaceDialog.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "DllOption.h"
12#include "ui_AddWorkspaceDialog.h"
13
14#include <vector>
15
16#include <QComboBox>
17#include <QDialog>
18#include <QLineEdit>
19
20namespace MantidQt {
21namespace MantidWidgets {
22
27 Q_OBJECT
28
29public:
30 explicit AddWorkspaceDialog(QWidget *parent = nullptr);
31 QString workspaceName() const { return m_workspaceName; }
32 std::vector<int> workspaceIndices() const { return m_wsIndices; }
33
34 std::vector<Mantid::API::MatrixWorkspace_const_sptr> getWorkspaces() const;
35
36public:
38 QComboBox *workspaceNameComboBox() const { return m_uiForm.cbWorkspaceName; }
39 QLineEdit *workspaceIndiceLineEdit() const { return m_uiForm.leWSIndices; }
40
41signals:
43 void okClicked(bool close);
44
45public slots:
46 void handleCancelClicked();
47 void handleOKClicked();
48
49private slots:
50 void workspaceNameChanged(const QString & /*wsName*/);
51 void selectAllSpectra(int state);
52
53private:
54 void addWorkspacesFromGroup(std::vector<Mantid::API::MatrixWorkspace_const_sptr> &workspaces,
56
57 QStringList availableWorkspaces() const;
58 void findCommonMaxIndex(const QString &wsName);
62 std::vector<int> m_wsIndices;
65 Ui::AddWorkspaceDialog m_uiForm;
66};
67
68} // namespace MantidWidgets
69} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
A dialog for selecting a workspace from the ADS.
std::vector< int > m_wsIndices
Selected workspace index.
QComboBox * workspaceNameComboBox() const
Testing accessors.
QString m_workspaceName
Name of the selected workspace.
int m_maxIndex
Maximum index in the selected workspace.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< const WorkspaceGroup > WorkspaceGroup_const_sptr
shared pointer to Mantid::API::WorkspaceGroup, pointer to const version