diff --git a/slsDetectorSoftware/commonFiles/error_defs.h b/slsDetectorSoftware/commonFiles/error_defs.h index 149566820..5428db053 100644 --- a/slsDetectorSoftware/commonFiles/error_defs.h +++ b/slsDetectorSoftware/commonFiles/error_defs.h @@ -80,7 +80,10 @@ using namespace std; #define RECEIVER_FLIPPED_DATA_NOT_SET 0x0000000020000000ULL #define THRESHOLD_NOT_SET 0x0000000040000000ULL #define RECEIVER_FILE_FORMAT 0x0000000080000000ULL -#define RECEIVER_TIMER_NOT_SET 0x0000000100000000ULL +#define RECEIVER_SUBF_TIME_NOT_SET 0x0000000100000000ULL +#define RECEIVER_SILENT_MODE_NOT_SET 0x0000000200000000ULL +#define RECEIVER_TIMER_NOT_SET 0x0000000400000000ULL + // 0x0000000FFFFFFFFFULL /** @short class returning all error messages for error mask */ @@ -259,8 +262,16 @@ public: if(slsErrorMask&RECEIVER_FILE_FORMAT) retval.append("Could not set receiver file format\n"); +<<<<<<< HEAD if(slsErrorMask&RECEIVER_TIMER_NOT_SET) retval.append("Could not set timer in receiver.\n"); +======= + 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"); +>>>>>>> 3.0.1 //------------------------------------------------------ length of message diff --git a/slsDetectorSoftware/gitInfo.txt b/slsDetectorSoftware/gitInfo.txt index c93f8cb81..3321a278b 100644 --- a/slsDetectorSoftware/gitInfo.txt +++ b/slsDetectorSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsDetectorSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git -Repsitory UUID: 0fb1ff01209ad1aa975f39285814c2cc42db2678 -Revision: 1556 +Repsitory UUID: 1fd03e9cdd01efd75e3ab8641be71d61b2e1aa10 +Revision: 1566 Branch: 3.0.1 Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 1561 -Last Changed Date: 2017-09-20 18:27:25.000000002 +0200 ./slsDetectorAnalysis/postProcessing.cpp +Last Changed Rev: 1571 +Last Changed Date: 2017-10-03 14:12:22.000000002 +0200 ./slsDetector/slsDetector.cpp diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 782e4f015..976eefe5f 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -6233,6 +6233,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<receiver_hostname, 0, MAX_STR_LENGTH); + strcpy(thisDetector->receiver_hostname,"none"); + thisDetector->receiverOnlineFlag = OFFLINE_FLAG; + return string(thisDetector->receiver_hostname); + } + if(getRunStatus()==RUNNING){ cprintf(RED,"Acquisition already running, Stopping it.\n"); stopAcquisition(); @@ -7652,23 +7660,23 @@ slsDetectorDefs::synchronizationMode slsDetector::setSynchronization(synchroniza /*receiver*/ int slsDetector::setReceiverOnline(int off) { - if (off!=GET_ONLINE_FLAG) { - // setting flag to offline - if (off == OFFLINE_FLAG) - thisDetector->receiverOnlineFlag = off; - // set flag to online only if hostname not none - else if(strcmp(thisDetector->receiver_hostname,"none")){ - thisDetector->receiverOnlineFlag=off; - } - if (thisDetector->receiverOnlineFlag==ONLINE_FLAG){ - setReceiverTCPSocket(); - // error in connecting - if(thisDetector->receiverOnlineFlag==OFFLINE_FLAG){ - std::cout << "cannot connect to receiver" << endl; - setErrorMask((getErrorMask())|(CANNOT_CONNECT_TO_RECEIVER)); - } - } - } + if (off!=GET_ONLINE_FLAG) { + // no receiver + if(!strcmp(thisDetector->receiver_hostname,"none")) + thisDetector->receiverOnlineFlag = OFFLINE_FLAG; + else + thisDetector->receiverOnlineFlag = off; + // check receiver online + if (thisDetector->receiverOnlineFlag==ONLINE_FLAG){ + setReceiverTCPSocket(); + // error in connecting + if(thisDetector->receiverOnlineFlag==OFFLINE_FLAG){ + std::cout << "cannot connect to receiver" << endl; + setErrorMask((getErrorMask())|(CANNOT_CONNECT_TO_RECEIVER)); + } + } + + } return thisDetector->receiverOnlineFlag; } @@ -8717,9 +8725,9 @@ int slsDetector::enableTenGigabitEthernet(int i){ //must also configuremac if((i != -1)&&(retval == i)) if(configureMAC() != FAIL){ - ret = FAIL; - retval=-1; if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){ + ret = FAIL; + retval=-1; #ifdef VERBOSE std::cout << "Enabling / Disabling 10Gbe in receiver: " << i << std::endl; #endif @@ -8766,6 +8774,29 @@ int slsDetector::setReceiverFifoDepth(int i){ +int slsDetector::setReceiverSilentMode(int i){ + int fnum=F_SET_RECEIVER_SILENT_MODE; + int ret = FAIL; + int retval=-1; + + + if(thisDetector->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 7efee8e14..84236fc35 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.h +++ b/slsDetectorSoftware/slsDetector/slsDetector.h @@ -1811,6 +1811,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 66877b746..28a4cb493 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -2041,6 +2041,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 */ @@ -5996,6 +6004,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"); } @@ -6011,6 +6032,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; @@ -6019,6 +6041,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/slsDetectorUsers.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp index f540b7db2..5f12abefc 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp @@ -345,3 +345,7 @@ int slsDetectorUsers::stopReceiver() { int slsDetectorUsers::startAcquisition() { return myDetector->startAcquisition(); } + +int slsDetectorUsers::setReceiverSilentMode(int i) { + return myDetector->setReceiverSilentMode(i); +} diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUsers.h b/slsDetectorSoftware/slsDetector/slsDetectorUsers.h index 063658f64..0727bb49c 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUsers.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUsers.h @@ -603,6 +603,13 @@ class slsDetectorUsers */ int startAcquisition(); + /** + * set receiver in silent mode + * @param i 1 sets, 0 unsets (-1 gets) + * @return silent mode of receiver + */ + int setReceiverSilentMode(int i); + /************************************************************************ STATIC FUNCTIONS 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