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;
42
43 // delete copy operations - Poco::NObserver contains std::atomic which is not copyable
45 InstrumentSelector &operator=(const InstrumentSelector &) = delete;
46
48 const QStringList &getTechniques() const;
50 void setTechniques(const QStringList &techniques);
52 bool getAutoUpdate();
54 void setAutoUpdate(bool autoUpdate);
56 QString getFacility();
58 void setFacility(const QString &facilityName);
60 void updateInstrumentOnSelection(const bool storeChanges);
61
62public slots:
64 void fillWithInstrumentsFromFacility(const QString &name = QString());
65
66signals:
69 void instrumentSelectionChanged(const QString & /*_t1*/);
70 void configValueChanged(const QString & /*_t1*/, const QString & /*_t2*/, const QString & /*_t3*/);
72 void instrumentListUpdated();
73
74private slots:
76 void updateInstrument(const QString &name);
77
78private:
79 void handleConfigChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf);
81 void filterByTechniquesAtFacility(const QStringList &techniques, const Mantid::Kernel::FacilityInfo &facility);
82
83private: // members
85 Poco::NObserver<InstrumentSelector, Mantid::Kernel::ConfigValChangeNotification> m_changeObserver;
88 QStringList m_techniques;
90 const Mantid::Kernel::FacilityInfo *m_currentFacility;
92 bool m_init;
94 bool m_storeChanges;
96 bool m_updateOnFacilityChange;
98 QString m_selectedInstrument;
99};
100} // namespace MantidWidgets
101} // 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.