mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
virtual, adding veto command
This commit is contained in:
@ -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) {
|
||||
@ -7420,3 +7422,43 @@ 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);
|
||||
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