mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 18:40:42 +02:00
incorrectly using detsize, caught and fixing it in background (#619)
This commit is contained in:
parent
a6aaa2c3c6
commit
3682644e15
@ -342,28 +342,32 @@ void DetectorImpl::updateDetectorSize() {
|
|||||||
"updating detector size. ");
|
"updating detector size. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
int maxx = shm()->numberOfChannels.x;
|
|
||||||
int maxy = shm()->numberOfChannels.y;
|
|
||||||
int nModx = 0, nMody = 0;
|
int nModx = 0, nMody = 0;
|
||||||
// 1d, add modules along x axis
|
// 1d, add modules along x axis
|
||||||
if (modSize.y == 1) {
|
if (modSize.y == 1) {
|
||||||
if (maxx == 0) {
|
int detSizeX = shm()->numberOfChannels.x;
|
||||||
maxx = modSize.x * size();
|
int maxChanX = modSize.x * size();
|
||||||
|
// user given detsizex used only within max value
|
||||||
|
if (detSizeX > 1 && detSizeX <= maxChanX) {
|
||||||
|
maxChanX = detSizeX;
|
||||||
}
|
}
|
||||||
nModx = maxx / modSize.x;
|
nModx = maxChanX / modSize.x;
|
||||||
nMody = size() / nModx;
|
nMody = size() / nModx;
|
||||||
if ((maxx % modSize.x) > 0) {
|
if ((maxChanX % modSize.x) > 0) {
|
||||||
++nMody;
|
++nMody;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 2d, add modules along y axis (due to eiger top/bottom)
|
// 2d, add modules along y axis (due to eiger top/bottom)
|
||||||
else {
|
else {
|
||||||
if (maxy == 0) {
|
int detSizeY = shm()->numberOfChannels.y;
|
||||||
maxy = modSize.y * size();
|
int maxChanY = modSize.y * size();
|
||||||
|
// user given detsizey used only within max value
|
||||||
|
if (detSizeY > 1 && detSizeY <= maxChanY) {
|
||||||
|
maxChanY = detSizeY;
|
||||||
}
|
}
|
||||||
nMody = maxy / modSize.y;
|
nMody = maxChanY / modSize.y;
|
||||||
nModx = size() / nMody;
|
nModx = size() / nMody;
|
||||||
if ((maxy % modSize.y) > 0) {
|
if ((maxChanY % modSize.y) > 0) {
|
||||||
++nModx;
|
++nModx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user