mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-01 10:20:04 +02:00
WIP det dependant master file attribtes
This commit is contained in:
parent
c2b586a333
commit
85c958facf
@ -7,6 +7,7 @@
|
|||||||
#include "ToString.h"
|
#include "ToString.h"
|
||||||
#include "ZmqSocket.h" //just for the zmq port define
|
#include "ZmqSocket.h" //just for the zmq port define
|
||||||
#include "file_utils.h"
|
#include "file_utils.h"
|
||||||
|
#include "masterFileAttributes.h"
|
||||||
|
|
||||||
#include <cerrno> //eperm
|
#include <cerrno> //eperm
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
116
slsReceiverSoftware/src/masterFileAttributes.h
Normal file
116
slsReceiverSoftware/src/masterFileAttributes.h
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
|
#include "logger.h"
|
||||||
|
#include "ToString.h"
|
||||||
|
|
||||||
|
// versions
|
||||||
|
#define HDF5_WRITER_VERSION (6.1) // 1 decimal places
|
||||||
|
#define BINARY_WRITER_VERSION (6.1) // 1 decimal places
|
||||||
|
|
||||||
|
class masterFileAttributes {
|
||||||
|
|
||||||
|
public:
|
||||||
|
double version{0.0};
|
||||||
|
slsDetectorDefs::detectorType detType{slsDetectorDefs::GENERIC};
|
||||||
|
uint32_t imageSize{0};
|
||||||
|
slsDetectorDefs::xy nPixels{};
|
||||||
|
uint32_t maxFramesPerFile{0};
|
||||||
|
uint64_t totalFrames{0};
|
||||||
|
uint64_t exptimeNs{0};
|
||||||
|
uint64_t periodNs{0};
|
||||||
|
uint32_t dynamicRange{0};
|
||||||
|
uint32_t tenGiga{0};
|
||||||
|
uint64_t subExptimeNs{0};
|
||||||
|
uint64_t subPeriodNs{0};
|
||||||
|
uint32_t quadEnable{0};
|
||||||
|
uint32_t adcmask{0};
|
||||||
|
uint32_t analogFlag{0};
|
||||||
|
uint32_t digitalFlag{0};
|
||||||
|
uint32_t dbitoffset{0};
|
||||||
|
uint64_t dbitlist{0};
|
||||||
|
slsDetectorDefs::ROI roi{};
|
||||||
|
uint64_t exptime1Ns{0};
|
||||||
|
uint64_t exptime2Ns{0};
|
||||||
|
uint64_t exptime3Ns{0};
|
||||||
|
uint64_t gateDelay1Ns{0};
|
||||||
|
uint64_t gateDelay2Ns{0};
|
||||||
|
uint64_t gateDelay3Ns{0};
|
||||||
|
uint32_t gates;
|
||||||
|
/*
|
||||||
|
double version{0.0};
|
||||||
|
slsDetectorDefs::detectorType myDetectorType{slsDetectorDefs::GENERIC};
|
||||||
|
uint32_t imageSize{0};
|
||||||
|
uint32_t nPixelsX{0};
|
||||||
|
uint32_t nPixelsY{0};
|
||||||
|
uint32_t maxFramesPerFile{0};
|
||||||
|
uint64_t totalFrames{0};
|
||||||
|
uint64_t exptimeNs{0};
|
||||||
|
uint64_t periodNs{0};
|
||||||
|
*/
|
||||||
|
/* eiger
|
||||||
|
uint32_t dynamicRange{0};
|
||||||
|
uint32_t tenGiga{0};
|
||||||
|
uint64_t subExptimeNs{0};
|
||||||
|
uint64_t subPeriodNs{0};
|
||||||
|
uint32_t quadEnable{0};
|
||||||
|
*/
|
||||||
|
/** moench
|
||||||
|
uint32_t tenGiga{0};
|
||||||
|
uint32_t adcmask{0};
|
||||||
|
*/
|
||||||
|
/* ctb
|
||||||
|
uint32_t tenGiga{0};
|
||||||
|
uint32_t adcmask{0};
|
||||||
|
uint32_t analogFlag{0};
|
||||||
|
uint32_t digitalFlag{0};
|
||||||
|
uint32_t dbitoffset{0};
|
||||||
|
uint64_t dbitlist{0};
|
||||||
|
*/
|
||||||
|
/* gotthard
|
||||||
|
uint32_t roiXmin{0};
|
||||||
|
uint32_t roiXmax{0};
|
||||||
|
*/
|
||||||
|
/* mythen3
|
||||||
|
uint32_t dynamicRange{0};
|
||||||
|
uint32_t tenGiga{0};
|
||||||
|
uint64_t exptime1Ns{0};
|
||||||
|
uint64_t exptime2Ns{0};
|
||||||
|
uint64_t exptime3Ns{0};
|
||||||
|
uint64_t gateDelay1Ns{0};
|
||||||
|
uint64_t gateDelay2Ns{0};
|
||||||
|
uint64_t gateDelay3Ns{0};
|
||||||
|
uint32_t gates;
|
||||||
|
*/
|
||||||
|
masterFileAttributes(){};
|
||||||
|
virtual ~masterFileAttributes(){};
|
||||||
|
|
||||||
|
std::string GetBinaryMasterFileAttributes() {
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << "Version : " << std::setprecision(2) << version << '\n'
|
||||||
|
<< "Detector Type : " << sls::ToString(detType) << '\n'
|
||||||
|
<< "Image Size : " << imageSize << " bytes" << '\n'
|
||||||
|
<< "nPixels : " << sls::ToString(nPixels) << " pixels" << '\n'
|
||||||
|
<< "Max Frames Per File : " << maxFramesPerFile << '\n'
|
||||||
|
<< "Total Frames : " << totalFrames << '\n'
|
||||||
|
<< "Exptime (ns) : " << exptimeNs << '\n'
|
||||||
|
<< "Period (ns) : " << periodNs << '\n';
|
||||||
|
return oss.str();
|
||||||
|
};
|
||||||
|
|
||||||
|
// hdf5
|
||||||
|
};
|
||||||
|
|
||||||
|
class GotthardMasterFileAttributes : public masterFileAttributes {
|
||||||
|
|
||||||
|
public:
|
||||||
|
GotthardMasterFileAttributes() {};
|
||||||
|
|
||||||
|
std::string GetBinaryMasterFileAttributes() {
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << masterFileAttributes::GetBinaryMasterFileAttributes()
|
||||||
|
<< "Roi (xmin, xmax) : " << sls::ToString(roi) << '\n';
|
||||||
|
return oss.str();
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
@ -39,10 +39,6 @@
|
|||||||
// hdf5
|
// hdf5
|
||||||
#define MAX_CHUNKED_IMAGES (1)
|
#define MAX_CHUNKED_IMAGES (1)
|
||||||
|
|
||||||
// versions
|
|
||||||
#define HDF5_WRITER_VERSION (6.0) // 1 decimal places
|
|
||||||
#define BINARY_WRITER_VERSION (6.0) // 1 decimal places
|
|
||||||
|
|
||||||
// parameters to calculate fifo depth
|
// parameters to calculate fifo depth
|
||||||
#define SAMPLE_TIME_IN_NS (100000000) // 100ms
|
#define SAMPLE_TIME_IN_NS (100000000) // 100ms
|
||||||
#define MAX_EIGER_ROWS_PER_READOUT (256)
|
#define MAX_EIGER_ROWS_PER_READOUT (256)
|
||||||
@ -57,6 +53,9 @@
|
|||||||
#define STREAMER_PRIORITY (10)
|
#define STREAMER_PRIORITY (10)
|
||||||
#define TCP_PRIORITY (10)
|
#define TCP_PRIORITY (10)
|
||||||
|
|
||||||
|
|
||||||
|
#define HDF5_WRITER_VERSION (6.1) // 1 decimal places
|
||||||
|
#define BINARY_WRITER_VERSION (6.1) // 1 decimal places
|
||||||
struct masterAttributes {
|
struct masterAttributes {
|
||||||
double version;
|
double version;
|
||||||
uint32_t detectorType;
|
uint32_t detectorType;
|
||||||
|
@ -39,6 +39,8 @@ std::string ToString(const std::vector<defs::dacIndex> &vec);
|
|||||||
std::string ToString(const defs::burstMode s);
|
std::string ToString(const defs::burstMode s);
|
||||||
std::string ToString(const defs::timingSourceType s);
|
std::string ToString(const defs::timingSourceType s);
|
||||||
|
|
||||||
|
std::string ToString(const slsDetectorDefs::xy &coord);
|
||||||
|
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::xy &coord);
|
||||||
std::string ToString(const slsDetectorDefs::ROI &roi);
|
std::string ToString(const slsDetectorDefs::ROI &roi);
|
||||||
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi);
|
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi);
|
||||||
std::string ToString(const slsDetectorDefs::rxParameters &r);
|
std::string ToString(const slsDetectorDefs::rxParameters &r);
|
||||||
|
@ -3,6 +3,16 @@
|
|||||||
|
|
||||||
namespace sls {
|
namespace sls {
|
||||||
|
|
||||||
|
std::string ToString(const slsDetectorDefs::xy &coord) {
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << '[' << coord.x << ", " << coord.y << ']';
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::xy &coord) {
|
||||||
|
return os << ToString(coord);
|
||||||
|
}
|
||||||
|
|
||||||
std::string ToString(const slsDetectorDefs::ROI &roi) {
|
std::string ToString(const slsDetectorDefs::ROI &roi) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << '[' << roi.xmin << ", " << roi.xmax << ']';
|
oss << '[' << roi.xmin << ", " << roi.xmax << ']';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user