mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-06-06 21:58:41 +02:00
Add buffering to replay
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <string>
|
||||
#include "jungfrau.hpp"
|
||||
#include <H5Cpp.h>
|
||||
#include <memory>
|
||||
|
||||
|
||||
class ReplayH5Reader {
|
||||
@@ -16,7 +17,13 @@ class ReplayH5Reader {
|
||||
H5::DataSet dset_metadata_;
|
||||
H5::DataSet dset_frame_;
|
||||
|
||||
void prepare_file_for_pulse(const uint64_t pulse_id);
|
||||
std::unique_ptr<char[]> frame_buffer = make_unique<char[]>(
|
||||
MODULE_N_BYTES * REPLAY_READ_BUFFER_SIZE);
|
||||
std::unique_ptr<char[]> metadata_buffer = make_unique<char[]>(
|
||||
sizeof(ModuleFrame) * FILE_MOD);
|
||||
uint64_t buffer_start_pulse_id_ = 0;
|
||||
uint64_t buffer_end_pulse_id_ = 0;
|
||||
void prepare_buffer_for_pulse(const uint64_t pulse_id);
|
||||
|
||||
public:
|
||||
ReplayH5Reader(const std::string device, const std::string channel_name);
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace core_buffer {
|
||||
|
||||
const std::string REPLAY_STREAM_IPC_URL = "ipc:///tmp/sf-replay-";
|
||||
|
||||
const size_t REPLAY_READ_BUFFER_SIZE = 100;
|
||||
|
||||
const size_t BUFFER_UDP_N_RECV_MSG = 64;
|
||||
|
||||
// Size of UDP recv buffer
|
||||
|
||||
Reference in New Issue
Block a user