diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/Elwin.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/Elwin.h index 87fdeae8fdf10227568357a251776f7596a299eb..2c280231fa891797b64439ba85010c8d1598c298 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/Elwin.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/Elwin.h @@ -19,7 +19,8 @@ private: void run() override; bool validate() override; void loadSettings(const QSettings &settings) override; - void setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws); + void setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws, + const QPair<double, double> &range); void setDefaultSampleLog(Mantid::API::MatrixWorkspace_const_sptr ws); private slots: diff --git a/MantidQt/CustomInterfaces/src/Indirect/Elwin.cpp b/MantidQt/CustomInterfaces/src/Indirect/Elwin.cpp index ccb4027fb165fb7b72ec30f82063cb3e7a3bb40f..0eda870b816f17978fe8854a7255777851d4e1f8 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/Elwin.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/Elwin.cpp @@ -306,7 +306,8 @@ void Elwin::loadSettings(const QSettings &settings) { m_uiForm.dsInputFiles->readSettings(settings.group()); } -void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws) { +void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws, + const QPair<double, double> &range) { auto inst = ws->getInstrument(); auto analyser = inst->getStringParameter("analyser"); @@ -322,6 +323,9 @@ void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws) { m_dblManager->setValue(m_properties["BackgroundStart"], -10 * res); m_dblManager->setValue(m_properties["BackgroundEnd"], -9 * res); + } else { + m_dblManager->setValue(m_properties["IntegrationStart"], range.first); + m_dblManager->setValue(m_properties["IntegrationEnd"], range.second); } } } @@ -423,22 +427,17 @@ void Elwin::plotInput() { int specNo = m_uiForm.spPreviewSpec->value(); - setDefaultResolution(ws); - setDefaultSampleLog(ws); - - m_uiForm.ppPlot->clear(); - m_uiForm.ppPlot->addSpectrum("Sample", ws, specNo); - try { + m_uiForm.ppPlot->clear(); + m_uiForm.ppPlot->addSpectrum("Sample", ws, specNo); QPair<double, double> range = m_uiForm.ppPlot->getCurveRange("Sample"); - // Set maximum range of Integration - m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange") - ->setRange(range.first, range.second); - // Set initial values - m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange") - ->setMinimum(range.first); - m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange") - ->setMaximum(range.second); + auto rangeSelector = + m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange"); + setPlotPropertyRange(rangeSelector, m_properties["IntegrationStart"], + m_properties["IntegrationEnd"], range); + + setDefaultResolution(ws, range); + setDefaultSampleLog(ws); } catch (std::invalid_argument &exc) { showMessageBox(exc.what()); } diff --git a/docs/source/release/v3.8.0/indirect_inelastic.rst b/docs/source/release/v3.8.0/indirect_inelastic.rst index 0f6e2b0ee5e9f93336f952f301f9cc7b6ea624a4..ee4af8b5f3db16faaf3fc835acfa44ec1a668dae 100644 --- a/docs/source/release/v3.8.0/indirect_inelastic.rst +++ b/docs/source/release/v3.8.0/indirect_inelastic.rst @@ -34,6 +34,7 @@ Improvements - Algorithm :ref:`BASISReduction311 <algm-BASISReduction311>` has been included in algorithm :ref:`BASISReduction <algm-BASISReduction>`. - Range bars colours in the *ISIS Calibration* interface have been updated to match the convention in the fit wizard. - Vesuvio sigma_theta value updated for single and double differencing in both forward and back scattering. The new value is 0.016 for all. +- The Elwin interface now uses the resolution of the instrument to create the range bars when possible Bugfixes