Raw dataset config

This commit is contained in:
2018-01-31 15:31:12 +01:00
parent 0952aeaa49
commit 397782a69b
5 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -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<std::string, h5_value>& input_values, const string& frames_dataset_name){
void H5Format::write_format(H5::H5File& file, const std::map<std::string, h5_value>& 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<std::string, h5_val
write_format_data(file, *format, *values);
file.move("raw_data", frames_dataset_name.c_str());
file.move(raw_frames_dataset_name.c_str(), frames_dataset_name.c_str());
}
+1 -1
View File
@@ -85,7 +85,7 @@ namespace H5Format {
const boost::any& get_value_from_reference(const std::string& dataset_name, const boost::any& value_reference, const std::map<std::string, boost::any>& values);
void write_format_data(H5::Group& file_node, const h5_parent& format_node, const std::map<std::string, h5_value>& values);
void write_format(H5::H5File& file, const std::map<std::string, h5_value>& input_values, const std::string& frames_dataset_name);
void write_format(H5::H5File& file, const std::map<std::string, h5_value>& input_values, const std::string& raw_frames_dataset_name, const std::string& frames_dataset_name);
};
// Move this somewhere else.
+2
View File
@@ -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;
+1
View File
@@ -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;
}
+2 -2
View File
@@ -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;
}