Skip to content
Snippets Groups Projects
Commit 20c275da authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

Merge pull request #16275 from mantidproject/16259_Iqt_EMin/Max_validation

Indirect Data Analysis I(Q,t) - Elow/EHigh validation
parents 6514ee1d 6d9356a4
No related branches found
No related tags found
No related merge requests found
......@@ -205,6 +205,11 @@ bool Iqt::validate() {
uiv.checkDataSelectorIsValid("Sample", m_uiForm.dsInput);
uiv.checkDataSelectorIsValid("Resolution", m_uiForm.dsResolution);
const auto eLow = m_dblManager->value(m_properties["ELow"]);
const auto eHigh = m_dblManager->value(m_properties["EHigh"]);
if (eLow >= eHigh)
uiv.addErrorMessage("ELow must be strictly less than EHigh.\n");
QString message = uiv.generateErrorMessage();
showMessageBox(message);
......@@ -252,9 +257,6 @@ void Iqt::updatePropertyValues(QtProperty *prop, double val) {
void Iqt::calculateBinning() {
using namespace Mantid::API;
disconnect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(updatePropertyValues(QtProperty *, double)));
QString wsName = m_uiForm.dsInput->getCurrentDataName();
QString resName = m_uiForm.dsResolution->getCurrentDataName();
if (wsName.isEmpty() || resName.isEmpty())
......@@ -263,8 +265,11 @@ void Iqt::calculateBinning() {
double energyMin = m_dblManager->value(m_properties["ELow"]);
double energyMax = m_dblManager->value(m_properties["EHigh"]);
double numBins = m_dblManager->value(m_properties["SampleBinning"]);
if (numBins == 0)
return;
if (energyMin == 0 && energyMax == 0)
return;
IAlgorithm_sptr furyAlg =
AlgorithmManager::Instance().create("TransformToIqt");
......@@ -292,6 +297,9 @@ void Iqt::calculateBinning() {
int sampleBins = propsTable->getColumn("SampleOutputBins")->cell<int>(0);
int resolutionBins = propsTable->getColumn("ResolutionBins")->cell<int>(0);
disconnect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(updatePropertyValues(QtProperty *, double)));
// Update data in property editor
m_dblManager->setValue(m_properties["EWidth"], energyWidth);
m_dblManager->setValue(m_properties["ResolutionBins"], resolutionBins);
......
......@@ -78,6 +78,9 @@ Improvements
- Updated the :ref:`SimulatedDensityOfStates <algm-SimulatedDensityOfStates>` workflow diagram to show an overview of the algorithm.
- the *Iqt* interface now validates that EMin is strictly less than EMax and that they are both not equal to 0
Bugfixes
--------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment