From 6f18a85a4febe55d7a7edaa55d44770539d82611 Mon Sep 17 00:00:00 2001 From: Dan Nixon <dan@dan-nixon.com> Date: Thu, 30 Jul 2015 11:17:23 +0100 Subject: [PATCH] Only allow QENS instruments to have the option Re #13109 --- .../src/Indirect/ISISEnergyTransfer.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp index 1b9b7ea1107..79c1c3c0118 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp @@ -111,9 +111,9 @@ void ISISEnergyTransfer::run() { reductionAlg->initialize(); BatchAlgorithmRunner::AlgorithmRuntimeProps reductionRuntimeProps; - reductionAlg->setProperty( - "Instrument", - getInstrumentConfiguration()->getInstrumentName().toStdString()); + QString instName = getInstrumentConfiguration()->getInstrumentName(); + + reductionAlg->setProperty("Instrument", instName.toStdString()); reductionAlg->setProperty( "Analyser", getInstrumentConfiguration()->getAnalyserName().toStdString()); @@ -121,7 +121,12 @@ void ISISEnergyTransfer::run() { "Reflection", getInstrumentConfiguration()->getReflectionName().toStdString()); - reductionAlg->setProperty("Efixed", m_uiForm.spEfixed->value()); + // Override the efixed for QENS spectrometers only + QStringList qens; + qens << "IRIS" + << "OSIRIS"; + if (qens.contains(instName)) + reductionAlg->setProperty("Efixed", m_uiForm.spEfixed->value()); QString files = m_uiForm.dsRunFiles->getFilenames().join(","); reductionAlg->setProperty("InputFiles", files.toStdString()); @@ -234,6 +239,11 @@ void ISISEnergyTransfer::setInstrumentDefault() { // Set the search instrument for runs m_uiForm.dsRunFiles->setInstrumentOverride(instDetails["instrument"]); + QStringList qens; + qens << "IRIS" + << "OSIRIS"; + m_uiForm.spEfixed->setEnabled(qens.contains(instDetails["instrument"])); + if (instDetails["spectra-min"].isEmpty() || instDetails["spectra-max"].isEmpty()) { emit showMessageBox("Could not gather necessary data from parameter file."); -- GitLab