Skip to content
Snippets Groups Projects
Commit 49b4b2d8 authored by Brandon Hewer's avatar Brandon Hewer
Browse files

Disable create resolution for instruments without resolution params

Refs #21969
parent 4cfabda0
No related merge requests found
......@@ -368,6 +368,14 @@ void ISISCalibration::setDefaultInstDetails() {
getValueOr(ranges, "peak-end-tof", 0.0));
setBackgroundRange(getValueOr(ranges, "back-start-tof", 0.0),
getValueOr(ranges, "back-end-tof", 0.0));
if (instDetails.contains("resolution") &&
!instDetails["resolution"].isEmpty()) {
m_uiForm.ckCreateResolution->setEnabled(true);
} else {
m_uiForm.ckCreateResolution->setChecked(false);
m_uiForm.ckCreateResolution->setEnabled(false);
}
}
/**
......@@ -489,7 +497,7 @@ void ISISCalibration::calSetDefaultResolution(MatrixWorkspace_const_sptr ws) {
auto params = comp->getNumberParameter("resolution", true);
// Set the default instrument resolution
if (params.size() > 0) {
if (!params.empty()) {
double res = params[0];
const auto energyRange = m_uiForm.ppResolution->getCurveRange("Energy");
......
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