mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-05 06:04:13 +02:00
Merge branch 'eiger' of https://github.com/paulscherrerinstitute/sf_daq_buffer into eiger
Conflicts: jf-assembler/src/main.cpp jf-udp-recv/src/main.cpp std-udp-recv/src/FrameUdpReceiver.cpp
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <string>
|
||||
#include "formats.hpp"
|
||||
#include "buffer_config.hpp"
|
||||
|
||||
class RamBuffer {
|
||||
const std::string buffer_name_;
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace buffer_config {
|
||||
const size_t BUFFER_BLOCK_SIZE = 100;
|
||||
|
||||
|
||||
const size_t BUFFER_UDP_N_RECV_MSG = 128;
|
||||
// Size of UDP recv buffer
|
||||
const int BUFFER_UDP_RCVBUF_N_SLOTS = 100;
|
||||
// 8246 bytes for each UDP packet.
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
#include <cstdint>
|
||||
#include <stdint.h>
|
||||
|
||||
#define IS_BOTTOM(n) ((n%2 != 0) ? -1 : 1)
|
||||
|
||||
const std::string DETECTOR_TYPE = "eiger";
|
||||
|
||||
#define N_MODULES 1
|
||||
#define BYTES_PER_PACKET 4144
|
||||
#define DATA_BYTES_PER_PACKET 4096
|
||||
@@ -20,7 +24,6 @@
|
||||
#define MODULE_Y_SIZE 512
|
||||
#define MODULE_N_PIXELS 131072
|
||||
#define PIXEL_N_BYTES 2
|
||||
#define MODULE_N_BYTES 262144
|
||||
#define GAP_X_MODULE_PIXELS 2
|
||||
#define GAP_Y_MODULE_PIXELS 2
|
||||
#define GAP_X_EIGERMOD_PIXELS 8
|
||||
@@ -28,7 +31,7 @@
|
||||
|
||||
|
||||
#define N_BYTES_PER_MODULE_LINE(bit_depth) ((MODULE_X_SIZE * bit_depth) / 8)
|
||||
#define N_BYTES_PER_MODULE_FRAME(bit_depth) ((131072 * bit_depth) / 8)
|
||||
#define N_BYTES_PER_MODULE_FRAME(bit_depth) ((MODULE_N_PIXELS * bit_depth) / 8)
|
||||
|
||||
|
||||
// #define N_BYTES_PER_IMAGE_LINE(bit_depth, n_submodules) ((n_submodules / 2 * MODULE_X_SIZE * bit_depth) / 8)
|
||||
|
||||
@@ -1,27 +1,18 @@
|
||||
#ifndef SF_DAQ_BUFFER_FORMATS_HPP
|
||||
#define SF_DAQ_BUFFER_FORMATS_HPP
|
||||
|
||||
#include "buffer_config.hpp"
|
||||
|
||||
#ifndef USE_EIGER
|
||||
#include "jungfrau.hpp"
|
||||
#else
|
||||
#include "eiger.hpp"
|
||||
#endif
|
||||
|
||||
#define IS_BOTTOM(n) ((n%2 != 0) ? -1 : 1)
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
struct ModuleFrame {
|
||||
uint64_t id;
|
||||
uint64_t pulse_id;
|
||||
uint64_t frame_index;
|
||||
uint64_t daq_rec;
|
||||
uint64_t n_recv_packets;
|
||||
uint64_t module_id;
|
||||
uint16_t bit_depth;
|
||||
uint16_t row;
|
||||
uint16_t column;
|
||||
uint16_t pos_y;
|
||||
uint16_t pos_x;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -29,33 +20,17 @@ struct ModuleFrame {
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
struct ImageMetadata {
|
||||
uint64_t pulse_id;
|
||||
uint64_t frame_index;
|
||||
uint32_t daq_rec;
|
||||
uint32_t is_good_image;
|
||||
uint64_t id;
|
||||
uint64_t height;
|
||||
uint64_t width;
|
||||
uint64_t dtype;
|
||||
uint64_t encoding;
|
||||
uint64_t source_id;
|
||||
uint64_t status;
|
||||
uint64_t user_1;
|
||||
uint64_t user_2;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
struct ModuleFrameBuffer {
|
||||
ModuleFrame module[N_MODULES];
|
||||
};
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
struct BufferBinaryFormat {
|
||||
const char FORMAT_MARKER = 0xBE;
|
||||
ModuleFrame meta;
|
||||
char data[MODULE_N_BYTES];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
struct BufferBinaryBlock
|
||||
{
|
||||
BufferBinaryFormat frame[buffer_config::BUFFER_BLOCK_SIZE];
|
||||
uint64_t start_pulse_id;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif //SF_DAQ_BUFFER_FORMATS_HPP
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
const std::string DETECTOR_TYPE = "jungfrau";
|
||||
|
||||
#define N_MODULES 32
|
||||
#define BYTES_PER_PACKET 8240
|
||||
#define DATA_BYTES_PER_PACKET 8192
|
||||
@@ -40,5 +42,4 @@ struct det_packet {
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user