mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-07-31 12:53:38 +02:00
Remove old writer
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
#ifndef SF_DAQ_BUFFER_BUFFERBINARYREADER_HPP
|
||||
#define SF_DAQ_BUFFER_BUFFERBINARYREADER_HPP
|
||||
|
||||
|
||||
#include <formats.hpp>
|
||||
|
||||
class BufferBinaryReader {
|
||||
|
||||
const std::string detector_folder_;
|
||||
const std::string module_name_;
|
||||
|
||||
std::string current_input_file_;
|
||||
int input_file_fd_;
|
||||
|
||||
void open_file(const std::string& filename);
|
||||
void close_current_file();
|
||||
|
||||
public:
|
||||
BufferBinaryReader(const std::string &detector_folder,
|
||||
const std::string &module_name);
|
||||
|
||||
~BufferBinaryReader();
|
||||
|
||||
void get_block(const uint64_t block_id, BufferBinaryBlock *buffer);
|
||||
};
|
||||
|
||||
|
||||
#endif //SF_DAQ_BUFFER_BUFFERBINARYREADER_HPP
|
||||
@@ -1,53 +0,0 @@
|
||||
#ifndef SF_DAQ_BUFFER_IMAGEASSEMBLER_HPP
|
||||
#define SF_DAQ_BUFFER_IMAGEASSEMBLER_HPP
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "buffer_config.hpp"
|
||||
#include "formats.hpp"
|
||||
|
||||
const uint64_t IA_EMPTY_SLOT_VALUE = 0;
|
||||
|
||||
struct ImageMetadataBlock
|
||||
{
|
||||
uint64_t pulse_id[buffer_config::BUFFER_BLOCK_SIZE];
|
||||
uint64_t frame_index[buffer_config::BUFFER_BLOCK_SIZE];
|
||||
uint32_t daq_rec[buffer_config::BUFFER_BLOCK_SIZE];
|
||||
uint8_t is_good_image[buffer_config::BUFFER_BLOCK_SIZE];
|
||||
uint64_t block_start_pulse_id;
|
||||
uint64_t block_stop_pulse_id;
|
||||
};
|
||||
|
||||
class ImageAssembler {
|
||||
const size_t n_modules_;
|
||||
const size_t image_buffer_slot_n_bytes_;
|
||||
|
||||
char* image_buffer_;
|
||||
ImageMetadataBlock* meta_buffer_;
|
||||
ModuleFrame* frame_meta_buffer_;
|
||||
std::atomic_int* buffer_status_;
|
||||
std::atomic_uint64_t* buffer_bunch_id_;
|
||||
|
||||
size_t get_data_offset(const uint64_t slot_id, const int i_module);
|
||||
size_t get_metadata_offset(const uint64_t slot_id, const int i_module);
|
||||
|
||||
public:
|
||||
ImageAssembler(const size_t n_modules);
|
||||
|
||||
virtual ~ImageAssembler();
|
||||
|
||||
bool is_slot_free(const uint64_t bunch_id);
|
||||
bool is_slot_full(const uint64_t bunch_id);
|
||||
|
||||
void process(const uint64_t bunch_id,
|
||||
const int i_module,
|
||||
const BufferBinaryBlock* block_buffer);
|
||||
|
||||
void free_slot(const uint64_t bunch_id);
|
||||
|
||||
ImageMetadataBlock* get_metadata_buffer(const uint64_t bunch_id);
|
||||
char* get_data_buffer(const uint64_t bunch_id);
|
||||
};
|
||||
|
||||
|
||||
#endif //SF_DAQ_BUFFER_IMAGEASSEMBLER_HPP
|
||||
@@ -1,9 +0,0 @@
|
||||
#include <cstddef>
|
||||
|
||||
namespace writer_config
|
||||
{
|
||||
// MS to retry reading from the image assembler.
|
||||
const size_t ASSEMBLER_RETRY_MS = 5;
|
||||
// Number of slots in the reconstruction buffer.
|
||||
const size_t WRITER_IA_N_SLOTS = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user