30 : QComboBox(parent), m_changeObserver(*this, &
InstrumentSelector::handleConfigChange), m_techniques(),
31 m_currentFacility(nullptr), m_init(init), m_storeChanges(false), m_updateOnFacilityChange(true),
32 m_selectedInstrument() {
42 connect(
this, SIGNAL(currentIndexChanged(
const QString &)),
this, SLOT(
updateInstrument(
const QString &)));
103 QString prop = QString::fromStdString(pNf->key());
104 QString newV = QString::fromStdString(pNf->curValue());
105 QString oldV = QString::fromStdString(pNf->preValue());
110 }
else if ((prop ==
"default.instrument") && (newV != this->currentText())) {
111 this->setCurrentIndex(this->findText(newV));
129 this->blockSignals(
true);
133 if (name.isEmpty()) {
145 std::set<std::string> alphabetizedNames;
146 for (
const auto &instrument : instruments) {
147 alphabetizedNames.insert(instrument.name());
149 for (
const auto &name_std_str : alphabetizedNames) {
150 QString instrumentName = QString::fromStdString(name_std_str);
152 QString shortName = QString::fromStdString(prefix);
153 this->
addItem(instrumentName, QVariant(shortName));
163 int index = this->findText(defaultName);
169 this->setCurrentIndex(
index);
170 this->blockSignals(
false);
221 this->blockSignals(
true);
223 QStringList supportedInstruments;
225 while (techItr.hasNext()) {
226 const std::vector<InstrumentInfo> instruments =
facility.instruments(techItr.next().toStdString());
227 const size_t nInstrs = instruments.size();
228 for (
size_t i = 0; i < nInstrs; ++i) {
229 supportedInstruments.append(QString::fromStdString(instruments[i].name()));
234 for (
int i = 0; i < this->
count();) {
235 if (!supportedInstruments.contains(itemText(i))) {
242 this->blockSignals(
false);
std::map< DeltaEMode::Type, std::string > index
void removeItem(WorkspaceGroup &self, const std::string &name)
void addItem(WorkspaceGroup &self, const std::string &name)
The ConfigService class provides a simple facade to access the Configuration functionality of the Man...
const FacilityInfo & getFacility() const
Get the default facility.
void addObserver(const Poco::AbstractObserver &observer) const
Add an observer for a notification.
const std::vector< std::string > getFacilityNames() const
Get the list of facility names.
Exception for when an item is not found in a collection.
A class that holds information about a facility.
const std::vector< InstrumentInfo > & instruments() const
Returns a list of instruments of this facility.
const std::string & name() const
Return the name of the facility.
const InstrumentInfo & instrument(std::string iName="") const
Returns instruments with given name.
const std::string shortName() const
Return the short name of the instrument.
The Logger class is in charge of the publishing messages from the framework through various channels.
void debug(const std::string &msg)
Logs at debug level.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
Kernel::Logger g_log("ExperimentInfo")
static logger object
const Poco::AutoPtr< Mantid::Kernel::ConfigServiceImpl::ValueChanged > & ConfigValChangeNotification_ptr