Moved base buffer config to separate file

This commit is contained in:
2020-04-23 09:41:07 +02:00
parent ac5624cafc
commit 40bdd8e9a2
3 changed files with 40 additions and 45 deletions
-23
View File
@@ -6,29 +6,6 @@
namespace BufferUtils
{
const size_t STREAM_BLOCK_SIZE = 100;
extern const size_t FILE_MOD;
extern const size_t FOLDER_MOD;
extern const std::string FILE_EXTENSION;
#pragma pack(push)
#pragma pack(1)
struct FileBufferMetadata {
// Needed by RingBuffer
const uint64_t frame_bytes_size = 2*512*1024*STREAM_BLOCK_SIZE;
uint64_t buffer_slot_index;
uint64_t start_pulse_id;
uint64_t stop_pulse_id;
uint16_t module_id;
uint64_t pulse_id[STREAM_BLOCK_SIZE];
uint64_t frame_index[STREAM_BLOCK_SIZE];
uint32_t daq_rec[STREAM_BLOCK_SIZE];
uint16_t n_received_packets[STREAM_BLOCK_SIZE];
};
#pragma pack(pop)
std::string get_filename(
std::string root_folder,
std::string device_name,
+23
View File
@@ -0,0 +1,23 @@
#ifndef BUFFERCONFIG_HPP
#define BUFFERCONFIG_HPP
#include <cstddef>
#include <string>
namespace core_buffer {
// How many frames we store in each file.
// Must be power of 10 and <= than FOLDER_MOD
const size_t FILE_MOD = 1000;
// How many frames go into each files folder.
// Must be power of 10 and >= than FILE_MOD.
const size_t FOLDER_MOD = 100000;
// Extension of our file format.
const std::string FILE_EXTENSION = ".h5";
// How many frames do we read at once during replay.
const size_t REPLAY_BLOCK_SIZE = 100;
}
#endif //BUFFERCONFIG_HPP