mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-15 06:18:44 +01:00
refactoring
This commit is contained in:
@@ -208,11 +208,12 @@ defs::xy Detector::getPortPerModuleGeometry() const {
|
||||
Result<defs::xy> Detector::getPortSize(Positions pos) const {
|
||||
Result<defs::xy> res = pimpl->Parallel(&Module::getNumberOfChannels, pos);
|
||||
defs::xy portGeometry = getPortPerModuleGeometry();
|
||||
if ((portGeometry.x != 1 && portGeometry.x != 2) || (portGeometry.y != 1 && portGeometry.y != 2)) {
|
||||
throw RuntimeError("Port size is not 1 or 2 in either dimension. Port geometry:" + ToString(portGeometry));
|
||||
}
|
||||
for (auto &it : res) {
|
||||
if (portGeometry.x == 2)
|
||||
it.x /= 2;
|
||||
if (portGeometry.y == 2)
|
||||
it.y /= 2;
|
||||
it.x /= portGeometry.x;
|
||||
it.y /= portGeometry.y;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user