diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index 13738442d..78f6ca5c6 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git -Repsitory UUID: 55bce97b990e627682fc8dc7b38ed883fe155fde -Revision: 599 -Branch: developer +Repsitory UUID: 93d7b6862d591a0615e8f6f710aca7c69040dd97 +Revision: 601 +Branch: updaterec Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 604 -Last Changed Date: 2017-06-30 18:17:33 +0200 +Last Changed Rev: 606 +Last Changed Date: 2017-07-03 13:45:45 +0200 diff --git a/slsReceiverSoftware/include/BinaryFileStatic.h b/slsReceiverSoftware/include/BinaryFileStatic.h index 8e1c14569..e840b4566 100644 --- a/slsReceiverSoftware/include/BinaryFileStatic.h +++ b/slsReceiverSoftware/include/BinaryFileStatic.h @@ -166,7 +166,7 @@ class BinaryFileStatic { (long long int)acquisitionPeriod, ctime(&t)); if (strlen(message) > MAX_STR_LENGTH) { - bprintf(BG_RED,"Master File Size %d is greater than max str size %d\n", + bprintf(RED,"Master File Size %d is greater than max str size %d\n", (int)strlen(message), MAX_STR_LENGTH); return 1; } diff --git a/slsReceiverSoftware/include/ansi.h b/slsReceiverSoftware/include/ansi.h index bf76b4403..3bd8f6eb3 100644 --- a/slsReceiverSoftware/include/ansi.h +++ b/slsReceiverSoftware/include/ansi.h @@ -18,7 +18,8 @@ #define BOLD "\x1b[1m" //on background black -#define bprintf(code, format, ...) printf(code BG_BLACK format RESET, ##__VA_ARGS__) +#define bprintf(code, format, ...) printf(code BG_BLACK format RESET, ##__VA_ARGS__) + //normal printout #define cprintf(code, format, ...) printf(code format RESET, ##__VA_ARGS__) /* diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index d410603af..9ad7910e4 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "55bce97b990e627682fc8dc7b38ed883fe155fde" -//#define SVNREV 0x604 +#define SVNREPUUID "93d7b6862d591a0615e8f6f710aca7c69040dd97" +//#define SVNREV 0x606 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x604 -#define SVNDATE 0x20170630 +#define SVNREV 0x606 +#define SVNDATE 0x20170703 // diff --git a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h index 587f8b518..29f897144 100644 --- a/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h +++ b/slsReceiverSoftware/include/slsReceiverTCPIPInterface.h @@ -297,7 +297,6 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs { /** port number */ int portNumber; - //***callback parameters*** /** * Call back for start acquisition diff --git a/slsReceiverSoftware/src/HDF5File.cpp b/slsReceiverSoftware/src/HDF5File.cpp index 01daf3946..a8d444b88 100644 --- a/slsReceiverSoftware/src/HDF5File.cpp +++ b/slsReceiverSoftware/src/HDF5File.cpp @@ -59,7 +59,7 @@ void HDF5File::PrintMembers() { } else if (datatype == PredType::STD_U32LE) { FILE_LOG(logINFO) << "Data Type: 32"; } else { - FILE_LOG(logERROR) << BG_RED,"unknown data type"; + FILE_LOG(logERROR) << "unknown data type"; } } diff --git a/slsReceiverSoftware/src/Listener.cpp b/slsReceiverSoftware/src/Listener.cpp index 8280624bb..7d267d2dd 100644 --- a/slsReceiverSoftware/src/Listener.cpp +++ b/slsReceiverSoftware/src/Listener.cpp @@ -275,7 +275,7 @@ void Listener::ThreadExecution() { //error check, (should not be here) if not transmitting yet (previous if) rc should be > 0 if (rc <= 0) { - //bprintf(BG_RED,"Error:(Weird Early self shut down), UDP Sockets not shut down, but received nothing\n"); + //cprintf(RED,"Error:(Weird Early self shut down), UDP Sockets not shut down, but received nothing\n"); StopListening(buffer); return; } @@ -343,7 +343,7 @@ uint32_t Listener::ListenToAnImage(char* buf) { //------------------------------------------------------------------------------------------------------------ if (fnum != currentFrameIndex) { if (fnum < currentFrameIndex) { - bprintf(BG_RED,"Error:(Weird), With carry flag: Frame number %lu less than current frame number %lu\n", fnum, currentFrameIndex); + bprintf(RED,"Error:(Weird), With carry flag: Frame number %lu less than current frame number %lu\n", fnum, currentFrameIndex); return 0; } new_header->packetNumber = numpackets; diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 9cfbf1bdd..a161f64bf 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -203,9 +203,9 @@ int UDPStandardImplementation::setDataStreamEnable(const bool enable) { } if (DataStreamer::GetErrorMask() || error) { if (DataStreamer::GetErrorMask()) - bprintf(BG_RED,"Error: Could not create data callback threads\n"); + bprintf(RED,"Error: Could not create data callback threads\n"); else - bprintf(BG_RED,"Error: Could not create zmq sockets\n"); + bprintf(RED,"Error: Could not create zmq sockets\n"); for (vector::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it) delete(*it); dataStreamer.clear(); @@ -731,7 +731,7 @@ int UDPStandardImplementation::SetupFifoStructure() { (generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize), fifoDepth, success)); if (!success) { - bprintf(BG_RED,"Error: Could not allocate memory for fifo structure of index %d\n", i); + bprintf(RED,"Error: Could not allocate memory for fifo structure of index %d\n", i); for (vector::const_iterator it = fifo.begin(); it != fifo.end(); ++it) delete(*it); fifo.clear(); diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 9d7d60ad6..18f721f7a 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -510,6 +510,7 @@ int slsReceiverTCPIPInterface::lock_receiver() { int slsReceiverTCPIPInterface::get_last_client_ip() { ret = OK; + if (mySock->differentClients) ret = FORCE_UPDATE; @@ -602,7 +603,8 @@ int slsReceiverTCPIPInterface::update_client() { // send answer mySock->SendDataOnly(&ret,sizeof(ret)); - if (ret == FAIL){ + //fail and force_update + if (ret != OK){ mySock->SendDataOnly(mess,sizeof(mess)); // return ok/fail return ret; @@ -622,7 +624,7 @@ int slsReceiverTCPIPInterface::send_update() { mySock->SendDataOnly(mySock->lastClientIP,sizeof(mySock->lastClientIP)); - //filepath + // filepath #ifdef SLS_RECEIVER_UDP_FUNCTIONS path = receiverBase->getFilePath(); #endif @@ -633,7 +635,7 @@ int slsReceiverTCPIPInterface::send_update() { delete[] path; } - //filename + // filename #ifdef SLS_RECEIVER_UDP_FUNCTIONS path = receiverBase->getFileName(); #endif @@ -644,27 +646,29 @@ int slsReceiverTCPIPInterface::send_update() { delete[] path; } - //index + // index #ifdef SLS_RECEIVER_UDP_FUNCTIONS ind=receiverBase->getFileIndex(); #endif mySock->SendDataOnly(&ind,sizeof(ind)); + //file format +#ifdef SLS_RECEIVER_UDP_FUNCTIONS + ind=(int)receiverBase->getFileFormat(); +#endif + mySock->SendDataOnly(&ind,sizeof(ind)); - // file path - // file name - // file index - // file format // file write enable +#ifdef SLS_RECEIVER_UDP_FUNCTIONS + ind=(int)receiverBase->getFileWriteEnable(); +#endif + mySock->SendDataOnly(&ind,sizeof(ind)); + // file overwrite enable - - // activate - // fifo depth - - // data stream enable - // receiver read frequency - // receiver read timer - +#ifdef SLS_RECEIVER_UDP_FUNCTIONS + ind=(int)receiverBase->getOverwriteEnable(); +#endif + mySock->SendDataOnly(&ind,sizeof(ind)); if (!lockStatus) strcpy(mySock->lastClientIP,mySock->thisClientIP); @@ -747,6 +751,10 @@ int slsReceiverTCPIPInterface::set_detector_type(){ } } #endif + // client has started updating receiver, update ip + if (!lockStatus) + strcpy(mySock->lastClientIP,mySock->thisClientIP); + if (ret == OK && mySock->differentClients) ret = FORCE_UPDATE;