mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 11:20:04 +02:00
multisize to numberofdetectors
This commit is contained in:
parent
e09fc8cd2b
commit
b5781e1f9b
@ -6916,7 +6916,7 @@ int get_receiver_parameters(int file_des) {
|
||||
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
// multisize
|
||||
// numberOfDetector
|
||||
i32 = 0;
|
||||
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||
if (n < 0)
|
||||
|
@ -315,7 +315,7 @@ void DetectorImpl::updateDetectorSize() {
|
||||
<< multi_shm()->numberOfChannels.y;
|
||||
|
||||
for (auto &d : detectors) {
|
||||
d->updateMultiSize(multi_shm()->numberOfDetector);
|
||||
d->updateNumberOfDetector(multi_shm()->numberOfDetector);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -375,8 +375,8 @@ void Module::initializeDetectorStructure(detectorType type) {
|
||||
shm()->shmversion = SLS_SHMVERSION;
|
||||
memset(shm()->hostname, 0, MAX_STR_LENGTH);
|
||||
shm()->myDetectorType = type;
|
||||
shm()->multiSize.x = 0;
|
||||
shm()->multiSize.y = 0;
|
||||
shm()->numberOfDetector.x = 0;
|
||||
shm()->numberOfDetector.y = 0;
|
||||
shm()->controlPort = DEFAULT_PORTNO;
|
||||
shm()->stopPort = DEFAULT_PORTNO + 1;
|
||||
sls::strcpy_safe(shm()->settingsDir, getenv("HOME"));
|
||||
@ -558,9 +558,9 @@ void Module::setReadNLines(const int value) {
|
||||
|
||||
int Module::getReadNLines() { return sendToDetector<int>(F_GET_READ_N_LINES); }
|
||||
|
||||
void Module::updateMultiSize(slsDetectorDefs::xy det) {
|
||||
shm()->multiSize = det;
|
||||
int args[2] = {shm()->multiSize.y, detId};
|
||||
void Module::updateNumberOfDetector(slsDetectorDefs::xy det) {
|
||||
shm()->numberOfDetector = det;
|
||||
int args[2] = {shm()->numberOfDetector.y, detId};
|
||||
sendToDetector(F_SET_POSITION, args, nullptr);
|
||||
}
|
||||
|
||||
@ -1434,15 +1434,17 @@ void Module::setReceiverHostname(const std::string &receiverIP) {
|
||||
|
||||
// populate from shared memory
|
||||
retval.detType = shm()->myDetectorType;
|
||||
retval.multiSize.x = shm()->multiSize.x;
|
||||
retval.multiSize.y = shm()->multiSize.y;
|
||||
retval.numberOfDetector.x = shm()->numberOfDetector.x;
|
||||
retval.numberOfDetector.y = shm()->numberOfDetector.y;
|
||||
retval.detId = detId;
|
||||
memset(retval.hostname, 0, sizeof(retval.hostname));
|
||||
strcpy_safe(retval.hostname, shm()->hostname);
|
||||
|
||||
LOG(logDEBUG1) << "detType:" << retval.detType << std::endl
|
||||
<< "multiSize.x:" << retval.multiSize.x << std::endl
|
||||
<< "multiSize.y:" << retval.multiSize.y << std::endl
|
||||
<< "numberOfDetector.x:" << retval.numberOfDetector.x
|
||||
<< std::endl
|
||||
<< "numberOfDetector.y:" << retval.numberOfDetector.y
|
||||
<< std::endl
|
||||
<< "detId:" << retval.detId << std::endl
|
||||
<< "hostname:" << retval.hostname << std::endl
|
||||
<< "udpInterfaces:" << retval.udpInterfaces << std::endl
|
||||
|
@ -26,20 +26,14 @@ struct sharedSlsDetector {
|
||||
|
||||
/* FIXED PATTERN FOR STATIC FUNCTIONS. DO NOT CHANGE, ONLY APPEND ------*/
|
||||
|
||||
/** shared memory version */
|
||||
int shmversion;
|
||||
|
||||
/** is the hostname (or IP address) of the detector. needs to be set
|
||||
* before starting the communication */
|
||||
char hostname[MAX_STR_LENGTH];
|
||||
|
||||
/** detector type \ see :: detectorType*/
|
||||
slsDetectorDefs::detectorType myDetectorType;
|
||||
|
||||
/** END OF FIXED PATTERN -----------------------------------------------*/
|
||||
|
||||
/** Number of detectors in multi list in x dir and y dir */
|
||||
slsDetectorDefs::xy multiSize;
|
||||
slsDetectorDefs::xy numberOfDetector;
|
||||
|
||||
/** is the port used for control functions */
|
||||
int controlPort;
|
||||
@ -212,7 +206,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
* Set Detector offset in shared memory in dimension d
|
||||
* @param det detector size
|
||||
*/
|
||||
void updateMultiSize(slsDetectorDefs::xy det);
|
||||
void updateNumberOfDetector(slsDetectorDefs::xy det);
|
||||
|
||||
int setControlPort(int port_number);
|
||||
|
||||
|
@ -339,8 +339,10 @@ int ClientInterface::get_version(Interface &socket) {
|
||||
int ClientInterface::setup_receiver(Interface &socket) {
|
||||
auto arg = socket.Receive<rxParameters>();
|
||||
LOG(logDEBUG) << "detType:" << arg.detType << std::endl
|
||||
<< "multiSize.x:" << arg.multiSize.x << std::endl
|
||||
<< "multiSize.y:" << arg.multiSize.y << std::endl
|
||||
<< "numberOfDetector.x:" << arg.numberOfDetector.x
|
||||
<< std::endl
|
||||
<< "numberOfDetector.y:" << arg.numberOfDetector.y
|
||||
<< std::endl
|
||||
<< "detId:" << arg.detId << std::endl
|
||||
<< "hostname:" << arg.hostname << std::endl
|
||||
<< "udpInterfaces:" << arg.udpInterfaces << std::endl
|
||||
@ -389,8 +391,8 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
||||
// basic setup
|
||||
setDetectorType(arg.detType);
|
||||
{
|
||||
int msize[2] = {arg.multiSize.x, arg.multiSize.y};
|
||||
impl()->setMultiDetectorSize(msize);
|
||||
int msize[2] = {arg.numberOfDetector.x, arg.numberOfDetector.y};
|
||||
impl()->setDetectorSize(msize);
|
||||
}
|
||||
impl()->setDetectorPositionId(arg.detId);
|
||||
impl()->setDetectorHostname(arg.hostname);
|
||||
|
@ -315,12 +315,12 @@ void Implementation::setDetectorType(const detectorType d) {
|
||||
LOG(logDEBUG) << " Detector type set to " << sls::ToString(d);
|
||||
}
|
||||
|
||||
int *Implementation::getMultiDetectorSize() const {
|
||||
int *Implementation::getDetectorSize() const {
|
||||
LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||
return (int *)numDet;
|
||||
}
|
||||
|
||||
void Implementation::setMultiDetectorSize(const int *size) {
|
||||
void Implementation::setDetectorSize(const int *size) {
|
||||
LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||
std::string log_message = "Detector Size (ports): (";
|
||||
for (int i = 0; i < MAX_DIMENSIONS; ++i) {
|
||||
@ -1062,7 +1062,7 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
|
||||
SetThreadPriorities();
|
||||
|
||||
// update (from 1 to 2 interface) & also for printout
|
||||
setMultiDetectorSize(numDet);
|
||||
setDetectorSize(numDet);
|
||||
// update row and column in dataprocessor
|
||||
setDetectorPositionId(detID);
|
||||
|
||||
|
@ -28,8 +28,8 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
* ************************************************/
|
||||
|
||||
void setDetectorType(const detectorType d);
|
||||
int *getMultiDetectorSize() const;
|
||||
void setMultiDetectorSize(const int *size);
|
||||
int *getDetectorSize() const;
|
||||
void setDetectorSize(const int *size);
|
||||
int getDetectorPositionId() const;
|
||||
void setDetectorPositionId(const int id);
|
||||
std::string getDetectorHostname() const;
|
||||
|
@ -445,7 +445,7 @@ typedef struct {
|
||||
*/
|
||||
struct rxParameters {
|
||||
detectorType detType{GENERIC};
|
||||
xy multiSize;
|
||||
xy numberOfDetector;
|
||||
int detId{0};
|
||||
char hostname[MAX_STR_LENGTH];
|
||||
int udpInterfaces{1};
|
||||
|
Loading…
x
Reference in New Issue
Block a user