mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 23:37:14 +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:
@ -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