Skip to content

Commit

Permalink
Merge pull request #37055 from mantidproject/add_commits_to_6_9_1_rel…
Browse files Browse the repository at this point in the history
…ease

Cherry pick for 6.9.1 patch release
  • Loading branch information
thomashampson authored Mar 22, 2024
2 parents f482b46 + 0513a98 commit 78313e9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,16 @@ def _alternative_theta_name(self):
return "Theta"

def _s1vg_name(self):
return "s1vgap" if self._instrument == "OFFSPEC" else "S1VG"
return "S1VG"

def _alternative_s1vg_name(self):
return "S1VG" if self._instrument == "OFFSPEC" else "s1vg"
return "s1vg"

def _s2vg_name(self):
return "s2vgap" if self._instrument == "OFFSPEC" else "S2VG"
return "S2VG"

def _alternative_s2vg_name(self):
return "S2VG" if self._instrument == "OFFSPEC" else "s2vg"
return "s2vg"

def _get_double_or_none(self, propertyName):
value = self.getProperty(propertyName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,51 +407,25 @@ void InelasticDataManipulationElwinTabView::notifyCheckboxValueChanged(QtPropert
}

void InelasticDataManipulationElwinTabView::notifyMinChanged(double val) {
auto integrationRangeSelector = m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange");
auto backgroundRangeSelector = m_uiForm.ppPlot->getRangeSelector("ElwinBackgroundRange");

MantidWidgets::RangeSelector *from = qobject_cast<MantidWidgets::RangeSelector *>(sender());

disconnect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(notifyDoubleValueChanged(QtProperty *, double)));
if (from == integrationRangeSelector) {
m_dblManager->setValue(m_properties["IntegrationStart"], val);
} else if (from == backgroundRangeSelector) {
m_dblManager->setValue(m_properties["BackgroundStart"], val);
}

connect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(notifyDoubleValueChanged(QtProperty *, double)));
auto prop = (from == m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange")) ? m_properties["IntegrationStart"]
: m_properties["BackgroundStart"];
m_dblManager->setValue(prop, val);
}

void InelasticDataManipulationElwinTabView::notifyMaxChanged(double val) {
auto integrationRangeSelector = m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange");
auto backgroundRangeSelector = m_uiForm.ppPlot->getRangeSelector("ElwinBackgroundRange");

MantidWidgets::RangeSelector *from = qobject_cast<MantidWidgets::RangeSelector *>(sender());

disconnect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(notifyDoubleValueChanged(QtProperty *, double)));

if (from == integrationRangeSelector) {
m_dblManager->setValue(m_properties["IntegrationEnd"], val);
} else if (from == backgroundRangeSelector) {
m_dblManager->setValue(m_properties["BackgroundEnd"], val);
}

connect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(notifyDoubleValueChanged(QtProperty *, double)));
auto prop = (from == m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange")) ? m_properties["IntegrationEnd"]
: m_properties["BackgroundEnd"];
m_dblManager->setValue(prop, val);
}

void InelasticDataManipulationElwinTabView::notifyDoubleValueChanged(QtProperty *prop, double val) {
auto integrationRangeSelector = m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange");
auto backgroundRangeSelector = m_uiForm.ppPlot->getRangeSelector("ElwinBackgroundRange");

m_presenter->handleValueChanged(prop->propertyName().toStdString(), val);

disconnect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(notifyDoubleValueChanged(QtProperty *, double)));

disconnectSignals();
if (prop == m_properties["IntegrationStart"])
setRangeSelectorMin(m_properties["IntegrationStart"], m_properties["IntegrationEnd"], integrationRangeSelector,
val);
Expand All @@ -462,9 +436,33 @@ void InelasticDataManipulationElwinTabView::notifyDoubleValueChanged(QtProperty
setRangeSelectorMin(m_properties["BackgroundStart"], m_properties["BackgroundEnd"], backgroundRangeSelector, val);
else if (prop == m_properties["BackgroundEnd"])
setRangeSelectorMax(m_properties["BackgroundStart"], m_properties["BackgroundEnd"], backgroundRangeSelector, val);
connectSignals();
}

void InelasticDataManipulationElwinTabView::disconnectSignals() {
disconnect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(notifyDoubleValueChanged(QtProperty *, double)));
disconnect(m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange"), SIGNAL(maxValueChanged(double)), this,
SLOT(notifyMaxChanged(double)));
disconnect(m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange"), SIGNAL(minValueChanged(double)), this,
SLOT(notifyMinChanged(double)));
disconnect(m_uiForm.ppPlot->getRangeSelector("ElwinBackgroundRange"), SIGNAL(maxValueChanged(double)), this,
SLOT(notifyMaxChanged(double)));
disconnect(m_uiForm.ppPlot->getRangeSelector("ElwinBackgroundRange"), SIGNAL(minValueChanged(double)), this,
SLOT(notifyMinChanged(double)));
}

void InelasticDataManipulationElwinTabView::connectSignals() {
connect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
SLOT(notifyDoubleValueChanged(QtProperty *, double)));
connect(m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange"), SIGNAL(maxValueChanged(double)), this,
SLOT(notifyMaxChanged(double)));
connect(m_uiForm.ppPlot->getRangeSelector("ElwinIntegrationRange"), SIGNAL(minValueChanged(double)), this,
SLOT(notifyMinChanged(double)));
connect(m_uiForm.ppPlot->getRangeSelector("ElwinBackgroundRange"), SIGNAL(maxValueChanged(double)), this,
SLOT(notifyMaxChanged(double)));
connect(m_uiForm.ppPlot->getRangeSelector("ElwinBackgroundRange"), SIGNAL(minValueChanged(double)), this,
SLOT(notifyMinChanged(double)));
}

void InelasticDataManipulationElwinTabView::setIntegrationStart(double value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ private slots:
void setHorizontalHeaders();
void setDefaultSampleLog(const Mantid::API::MatrixWorkspace_const_sptr &ws);

void disconnectSignals();
void connectSignals();

/// Function to set the range selector on the mini plot
void setRangeSelector(MantidWidgets::RangeSelector *rs, QtProperty *lower, QtProperty *upper,
const QPair<double, double> &range,
Expand Down

0 comments on commit 78313e9

Please sign in to comment.