mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-22 17:47:59 +02:00
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:
@ -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
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user