Skip to content
Snippets Groups Projects
Commit aa5ee14e authored by Lamar Moore's avatar Lamar Moore
Browse files

Remove dynamic cast for detectors in MoveInstrumentComponent #23073

parent d1bd1e7f
No related branches found
No related tags found
No related merge requests found
...@@ -106,10 +106,20 @@ void MoveInstrumentComponent::exec() { ...@@ -106,10 +106,20 @@ void MoveInstrumentComponent::exec() {
throw std::invalid_argument("DetectorID or ComponentName must be given."); throw std::invalid_argument("DetectorID or ComponentName must be given.");
} }
if (dynamic_cast<const Geometry::GridDetectorPixel *>(comp.get())) { const auto &componentInfo = inputW->componentInfo();
auto compIndex = componentInfo.indexOf(comp->getComponentID());
auto parent = componentInfo.parent(compIndex);
auto grandParent = componentInfo.parent(parent);
if (componentInfo.isDetector(compIndex) &&
(componentInfo.componentType(grandParent) ==
Mantid::Beamline::ComponentType::Grid ||
componentInfo.componentType(grandParent) ==
Mantid::Beamline::ComponentType::Rectangular ||
componentInfo.componentType(grandParent) ==
Mantid::Beamline::ComponentType::Structured)) {
// DetectorInfo makes changing positions possible but we keep the old // DetectorInfo makes changing positions possible but we keep the old
// behavior of ignoring position changes for GridDetectorPixel. // behavior of ignoring position changes for GridDetectorPixel.
g_log.warning("Component is a GridDetectorPixel, moving is not " g_log.warning("Component is fixed within a structured bank, moving is not "
"possible, doing nothing."); "possible, doing nothing.");
return; return;
} }
......
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