diff --git a/src/H5Format.cpp b/src/H5Format.cpp index 4a53a46..aaeb84d 100644 --- a/src/H5Format.cpp +++ b/src/H5Format.cpp @@ -294,7 +294,7 @@ void H5Format::write_format_data(H5::Group& file_node, const h5_parent& format_n } } -void H5Format::write_format(H5::H5File& file, const std::map& input_values, const string& frames_dataset_name){ +void H5Format::write_format(H5::H5File& file, const std::map& input_values, const string& raw_frames_dataset_name, const string& frames_dataset_name){ auto format = get_format_definition(); auto values = get_default_values(); @@ -304,5 +304,5 @@ void H5Format::write_format(H5::H5File& file, const std::map& values); void write_format_data(H5::Group& file_node, const h5_parent& format_node, const std::map& values); - void write_format(H5::H5File& file, const std::map& input_values, const std::string& frames_dataset_name); + void write_format(H5::H5File& file, const std::map& input_values, const std::string& raw_frames_dataset_name, const std::string& frames_dataset_name); }; // Move this somewhere else. diff --git a/src/config.cpp b/src/config.cpp index 802b8d9..3f32ed2 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -14,6 +14,8 @@ namespace config { size_t ring_buffer_n_slots = 100; // Delay before trying again to get data from the ring buffer. uint32_t ring_buffer_read_retry_interval = 5; + + std::string raw_dataset_name = "raw_data"; // By how much to enlarge a dataset when a resizing is needed. hsize_t dataset_increase_step = 1000; diff --git a/src/config.hpp b/src/config.hpp index 3ba8f1b..3ff2c0d 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -16,6 +16,7 @@ namespace config extern hsize_t dataset_increase_step; extern hsize_t initial_dataset_size; + extern std::string raw_dataset_name; extern uint32_t parameters_read_retry_interval; } diff --git a/src/h5_zmq_writer.cpp b/src/h5_zmq_writer.cpp index f03cbec..d46afb1 100644 --- a/src/h5_zmq_writer.cpp +++ b/src/h5_zmq_writer.cpp @@ -20,7 +20,7 @@ namespace pt = boost::property_tree; void write_h5(WriterManager& manager, RingBuffer& ring_buffer, string output_file) { - H5Writer writer(output_file, "raw_data"); + H5Writer writer(output_file, config::raw_dataset_name); // Run until the running flag is set or the ring_buffer is empty. while(manager.is_running() || !ring_buffer.is_empty()) { @@ -65,7 +65,7 @@ void write_h5(WriterManager& manager, RingBuffer& ring_buffer, string output_fil // Even if we can't write the format, lets try to preserve the data. try { - H5Format::write_format(writer.get_h5_file(), parameters, get_frames_dataset_name()); + H5Format::write_format(writer.get_h5_file(), parameters, config::raw_dataset_name, get_frames_dataset_name()); } catch (const runtime_error& ex) { cerr << "[h5_zmq_writer::write] Error while trying to write file format: "<< ex.what() << endl; }