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 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*/);
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
83 QStringList m_techniques;
87 bool m_init;
94};
95} // namespace MantidWidgets
96} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
This class defines a widget for selecting an instrument known to Mantid.
Poco::NObserver< InstrumentSelector, Mantid::Kernel::ConfigValChangeNotification > m_changeObserver
Poco Observer for Config Service Notifications.
bool m_init
Should the object be initialized.
bool m_storeChanges
Should the default instrument be changed when the selection changes.
const Mantid::Kernel::FacilityInfo * m_currentFacility
The current facility.
void configValueChanged(const QString &, const QString &, const QString &)
QString m_selectedInstrument
The last selected instrument.
bool m_updateOnFacilityChange
If the instrument list should be reloaded when the facility changes.
void instrumentSelectionChanged(const QString &)
Indicate that the instrument selection has changed.
QStringList m_techniques
A list of technqiues.
void instrumentListUpdated()
Signals that the list of instruments has been updated.
A class that holds information about a facility.
Definition: FacilityInfo.h:36
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.