mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-15 06:17:12 +02:00
wip
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "sls/logger.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
struct MasterAttributes;
|
||||
@ -7,36 +8,60 @@ struct MasterAttributes;
|
||||
class File : private virtual slsDetectorDefs {
|
||||
|
||||
public:
|
||||
File(slsDetectorDefs::fileFormat type);
|
||||
File(const slsDetectorDefs::fileFormat format);
|
||||
virtual ~File();
|
||||
|
||||
fileFormat GetFileType();
|
||||
virtual uint32_t GetFilesInAcquisition() = 0;
|
||||
fileFormat GetFileFormat() const;
|
||||
virtual void CloseFile() = 0;
|
||||
|
||||
virtual void CreateMasterFile(std::string filePath,
|
||||
std::string fileNamePrefix,
|
||||
uint64_t fileIndex, bool overWriteEnable,
|
||||
bool silentMode, MasterAttributes *attr) = 0;
|
||||
virtual uint32_t GetFilesInAcquisition() const {
|
||||
LOG(logERROR)
|
||||
<< "This is a generic function GetFilesInAcquisition that "
|
||||
"should be overloaded by a derived class";
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual void
|
||||
CreateFirstBinaryDataFile(std::string filePath, std::string fileNamePrefix,
|
||||
uint64_t fileIndex, bool overWriteEnable,
|
||||
bool silentMode, int detIndex,
|
||||
int numUnitsPerDetector, uint32_t udpPortNumber,
|
||||
uint32_t maxFramesPerFile) = 0;
|
||||
virtual void CreateMasterFile(const std::string filePath,
|
||||
const std::string fileNamePrefix,
|
||||
const uint64_t fileIndex,
|
||||
const bool overWriteEnable,
|
||||
const bool silentMode,
|
||||
MasterAttributes *attr) {
|
||||
LOG(logERROR) << "This is a generic function CreateMasterFile that "
|
||||
"should be overloaded by a derived class";
|
||||
};
|
||||
|
||||
virtual void CreateFirstBinaryDataFile(
|
||||
const std::string filePath, const std::string fileNamePrefix,
|
||||
const uint64_t fileIndex, const bool overWriteEnable,
|
||||
const bool silentMode, const int modulePos,
|
||||
const int numUnitsPerReadout, const uint32_t udpPortNumber,
|
||||
const uint32_t maxFramesPerFile) {
|
||||
LOG(logERROR)
|
||||
<< "This is a generic function CreateFirstBinaryDataFile that "
|
||||
"should be overloaded by a derived class";
|
||||
};
|
||||
|
||||
virtual void CreateFirstHDF5DataFile(
|
||||
std::string filePath, std::string fileNamePrefix, uint64_t fileIndex,
|
||||
bool overWriteEnable, bool silentMode, int detIndex,
|
||||
int numUnitsPerDetector, uint32_t udpPortNumber,
|
||||
uint32_t maxFramesPerFile, uint64_t numImages, uint32_t nPIxelsX,
|
||||
uint32_t nPIxelsY, uint32_t dynamicRange) = 0;
|
||||
const std::string filePath, const std::string fileNamePrefix,
|
||||
const uint64_t fileIndex, const bool overWriteEnable,
|
||||
const bool silentMode, const int modulePos,
|
||||
const int numUnitsPerReadout, const uint32_t udpPortNumber,
|
||||
const uint32_t maxFramesPerFile, const uint64_t numImages,
|
||||
const uint32_t nPIxelsX, const uint32_t nPIxelsY,
|
||||
const uint32_t dynamicRange) {
|
||||
LOG(logERROR)
|
||||
<< "This is a generic function CreateFirstHDF5DataFile that "
|
||||
"should be overloaded by a derived class";
|
||||
};
|
||||
|
||||
virtual void WriteToFile(char *buffer, int buffersize,
|
||||
uint64_t currentFrameNumber,
|
||||
uint32_t numPacketsCaught) = 0;
|
||||
virtual void WriteToFile(char *buffer, const int buffersize,
|
||||
const uint64_t currentFrameNumber,
|
||||
const uint32_t numPacketsCaught) {
|
||||
LOG(logERROR) << "This is a generic function WriteToFile that "
|
||||
"should be overloaded by a derived class";
|
||||
};
|
||||
|
||||
protected:
|
||||
slsDetectorDefs::fileFormat type_;
|
||||
slsDetectorDefs::fileFormat format_;
|
||||
};
|
||||
|
Reference in New Issue
Block a user