mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-06-07 21:28:41 +02:00
Periodic watchdog fot cache flushing
This commit is contained in:
@@ -28,7 +28,7 @@ public:
|
||||
void write_frame(const ModuleFrame &src_meta, const char *src_data) const;
|
||||
void read_frame(const uint64_t pulse_id, const uint64_t module_id, ModuleFrame &meta, char *data) const;
|
||||
char* read_image(const uint64_t pulse_id) const;
|
||||
char* write_image(const ImageMetadata &src_meta, const char *src_data);
|
||||
void write_image(const ImageMetadata &src_meta, const char *src_data);
|
||||
void assemble_image(const uint64_t pulse_id, ImageMetadata &image_meta) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef SF_DAQ_BUFFER_TYPEMAP_HPP
|
||||
#define SF_DAQ_BUFFER_TYPEMAP_HPP
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
enum class TypeMap {
|
||||
VOID,
|
||||
CHAR,
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef IMAGE_HPP
|
||||
#define JUNGFRAU_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include "formats.hpp"
|
||||
|
||||
|
||||
class array_t {
|
||||
public:
|
||||
// Constructor
|
||||
array_t(size_t i_size): m_container(i_size) {};
|
||||
|
||||
// Access methods
|
||||
ModuleFrame* meta(){ return &m_metadata; };
|
||||
char* data(){ return m_container.data(); };
|
||||
size_t size(){ return m_container.size(); };
|
||||
protected:
|
||||
std::vector<char> m_container;
|
||||
ModuleFrame m_metadata;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //IMAGE_HPP
|
||||
@@ -125,35 +125,35 @@ void RamBuffer::assemble_image(
|
||||
throw runtime_error(err_msg.str());
|
||||
}
|
||||
|
||||
image_meta.pulse_id = frame_meta->pulse_id;
|
||||
image_meta.frame_index = frame_meta->frame_index;
|
||||
image_meta.daq_rec = frame_meta->daq_rec;
|
||||
image_meta.id = frame_meta->pulse_id;
|
||||
image_meta.user_1 = frame_meta->frame_index;
|
||||
image_meta.user_2 = frame_meta->daq_rec;
|
||||
|
||||
is_pulse_init = 1;
|
||||
}
|
||||
|
||||
if (is_good_image) {
|
||||
if (frame_meta->pulse_id != image_meta.pulse_id) {
|
||||
if (frame_meta->pulse_id != image_meta.id) {
|
||||
is_good_image = false;
|
||||
// TODO: Add some diagnostics in case this happens.
|
||||
}
|
||||
|
||||
if (frame_meta->frame_index != image_meta.frame_index) {
|
||||
if (frame_meta->frame_index != image_meta.user_1) {
|
||||
is_good_image = false;
|
||||
}
|
||||
|
||||
if (frame_meta->daq_rec != image_meta.daq_rec) {
|
||||
if (frame_meta->daq_rec != image_meta.user_2) {
|
||||
is_good_image = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
image_meta.is_good_image = is_good_image;
|
||||
image_meta.status = is_good_image;
|
||||
|
||||
if (!is_pulse_init) {
|
||||
image_meta.pulse_id = 0;
|
||||
image_meta.frame_index = 0;
|
||||
image_meta.daq_rec = 0;
|
||||
image_meta.id = 0;
|
||||
image_meta.user_1 = 0;
|
||||
image_meta.user_2 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user