mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
Merged developer branch with anna's modifications for chiptestboard
This commit is contained in:
parent
149610aa51
commit
70326f8b10
@ -176,6 +176,9 @@ private:
|
||||
/** Sets the receiver to send every nth frame to gui, or only upon gui request */
|
||||
int set_read_frequency();
|
||||
|
||||
/** Sets the timer between frames streamed by receiver when frequency is set to 0 */
|
||||
int set_read_receiver_timer();
|
||||
|
||||
/* Set the data stream enable */
|
||||
int set_data_stream_enable();
|
||||
|
||||
|
@ -52,7 +52,9 @@ enum {
|
||||
F_SET_RECEIVER_FIFO_DEPTH, /**< set receiver fifo depth */
|
||||
|
||||
F_ACTIVATE, /** < activate/deactivate readout */
|
||||
F_STREAM_DATA_FROM_RECEIVER /**< stream data from receiver to client */
|
||||
F_STREAM_DATA_FROM_RECEIVER, /**< stream data from receiver to client */
|
||||
|
||||
F_READ_RECEIVER_TIMER /** < sets the timer between each data stream in receiver */
|
||||
|
||||
|
||||
/* Always append functions hereafter!!! */
|
||||
|
@ -264,6 +264,7 @@ int slsReceiverTCPIPInterface::function_table(){
|
||||
flist[F_SET_RECEIVER_FIFO_DEPTH] = &slsReceiverTCPIPInterface::set_fifo_depth;
|
||||
flist[F_ACTIVATE] = &slsReceiverTCPIPInterface::set_activate;
|
||||
flist[F_STREAM_DATA_FROM_RECEIVER] = &slsReceiverTCPIPInterface::set_data_stream_enable;
|
||||
flist[F_READ_RECEIVER_TIMER] = &slsReceiverTCPIPInterface::set_read_receiver_timer;
|
||||
|
||||
|
||||
#ifdef VERYVERBOSE
|
||||
@ -2144,6 +2145,71 @@ int slsReceiverTCPIPInterface::set_read_frequency(){
|
||||
|
||||
|
||||
|
||||
|
||||
int slsReceiverTCPIPInterface::set_read_receiver_timer(){
|
||||
ret=OK;
|
||||
int retval=-1;
|
||||
int index;
|
||||
strcpy(mess,"Could not set receiver read timer\n");
|
||||
|
||||
|
||||
// receive arguments
|
||||
if(socket->ReceiveDataOnly(&index,sizeof(index)) < 0 ){
|
||||
strcpy(mess,"Error reading from socket\n");
|
||||
ret = FAIL;
|
||||
}
|
||||
|
||||
// execute action if the arguments correctly arrived
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
if (ret==OK) {
|
||||
if (lockStatus==1 && socket->differentClients==1){
|
||||
sprintf(mess,"Receiver locked by %s\n", socket->lastClientIP);
|
||||
ret=FAIL;
|
||||
}
|
||||
else if (receiverBase == NULL){
|
||||
strcpy(mess,SET_RECEIVER_ERR_MESSAGE);
|
||||
ret=FAIL;
|
||||
}
|
||||
else if(receiverBase->getStatus()==RUNNING || receiverBase->getStatus()==TRANSMITTING){
|
||||
strcpy(mess,"Can not set receiver frequency mode while receiver not idle\n");
|
||||
cprintf(RED,"%s\n",mess);
|
||||
ret = FAIL;
|
||||
}
|
||||
else{
|
||||
if(index >= 0 ){
|
||||
receiverBase->setDataStreamTimer(index);
|
||||
}
|
||||
retval=receiverBase->getDataStreamTimer();
|
||||
if(index>=0 && retval!=index){
|
||||
strcpy(mess,"Could not set datastream timer");
|
||||
cprintf(RED,"%s\n",mess);
|
||||
ret = FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if(ret==OK && socket->differentClients){
|
||||
FILE_LOG(logDEBUG) << "Force update";
|
||||
ret=FORCE_UPDATE;
|
||||
}
|
||||
|
||||
// send answer
|
||||
socket->SendDataOnly(&ret,sizeof(ret));
|
||||
if(ret==FAIL){
|
||||
cprintf(RED,"%s\n",mess);
|
||||
socket->SendDataOnly(mess,sizeof(mess));
|
||||
}
|
||||
socket->SendDataOnly(&retval,sizeof(retval));
|
||||
|
||||
//return ok/fail
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int slsReceiverTCPIPInterface::set_data_stream_enable(){
|
||||
ret=OK;
|
||||
int retval=-1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user