diff --git a/slsDetectorSoftware/commonFiles/error_defs.h b/slsDetectorSoftware/commonFiles/error_defs.h index ac4787cff..922d1b08d 100644 --- a/slsDetectorSoftware/commonFiles/error_defs.h +++ b/slsDetectorSoftware/commonFiles/error_defs.h @@ -81,6 +81,7 @@ using namespace std; #define THRESHOLD_NOT_SET 0x0000000040000000ULL #define RECEIVER_FILE_FORMAT 0x0000000080000000ULL #define RECEIVER_SUBF_TIME_NOT_SET 0x0000000100000000ULL +#define RECEIVER_SILENT_MODE_NOT_SET 0x0000000200000000ULL // 0x0000000FFFFFFFFFULL /** @short class returning all error messages for error mask */ @@ -262,6 +263,8 @@ public: if(slsErrorMask&RECEIVER_SUBF_TIME_NOT_SET) retval.append("Could not set sub exposure time in receiver.\n"); + if(slsErrorMask&RECEIVER_SILENT_MODE_NOT_SET) + retval.append("Could not set silent mode in receiver.\n"); //------------------------------------------------------ length of message diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 62c8a45ee..462ceeb2a 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -6266,6 +6266,20 @@ int multiSlsDetector::setReceiverFifoDepth(int i){ } +int multiSlsDetector::setReceiverSilentMode(int i){ + int ret=-100,ret1; + for (int idet=0; idetnumberOfDetectors; ++idet) + if (detectors[idet]){ + ret1=detectors[idet]->setReceiverSilentMode(i); + if(detectors[idet]->getErrorMask()) + setErrorMask(getErrorMask()|(1<receiverOnlineFlag==ONLINE_FLAG){ +#ifdef VERBOSE + if(i ==-1) + std::cout<< "Getting Receiver Silent Mode" << endl; + else + std::cout<< "Setting Receiver Silent Mode to " << i << endl; +#endif + if (connectData() == OK){ + ret=thisReceiver->sendInt(fnum,retval,i); + disconnectData(); + } + if(ret==FAIL) + setErrorMask((getErrorMask())|(RECEIVER_SILENT_MODE_NOT_SET)); + } + return retval; +} + /******** CTB funcs */ diff --git a/slsDetectorSoftware/slsDetector/slsDetector.h b/slsDetectorSoftware/slsDetector/slsDetector.h index d8272964c..97a40e9f2 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.h +++ b/slsDetectorSoftware/slsDetector/slsDetector.h @@ -1812,6 +1812,12 @@ class slsDetector : public slsDetectorUtils, public energyConversion { */ int setReceiverFifoDepth(int i = -1); + /** set/get receiver silent mode + * @param i is -1 to get, 0 unsets silent mode, 1 sets silent mode + /returns the receiver silent mode enable + */ + int setReceiverSilentMode(int i = -1); + /******** CTB funcs */ /** opens pattern file and sends pattern to CTB diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index 17aa3edef..83960ada2 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -2033,6 +2033,14 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) { descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; ++i; + /*! \page receiver + - r_silent [i] sets/gets receiver in silent mode, ie. it will not print anything during real time acquisition. 1 sets, 0 unsets. \c Returns \c (int) + */ + descrToFuncMap[i].m_pFuncName="r_silent"; // + descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver; + ++i; + + /* pattern generator */ @@ -5983,6 +5991,19 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) { } + else if(cmd=="r_silent"){ + if (action==PUT_ACTION){ + if (!sscanf(args[1],"%d",&ival)) + return string("Could not scan r_online input ")+string(args[1]); + if(ival>=0) + sprintf(answer,"%d",myDet->setReceiverSilentMode(ival)); + }else + sprintf(answer,"%d",myDet->setReceiverSilentMode()); + return string(answer); + + } + + return string("could not decode command"); } @@ -5998,6 +6019,7 @@ string slsDetectorCommand::helpReceiver(int narg, char *args[], int action) { os << "r_readfreq \t sets the gui read frequency of the receiver, 0 if gui requests frame, >0 if receiver sends every nth frame to gui" << std::endl; os << "tengiga \t sets system to be configure for 10Gbe if set to 1, else 1Gbe if set to 0" << std::endl; os << "rx_fifodepth [val]\t sets receiver fifo depth to val" << std::endl; + os << "r_silent [i]\t sets receiver in silent mode, ie. it will not print anything during real time acquisition. 1 sets, 0 unsets." << std::endl; } if (action==GET_ACTION || action==HELP_ACTION){ os << "receiver \t returns the status of receiver - can be running or idle" << std::endl; @@ -6006,6 +6028,7 @@ string slsDetectorCommand::helpReceiver(int narg, char *args[], int action) { os << "r_readfreq \t returns the gui read frequency of the receiver" << std::endl; os << "tengiga \t returns 1 if the system is configured for 10Gbe else 0 for 1Gbe" << std::endl; os << "rx_fifodepth \t returns receiver fifo depth" << std::endl; + os << "r_silent \t returns receiver silent mode enable. 1 is silent, 0 not silent." << std::endl; } return os.str(); diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h index c88b916c8..cf1cbd2d4 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h @@ -774,6 +774,12 @@ virtual int enableTenGigabitEthernet(int i = -1)=0; */ virtual int setReceiverFifoDepth(int i = -1)=0; +/** set/get receiver silent mode + * @param i is -1 to get, 0 unsets silent mode, 1 sets silent mode + /returns the receiver silent mode enable + */ +virtual int setReceiverSilentMode(int i = -1)=0; + /******** CTB funcs */ /** opens pattern file and sends pattern to CTB