diff --git a/slsReceiverSoftware/include/BinaryFile.h b/slsReceiverSoftware/include/BinaryFile.h index 5e4512075..449a5d436 100644 --- a/slsReceiverSoftware/include/BinaryFile.h +++ b/slsReceiverSoftware/include/BinaryFile.h @@ -33,10 +33,12 @@ class BinaryFile : private virtual slsReceiverDefs, public File, public BinaryFi * @param nf pointer to number of images in acquisition * @param dr pointer to dynamic range * @param portno pointer to udp port number for logging + * @param smode pointer to silent mode */ BinaryFile(int ind, uint32_t maxf, const uint32_t* ppf, int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable, - int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno); + int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno, + bool* smode); /** * Destructor diff --git a/slsReceiverSoftware/include/DataProcessor.h b/slsReceiverSoftware/include/DataProcessor.h index 26be77690..0b5a71737 100644 --- a/slsReceiverSoftware/include/DataProcessor.h +++ b/slsReceiverSoftware/include/DataProcessor.h @@ -64,6 +64,12 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject { */ static void ResetRunningMask(); + /** + * Set Silent Mode + * @param mode 1 sets 0 unsets + */ + static void SetSilentMode(bool mode); + //*** non static functions *** //*** getters *** /** @@ -284,6 +290,9 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject { /** Fifo structure */ Fifo* fifo; + /** Silent Mode */ + static bool SilentMode; + //individual members /** File writer implemented as binary or hdf5 File */ diff --git a/slsReceiverSoftware/include/DataStreamer.h b/slsReceiverSoftware/include/DataStreamer.h index cecaa24ba..796055443 100644 --- a/slsReceiverSoftware/include/DataStreamer.h +++ b/slsReceiverSoftware/include/DataStreamer.h @@ -51,6 +51,12 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject { */ static void ResetRunningMask(); + /** + * Set Silent Mode + * @param mode 1 sets 0 unsets + */ + static void SetSilentMode(bool mode); + //*** non static functions *** //*** getters *** @@ -181,6 +187,11 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject { /** Fifo structure */ Fifo* fifo; + /** Silent Mode */ + static bool SilentMode; + + + /** ZMQ Socket - Receiver to Client */ ZmqSocket* zmqSocket; diff --git a/slsReceiverSoftware/include/File.h b/slsReceiverSoftware/include/File.h index b5aaaacab..955c10fc5 100644 --- a/slsReceiverSoftware/include/File.h +++ b/slsReceiverSoftware/include/File.h @@ -33,10 +33,12 @@ class File : private virtual slsReceiverDefs { * @param nf pointer to number of images in acquisition * @param dr pointer to dynamic range * @param portno pointer to udp port number for logging + * @param smode pointer to silent mode */ File(int ind, uint32_t maxf, const uint32_t* ppf, int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable, - int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno); + int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno, + bool* smode); /** * Destructor @@ -213,5 +215,8 @@ class File : private virtual slsReceiverDefs { /** UDP Port Number for logging */ uint32_t* udpPortNumber; + /** Silent Mode */ + bool silentMode; + }; diff --git a/slsReceiverSoftware/include/HDF5File.h b/slsReceiverSoftware/include/HDF5File.h index bff50080d..4abae2f7e 100644 --- a/slsReceiverSoftware/include/HDF5File.h +++ b/slsReceiverSoftware/include/HDF5File.h @@ -41,11 +41,13 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt * @param portno pointer to udp port number for logging * @param nx number of pixels in x direction * @param ny number of pixels in y direction + * @param smode pointer to silent mode */ HDF5File(int ind, uint32_t maxf, const uint32_t* ppf, int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable, int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno, - uint32_t nx, uint32_t ny); + uint32_t nx, uint32_t ny, + bool* smode); /** * Destructor diff --git a/slsReceiverSoftware/include/Listener.h b/slsReceiverSoftware/include/Listener.h index e2aa7c971..575add7e1 100644 --- a/slsReceiverSoftware/include/Listener.h +++ b/slsReceiverSoftware/include/Listener.h @@ -57,6 +57,12 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject { */ static void ResetRunningMask(); + /** + * Set Silent Mode + * @param mode 1 sets 0 unsets + */ + static void SetSilentMode(bool mode); + //*** non static functions *** //*** getters *** @@ -217,6 +223,9 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject { /** Fifo structure */ Fifo* fifo; + /** Silent Mode */ + static bool SilentMode; + // individual members /** Detector Type */ @@ -258,7 +267,7 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject { uint64_t firstMeasurementIndex; - // for statistics + // for acquisition summary /** Number of complete Packets caught for each real time acquisition (eg. for each scan (start& stop of receiver)) */ volatile uint64_t numPacketsCaught; @@ -287,8 +296,12 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject { /** if the udp socket is connected */ bool udpSocketAlive; + + // for print progress during acqusition + /** number of packets for statistic */ uint32_t numPacketsStatistic; + /** number of images for statistic */ uint32_t numFramesStatistic; }; diff --git a/slsReceiverSoftware/include/UDPBaseImplementation.h b/slsReceiverSoftware/include/UDPBaseImplementation.h index 8e4a54b6b..45d8aed98 100644 --- a/slsReceiverSoftware/include/UDPBaseImplementation.h +++ b/slsReceiverSoftware/include/UDPBaseImplementation.h @@ -245,6 +245,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter */ runStatus getStatus() const; + /** + * Get Silent Mode + * @return silent mode + */ + uint32_t getSilentMode() const; + /** * Get activate * If deactivated, receiver will write dummy packets 0xFF @@ -456,6 +462,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter */ int setFifoDepth(const uint32_t i); + //***receiver parameters*** + /** + * Set Silent Mode + * @param i silent mode. 1 sets, 0 unsets + */ + void setSilentMode(const uint32_t i); /************************************************************************* * Behavioral functions*************************************************** @@ -671,6 +683,11 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter /** streaming port */ char streamingSrcIP[MAX_STR_LENGTH]; + //***receiver parameters*** + uint32_t silentMode; + + + //***callback parameters*** /** * Call back for start acquisition diff --git a/slsReceiverSoftware/include/UDPInterface.h b/slsReceiverSoftware/include/UDPInterface.h index d12b60032..a32e9d009 100644 --- a/slsReceiverSoftware/include/UDPInterface.h +++ b/slsReceiverSoftware/include/UDPInterface.h @@ -331,6 +331,12 @@ class UDPInterface { */ virtual slsReceiverDefs::runStatus getStatus() const = 0; + /** + * Get Silent Mode + * @return silent mode + */ + virtual uint32_t getSilentMode() const = 0; + /** * Get activate * If deactivated, receiver will write dummy packets 0xFF @@ -543,6 +549,14 @@ class UDPInterface { virtual int setFifoDepth(const uint32_t i) = 0; + //***receiver parameters*** + /** + * Set Silent Mode + * @param i silent mode. 1 sets, 0 unsets + */ + virtual void setSilentMode(const uint32_t i) = 0; + + /************************************************************************* * Behavioral functions*************************************************** * They may modify the status of the receiver **************************** diff --git a/slsReceiverSoftware/include/UDPStandardImplementation.h b/slsReceiverSoftware/include/UDPStandardImplementation.h index 4136f91f2..9f6deee8c 100644 --- a/slsReceiverSoftware/include/UDPStandardImplementation.h +++ b/slsReceiverSoftware/include/UDPStandardImplementation.h @@ -115,6 +115,12 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase */ int setFifoDepth(const uint32_t i); + /** + * Set Silent Mode + * @param i silent mode. 1 sets, 0 unsets + */ + void setSilentMode(const uint32_t i); + /** * Set receiver type (and corresponding detector variables in derived STANDARD class) * It is the first function called by the client when connecting to receiver diff --git a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h index 885c7ef90..1f5be418e 100644 --- a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h +++ b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h @@ -261,6 +261,9 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs { /** set streaming source ip */ int set_streaming_source_ip(); + /** set silent mode */ + int set_silent_mode(); + /** enable gap pixels */ int enable_gap_pixels(); diff --git a/slsReceiverSoftware/include/sls_receiver_funcs.h b/slsReceiverSoftware/include/sls_receiver_funcs.h index cd29bfe8c..695e77815 100644 --- a/slsReceiverSoftware/include/sls_receiver_funcs.h +++ b/slsReceiverSoftware/include/sls_receiver_funcs.h @@ -60,6 +60,7 @@ enum recFuncs{ F_SEND_RECEIVER_MULTIDETSIZE, /** < sets the multi detector size to the receiver */ F_SET_RECEIVER_STREAMING_PORT, /** < sets the receiver streaming port */ F_RECEIVER_STREAMING_SRC_IP, /** < sets the receiver streaming source IP */ + F_SET_RECEIVER_SILENT_MODE, /** < sets the receiver silent mode */ F_ENABLE_GAPPIXELS_IN_RECEIVER, /** < sets gap pixels in the receiver */ /* Always append functions hereafter!!! */ diff --git a/slsReceiverSoftware/src/BinaryFile.cpp b/slsReceiverSoftware/src/BinaryFile.cpp index e0c7bb681..8de0d87de 100644 --- a/slsReceiverSoftware/src/BinaryFile.cpp +++ b/slsReceiverSoftware/src/BinaryFile.cpp @@ -16,9 +16,9 @@ FILE* BinaryFile::masterfd = 0; BinaryFile::BinaryFile(int ind, uint32_t maxf, const uint32_t* ppf, int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable, - int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno): - - File(ind, maxf, ppf, nd, fname, fpath, findex, owenable, dindex, nunits, nf, dr, portno), + int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno, + bool* smode): + File(ind, maxf, ppf, nd, fname, fpath, findex, owenable, dindex, nunits, nf, dr, portno, smode), filefd(0), numFramesInFile(0), numActualPacketsInFile(0) @@ -53,7 +53,8 @@ int BinaryFile::CreateFile(uint64_t fnum) { if (BinaryFileStatic::CreateDataFile(filefd, *overWriteEnable, currentFileName, FILE_BUFFER_SIZE) == FAIL) return FAIL; - FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName; + if(!silentMode) + FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName; return OK; } @@ -89,7 +90,8 @@ int BinaryFile::CreateMasterFile(bool en, uint32_t size, if (master && (*detIndex==0)) { masterFileName = BinaryFileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex); - FILE_LOG(logINFO) << "Master File: " << masterFileName; + if(!silentMode) + FILE_LOG(logINFO) << "Master File: " << masterFileName; return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable, *dynamicRange, en, size, nx, ny, *numImages, at, st, ap, BINARY_WRITER_VERSION); diff --git a/slsReceiverSoftware/src/DataProcessor.cpp b/slsReceiverSoftware/src/DataProcessor.cpp index 1b9d6544c..5d7131d8d 100644 --- a/slsReceiverSoftware/src/DataProcessor.cpp +++ b/slsReceiverSoftware/src/DataProcessor.cpp @@ -30,6 +30,8 @@ uint64_t DataProcessor::RunningMask(0x0); pthread_mutex_t DataProcessor::Mutex = PTHREAD_MUTEX_INITIALIZER; +bool DataProcessor::SilentMode(false); + DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool* fwenable, bool* dsEnable, uint32_t* freq, uint32_t* timer, @@ -90,6 +92,10 @@ void DataProcessor::ResetRunningMask() { RunningMask = 0x0; } +void DataProcessor::SetSilentMode(bool mode) { + SilentMode = mode; +} + /** non static functions */ /** getters */ string DataProcessor::GetType(){ @@ -237,13 +243,13 @@ void DataProcessor::SetupFileWriter(int* nd, char* fname, char* fpath, uint64_t* file = new HDF5File(index, generalData->maxFramesPerFile, &generalData->packetsPerFrame, nd, fname, fpath, findex, owenable, dindex, nunits, nf, dr, portno, - generalData->nPixelsX, generalData->nPixelsY); + generalData->nPixelsX, generalData->nPixelsY, &SilentMode); break; #endif default: file = new BinaryFile(index, generalData->maxFramesPerFile, &generalData->packetsPerFrame, nd, fname, fpath, findex, owenable, - dindex, nunits, nf, dr, portno); + dindex, nunits, nf, dr, portno, &SilentMode); break; } } diff --git a/slsReceiverSoftware/src/DataStreamer.cpp b/slsReceiverSoftware/src/DataStreamer.cpp index 5f83f9514..47be68a65 100644 --- a/slsReceiverSoftware/src/DataStreamer.cpp +++ b/slsReceiverSoftware/src/DataStreamer.cpp @@ -23,6 +23,8 @@ uint64_t DataStreamer::RunningMask(0x0); pthread_mutex_t DataStreamer::Mutex = PTHREAD_MUTEX_INITIALIZER; +bool DataStreamer::SilentMode(false); + DataStreamer::DataStreamer(Fifo*& f, uint32_t* dr, int* sEnable) : ThreadObject(NumberofDataStreamers), @@ -71,6 +73,11 @@ void DataStreamer::ResetRunningMask() { RunningMask = 0x0; } +void DataStreamer::SetSilentMode(bool mode) { + SilentMode = mode; +} + + /** non static functions */ /** getters */ string DataStreamer::GetType(){ diff --git a/slsReceiverSoftware/src/File.cpp b/slsReceiverSoftware/src/File.cpp index 2205759f7..fa55c5357 100644 --- a/slsReceiverSoftware/src/File.cpp +++ b/slsReceiverSoftware/src/File.cpp @@ -12,7 +12,8 @@ using namespace std; File::File(int ind, uint32_t maxf, const uint32_t* ppf, int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable, - int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno): + int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno, + bool* smode): index(ind), maxFramesPerFile(maxf), packetsPerFrame(ppf), @@ -26,7 +27,8 @@ File::File(int ind, uint32_t maxf, const uint32_t* ppf, numUnitsPerDetector(nunits), numImages(nf), dynamicRange(dr), - udpPortNumber(portno) + udpPortNumber(portno), + silentMode(smode) { master = index?false:true; @@ -56,7 +58,8 @@ void File::PrintMembers() { << "Dynamic Range: " << *dynamicRange << endl << "UDP Port number: " << *udpPortNumber << endl << "Master File Name: " << masterFileName << endl - << "Current File Name: " << currentFileName; + << "Current File Name: " << currentFileName << endl + << "Silent Mode: " << silentMode; } diff --git a/slsReceiverSoftware/src/HDF5File.cpp b/slsReceiverSoftware/src/HDF5File.cpp index dd12eabd6..ab17079ea 100644 --- a/slsReceiverSoftware/src/HDF5File.cpp +++ b/slsReceiverSoftware/src/HDF5File.cpp @@ -25,9 +25,10 @@ HDF5File::HDF5File(int ind, uint32_t maxf, const uint32_t* ppf, int* nd, char* fname, char* fpath, uint64_t* findex, bool* frindexenable, bool* owenable, int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno, - uint32_t nx, uint32_t ny): + uint32_t nx, uint32_t ny, + bool* smode): - File(ind, maxf, ppf, nd, fname, fpath, findex, frindexenable, owenable, dindex, nunits, nf, dr, portno), + File(ind, maxf, ppf, nd, fname, fpath, findex, frindexenable, owenable, dindex, nunits, nf, dr, portno, smode), filefd(0), dataspace(0), dataset(0), @@ -110,7 +111,8 @@ int HDF5File::CreateFile(uint64_t fnum) { if (dataspace == NULL) bprintf(RED,"Got nothing!\n"); - FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName; + if(!silentMode) + FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName; return OK; } @@ -171,7 +173,8 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size, if (master && (*detIndex==0)) { virtualfd = 0; masterFileName = HDF5FileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex); - FILE_LOG(logINFO) << "Master File: " << masterFileName; + if(!silentMode) + FILE_LOG(logINFO) << "Master File: " << masterFileName; pthread_mutex_lock(&Mutex); int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable, *dynamicRange, en, size, nx, ny, *numImages, at, st, ap, HDF5_WRITER_VERSION); diff --git a/slsReceiverSoftware/src/Listener.cpp b/slsReceiverSoftware/src/Listener.cpp index aaac550b0..f1737af05 100644 --- a/slsReceiverSoftware/src/Listener.cpp +++ b/slsReceiverSoftware/src/Listener.cpp @@ -26,6 +26,8 @@ uint64_t Listener::RunningMask(0x0); pthread_mutex_t Listener::Mutex = PTHREAD_MUTEX_INITIALIZER; +bool Listener::SilentMode(false); + Listener::Listener(detectorType dtype, Fifo*& f, runStatus* s, uint32_t* portno, char* e, int* act, uint64_t* nf, uint32_t* dr) : ThreadObject(NumberofListeners), @@ -93,6 +95,9 @@ void Listener::ResetRunningMask() { RunningMask = 0x0; } +void Listener::SetSilentMode(bool mode) { + SilentMode = mode; +} /** non static functions */ /** getters */ @@ -183,10 +188,13 @@ void Listener::RecordFirstIndices(uint64_t fnum) { acquisitionStartedFlag = true; firstAcquisitionIndex = fnum; } - if (!index) bprintf(BLUE,"%d First Acquisition Index:%lu\n" - "%d First Measurement Index:%lu\n", - index, firstAcquisitionIndex, - index, firstMeasurementIndex); + + if(!SilentMode) { + if (!index) bprintf(BLUE,"%d First Acquisition Index:%lu\n" + "%d First Measurement Index:%lu\n", + index, firstAcquisitionIndex, + index, firstMeasurementIndex); + } } @@ -299,9 +307,11 @@ void Listener::ThreadExecution() { fifo->PushAddress(buffer); //Statistics - numFramesStatistic++; - if (numFramesStatistic >= generalData->maxFramesPerFile) - PrintFifoStatistics(); + if(!SilentMode) { + numFramesStatistic++; + if (numFramesStatistic >= generalData->maxFramesPerFile) + PrintFifoStatistics(); + } } diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index ae29ae7f3..d57122c5d 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -82,6 +82,10 @@ void UDPBaseImplementation::initializeMembers(){ dataStreamEnable = false; streamingPort = 0; memset(streamingSrcIP, 0, sizeof(streamingSrcIP)); + + //***receiver parameters*** + silentMode = 0; + } UDPBaseImplementation::~UDPBaseImplementation(){} @@ -212,6 +216,8 @@ uint32_t UDPBaseImplementation::getFifoDepth() const{ FILE_LOG(logDEBUG) << __AT /***receiver status***/ slsReceiverDefs::runStatus UDPBaseImplementation::getStatus() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; return status;} +uint32_t UDPBaseImplementation::getSilentMode() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; return silentMode;} + int UDPBaseImplementation::getActivate() const{FILE_LOG(logDEBUG) << __AT__ << " starting"; return activated;} uint32_t UDPBaseImplementation::getStreamingPort() const{FILE_LOG(logDEBUG) << __AT__ << " starting"; return streamingPort;} @@ -491,6 +497,14 @@ int UDPBaseImplementation::setFifoDepth(const uint32_t i){ return OK; } +/***receiver parameters***/ +void UDPBaseImplementation::setSilentMode(const uint32_t i){ + FILE_LOG(logDEBUG) << __AT__ << " starting"; + + silentMode = i; + FILE_LOG(logINFO) << "Silent Mode: " << i; +} + /************************************************************************* * Behavioral functions*************************************************** * They may modify the status of the receiver **************************** diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 46a1985e4..57179a1b0 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -292,6 +292,16 @@ int UDPStandardImplementation::setFifoDepth(const uint32_t i) { } +void UDPStandardImplementation::setSilentMode(const uint32_t i){ + silentMode = i; + + Listener::SetSilentMode(i); + DataProcessor::SetSilentMode(i); + DataStreamer::SetSilentMode(i); + + FILE_LOG(logINFO) << "Silent Mode: " << i; +} + int UDPStandardImplementation::setDetectorType(const detectorType d) { FILE_LOG (logDEBUG) << "Setting receiver type"; @@ -357,9 +367,8 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) { //set up writer and callbacks for (vector::const_iterator it = listener.begin(); it != listener.end(); ++it) (*it)->SetGeneralData(generalData); - for (vector::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it) { + for (vector::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it) (*it)->SetGeneralData(generalData); - } SetThreadPriorities(); diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 647c60342..c27d141b1 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -279,6 +279,8 @@ const char* slsReceiverTCPIPInterface::getFunctionName(enum recFuncs func) { case F_SET_RECEIVER_FILE_FORMAT: return "F_SET_RECEIVER_FILE_FORMAT"; 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"; case F_RECEIVER_STREAMING_SRC_IP: return "F_RECEIVER_STREAMING_SRC_IP"; case F_ENABLE_GAPPIXELS_IN_RECEIVER:return "F_ENABLE_GAPPIXELS_IN_RECEIVER"; @@ -326,8 +328,10 @@ 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; flist[F_RECEIVER_STREAMING_SRC_IP] = &slsReceiverTCPIPInterface::set_streaming_source_ip; flist[F_ENABLE_GAPPIXELS_IN_RECEIVER] = &slsReceiverTCPIPInterface::enable_gap_pixels; + #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]; @@ -2327,6 +2331,7 @@ int slsReceiverTCPIPInterface::set_streaming_port() { + int slsReceiverTCPIPInterface::set_streaming_source_ip() { ret = OK; memset(mess, 0, sizeof(mess)); @@ -2370,6 +2375,57 @@ int slsReceiverTCPIPInterface::set_streaming_source_ip() { mySock->SendDataOnly(retval,MAX_STR_LENGTH); delete[] retval; + // 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;