mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 17:18:00 +02:00
merge vetoheader
This commit is contained in:
@ -518,6 +518,8 @@ void setCurrentSource(int value);
|
||||
int getCurrentSource();
|
||||
void setTimingSource(enum timingSourceType value);
|
||||
enum timingSourceType getTimingSource();
|
||||
void setVeto(int enable);
|
||||
int getVeto();
|
||||
#endif
|
||||
|
||||
#if defined(JUNGFRAUD) || defined(EIGERD)
|
||||
|
@ -224,4 +224,6 @@ int get_num_gates(int);
|
||||
int set_gate_delay(int);
|
||||
int get_gate_delay(int);
|
||||
int get_exptime_all_gates(int);
|
||||
int get_gate_delay_all_gates(int);
|
||||
int get_gate_delay_all_gates(int);
|
||||
int get_veto(int);
|
||||
int set_veto(int);
|
@ -336,6 +336,8 @@ void function_table() {
|
||||
flist[F_GET_GATE_DELAY] = &get_gate_delay;
|
||||
flist[F_GET_EXPTIME_ALL_GATES] = &get_exptime_all_gates;
|
||||
flist[F_GET_GATE_DELAY_ALL_GATES] = &get_gate_delay_all_gates;
|
||||
flist[F_GET_VETO] = &get_veto;
|
||||
flist[F_SET_VETO] = &set_veto;
|
||||
|
||||
// check
|
||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||
@ -7429,3 +7431,62 @@ int get_gate_delay_all_gates(int file_des) {
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT64, retvals, sizeof(retvals));
|
||||
}
|
||||
|
||||
int get_veto(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int retval = -1;
|
||||
|
||||
LOG(logDEBUG1, ("Getting veto\n"));
|
||||
|
||||
#ifndef GOTTHARD2D
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
retval = getVeto();
|
||||
LOG(logDEBUG1, ("veto mode retval: %u\n", retval));
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int set_veto(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int arg = 0;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
LOG(logINFO, ("Setting veto mode: %u\n", arg));
|
||||
|
||||
#ifndef GOTTHARD2D
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
if (Server_VerifyLock() == OK) {
|
||||
setVeto(arg);
|
||||
// if numinterfaces is 2 and veto is 1 now, then configuremac
|
||||
if (arg > 0 && getNumberofUDPInterfaces() == 2 &&
|
||||
is_configurable() == OK) {
|
||||
ret = configureMAC();
|
||||
if (ret != OK) {
|
||||
sprintf(mess, "Configure Mac failed after enabling veto\n");
|
||||
strcpy(configureMessage, mess);
|
||||
LOG(logERROR, (mess));
|
||||
configured = FAIL;
|
||||
LOG(logWARNING, ("Configure FAIL, not all parameters "
|
||||
"configured yet\n"));
|
||||
|
||||
} else {
|
||||
LOG(logINFOGREEN, ("\tConfigure MAC successful\n"));
|
||||
configured = OK;
|
||||
}
|
||||
}
|
||||
if (ret == OK) {
|
||||
int retval = getVeto();
|
||||
LOG(logDEBUG1, ("veto mode retval: %u\n", retval));
|
||||
validate(arg, retval, "set veto mode", DEC);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user