33 lines
916 B
C++
33 lines
916 B
C++
// Copyright (2019-2023) Paul Scherrer Institute
|
|
|
|
#ifndef JUNGFRAUJOCH_HDF5WRITER_H
|
|
#define JUNGFRAUJOCH_HDF5WRITER_H
|
|
|
|
#include <numeric>
|
|
|
|
#include "HDF5DataFile.h"
|
|
#include "../frame_serialize/JFJochMessages.h"
|
|
#include "../common/ZMQWrappers.h"
|
|
|
|
class HDF5Writer {
|
|
std::vector<std::unique_ptr<HDF5DataFile> > files;
|
|
int64_t images_per_file;
|
|
std::string file_prefix;
|
|
uint64_t max_spot_count;
|
|
std::vector<float> az_int_bin_to_q;
|
|
std::vector<HDF5DataFileStatistics> stats;
|
|
std::string user_data;
|
|
|
|
std::unique_ptr<ZMQSocket> socket;
|
|
|
|
void AddStats(const std::optional<HDF5DataFileStatistics>& s);
|
|
public:
|
|
explicit HDF5Writer(const StartMessage &request);
|
|
void Write(const DataMessage& msg);
|
|
std::vector<HDF5DataFileStatistics> Finalize();
|
|
void SetupSocket(const std::string &addr);
|
|
std::optional<std::string> GetZMQAddr();
|
|
};
|
|
|
|
#endif //JUNGFRAUJOCH_HDF5WRITER_H
|