mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 00:58:01 +02:00
added silent mode in receiver during real time acquisition, doesnt print packet loss regularly or file name created each time
This commit is contained in:
@ -282,6 +282,7 @@ const char* slsReceiverTCPIPInterface::getFunctionName(enum recFuncs func) {
|
||||
case F_SEND_RECEIVER_DETPOSID: return "F_SEND_RECEIVER_DETPOSID";
|
||||
case F_SEND_RECEIVER_MULTIDETSIZE: return "F_SEND_RECEIVER_MULTIDETSIZE";
|
||||
case F_SET_RECEIVER_STREAMING_PORT: return "F_SET_RECEIVER_STREAMING_PORT";
|
||||
case F_SET_RECEIVER_SILENT_MODE: return "F_SET_RECEIVER_SILENT_MODE";
|
||||
default: return "Unknown Function";
|
||||
}
|
||||
}
|
||||
@ -328,6 +329,7 @@ int slsReceiverTCPIPInterface::function_table(){
|
||||
flist[F_SEND_RECEIVER_DETPOSID] = &slsReceiverTCPIPInterface::set_detector_posid;
|
||||
flist[F_SEND_RECEIVER_MULTIDETSIZE] = &slsReceiverTCPIPInterface::set_multi_detector_size;
|
||||
flist[F_SET_RECEIVER_STREAMING_PORT] = &slsReceiverTCPIPInterface::set_streaming_port;
|
||||
flist[F_SET_RECEIVER_SILENT_MODE] = &slsReceiverTCPIPInterface::set_silent_mode;
|
||||
#ifdef VERYVERBOSE
|
||||
for (int i = 0; i < NUM_REC_FUNCTIONS ; i++) {
|
||||
FILE_LOG(logINFO) << "function fnum: " << i << " (" << getFunctionName((enum recFuncs)i) << ") located at " << (unsigned int)flist[i];
|
||||
@ -2366,3 +2368,53 @@ int slsReceiverTCPIPInterface::set_streaming_port() {
|
||||
// return ok/fail
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int slsReceiverTCPIPInterface::set_silent_mode() {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int value = -1;
|
||||
int retval = -1;
|
||||
|
||||
// receive arguments
|
||||
if (mySock->ReceiveDataOnly(&value,sizeof(value)) < 0 )
|
||||
return printSocketReadError();
|
||||
|
||||
// execute action
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
if (receiverBase == NULL)
|
||||
invalidReceiverObject();
|
||||
else {
|
||||
// set
|
||||
if(value >= 0) {
|
||||
if (mySock->differentClients && lockStatus)
|
||||
receiverlocked();
|
||||
else if (receiverBase->getStatus() != IDLE)
|
||||
receiverNotIdle();
|
||||
else {
|
||||
receiverBase->setSilentMode(value); // no check required
|
||||
}
|
||||
}
|
||||
//get
|
||||
retval = receiverBase->getSilentMode(); // no check required
|
||||
}
|
||||
#endif
|
||||
#ifdef VERYVERBOSE
|
||||
FILE_LOG(logDEBUG1) << "silent mode:" << retval;
|
||||
#endif
|
||||
|
||||
if (ret == OK && mySock->differentClients)
|
||||
ret = FORCE_UPDATE;
|
||||
|
||||
// send answer
|
||||
mySock->SendDataOnly(&ret,sizeof(ret));
|
||||
if (ret == FAIL)
|
||||
mySock->SendDataOnly(mess,sizeof(mess));
|
||||
mySock->SendDataOnly(&retval,sizeof(retval));
|
||||
|
||||
// return ok/fail
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user