mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 18:40:42 +02:00
gui doesnt work, but ports fixed
This commit is contained in:
parent
88869c1746
commit
fd655437ab
@ -201,7 +201,7 @@ void Implementation::setDetectorType(const detectorType d) {
|
|||||||
PortGeometry Implementation::getDetectorSize() const { return numModules; }
|
PortGeometry Implementation::getDetectorSize() const { return numModules; }
|
||||||
|
|
||||||
PortGeometry Implementation::GetPortGeometry() {
|
PortGeometry Implementation::GetPortGeometry() {
|
||||||
portGeometry = {{1, 1}};
|
PortGeometry portGeometry = {{1, 1}};
|
||||||
if (detType == EIGER)
|
if (detType == EIGER)
|
||||||
portGeometry[X] = numUDPInterfaces;
|
portGeometry[X] = numUDPInterfaces;
|
||||||
else // (jungfrau and gotthard2)
|
else // (jungfrau and gotthard2)
|
||||||
@ -214,7 +214,7 @@ void Implementation::setDetectorSize(const int *size) {
|
|||||||
|
|
||||||
std::string log_message = "Detector Size (ports): (";
|
std::string log_message = "Detector Size (ports): (";
|
||||||
for (int i = 0; i < MAX_DIMENSIONS; ++i) {
|
for (int i = 0; i < MAX_DIMENSIONS; ++i) {
|
||||||
numModules = portGeometry[i] * size[i];
|
numModules[i] = portGeometry[i] * size[i];
|
||||||
log_message += std::to_string(numModules[i]);
|
log_message += std::to_string(numModules[i]);
|
||||||
if (i < MAX_DIMENSIONS - 1)
|
if (i < MAX_DIMENSIONS - 1)
|
||||||
log_message += ", ";
|
log_message += ", ";
|
||||||
@ -249,8 +249,8 @@ void Implementation::setModulePositionId(const int id) {
|
|||||||
assert(numModules[Y] != 0);
|
assert(numModules[Y] != 0);
|
||||||
for (unsigned int i = 0; i < listener.size(); ++i) {
|
for (unsigned int i = 0; i < listener.size(); ++i) {
|
||||||
uint16_t row = 0, col = 0;
|
uint16_t row = 0, col = 0;
|
||||||
row = (modulePos % numMods[Y]) * portGeometry[Y];
|
row = (modulePos % numModules[Y]) * portGeometry[Y];
|
||||||
col = (modulePos / numMods[Y]) * portGeometry[X] + i;
|
col = (modulePos / numModules[Y]) * portGeometry[X] + i;
|
||||||
|
|
||||||
listener[i]->SetHardCodedPosition(row, col);
|
listener[i]->SetHardCodedPosition(row, col);
|
||||||
}
|
}
|
||||||
@ -955,7 +955,8 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
|
|||||||
SetThreadPriorities();
|
SetThreadPriorities();
|
||||||
|
|
||||||
// update (from 1 to 2 interface) & also for printout
|
// update (from 1 to 2 interface) & also for printout
|
||||||
setDetectorSize(numModules);
|
int nm[2] = {numModules[X], numModules[Y]};
|
||||||
|
setDetectorSize(nm);
|
||||||
// update row and column in dataprocessor
|
// update row and column in dataprocessor
|
||||||
setModulePositionId(modulePos);
|
setModulePositionId(modulePos);
|
||||||
|
|
||||||
@ -1015,7 +1016,7 @@ void Implementation::setUDPSocketBufferSize(const int s) {
|
|||||||
// testing default setup at startup, argument is 0 to use default values
|
// testing default setup at startup, argument is 0 to use default values
|
||||||
int size = (s == 0) ? udpSocketBufferSize : s;
|
int size = (s == 0) ? udpSocketBufferSize : s;
|
||||||
size_t listSize = listener.size();
|
size_t listSize = listener.size();
|
||||||
if ((detType == JUNGFRAU || detytype == GOTTHARD2) &&
|
if ((detType == JUNGFRAU || detType == GOTTHARD2) &&
|
||||||
(int)listSize != numUDPInterfaces) {
|
(int)listSize != numUDPInterfaces) {
|
||||||
throw sls::RuntimeError(
|
throw sls::RuntimeError(
|
||||||
"Number of Interfaces " + std::to_string(numUDPInterfaces) +
|
"Number of Interfaces " + std::to_string(numUDPInterfaces) +
|
||||||
@ -1483,8 +1484,9 @@ void Implementation::setQuad(const bool b) {
|
|||||||
quadEnable = b;
|
quadEnable = b;
|
||||||
|
|
||||||
if (!quadEnable) {
|
if (!quadEnable) {
|
||||||
|
int nm[2] = {numModules[X], numModules[Y]};
|
||||||
for (const auto &it : dataStreamer) {
|
for (const auto &it : dataStreamer) {
|
||||||
it->SetNumberofModules(numModules);
|
it->SetNumberofModules(nm);
|
||||||
it->SetFlipRows(flipRows);
|
it->SetFlipRows(flipRows);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -35,7 +35,7 @@ class Implementation : private virtual slsDetectorDefs {
|
|||||||
* ************************************************/
|
* ************************************************/
|
||||||
|
|
||||||
void setDetectorType(const detectorType d);
|
void setDetectorType(const detectorType d);
|
||||||
PortGeometry *getDetectorSize() const;
|
PortGeometry getDetectorSize() const;
|
||||||
void setDetectorSize(const int *size);
|
void setDetectorSize(const int *size);
|
||||||
int getModulePositionId() const;
|
int getModulePositionId() const;
|
||||||
void setModulePositionId(const int id);
|
void setModulePositionId(const int id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user