mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-23 14:30:43 +02:00
Fix bugs in ReplayH5Reader
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "jungfrau.hpp"
|
||||
#include <H5Cpp.h>
|
||||
#include <memory>
|
||||
#include "buffer_config.hpp"
|
||||
|
||||
|
||||
class ReplayH5Reader {
|
||||
@@ -17,10 +18,10 @@ class ReplayH5Reader {
|
||||
H5::DataSet dset_metadata_;
|
||||
H5::DataSet dset_frame_;
|
||||
|
||||
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);
|
||||
std::unique_ptr<char[]> frame_buffer = std::make_unique<char[]>(
|
||||
core_buffer::MODULE_N_BYTES * core_buffer::REPLAY_READ_BUFFER_SIZE);
|
||||
std::unique_ptr<char[]> metadata_buffer = std::make_unique<char[]>(
|
||||
sizeof(ModuleFrame) * core_buffer::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);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "ReplayH5Reader.hpp"
|
||||
|
||||
#include "BufferUtils.hpp"
|
||||
#include "buffer_config.hpp"
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
@@ -74,7 +73,7 @@ void ReplayH5Reader::prepare_buffer_for_pulse(const uint64_t pulse_id)
|
||||
hsize_t f_f_start[] = {start_index_in_file, 0, 0};
|
||||
f_f_space.selectHyperslab(H5S_SELECT_SET, f_f_count, f_f_start);
|
||||
|
||||
dset_frame_.read(frame_buffer, H5::PredType::NATIVE_UINT16,
|
||||
dset_frame_.read(&(frame_buffer[0]), H5::PredType::NATIVE_UINT16,
|
||||
b_f_space, f_f_space);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user