mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
@ -397,6 +397,11 @@ int isTop(int *retval);
|
||||
int isMaster(int *retval);
|
||||
#endif
|
||||
|
||||
#ifdef JUNGFRAUD
|
||||
int getSynchronization();
|
||||
void setSynchronization(int enable);
|
||||
#endif
|
||||
|
||||
#ifdef GOTTHARD2D
|
||||
void updatingRegisters();
|
||||
#endif
|
||||
|
@ -304,3 +304,5 @@ int set_analog_pulsing(int);
|
||||
int get_digital_pulsing(int);
|
||||
int set_digital_pulsing(int);
|
||||
int get_module(int);
|
||||
int get_synchronization(int);
|
||||
int set_synchronization(int);
|
@ -468,6 +468,8 @@ void function_table() {
|
||||
flist[F_GET_DIGITAL_PULSING] = &get_digital_pulsing;
|
||||
flist[F_SET_DIGITAL_PULSING] = &set_digital_pulsing;
|
||||
flist[F_GET_MODULE] = &get_module;
|
||||
flist[F_GET_SYNCHRONIZATION] = &get_synchronization;
|
||||
flist[F_SET_SYNCHRONIZATION] = &set_synchronization;
|
||||
|
||||
// check
|
||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||
@ -10126,4 +10128,51 @@ int set_digital_pulsing(int file_des) {
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
int get_synchronization(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int retval = -1;
|
||||
|
||||
LOG(logDEBUG1, ("Getting synchronization\n"));
|
||||
|
||||
#ifndef JUNGFRAUD
|
||||
functionNotImplemented();
|
||||
#else
|
||||
retval = getSynchronization();
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int set_synchronization(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int arg = -1;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
LOG(logDEBUG1, ("Setting synchronization: %u\n", (int)arg));
|
||||
|
||||
#ifndef JUNGFRAUD
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
if (Server_VerifyLock() == OK) {
|
||||
if ((check_detector_idle("set synchronization") == OK) &&
|
||||
(arg != 0 && arg != 1)) {
|
||||
ret = FAIL;
|
||||
sprintf(mess,
|
||||
"Could not set synchronization. Invalid argument %d.\n",
|
||||
arg);
|
||||
LOG(logERROR, (mess));
|
||||
} else {
|
||||
setSynchronization(arg);
|
||||
int retval = getSynchronization();
|
||||
LOG(logDEBUG1, ("synchronization retval: %u\n", retval));
|
||||
validate(&ret, mess, arg, retval, "set synchronization", DEC);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user