Mantid
Loading...
Searching...
No Matches
InstrumentSelector.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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"
11
12#include <Poco/NObserver.h>
13#include <QComboBox>
14#include <QStringList>
15
16namespace Mantid {
17namespace Kernel {
18class FacilityInfo;
19}
20} // namespace Mantid
21
22namespace MantidQt {
23namespace MantidWidgets {
31 Q_OBJECT
32
33 Q_PROPERTY(QStringList techniques READ getTechniques WRITE setTechniques)
34 Q_PROPERTY(bool updateOnFacilityChange READ getAutoUpdate WRITE setAutoUpdate)
35 Q_PROPERTY(QString facility READ getFacility WRITE setFacility)
36
37public:
39 InstrumentSelector(QWidget *parent = nullptr, bool init = true);
41 ~InstrumentSelector() override;
43 const QStringList &getTechniques() const;
45 void setTechniques(const QStringList &techniques);
47 bool getAutoUpdate();
49 void setAutoUpdate(bool autoUpdate);
51 QString getFacility();
53 void setFacility(const QString &facilityName);
55 void updateInstrumentOnSelection(const bool storeChanges);
56
57public slots:
59 void fillWithInstrumentsFromFacility(const QString &name = QString());
60
61signals:
64 void instrumentSelectionChanged(const QString & /*_t1*/);
65 void configValueChanged(const QString & /*_t1*/, const QString & /*_t2*/, const QString & /*_t3*/);
67 void instrumentListUpdated();
68
69private slots:
71 void updateInstrument(const QString &name);
72
73private:
74 void handleConfigChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf);
76 void filterByTechniquesAtFacility(const QStringList &techniques, const Mantid::Kernel::FacilityInfo &facility);
77
78private: // members
80 Poco::NObserver<InstrumentSelector, Mantid::Kernel::ConfigValChangeNotification> m_changeObserver;
83 QStringList m_techniques;
85 const Mantid::Kernel::FacilityInfo *m_currentFacility;
87 bool m_init;
89 bool m_storeChanges;
91 bool m_updateOnFacilityChange;
93 QString m_selectedInstrument;
94};
95} // namespace MantidWidgets
96} // namespace MantidQt
std::string name
Definition Run.cpp:60
#define EXPORT_OPT_MANTIDQT_COMMON
Definition DllOption.h:15
This class defines a widget for selecting an instrument known to Mantid.
This is the class for the notification that is to be sent when a value has been changed in config ser...
A class that holds information about a facility.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
const Poco::AutoPtr< Mantid::Kernel::ConfigServiceImpl::ValueChanged > & ConfigValChangeNotification_ptr
Helper class which provides the Collimation Length for SANS instruments.