slsReceiver, slsDetector(eiger server), client: added sub period to receiver, fixed eiger subperiod updates to client, added subperiod and subexptime to users, fixed hdf5 warnings

This commit is contained in:
maliakal_d 2018-05-17 12:34:18 +02:00
parent 51fd9ed423
commit b4d9a6a09d
26 changed files with 284 additions and 144 deletions

View File

@ -1,18 +1,9 @@
Path: slsDetectorsPackage/slsDetectorGui Path: slsDetectorsPackage/slsDetectorGui
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
<<<<<<< HEAD Repsitory UUID: 51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b Revision: 505
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
Branch: developer Branch: developer
Last Changed Author: Dhanya_Thattil Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3747 Last Changed Rev: 3818
Last Changed Date: 2018-03-27 17:30:53.000000002 +0200 ./include/qTabMeasurement.h Last Changed Date: 2018-05-15 13:48:54.000000002 +0200 ./src/qTabSettings.cpp
>>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3

View File

@ -1,7 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d"
#define GITREPUUID "fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41"
#define GITAUTH "Dhanya_Thattil" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3747 #define GITREV 0x3818
#define GITDATE 0x20180327 #define GITDATE 0x20180515
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -1,18 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
<<<<<<< HEAD Repsitory UUID: 51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b Revision: 1906
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
Branch: developer Branch: developer
Last Changed Author: Dhanya_Thattil Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3746 Last Changed Rev: 3818
Last Changed Date: 2018-03-27 10:47:02.000000002 +0200 ./slsDetector/slsDetector.o Last Changed Date: 2018-05-17 10:41:55.000000002 +0200 ./slsDetector/slsDetector.o
>>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3

View File

@ -1,8 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d"
#define GITREPUUID "b8bdbf4da61f95b88893b02ddabc2491b16fa10f"
#define GITAUTH "Dhanya_Thattil" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3746 #define GITREV 0x3818
#define GITDATE 0x20180327 #define GITDATE 0x20180517
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -4156,6 +4156,10 @@ int slsDetector::updateDetectorNoWait() {
//retval=setSubFrameExposureTime(tns); //retval=setSubFrameExposureTime(tns);
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]=retval; thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]=retval;
//retval=setSubFramePeriod(tns);
n += controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[SUBFRAME_PERIOD]=retval;
} }
//retval=setPeriod(tns); //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 //send acquisiton time/period/subexptime/frame/cycles/samples to receiver
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)|| if((index==FRAME_NUMBER)||(index==FRAME_PERIOD)||(index==CYCLES_NUMBER)||
(index==ACQUISITION_TIME) || (index==SUBFRAME_ACQUISITION_TIME) || (index==ACQUISITION_TIME) || (index==SUBFRAME_ACQUISITION_TIME) ||
(index==SUBFRAME_PERIOD) ||
(index==SAMPLES_JCTB) || (index==STORAGE_CELL_NUMBER)){ (index==SAMPLES_JCTB) || (index==STORAGE_CELL_NUMBER)){
string timername = getTimerType(index); string timername = getTimerType(index);
if(ret != FAIL){ if(ret != FAIL){
@ -4802,7 +4807,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
#endif #endif
} }
#ifdef VERBOSE #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; else std::cout << "Setting/Getting " << timername << " " << index << " to/from receiver " << args[1] << std::endl;
#endif #endif
@ -4824,8 +4829,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET)); setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET));
break; break;
case SUBFRAME_ACQUISITION_TIME: case SUBFRAME_ACQUISITION_TIME:
setErrorMask((getErrorMask())|(RECEIVER_TIMER_NOT_SET)); case SUBFRAME_PERIOD:
break;
case SAMPLES_JCTB: case SAMPLES_JCTB:
setErrorMask((getErrorMask())|(RECEIVER_TIMER_NOT_SET)); setErrorMask((getErrorMask())|(RECEIVER_TIMER_NOT_SET));
break; break;
@ -6403,6 +6407,7 @@ string slsDetector::setReceiver(string receiverIP){
std::cout << "frame period:" << thisDetector->timerValue[FRAME_PERIOD] << endl; std::cout << "frame period:" << thisDetector->timerValue[FRAME_PERIOD] << endl;
std::cout << "frame number:" << thisDetector->timerValue[FRAME_NUMBER] << endl; std::cout << "frame number:" << thisDetector->timerValue[FRAME_NUMBER] << endl;
std::cout << "sub exp time:" << thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME] << 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 << "dynamic range:" << thisDetector->dynamicRange << endl << endl;
std::cout << "flippeddatax:" << thisDetector->flippedData[d] << endl; std::cout << "flippeddatax:" << thisDetector->flippedData[d] << endl;
std::cout << "10GbE:" << thisDetector->tenGigaEnable << endl << 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_PERIOD,thisDetector->timerValue[FRAME_PERIOD]);
setTimer(FRAME_NUMBER,thisDetector->timerValue[FRAME_NUMBER]); setTimer(FRAME_NUMBER,thisDetector->timerValue[FRAME_NUMBER]);
setTimer(ACQUISITION_TIME,thisDetector->timerValue[ACQUISITION_TIME]); 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_ACQUISITION_TIME,thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]);
setTimer(SUBFRAME_PERIOD,thisDetector->timerValue[SUBFRAME_PERIOD]);
}
if(thisDetector->myDetectorType == JUNGFRAUCTB) if(thisDetector->myDetectorType == JUNGFRAUCTB)
setTimer(SAMPLES_JCTB,thisDetector->timerValue[SAMPLES_JCTB]); setTimer(SAMPLES_JCTB,thisDetector->timerValue[SAMPLES_JCTB]);
setDynamicRange(thisDetector->dynamicRange); setDynamicRange(thisDetector->dynamicRange);

View File

@ -374,6 +374,7 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
virtual int64_t setTimer(timerIndex index, int64_t t=-1)=0; 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 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 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 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 setDelayAfterTrigger(int64_t t=-1){return setTimer(DELAY_AFTER_TRIGGER,t);};
int64_t setNumberOfGates(int64_t t=-1){return setTimer(GATES_NUMBER,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 /** 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 \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 \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){ \ static string getTimerType(timerIndex t){ \
switch (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 FRAMES_FROM_START_PG: return string("frames_from_start_pg"); \
case SAMPLES_JCTB: return string("samples_jctb"); \ case SAMPLES_JCTB: return string("samples_jctb"); \
case SUBFRAME_ACQUISITION_TIME: return string("subframe_acquisition_time"); \ 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"); \ case STORAGE_CELL_NUMBER: return string("storage_cell_number"); \
default: return string("unknown"); \ default: return string("unknown"); \
}}; }};

View File

@ -403,3 +403,22 @@ int slsDetectorUsers::setTenGigabitEthernet(int i) {
int slsDetectorUsers::getNMods() { int slsDetectorUsers::getNMods() {
return myDetector->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));
}

View File

@ -711,6 +711,22 @@ class slsDetectorUsers
*/ */
int getNMods(); 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 STATIC FUNCTIONS

View File

@ -3587,6 +3587,12 @@ int send_update(int file_des) {
#endif #endif
n = sendData(file_des,&retval,sizeof(int64_t),INT64); n = sendData(file_des,&retval,sizeof(int64_t),INT64);
if (n < 0) return printSocketReadError(); 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 #endif

View File

@ -1,18 +1,9 @@
Path: slsDetectorsPackage/slsReceiverSoftware Path: slsDetectorsPackage/slsReceiverSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
<<<<<<< HEAD Repsitory UUID: 51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b Revision: 791
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
Branch: developer Branch: developer
Last Changed Author: Dhanya_Thattil Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3746 Last Changed Rev: 3818
Last Changed Date: 2018-03-27 10:43:44.000000002 +0200 ./src/slsReceiverTCPIPInterface.cpp Last Changed Date: 2018-05-17 09:23:53.000000002 +0200 ./include/HDF5FileStatic.h
>>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3

View File

@ -63,12 +63,14 @@ class BinaryFile : private virtual slsReceiverDefs, public File, public BinaryFi
* @param nx number of pixels in x direction * @param nx number of pixels in x direction
* @param ny number of pixels in y direction * @param ny number of pixels in y direction
* @param at acquisition time * @param at acquisition time
* @param at sub exposure time * @param st sub exposure time
* @param sp sub period
* @param ap acquisition period * @param ap acquisition period
* @returns OK or FAIL * @returns OK or FAIL
*/ */
int CreateMasterFile(bool en, uint32_t size, 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 * Close Current File

View File

@ -109,12 +109,15 @@ class BinaryFileStatic {
* @param acquisitionTime acquisition time * @param acquisitionTime acquisition time
* @param acquisitionPeriod acquisition period * @param acquisitionPeriod acquisition period
* @param subexposuretime sub exposure time * @param subexposuretime sub exposure time
* @param subperiod sub period
* @param version version of software for binary writing * @param version version of software for binary writing
* @returns 0 for success and 1 for fail * @returns 0 for success and 1 for fail
*/ */
static int CreateMasterDataFile(FILE*& fd, string fname, bool owenable, 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, uint32_t dr, bool tenE, uint32_t size,
uint64_t acquisitionTime, uint64_t subexposuretime, uint64_t acquisitionPeriod, double version) 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(!owenable){
if (NULL == (fd = fopen((const char *) fname.c_str(), "wx"))){ if (NULL == (fd = fopen((const char *) fname.c_str(), "wx"))){
@ -130,32 +133,33 @@ class BinaryFileStatic {
time_t t = time(0); time_t t = time(0);
char message[MAX_STR_LENGTH]; char message[MAX_STR_LENGTH];
sprintf(message, sprintf(message,
"Version : %.1f\n" "Version : %.1f\n"
"Dynamic Range : %d\n" "Dynamic Range : %d\n"
"Ten Giga : %d\n" "Ten Giga : %d\n"
"Image Size : %d bytes\n" "Image Size : %d bytes\n"
"x : %d pixels\n" "x : %d pixels\n"
"y : %d pixels\n" "y : %d pixels\n"
"Total Frames : %lld\n" "Total Frames : %lld\n"
"Exptime (ns) : %lld\n" "Exptime (ns) : %lld\n"
"SubExptime (ns) : %lld\n" "SubExptime (ns) : %lld\n"
"Period (ns) : %lld\n" "SubPeriod(ns) : %lld\n"
"Timestamp : %s\n\n" "Period (ns) : %lld\n"
"Timestamp : %s\n\n"
"#Frame Header\n" "#Frame Header\n"
"Frame Number : 8 bytes\n" "Frame Number : 8 bytes\n"
"SubFrame Number/ExpLength : 4 bytes\n" "SubFrame Number/ExpLength : 4 bytes\n"
"Packet Number : 4 bytes\n" "Packet Number : 4 bytes\n"
"Bunch ID : 8 bytes\n" "Bunch ID : 8 bytes\n"
"Timestamp : 8 bytes\n" "Timestamp : 8 bytes\n"
"Module Id : 2 bytes\n" "Module Id : 2 bytes\n"
"X Coordinate : 2 bytes\n" "X Coordinate : 2 bytes\n"
"Y Coordinate : 2 bytes\n" "Y Coordinate : 2 bytes\n"
"Z Coordinate : 2 bytes\n" "Z Coordinate : 2 bytes\n"
"Debug : 4 bytes\n" "Debug : 4 bytes\n"
"Round Robin Number : 2 bytes\n" "Round Robin Number : 2 bytes\n"
"Detector Type : 1 byte\n" "Detector Type : 1 byte\n"
"Header Version : 1 byte\n" "Header Version : 1 byte\n"
, ,
version, version,
dr, dr,
@ -166,6 +170,7 @@ class BinaryFileStatic {
(long long int)nf, (long long int)nf,
(long long int)acquisitionTime, (long long int)acquisitionTime,
(long long int)subexposuretime, (long long int)subexposuretime,
(long long int)subperiod,
(long long int)acquisitionPeriod, (long long int)acquisitionPeriod,
ctime(&t)); ctime(&t));
if (strlen(message) > MAX_STR_LENGTH) { if (strlen(message) > MAX_STR_LENGTH) {

View File

@ -173,11 +173,13 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
* @param en ten giga enable * @param en ten giga enable
* @param nf number of frames * @param nf number of frames
* @param at acquisition time * @param at acquisition time
* @param at sub exposure time * @param st sub exposure time
* @param sp sub period
* @param ap acquisition period * @param ap acquisition period
* @returns OK or FAIL * @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 * Closes files

View File

@ -89,7 +89,8 @@ class File : private virtual slsReceiverDefs {
* @returns OK or FAIL * @returns OK or FAIL
*/ */
virtual int CreateFile(uint64_t fnum){ 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; return OK;
} }
@ -97,14 +98,16 @@ class File : private virtual slsReceiverDefs {
* Close Current File * Close Current File
*/ */
virtual void CloseCurrentFile() { 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 * Close Files
*/ */
virtual void CloseAllFiles() { 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 * @param OK or FAIL
*/ */
virtual int WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t nump) { 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; return FAIL;
} }
@ -126,13 +130,16 @@ class File : private virtual slsReceiverDefs {
* @param nx number of pixels in x direction * @param nx number of pixels in x direction
* @param ny number of pixels in y direction * @param ny number of pixels in y direction
* @param at acquisition time * @param at acquisition time
* @param at sub exposure time * @param st sub exposure time
* @param sp sub period
* @param ap acquisition period * @param ap acquisition period
* @returns OK or FAIL * @returns OK or FAIL
*/ */
virtual int CreateMasterFile(bool en, uint32_t size, virtual 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,
cprintf(RED,"This is a generic function CreateMasterFile that should be overloaded by a derived class\n"); 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; return OK;
} }
@ -143,7 +150,8 @@ class File : private virtual slsReceiverDefs {
* @param ny number of pixels in y direction * @param ny number of pixels in y direction
*/ */
virtual void SetNumberofPixels(uint32_t nx, uint32_t ny) { 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 * @param numf number of images caught
*/ */
virtual void EndofAcquisition(uint64_t numf) { 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: protected:

View File

@ -99,12 +99,14 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
* @param nx number of pixels in x direction * @param nx number of pixels in x direction
* @param ny number of pixels in y direction * @param ny number of pixels in y direction
* @param at acquisition time * @param at acquisition time
* @param at sub exposure time * @param st sub exposure time
* @param sp sub period
* @param ap acquisition period * @param ap acquisition period
* @returns OK or FAIL * @returns OK or FAIL
*/ */
int CreateMasterFile(bool en, uint32_t size, 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 * End of Acquisition

View File

@ -232,13 +232,16 @@ public:
* @param nf number of images * @param nf number of images
* @param acquisitionTime acquisition time * @param acquisitionTime acquisition time
* @param subexposuretime sub exposure time * @param subexposuretime sub exposure time
* @param subperiod sub period
* @param acquisitionPeriod acquisition period * @param acquisitionPeriod acquisition period
* @param version version of software for hdf5 writing * @param version version of software for hdf5 writing
* @returns 0 for success and 1 for fail * @returns 0 for success and 1 for fail
*/ */
static int CreateMasterDataFile(H5File*& fd, string fname, bool owenable, 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, uint32_t dr, bool tenE, uint32_t size,
uint64_t acquisitionTime, uint64_t subexposuretime, uint64_t acquisitionPeriod, double version) uint32_t nPixelsx, uint32_t nPixelsy, uint64_t nf,
uint64_t acquisitionTime, uint64_t subexposuretime,
uint64_t subperiod, uint64_t acquisitionPeriod, double version)
{ {
try { try {
Exception::dontPrint(); //to handle errors Exception::dontPrint(); //to handle errors
@ -246,9 +249,13 @@ public:
FileAccPropList flist; FileAccPropList flist;
flist.setFcloseDegree(H5F_CLOSE_STRONG); flist.setFcloseDegree(H5F_CLOSE_STRONG);
if(!owenable) 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 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 //variables
DataSpace dataspace = DataSpace (H5S_SCALAR); DataSpace dataspace = DataSpace (H5S_SCALAR);
@ -313,6 +320,12 @@ public:
attribute = dataset.createAttribute("unit",strdatatype, dataspace); attribute = dataset.createAttribute("unit",strdatatype, dataspace);
attribute.write(strdatatype, string("ns")); 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 //Period
dataset = group5.createDataSet ( "acquisition period", PredType::STD_U64LE, dataspace ); dataset = group5.createDataSet ( "acquisition period", PredType::STD_U64LE, dataspace );
dataset.write ( &acquisitionPeriod, PredType::STD_U64LE); dataset.write ( &acquisitionPeriod, PredType::STD_U64LE);
@ -374,9 +387,13 @@ public:
FileAccPropList fapl; FileAccPropList fapl;
fapl.setFcloseDegree(H5F_CLOSE_STRONG); fapl.setFcloseDegree(H5F_CLOSE_STRONG);
if(!owenable) 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 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 //attributes - version
double dValue=version; double dValue=version;
@ -678,9 +695,13 @@ public:
FileAccPropList fapl; FileAccPropList fapl;
fapl.setFcloseDegree(H5F_CLOSE_STRONG); fapl.setFcloseDegree(H5F_CLOSE_STRONG);
if(!owenable) 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 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 and dataset
DataSpace* newDataspace; DataSpace* newDataspace;
if (rank == 3) { if (rank == 3) {

View File

@ -206,6 +206,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
*/ */
uint64_t getSubExpTime() const; uint64_t getSubExpTime() const;
/**
* Get Sub Period
* @return Sub Period
*/
uint64_t getSubPeriod() const;
/* /*
* Get Number of Frames expected by receiver from detector * 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) * 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); 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 * 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 * 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; uint64_t acquisitionTime;
/** Sub Exposure Time */ /** Sub Exposure Time */
uint64_t subExpTime; uint64_t subExpTime;
/** Sub Period */
uint64_t subPeriod;
/** Frame Number */ /** Frame Number */
uint64_t numberOfFrames; uint64_t numberOfFrames;
/** Samples Number */ /** Samples Number */

View File

@ -294,6 +294,12 @@ class UDPInterface {
*/ */
virtual uint64_t getSubExpTime() const = 0; 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 * 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) * 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; 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 * 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) * The data receiver status will change from running to idle when it gets this number of frames FIXME: (for Leo? Not implemented)

View File

@ -1,7 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "51fd9ed423b7a8fb45a76b4f48316537c4fb0f5d"
#define GITREPUUID "b8bdbf4da61f95b88893b02ddabc2491b16fa10f"
#define GITAUTH "Dhanya_Thattil" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3746 #define GITREV 0x3818
#define GITDATE 0x20180327 #define GITDATE 0x20180517
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -84,19 +84,22 @@ int BinaryFile::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_
int BinaryFile::CreateMasterFile(bool en, uint32_t size, 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 //beginning of every acquisition
numFramesInFile = 0; numFramesInFile = 0;
numActualPacketsInFile = 0; numActualPacketsInFile = 0;
if (master && (*detIndex==0)) { if (master && (*detIndex==0)) {
masterFileName = BinaryFileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex); masterFileName = BinaryFileStatic::CreateMasterFileName(filePath,
fileNamePrefix, *fileIndex);
if(!silentMode) { if(!silentMode) {
FILE_LOG(logINFO) << "Master File: " << masterFileName; FILE_LOG(logINFO) << "Master File: " << masterFileName;
} }
return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable, return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName,
*overWriteEnable,
*dynamicRange, en, size, nx, ny, *numImages, *dynamicRange, en, size, nx, ny, *numImages,
at, st, ap, BINARY_WRITER_VERSION); at, st, sp, ap, BINARY_WRITER_VERSION);
} }
return OK; return OK;
} }

View File

@ -245,12 +245,12 @@ void DataProcessor::SetupFileWriter(bool fwe, int* nd, char* fname, char* fpath,
} }
// only the first file // 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) if (file == NULL)
return FAIL; return FAIL;
file->CloseAllFiles(); file->CloseAllFiles();
if (file->CreateMasterFile(en, generalData->imageSize, generalData->nPixelsX, generalData->nPixelsY, if (file->CreateMasterFile(en, generalData->imageSize, generalData->nPixelsX, generalData->nPixelsY,
at, st, ap) == FAIL) at, st, sp, ap) == FAIL)
return FAIL; return FAIL;
if (file->CreateFile(currentFrameIndex) == FAIL) if (file->CreateFile(currentFrameIndex) == FAIL)
return FAIL; return FAIL;

View File

@ -163,7 +163,8 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
int HDF5File::CreateMasterFile(bool en, uint32_t size, 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 //beginning of every acquisition
numFramesInFile = 0; numFramesInFile = 0;
@ -171,12 +172,15 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
if (master && (*detIndex==0)) { if (master && (*detIndex==0)) {
virtualfd = 0; virtualfd = 0;
masterFileName = HDF5FileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex); masterFileName = HDF5FileStatic::CreateMasterFileName(filePath,
fileNamePrefix, *fileIndex);
if(!silentMode) if(!silentMode)
FILE_LOG(logINFO) << "Master File: " << masterFileName; FILE_LOG(logINFO) << "Master File: " << masterFileName;
pthread_mutex_lock(&Mutex); pthread_mutex_lock(&Mutex);
int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable, int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName,
*dynamicRange, en, size, nx, ny, *numImages, at, st, ap, HDF5_WRITER_VERSION); *overWriteEnable,
*dynamicRange, en, size, nx, ny, *numImages, at, st, sp, ap,
HDF5_WRITER_VERSION);
pthread_mutex_unlock(&Mutex); pthread_mutex_unlock(&Mutex);
return ret; return ret;
} }

View File

@ -47,6 +47,7 @@ void UDPBaseImplementation::initializeMembers(){
acquisitionPeriod = 0; acquisitionPeriod = 0;
acquisitionTime = 0; acquisitionTime = 0;
subExpTime = 0; subExpTime = 0;
subPeriod = 0;
numberOfFrames = 0; numberOfFrames = 0;
numberOfSamples = 0; numberOfSamples = 0;
dynamicRange = 16; dynamicRange = 16;
@ -103,11 +104,13 @@ UDPBaseImplementation::~UDPBaseImplementation(){}
/**initial parameters***/ /**initial parameters***/
int* UDPBaseImplementation::getMultiDetectorSize() const{ int* UDPBaseImplementation::getMultiDetectorSize() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return (int*) numDet;} return (int*) numDet;
}
int UDPBaseImplementation::getDetectorPositionId() const{ int UDPBaseImplementation::getDetectorPositionId() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return detID;} return detID;
}
char *UDPBaseImplementation::getDetectorHostname() const{ char *UDPBaseImplementation::getDetectorHostname() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
@ -136,7 +139,8 @@ bool UDPBaseImplementation::getGapPixelsEnable() const {
/***file parameters***/ /***file parameters***/
slsReceiverDefs::fileFormat UDPBaseImplementation::getFileFormat() const{ slsReceiverDefs::fileFormat UDPBaseImplementation::getFileFormat() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return fileFormatType;} return fileFormatType;
}
char *UDPBaseImplementation::getFileName() const{ char *UDPBaseImplementation::getFileName() const{
@ -167,46 +171,56 @@ char *UDPBaseImplementation::getFilePath() const{
uint64_t UDPBaseImplementation::getFileIndex() const{ uint64_t UDPBaseImplementation::getFileIndex() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return fileIndex;} return fileIndex;
}
int UDPBaseImplementation::getScanTag() const{ int UDPBaseImplementation::getScanTag() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return scanTag;} return scanTag;
}
bool UDPBaseImplementation::getFileWriteEnable() const{ bool UDPBaseImplementation::getFileWriteEnable() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return fileWriteEnable;} return fileWriteEnable;
}
bool UDPBaseImplementation::getOverwriteEnable() const{ bool UDPBaseImplementation::getOverwriteEnable() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return overwriteEnable;} return overwriteEnable;
}
bool UDPBaseImplementation::getDataCompressionEnable() const{ bool UDPBaseImplementation::getDataCompressionEnable() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return dataCompressionEnable;} return dataCompressionEnable;
}
/***acquisition count parameters***/ /***acquisition count parameters***/
uint64_t UDPBaseImplementation::getTotalFramesCaught() const{ uint64_t UDPBaseImplementation::getTotalFramesCaught() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return 0;} return 0;
}
uint64_t UDPBaseImplementation::getFramesCaught() const{ uint64_t UDPBaseImplementation::getFramesCaught() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return 0;} return 0;
}
int64_t UDPBaseImplementation::getAcquisitionIndex() const{ int64_t UDPBaseImplementation::getAcquisitionIndex() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return -1;} return -1;
}
/***connection parameters***/ /***connection parameters***/
uint32_t UDPBaseImplementation::getUDPPortNumber() const{ uint32_t UDPBaseImplementation::getUDPPortNumber() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return udpPortNum[0];} return udpPortNum[0];
}
uint32_t UDPBaseImplementation::getUDPPortNumber2() const{ uint32_t UDPBaseImplementation::getUDPPortNumber2() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return udpPortNum[1];} return udpPortNum[1];
}
char *UDPBaseImplementation::getEthernetInterface() const{ char *UDPBaseImplementation::getEthernetInterface() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
@ -221,39 +235,53 @@ char *UDPBaseImplementation::getEthernetInterface() const{
/***acquisition parameters***/ /***acquisition parameters***/
int UDPBaseImplementation::getShortFrameEnable() const{ int UDPBaseImplementation::getShortFrameEnable() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return shortFrameEnable;} return shortFrameEnable;
}
uint32_t UDPBaseImplementation::getFrameToGuiFrequency() const{ uint32_t UDPBaseImplementation::getFrameToGuiFrequency() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return frameToGuiFrequency;} return frameToGuiFrequency;
}
uint32_t UDPBaseImplementation::getFrameToGuiTimer() const{ uint32_t UDPBaseImplementation::getFrameToGuiTimer() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return frameToGuiTimerinMS;} return frameToGuiTimerinMS;
}
bool UDPBaseImplementation::getDataStreamEnable() const{ bool UDPBaseImplementation::getDataStreamEnable() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return dataStreamEnable;} return dataStreamEnable;
}
uint64_t UDPBaseImplementation::getAcquisitionPeriod() const{ uint64_t UDPBaseImplementation::getAcquisitionPeriod() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return acquisitionPeriod;} return acquisitionPeriod;
}
uint64_t UDPBaseImplementation::getAcquisitionTime() const{ uint64_t UDPBaseImplementation::getAcquisitionTime() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return acquisitionTime;} return acquisitionTime;
}
uint64_t UDPBaseImplementation::getSubExpTime() const{ uint64_t UDPBaseImplementation::getSubExpTime() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; 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{ uint64_t UDPBaseImplementation::getNumberOfFrames() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return numberOfFrames;} return numberOfFrames;
}
uint64_t UDPBaseImplementation::getNumberofSamples() const{ uint64_t UDPBaseImplementation::getNumberofSamples() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return numberOfSamples;} return numberOfSamples;
}
uint32_t UDPBaseImplementation::getDynamicRange() const{ uint32_t UDPBaseImplementation::getDynamicRange() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
@ -261,11 +289,13 @@ uint32_t UDPBaseImplementation::getDynamicRange() const{
bool UDPBaseImplementation::getTenGigaEnable() const{ bool UDPBaseImplementation::getTenGigaEnable() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return tengigaEnable;} return tengigaEnable;
}
uint32_t UDPBaseImplementation::getFifoDepth() const{ uint32_t UDPBaseImplementation::getFifoDepth() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return fifoDepth;} return fifoDepth;
}
/***receiver status***/ /***receiver status***/
slsReceiverDefs::runStatus UDPBaseImplementation::getStatus() const{ slsReceiverDefs::runStatus UDPBaseImplementation::getStatus() const{
@ -278,11 +308,13 @@ uint32_t UDPBaseImplementation::getSilentMode() const{
int UDPBaseImplementation::getActivate() const{ int UDPBaseImplementation::getActivate() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return activated;} return activated;
}
uint32_t UDPBaseImplementation::getStreamingPort() const{ uint32_t UDPBaseImplementation::getStreamingPort() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";
return streamingPort;} return streamingPort;
}
char *UDPBaseImplementation::getStreamingSourceIP() const{ char *UDPBaseImplementation::getStreamingSourceIP() const{
FILE_LOG(logDEBUG) << __AT__ << " starting"; 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"; 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){ int UDPBaseImplementation::setNumberOfFrames(const uint64_t i){
FILE_LOG(logDEBUG) << __AT__ << " starting"; FILE_LOG(logDEBUG) << __AT__ << " starting";

View File

@ -764,7 +764,7 @@ int UDPStandardImplementation::SetupWriter() {
bool error = false; bool error = false;
for (unsigned int i = 0; i < dataProcessor.size(); ++i) for (unsigned int i = 0; i < dataProcessor.size(); ++i)
if (dataProcessor[i]->CreateNewFile(tengigaEnable, if (dataProcessor[i]->CreateNewFile(tengigaEnable,
numberOfFrames, acquisitionTime, subExpTime, acquisitionPeriod) == FAIL) { numberOfFrames, acquisitionTime, subExpTime, subPeriod, acquisitionPeriod) == FAIL) {
error = true; error = true;
break; break;
} }

View File

@ -1054,6 +1054,9 @@ int slsReceiverTCPIPInterface::set_timer() {
case SUBFRAME_ACQUISITION_TIME: case SUBFRAME_ACQUISITION_TIME:
receiverBase->setSubExpTime(index[1]); receiverBase->setSubExpTime(index[1]);
break; break;
case SUBFRAME_PERIOD:
receiverBase->setSubPeriod(index[1]);
break;
case SAMPLES_JCTB: case SAMPLES_JCTB:
if (myDetectorType != JUNGFRAUCTB) { if (myDetectorType != JUNGFRAUCTB) {
ret = FAIL; ret = FAIL;
@ -1086,6 +1089,9 @@ int slsReceiverTCPIPInterface::set_timer() {
case SUBFRAME_ACQUISITION_TIME: case SUBFRAME_ACQUISITION_TIME:
retval=receiverBase->getSubExpTime(); retval=receiverBase->getSubExpTime();
break; break;
case SUBFRAME_PERIOD:
retval=receiverBase->getSubPeriod();
break;
case SAMPLES_JCTB: case SAMPLES_JCTB:
if (myDetectorType != JUNGFRAUCTB) { if (myDetectorType != JUNGFRAUCTB) {
ret = FAIL; ret = FAIL;