diff --git a/slsDetectorGui/gitInfo.txt b/slsDetectorGui/gitInfo.txt index cd47a074f..4e2bb5792 100644 --- a/slsDetectorGui/gitInfo.txt +++ b/slsDetectorGui/gitInfo.txt @@ -1,18 +1,9 @@ Path: slsDetectorsPackage/slsDetectorGui URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git -<<<<<<< HEAD -Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b -Revision: 492 -Branch: developer -Last Changed Author: Anna_Bergamaschi -Last Changed Rev: 3731 -Last Changed Date: 2018-03-15 12:27:06.000000002 +0100 ./src/qTabMeasurement.cpp -======= -Repsitory UUID: fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41 -Revision: 493 +Repsitory UUID: 51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d +Revision: 505 Branch: developer Last Changed Author: Dhanya_Thattil -Last Changed Rev: 3747 -Last Changed Date: 2018-03-27 17:30:53.000000002 +0200 ./include/qTabMeasurement.h ->>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3 +Last Changed Rev: 3818 +Last Changed Date: 2018-05-15 13:48:54.000000002 +0200 ./src/qTabSettings.cpp diff --git a/slsDetectorGui/include/gitInfoGui.h b/slsDetectorGui/include/gitInfoGui.h index fccb5d12c..f57d0eb74 100644 --- a/slsDetectorGui/include/gitInfoGui.h +++ b/slsDetectorGui/include/gitInfoGui.h @@ -1,7 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" - -#define GITREPUUID "fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41" +#define GITREPUUID "51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d" #define GITAUTH "Dhanya_Thattil" -#define GITREV 0x3747 -#define GITDATE 0x20180327 +#define GITREV 0x3818 +#define GITDATE 0x20180515 #define GITBRANCH "developer" diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer index e47c32260..b98c54446 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer differ diff --git a/slsDetectorSoftware/gitInfo.txt b/slsDetectorSoftware/gitInfo.txt index 2a9dec6de..88fb04df0 100644 --- a/slsDetectorSoftware/gitInfo.txt +++ b/slsDetectorSoftware/gitInfo.txt @@ -1,18 +1,9 @@ Path: slsDetectorsPackage/slsDetectorSoftware URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git -<<<<<<< HEAD -Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b -Revision: 1846 -Branch: developer -Last Changed Author: Anna_Bergamaschi -Last Changed Rev: 3731 -Last Changed Date: 2018-03-15 12:30:34.000000002 +0100 ./threadFiles/ThreadPool.o -======= -Repsitory UUID: b8bdbf4da61f95b88893b02ddabc2491b16fa10f -Revision: 1852 +Repsitory UUID: 51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d +Revision: 1906 Branch: developer Last Changed Author: Dhanya_Thattil -Last Changed Rev: 3746 -Last Changed Date: 2018-03-27 10:47:02.000000002 +0200 ./slsDetector/slsDetector.o ->>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3 +Last Changed Rev: 3818 +Last Changed Date: 2018-05-17 10:41:55.000000002 +0200 ./slsDetector/slsDetector.o diff --git a/slsDetectorSoftware/slsDetector/gitInfoLib.h b/slsDetectorSoftware/slsDetector/gitInfoLib.h index 6e7baa985..315130b93 100644 --- a/slsDetectorSoftware/slsDetector/gitInfoLib.h +++ b/slsDetectorSoftware/slsDetector/gitInfoLib.h @@ -1,8 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" - -#define GITREPUUID "b8bdbf4da61f95b88893b02ddabc2491b16fa10f" +#define GITREPUUID "51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d" #define GITAUTH "Dhanya_Thattil" -#define GITREV 0x3746 -#define GITDATE 0x20180327 - +#define GITREV 0x3818 +#define GITDATE 0x20180517 #define GITBRANCH "developer" diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index d4b3b2c71..f353cf50e 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -4156,6 +4156,10 @@ int slsDetector::updateDetectorNoWait() { //retval=setSubFrameExposureTime(tns); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]=retval; + + //retval=setSubFramePeriod(tns); + n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); + thisDetector->timerValue[SUBFRAME_PERIOD]=retval; } //retval=setPeriod(tns); @@ -4781,6 +4785,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){ //send acquisiton time/period/subexptime/frame/cycles/samples to receiver if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)|| (index==ACQUISITION_TIME) || (index==SUBFRAME_ACQUISITION_TIME) || + (index==SUBFRAME_PERIOD) || (index==SAMPLES_JCTB) || (index==STORAGE_CELL_NUMBER)){ string timername = getTimerType(index); if(ret != FAIL){ @@ -4802,7 +4807,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){ #endif } #ifdef VERBOSE - // set period/exptime/subexptime + // set period/exptime/subexptime/subperiod else std::cout << "Setting/Getting " << timername << " " << index << " to/from receiver " << args[1] << std::endl; #endif @@ -4824,8 +4829,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){ setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET)); break; case SUBFRAME_ACQUISITION_TIME: - setErrorMask((getErrorMask())|(RECEIVER_TIMER_NOT_SET)); - break; + case SUBFRAME_PERIOD: case SAMPLES_JCTB: setErrorMask((getErrorMask())|(RECEIVER_TIMER_NOT_SET)); break; @@ -6403,6 +6407,7 @@ string slsDetector::setReceiver(string receiverIP){ std::cout << "frame period:" << thisDetector->timerValue[FRAME_PERIOD] << endl; std::cout << "frame number:" << thisDetector->timerValue[FRAME_NUMBER] << endl; std::cout << "sub exp time:" << thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME] << endl; + std::cout << "sub period:" << thisDetector->timerValue[SUBFRAME_PERIOD] << endl; std::cout << "dynamic range:" << thisDetector->dynamicRange << endl << endl; std::cout << "flippeddatax:" << thisDetector->flippedData[d] << endl; std::cout << "10GbE:" << thisDetector->tenGigaEnable << endl << endl; @@ -6437,8 +6442,10 @@ string slsDetector::setReceiver(string receiverIP){ setTimer(FRAME_PERIOD,thisDetector->timerValue[FRAME_PERIOD]); setTimer(FRAME_NUMBER,thisDetector->timerValue[FRAME_NUMBER]); setTimer(ACQUISITION_TIME,thisDetector->timerValue[ACQUISITION_TIME]); - if(thisDetector->myDetectorType == EIGER) + if(thisDetector->myDetectorType == EIGER) { setTimer(SUBFRAME_ACQUISITION_TIME,thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]); + setTimer(SUBFRAME_PERIOD,thisDetector->timerValue[SUBFRAME_PERIOD]); + } if(thisDetector->myDetectorType == JUNGFRAUCTB) setTimer(SAMPLES_JCTB,thisDetector->timerValue[SAMPLES_JCTB]); setDynamicRange(thisDetector->dynamicRange); diff --git a/slsDetectorSoftware/slsDetector/slsDetectorBase.h b/slsDetectorSoftware/slsDetector/slsDetectorBase.h index 2936760a5..cbf613149 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorBase.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorBase.h @@ -374,6 +374,7 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef virtual int64_t setTimer(timerIndex index, int64_t t=-1)=0; int64_t setExposureTime(int64_t t=-1){return setTimer(ACQUISITION_TIME,t);}; int64_t setSubFrameExposureTime(int64_t t=-1){return setTimer(SUBFRAME_ACQUISITION_TIME,t);}; + int64_t setSubFramePeriod(int64_t t=-1){return setTimer(SUBFRAME_PERIOD,t);}; int64_t setExposurePeriod(int64_t t=-1){return setTimer(FRAME_PERIOD,t);}; int64_t setDelayAfterTrigger(int64_t t=-1){return setTimer(DELAY_AFTER_TRIGGER,t);}; int64_t setNumberOfGates(int64_t t=-1){return setTimer(GATES_NUMBER,t);}; @@ -833,8 +834,8 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0; }}; /** returns string from timer index - \param s can be FRAME_NUMBER,ACQUISITION_TIME,FRAME_PERIOD, DELAY_AFTER_TRIGGER,GATES_NUMBER,PROBES_NUMBER, CYCLES_NUMBER, ACTUAL_TIME,MEASUREMENT_TIME, PROGRESS,MEASUREMENTS_NUMBER,FRAMES_FROM_START,FRAMES_FROM_START_PG,SAMPLES_JCTB,SUBFRAME_ACQUISITION_TIME,STORAGE_CELL_NUMBER - \returns string frame_number,acquisition_time,frame_period, delay_after_trigger,gates_number,probes_number, cycles_number, actual_time,measurement_time, progress,measurements_number,frames_from_start,frames_from_start_pg,samples_jctb,subframe_acquisition_time,storage_cell_number + \param s can be FRAME_NUMBER,ACQUISITION_TIME,FRAME_PERIOD, DELAY_AFTER_TRIGGER,GATES_NUMBER,PROBES_NUMBER, CYCLES_NUMBER, ACTUAL_TIME,MEASUREMENT_TIME, PROGRESS,MEASUREMENTS_NUMBER,FRAMES_FROM_START,FRAMES_FROM_START_PG,SAMPLES_JCTB,SUBFRAME_ACQUISITION_TIME,STORAGE_CELL_NUMBER, SUBFRAME_PERIOD + \returns string frame_number,acquisition_time,frame_period, delay_after_trigger,gates_number,probes_number, cycles_number, actual_time,measurement_time, progress,measurements_number,frames_from_start,frames_from_start_pg,samples_jctb,subframe_acquisition_time,storage_cell_number, subframe_period */ static string getTimerType(timerIndex t){ \ switch (t) { \ @@ -853,6 +854,7 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0; case FRAMES_FROM_START_PG: return string("frames_from_start_pg"); \ case SAMPLES_JCTB: return string("samples_jctb"); \ case SUBFRAME_ACQUISITION_TIME: return string("subframe_acquisition_time"); \ + case SUBFRAME_PERIOD: return string("subframe_period"); \ case STORAGE_CELL_NUMBER: return string("storage_cell_number"); \ default: return string("unknown"); \ }}; diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp index 0d12a25c3..66757b484 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUsers.cpp @@ -403,3 +403,22 @@ int slsDetectorUsers::setTenGigabitEthernet(int i) { int slsDetectorUsers::getNMods() { return myDetector->getNMods(); } + +double slsDetectorUsers::setSubFrameExposureTime(double t, bool inseconds){ + int64_t tms = (int64_t)(t * (1E+9)); + if (t < 0) tms = -1; + if(!inseconds) + return myDetector->setSubFrameExposureTime((int64_t)t); + else + return ((1E-9) * (double)myDetector->setSubFrameExposureTime(tms)); +} + +double slsDetectorUsers::setSubFrameExposurePeriod(double t, bool inseconds){ + int64_t tms = (int64_t)(t * (1E+9)); + if (t < 0) tms = -1; + if(!inseconds) + return myDetector->setSubFramePeriod((int64_t)t); + else + return ((1E-9) * (double)myDetector->setSubFramePeriod(tms)); +} + diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUsers.h b/slsDetectorSoftware/slsDetector/slsDetectorUsers.h index b30e118d1..6a5693f6b 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUsers.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUsers.h @@ -711,6 +711,22 @@ class slsDetectorUsers */ int getNMods(); + /** + * Set sub frame exposure time (only for Eiger) + * @param i sub frame exposure time (-1 gets) + * @param inseconds true if the value is in s, else ns + * @returns sub frame exposure time in ns, or s if specified + */ + double setSubFrameExposureTime(double t=-1, bool inseconds=false); + + /** + * Set sub frame period (only for Eiger) + * @param i sub frame period (-1 gets) + * @param inseconds true if the value is in s, else ns + * @returns sub frame period in ns, or s if specified + */ + double setSubFrameExposurePeriod(double t=-1, bool inseconds=false); + /************************************************************************ STATIC FUNCTIONS diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c index b5e9e6177..32fffae28 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c @@ -3587,6 +3587,12 @@ int send_update(int file_des) { #endif n = sendData(file_des,&retval,sizeof(int64_t),INT64); if (n < 0) return printSocketReadError(); + +#ifdef SLS_DETECTOR_FUNCTION_LIST + retval=setTimer(SUBFRAME_PERIOD,GET_FLAG); +#endif + n = sendData(file_des,&retval,sizeof(int64_t),INT64); + if (n < 0) return printSocketReadError(); #endif diff --git a/slsReceiverSoftware/gitInfo.txt b/slsReceiverSoftware/gitInfo.txt index 811a55fc1..7101a2cc5 100644 --- a/slsReceiverSoftware/gitInfo.txt +++ b/slsReceiverSoftware/gitInfo.txt @@ -1,18 +1,9 @@ Path: slsDetectorsPackage/slsReceiverSoftware URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git -<<<<<<< HEAD -Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b -Revision: 765 -Branch: developer -Last Changed Author: Anna_Bergamaschi -Last Changed Rev: 3731 -Last Changed Date: 2018-03-15 12:27:06.000000002 +0100 ./src/slsReceiverTCPIPInterface.cpp -======= -Repsitory UUID: b8bdbf4da61f95b88893b02ddabc2491b16fa10f -Revision: 767 +Repsitory UUID: 51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d +Revision: 791 Branch: developer Last Changed Author: Dhanya_Thattil -Last Changed Rev: 3746 -Last Changed Date: 2018-03-27 10:43:44.000000002 +0200 ./src/slsReceiverTCPIPInterface.cpp ->>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3 +Last Changed Rev: 3818 +Last Changed Date: 2018-05-17 09:23:53.000000002 +0200 ./include/HDF5FileStatic.h diff --git a/slsReceiverSoftware/include/BinaryFile.h b/slsReceiverSoftware/include/BinaryFile.h index 3d1e46d0b..ac6f7a4e3 100644 --- a/slsReceiverSoftware/include/BinaryFile.h +++ b/slsReceiverSoftware/include/BinaryFile.h @@ -63,12 +63,14 @@ class BinaryFile : private virtual slsReceiverDefs, public File, public BinaryFi * @param nx number of pixels in x direction * @param ny number of pixels in y direction * @param at acquisition time - * @param at sub exposure time + * @param st sub exposure time + * @param sp sub period * @param ap acquisition period * @returns OK or FAIL */ int CreateMasterFile(bool en, uint32_t size, - uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap); + uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp, + uint64_t ap); /** * Close Current File diff --git a/slsReceiverSoftware/include/BinaryFileStatic.h b/slsReceiverSoftware/include/BinaryFileStatic.h index 2558486a7..78091d55c 100644 --- a/slsReceiverSoftware/include/BinaryFileStatic.h +++ b/slsReceiverSoftware/include/BinaryFileStatic.h @@ -109,12 +109,15 @@ class BinaryFileStatic { * @param acquisitionTime acquisition time * @param acquisitionPeriod acquisition period * @param subexposuretime sub exposure time + * @param subperiod sub period * @param version version of software for binary writing * @returns 0 for success and 1 for fail */ static int CreateMasterDataFile(FILE*& fd, string fname, bool owenable, - uint32_t dr, bool tenE, uint32_t size, uint32_t nPixelsX, uint32_t nPixelsY, uint64_t nf, - uint64_t acquisitionTime, uint64_t subexposuretime, uint64_t acquisitionPeriod, double version) + uint32_t dr, bool tenE, uint32_t size, + uint32_t nPixelsX, uint32_t nPixelsY, uint64_t nf, + uint64_t acquisitionTime, uint64_t subexposuretime, + uint64_t subperiod, uint64_t acquisitionPeriod, double version) { if(!owenable){ if (NULL == (fd = fopen((const char *) fname.c_str(), "wx"))){ @@ -130,32 +133,33 @@ class BinaryFileStatic { time_t t = time(0); char message[MAX_STR_LENGTH]; sprintf(message, - "Version : %.1f\n" - "Dynamic Range : %d\n" - "Ten Giga : %d\n" - "Image Size : %d bytes\n" - "x : %d pixels\n" - "y : %d pixels\n" - "Total Frames : %lld\n" - "Exptime (ns) : %lld\n" - "SubExptime (ns) : %lld\n" - "Period (ns) : %lld\n" - "Timestamp : %s\n\n" + "Version : %.1f\n" + "Dynamic Range : %d\n" + "Ten Giga : %d\n" + "Image Size : %d bytes\n" + "x : %d pixels\n" + "y : %d pixels\n" + "Total Frames : %lld\n" + "Exptime (ns) : %lld\n" + "SubExptime (ns) : %lld\n" + "SubPeriod(ns) : %lld\n" + "Period (ns) : %lld\n" + "Timestamp : %s\n\n" "#Frame Header\n" - "Frame Number : 8 bytes\n" - "SubFrame Number/ExpLength : 4 bytes\n" - "Packet Number : 4 bytes\n" - "Bunch ID : 8 bytes\n" - "Timestamp : 8 bytes\n" - "Module Id : 2 bytes\n" - "X Coordinate : 2 bytes\n" - "Y Coordinate : 2 bytes\n" - "Z Coordinate : 2 bytes\n" - "Debug : 4 bytes\n" - "Round Robin Number : 2 bytes\n" - "Detector Type : 1 byte\n" - "Header Version : 1 byte\n" + "Frame Number : 8 bytes\n" + "SubFrame Number/ExpLength : 4 bytes\n" + "Packet Number : 4 bytes\n" + "Bunch ID : 8 bytes\n" + "Timestamp : 8 bytes\n" + "Module Id : 2 bytes\n" + "X Coordinate : 2 bytes\n" + "Y Coordinate : 2 bytes\n" + "Z Coordinate : 2 bytes\n" + "Debug : 4 bytes\n" + "Round Robin Number : 2 bytes\n" + "Detector Type : 1 byte\n" + "Header Version : 1 byte\n" , version, dr, @@ -166,6 +170,7 @@ class BinaryFileStatic { (long long int)nf, (long long int)acquisitionTime, (long long int)subexposuretime, + (long long int)subperiod, (long long int)acquisitionPeriod, ctime(&t)); if (strlen(message) > MAX_STR_LENGTH) { diff --git a/slsReceiverSoftware/include/DataProcessor.h b/slsReceiverSoftware/include/DataProcessor.h index 6d10e6159..be2f24800 100644 --- a/slsReceiverSoftware/include/DataProcessor.h +++ b/slsReceiverSoftware/include/DataProcessor.h @@ -173,11 +173,13 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject { * @param en ten giga enable * @param nf number of frames * @param at acquisition time - * @param at sub exposure time + * @param st sub exposure time + * @param sp sub period * @param ap acquisition period * @returns OK or FAIL */ - int CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t st, uint64_t ap); + int CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t st, + uint64_t sp, uint64_t ap); /** * Closes files diff --git a/slsReceiverSoftware/include/File.h b/slsReceiverSoftware/include/File.h index cf024bc26..9eaa48177 100644 --- a/slsReceiverSoftware/include/File.h +++ b/slsReceiverSoftware/include/File.h @@ -89,7 +89,8 @@ class File : private virtual slsReceiverDefs { * @returns OK or FAIL */ virtual int CreateFile(uint64_t fnum){ - cprintf(RED,"This is a generic function CreateFile that should be overloaded by a derived class\n"); + cprintf(RED,"This is a generic function CreateFile that should be " + "overloaded by a derived class\n"); return OK; } @@ -97,14 +98,16 @@ class File : private virtual slsReceiverDefs { * Close Current File */ virtual void CloseCurrentFile() { - cprintf(RED,"This is a generic function CloseCurrentFile that should be overloaded by a derived class\n"); + cprintf(RED,"This is a generic function CloseCurrentFile that should be " + "overloaded by a derived class\n"); } /** * Close Files */ virtual void CloseAllFiles() { - cprintf(RED,"This is a generic function that should be overloaded by a derived class\n"); + cprintf(RED,"This is a generic function that should be overloaded " + "by a derived class\n"); } /** @@ -115,7 +118,8 @@ class File : private virtual slsReceiverDefs { * @param OK or FAIL */ virtual int WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t nump) { - cprintf(RED,"This is a generic function WriteToFile that should be overloaded by a derived class\n"); + cprintf(RED,"This is a generic function WriteToFile that " + "should be overloaded by a derived class\n"); return FAIL; } @@ -126,13 +130,16 @@ class File : private virtual slsReceiverDefs { * @param nx number of pixels in x direction * @param ny number of pixels in y direction * @param at acquisition time - * @param at sub exposure time + * @param st sub exposure time + * @param sp sub period * @param ap acquisition period * @returns OK or FAIL */ virtual int CreateMasterFile(bool en, uint32_t size, - uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap) { - cprintf(RED,"This is a generic function CreateMasterFile that should be overloaded by a derived class\n"); + uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, + uint64_t sp, uint64_t ap) { + cprintf(RED,"This is a generic function CreateMasterFile that " + "should be overloaded by a derived class\n"); return OK; } @@ -143,7 +150,8 @@ class File : private virtual slsReceiverDefs { * @param ny number of pixels in y direction */ virtual void SetNumberofPixels(uint32_t nx, uint32_t ny) { - cprintf(RED,"This is a generic function SetNumberofPixels that should be overloaded by a derived class\n"); + cprintf(RED,"This is a generic function SetNumberofPixels that " + "should be overloaded by a derived class\n"); } /** @@ -151,7 +159,8 @@ class File : private virtual slsReceiverDefs { * @param numf number of images caught */ virtual void EndofAcquisition(uint64_t numf) { - cprintf(RED,"This is a generic function EndofAcquisition that should be overloaded by a derived class\n"); + cprintf(RED,"This is a generic function EndofAcquisition that " + "should be overloaded by a derived class\n"); } protected: diff --git a/slsReceiverSoftware/include/HDF5File.h b/slsReceiverSoftware/include/HDF5File.h index 200d5c0d2..f5aafd9de 100644 --- a/slsReceiverSoftware/include/HDF5File.h +++ b/slsReceiverSoftware/include/HDF5File.h @@ -99,12 +99,14 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt * @param nx number of pixels in x direction * @param ny number of pixels in y direction * @param at acquisition time - * @param at sub exposure time + * @param st sub exposure time + * @param sp sub period * @param ap acquisition period * @returns OK or FAIL */ int CreateMasterFile(bool en, uint32_t size, - uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap); + uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp, + uint64_t ap); /** * End of Acquisition diff --git a/slsReceiverSoftware/include/HDF5FileStatic.h b/slsReceiverSoftware/include/HDF5FileStatic.h index 29c24e730..32c62fd50 100644 --- a/slsReceiverSoftware/include/HDF5FileStatic.h +++ b/slsReceiverSoftware/include/HDF5FileStatic.h @@ -232,13 +232,16 @@ public: * @param nf number of images * @param acquisitionTime acquisition time * @param subexposuretime sub exposure time + * @param subperiod sub period * @param acquisitionPeriod acquisition period * @param version version of software for hdf5 writing * @returns 0 for success and 1 for fail */ static int CreateMasterDataFile(H5File*& fd, string fname, bool owenable, - uint32_t dr, bool tenE, uint32_t size, uint32_t nPixelsx, uint32_t nPixelsy, uint64_t nf, - uint64_t acquisitionTime, uint64_t subexposuretime, uint64_t acquisitionPeriod, double version) + uint32_t dr, bool tenE, uint32_t size, + uint32_t nPixelsx, uint32_t nPixelsy, uint64_t nf, + uint64_t acquisitionTime, uint64_t subexposuretime, + uint64_t subperiod, uint64_t acquisitionPeriod, double version) { try { Exception::dontPrint(); //to handle errors @@ -246,9 +249,13 @@ public: FileAccPropList flist; flist.setFcloseDegree(H5F_CLOSE_STRONG); if(!owenable) - fd = new H5File( fname.c_str(), H5F_ACC_EXCL, NULL, flist ); + fd = new H5File( fname.c_str(), H5F_ACC_EXCL, + FileCreatPropList::DEFAULT, + flist ); else - fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, NULL, flist ); + fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, + FileCreatPropList::DEFAULT, + flist ); //variables DataSpace dataspace = DataSpace (H5S_SCALAR); @@ -313,6 +320,12 @@ public: attribute = dataset.createAttribute("unit",strdatatype, dataspace); attribute.write(strdatatype, string("ns")); + //SubPeriod + dataset = group5.createDataSet ( "sub period", PredType::STD_U64LE, dataspace ); + dataset.write ( &subperiod, PredType::STD_U64LE); + attribute = dataset.createAttribute("unit",strdatatype, dataspace); + attribute.write(strdatatype, string("ns")); + //Period dataset = group5.createDataSet ( "acquisition period", PredType::STD_U64LE, dataspace ); dataset.write ( &acquisitionPeriod, PredType::STD_U64LE); @@ -374,9 +387,13 @@ public: FileAccPropList fapl; fapl.setFcloseDegree(H5F_CLOSE_STRONG); if(!owenable) - fd = new H5File( fname.c_str(), H5F_ACC_EXCL, NULL,fapl ); + fd = new H5File( fname.c_str(), H5F_ACC_EXCL, + FileCreatPropList::DEFAULT, + fapl ); else - fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, NULL, fapl ); + fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, + FileCreatPropList::DEFAULT, + fapl ); //attributes - version double dValue=version; @@ -678,9 +695,13 @@ public: FileAccPropList fapl; fapl.setFcloseDegree(H5F_CLOSE_STRONG); if(!owenable) - newfd = new H5File( newFileName.c_str(), H5F_ACC_EXCL, NULL,fapl ); + newfd = new H5File( newFileName.c_str(), H5F_ACC_EXCL, + FileCreatPropList::DEFAULT, + fapl ); else - newfd = new H5File( newFileName.c_str(), H5F_ACC_TRUNC, NULL, fapl ); + newfd = new H5File( newFileName.c_str(), H5F_ACC_TRUNC, + FileCreatPropList::DEFAULT, + fapl ); //dataspace and dataset DataSpace* newDataspace; if (rank == 3) { diff --git a/slsReceiverSoftware/include/UDPBaseImplementation.h b/slsReceiverSoftware/include/UDPBaseImplementation.h index 4eb725e3a..2bfe08e36 100644 --- a/slsReceiverSoftware/include/UDPBaseImplementation.h +++ b/slsReceiverSoftware/include/UDPBaseImplementation.h @@ -206,6 +206,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter */ uint64_t getSubExpTime() const; + /** + * Get Sub Period + * @return Sub Period + */ + uint64_t getSubPeriod() const; + /* * Get Number of Frames expected by receiver from detector * The data receiver status will change from running to idle when it gets this number of frames FIXME: (Not implemented) @@ -445,6 +451,13 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter */ void setSubExpTime(const uint64_t i); + /** + * Set Sub Period + * @param i Period + * @return OK or FAIL + */ + void setSubPeriod(const uint64_t i); + /** * Set Number of Frames expected by receiver from detector * The data receiver status will change from running to idle when it gets this number of frames @@ -682,6 +695,8 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter uint64_t acquisitionTime; /** Sub Exposure Time */ uint64_t subExpTime; + /** Sub Period */ + uint64_t subPeriod; /** Frame Number */ uint64_t numberOfFrames; /** Samples Number */ diff --git a/slsReceiverSoftware/include/UDPInterface.h b/slsReceiverSoftware/include/UDPInterface.h index 763c1b5ba..68fe9d1d2 100644 --- a/slsReceiverSoftware/include/UDPInterface.h +++ b/slsReceiverSoftware/include/UDPInterface.h @@ -294,6 +294,12 @@ class UDPInterface { */ virtual uint64_t getSubExpTime() const = 0; + /** + * Get Sub Period + * @return Sub Period + */ + virtual uint64_t getSubPeriod() const = 0; + /* * Get Number of Frames expected by receiver from detector * The data receiver status will change from running to idle when it gets this number of frames FIXME: (for Leo? Not implemented) @@ -531,6 +537,13 @@ class UDPInterface { */ virtual void setSubExpTime(const uint64_t i) = 0; + /** + * Set Sub Period + * @param i Period + * @return OK or FAIL + */ + virtual void setSubPeriod(const uint64_t i) = 0; + /** * Set Number of Frames expected by receiver from detector * The data receiver status will change from running to idle when it gets this number of frames FIXME: (for Leo? Not implemented) diff --git a/slsReceiverSoftware/include/gitInfoReceiver.h b/slsReceiverSoftware/include/gitInfoReceiver.h index d94293f8c..315130b93 100644 --- a/slsReceiverSoftware/include/gitInfoReceiver.h +++ b/slsReceiverSoftware/include/gitInfoReceiver.h @@ -1,7 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" - -#define GITREPUUID "b8bdbf4da61f95b88893b02ddabc2491b16fa10f" +#define GITREPUUID "51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d" #define GITAUTH "Dhanya_Thattil" -#define GITREV 0x3746 -#define GITDATE 0x20180327 +#define GITREV 0x3818 +#define GITDATE 0x20180517 #define GITBRANCH "developer" diff --git a/slsReceiverSoftware/src/BinaryFile.cpp b/slsReceiverSoftware/src/BinaryFile.cpp index 4e6ff5de9..8aed19db3 100644 --- a/slsReceiverSoftware/src/BinaryFile.cpp +++ b/slsReceiverSoftware/src/BinaryFile.cpp @@ -84,19 +84,22 @@ int BinaryFile::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_ int BinaryFile::CreateMasterFile(bool en, uint32_t size, - uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap) { + uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp, + uint64_t ap) { //beginning of every acquisition numFramesInFile = 0; numActualPacketsInFile = 0; if (master && (*detIndex==0)) { - masterFileName = BinaryFileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex); + masterFileName = BinaryFileStatic::CreateMasterFileName(filePath, + fileNamePrefix, *fileIndex); if(!silentMode) { FILE_LOG(logINFO) << "Master File: " << masterFileName; } - return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable, + return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName, + *overWriteEnable, *dynamicRange, en, size, nx, ny, *numImages, - at, st, ap, BINARY_WRITER_VERSION); + at, st, sp, ap, BINARY_WRITER_VERSION); } return OK; } diff --git a/slsReceiverSoftware/src/DataProcessor.cpp b/slsReceiverSoftware/src/DataProcessor.cpp index 393cd3052..7729309b2 100644 --- a/slsReceiverSoftware/src/DataProcessor.cpp +++ b/slsReceiverSoftware/src/DataProcessor.cpp @@ -245,12 +245,12 @@ void DataProcessor::SetupFileWriter(bool fwe, int* nd, char* fname, char* fpath, } // only the first file -int DataProcessor::CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t st, uint64_t ap) { +int DataProcessor::CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t st, uint64_t sp, uint64_t ap) { if (file == NULL) return FAIL; file->CloseAllFiles(); if (file->CreateMasterFile(en, generalData->imageSize, generalData->nPixelsX, generalData->nPixelsY, - at, st, ap) == FAIL) + at, st, sp, ap) == FAIL) return FAIL; if (file->CreateFile(currentFrameIndex) == FAIL) return FAIL; diff --git a/slsReceiverSoftware/src/HDF5File.cpp b/slsReceiverSoftware/src/HDF5File.cpp index 413dfb910..28356d994 100644 --- a/slsReceiverSoftware/src/HDF5File.cpp +++ b/slsReceiverSoftware/src/HDF5File.cpp @@ -163,7 +163,8 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t int HDF5File::CreateMasterFile(bool en, uint32_t size, - uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap) { + uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t sp, + uint64_t ap) { //beginning of every acquisition numFramesInFile = 0; @@ -171,12 +172,15 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size, if (master && (*detIndex==0)) { virtualfd = 0; - masterFileName = HDF5FileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex); + masterFileName = HDF5FileStatic::CreateMasterFileName(filePath, + fileNamePrefix, *fileIndex); 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); + int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, + *overWriteEnable, + *dynamicRange, en, size, nx, ny, *numImages, at, st, sp, ap, + HDF5_WRITER_VERSION); pthread_mutex_unlock(&Mutex); return ret; } diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index d1ab17173..a8917849f 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -47,6 +47,7 @@ void UDPBaseImplementation::initializeMembers(){ acquisitionPeriod = 0; acquisitionTime = 0; subExpTime = 0; + subPeriod = 0; numberOfFrames = 0; numberOfSamples = 0; dynamicRange = 16; @@ -103,11 +104,13 @@ UDPBaseImplementation::~UDPBaseImplementation(){} /**initial parameters***/ int* UDPBaseImplementation::getMultiDetectorSize() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return (int*) numDet;} + return (int*) numDet; +} int UDPBaseImplementation::getDetectorPositionId() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return detID;} + return detID; +} char *UDPBaseImplementation::getDetectorHostname() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; @@ -136,7 +139,8 @@ bool UDPBaseImplementation::getGapPixelsEnable() const { /***file parameters***/ slsReceiverDefs::fileFormat UDPBaseImplementation::getFileFormat() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return fileFormatType;} + return fileFormatType; +} char *UDPBaseImplementation::getFileName() const{ @@ -167,46 +171,56 @@ char *UDPBaseImplementation::getFilePath() const{ uint64_t UDPBaseImplementation::getFileIndex() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return fileIndex;} + return fileIndex; +} int UDPBaseImplementation::getScanTag() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return scanTag;} + return scanTag; +} bool UDPBaseImplementation::getFileWriteEnable() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return fileWriteEnable;} + return fileWriteEnable; +} bool UDPBaseImplementation::getOverwriteEnable() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return overwriteEnable;} + return overwriteEnable; +} bool UDPBaseImplementation::getDataCompressionEnable() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return dataCompressionEnable;} + return dataCompressionEnable; +} /***acquisition count parameters***/ uint64_t UDPBaseImplementation::getTotalFramesCaught() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return 0;} + return 0; +} uint64_t UDPBaseImplementation::getFramesCaught() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return 0;} + return 0; +} int64_t UDPBaseImplementation::getAcquisitionIndex() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return -1;} + return -1; +} /***connection parameters***/ uint32_t UDPBaseImplementation::getUDPPortNumber() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return udpPortNum[0];} + return udpPortNum[0]; +} uint32_t UDPBaseImplementation::getUDPPortNumber2() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return udpPortNum[1];} + return udpPortNum[1]; +} char *UDPBaseImplementation::getEthernetInterface() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; @@ -221,39 +235,53 @@ char *UDPBaseImplementation::getEthernetInterface() const{ /***acquisition parameters***/ int UDPBaseImplementation::getShortFrameEnable() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return shortFrameEnable;} + return shortFrameEnable; +} uint32_t UDPBaseImplementation::getFrameToGuiFrequency() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return frameToGuiFrequency;} + return frameToGuiFrequency; +} uint32_t UDPBaseImplementation::getFrameToGuiTimer() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return frameToGuiTimerinMS;} + return frameToGuiTimerinMS; +} bool UDPBaseImplementation::getDataStreamEnable() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return dataStreamEnable;} + return dataStreamEnable; +} uint64_t UDPBaseImplementation::getAcquisitionPeriod() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return acquisitionPeriod;} + return acquisitionPeriod; +} uint64_t UDPBaseImplementation::getAcquisitionTime() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return acquisitionTime;} + return acquisitionTime; +} uint64_t UDPBaseImplementation::getSubExpTime() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return subExpTime;} + return subExpTime; +} + +uint64_t UDPBaseImplementation::getSubPeriod() const{ + FILE_LOG(logDEBUG) << __AT__ << " starting"; + return subPeriod; +} uint64_t UDPBaseImplementation::getNumberOfFrames() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return numberOfFrames;} + return numberOfFrames; +} uint64_t UDPBaseImplementation::getNumberofSamples() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return numberOfSamples;} + return numberOfSamples; +} uint32_t UDPBaseImplementation::getDynamicRange() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; @@ -261,11 +289,13 @@ uint32_t UDPBaseImplementation::getDynamicRange() const{ bool UDPBaseImplementation::getTenGigaEnable() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return tengigaEnable;} + return tengigaEnable; +} uint32_t UDPBaseImplementation::getFifoDepth() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return fifoDepth;} + return fifoDepth; +} /***receiver status***/ slsReceiverDefs::runStatus UDPBaseImplementation::getStatus() const{ @@ -278,11 +308,13 @@ uint32_t UDPBaseImplementation::getSilentMode() const{ int UDPBaseImplementation::getActivate() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return activated;} + return activated; +} uint32_t UDPBaseImplementation::getStreamingPort() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; - return streamingPort;} + return streamingPort; +} char *UDPBaseImplementation::getStreamingSourceIP() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; @@ -529,6 +561,13 @@ void UDPBaseImplementation::setSubExpTime(const uint64_t i){ FILE_LOG(logINFO) << "Sub Exposure Time: " << (double)subExpTime/(1E9) << "s"; } +void UDPBaseImplementation::setSubPeriod(const uint64_t i){ + FILE_LOG(logDEBUG) << __AT__ << " starting"; + + subPeriod = i; + FILE_LOG(logINFO) << "Sub Exposure Time: " << (double)subPeriod/(1E9) << "s"; +} + int UDPBaseImplementation::setNumberOfFrames(const uint64_t i){ FILE_LOG(logDEBUG) << __AT__ << " starting"; diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index e00ada285..ddf75cfd6 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -764,7 +764,7 @@ int UDPStandardImplementation::SetupWriter() { bool error = false; for (unsigned int i = 0; i < dataProcessor.size(); ++i) if (dataProcessor[i]->CreateNewFile(tengigaEnable, - numberOfFrames, acquisitionTime, subExpTime, acquisitionPeriod) == FAIL) { + numberOfFrames, acquisitionTime, subExpTime, subPeriod, acquisitionPeriod) == FAIL) { error = true; break; } diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 958144903..fd387202c 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -1054,6 +1054,9 @@ int slsReceiverTCPIPInterface::set_timer() { case SUBFRAME_ACQUISITION_TIME: receiverBase->setSubExpTime(index[1]); break; + case SUBFRAME_PERIOD: + receiverBase->setSubPeriod(index[1]); + break; case SAMPLES_JCTB: if (myDetectorType != JUNGFRAUCTB) { ret = FAIL; @@ -1086,6 +1089,9 @@ int slsReceiverTCPIPInterface::set_timer() { case SUBFRAME_ACQUISITION_TIME: retval=receiverBase->getSubExpTime(); break; + case SUBFRAME_PERIOD: + retval=receiverBase->getSubPeriod(); + break; case SAMPLES_JCTB: if (myDetectorType != JUNGFRAUCTB) { ret = FAIL;