mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-23 23:10:44 +02:00
H5Writer refactoring
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ void H5Writer::close_file()
|
||||
max_frame_index = 0;
|
||||
}
|
||||
|
||||
void H5Writer::write_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data, string data_type, string endianness)
|
||||
void H5Writer::write_frame_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data, string data_type, string endianness)
|
||||
{
|
||||
// Define the ofset of the currently received image in the file.
|
||||
hsize_t relative_frame_index = prepare_storage_for_frame(frame_index, frame_shape, data_type, endianness);
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class H5Writer
|
||||
~H5Writer();
|
||||
bool is_file_open();
|
||||
void close_file();
|
||||
void write_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data, std::string data_type, std::string endianness);
|
||||
void write_frame_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data, std::string data_type, std::string endianness);
|
||||
H5::H5File& get_h5_file();
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
|
||||
#include "config.hpp"
|
||||
#include "WriterManager.hpp"
|
||||
@@ -14,8 +13,6 @@
|
||||
#include "rest_interface.hpp"
|
||||
#include "h5_utils.hpp"
|
||||
|
||||
|
||||
|
||||
using namespace std;
|
||||
namespace pt = boost::property_tree;
|
||||
|
||||
@@ -38,12 +35,12 @@ void write_h5(WriterManager *manager, RingBuffer *ring_buffer, string output_fil
|
||||
continue;
|
||||
}
|
||||
|
||||
writer.write_data(received_data.first.frame_index,
|
||||
received_data.first.frame_shape,
|
||||
received_data.first.frame_bytes_size,
|
||||
received_data.second,
|
||||
received_data.first.type,
|
||||
received_data.first.endianness);
|
||||
writer.write_frame_data(received_data.first.frame_index,
|
||||
received_data.first.frame_shape,
|
||||
received_data.first.frame_bytes_size,
|
||||
received_data.second,
|
||||
received_data.first.type,
|
||||
received_data.first.endianness);
|
||||
|
||||
ring_buffer->release(received_data.first.buffer_slot_index);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user