From 4116ea04cf69fa829214d4abf76e453f8f997dfc Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Wed, 22 Apr 2020 15:18:19 +0200 Subject: [PATCH] Moved File metadata from RingBuffer to buffer utils --- core-buffer/include/BufferUtils.hpp | 19 +++++++++++++++++++ core-writer/include/RingBuffer.hpp | 18 ------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/core-buffer/include/BufferUtils.hpp b/core-buffer/include/BufferUtils.hpp index fb8063a..57017b6 100644 --- a/core-buffer/include/BufferUtils.hpp +++ b/core-buffer/include/BufferUtils.hpp @@ -6,10 +6,29 @@ 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, diff --git a/core-writer/include/RingBuffer.hpp b/core-writer/include/RingBuffer.hpp index e2829f0..38c9442 100644 --- a/core-writer/include/RingBuffer.hpp +++ b/core-writer/include/RingBuffer.hpp @@ -12,24 +12,6 @@ #include #include "date.h" -#pragma pack(push) -#pragma pack(1) -struct FileBufferMetadata { - // Needed by RingBuffer - const uint64_t frame_bytes_size = 2*512*1024*50; - uint64_t buffer_slot_index; - - uint64_t start_pulse_id; - uint64_t stop_pulse_id; - uint16_t module_id; - - uint64_t pulse_id[50]; - uint64_t frame_index[50]; - uint32_t daq_rec[50]; - uint16_t n_received_packets[50]; -}; -#pragma pack(pop) - struct FrameMetadata { // Ring buffer needed data.