Commit 6a80615a authored by Alice Russell's avatar Alice Russell
Browse files

Re #28255 Added a check so value are only set even if active

There was an issue where if values were tied they were still being changed by the unit conversion
so an extra check was added to avoid this.
parent 31e588c1
......@@ -111,8 +111,10 @@ void Bk2BkExpConvPV::setMatrixWorkspace(
const auto centre = getParameter("X0");
const auto scaleFactor = centre / convertValue(centre, tof, workspace, wi);
if (scaleFactor != 0) {
setParameter("Alpha", getParameter("Alpha") / scaleFactor);
setParameter("Beta", getParameter("Beta") / scaleFactor);
if (isActive(parameterIndex("Alpha")))
setParameter("Alpha", getParameter("Alpha") / scaleFactor);
if (isActive(parameterIndex("Beta")))
setParameter("Beta", getParameter("Beta") / scaleFactor);
}
}
IFunctionMW::setMatrixWorkspace(workspace, wi, startX, endX);
......
......@@ -420,9 +420,12 @@ void IkedaCarpenterPV::setMatrixWorkspace(
const auto centre = getParameter("X0");
const auto scaleFactor = centre / convertValue(centre, tof, workspace, wi);
if (scaleFactor != 0) {
setParameter("Alpha0", getParameter("Alpha0") * scaleFactor);
setParameter("Alpha1", getParameter("Alpha1") * scaleFactor);
setParameter("Beta0", getParameter("Beta0") * scaleFactor);
if (isActive(parameterIndex("Alpha0")))
setParameter("Alpha0", getParameter("Alpha0") * scaleFactor);
if (isActive(parameterIndex("Alpha1")))
setParameter("Alpha1", getParameter("Alpha1") * scaleFactor);
if (isActive(parameterIndex("Beta0")))
setParameter("Beta0", getParameter("Beta0") * scaleFactor);
}
}
IFunctionMW::setMatrixWorkspace(workspace, wi, startX, endX);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment