mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-09 14:52:03 +02:00
eiger_packet definitions and initial related changes
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#ifndef EIGER_H
|
||||
#define EIGER_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
#define EIGER_N_MODULES 1
|
||||
#define EIGER_BYTES_PER_PACKET 1072
|
||||
#define EIGER_DATA_BYTES_PER_PACKET 1024
|
||||
#define EIGER_N_PACKETS_PER_FRAME 128
|
||||
#define EIGER_DATA_BYTES_PER_FRAME 131072
|
||||
|
||||
// 48 bytes + 8192 bytes = 8240 bytes
|
||||
#pragma pack(push)
|
||||
#pragma pack(2)
|
||||
struct eiger_packet {
|
||||
uint64_t framenum;
|
||||
uint32_t exptime;
|
||||
uint32_t packetnum;
|
||||
|
||||
double bunchid;
|
||||
uint64_t timestamp;
|
||||
|
||||
uint16_t moduleID;
|
||||
uint16_t xCoord;
|
||||
uint16_t yCoord;
|
||||
uint16_t zCoord;
|
||||
|
||||
uint32_t debug;
|
||||
uint16_t roundRobin;
|
||||
uint8_t detectortype;
|
||||
uint8_t headerVersion;
|
||||
char data[EIGER_DATA_BYTES_PER_PACKET];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
#define SF_DAQ_BUFFER_FORMATS_HPP
|
||||
|
||||
#include "buffer_config.hpp"
|
||||
#include "jungfrau.hpp"
|
||||
#include "eiger.hpp"
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
@@ -27,7 +27,7 @@ struct ImageMetadata {
|
||||
#pragma pack(pop)
|
||||
|
||||
struct ModuleFrameBuffer {
|
||||
ModuleFrame module[JUNGFRAU_N_MODULES];
|
||||
ModuleFrame module[EIGER_N_MODULES];
|
||||
};
|
||||
|
||||
#pragma pack(push)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "RamBuffer.hpp"
|
||||
#include "buffer_config.hpp"
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace buffer_config;
|
||||
|
||||
@@ -100,7 +101,7 @@ char* RamBuffer::read_image(const uint64_t pulse_id,
|
||||
ModuleFrame *frame_meta = src_meta + i_module;
|
||||
|
||||
auto is_good_frame =
|
||||
frame_meta->n_recv_packets == JF_N_PACKETS_PER_FRAME;
|
||||
frame_meta->n_recv_packets == EIGER_N_PACKETS_PER_FRAME;
|
||||
|
||||
if (!is_good_frame) {
|
||||
is_good_image = false;
|
||||
|
||||
@@ -13,7 +13,7 @@ TEST(RamBuffer, simple_store)
|
||||
frame_meta.pulse_id = 123523;
|
||||
frame_meta.daq_rec = 1234;
|
||||
frame_meta.frame_index = 12342300;
|
||||
frame_meta.n_recv_packets = JF_N_PACKETS_PER_FRAME;
|
||||
frame_meta.n_recv_packets = EIGER_N_PACKETS_PER_FRAME;
|
||||
|
||||
auto frame_buffer = make_unique<uint16_t[]>(MODULE_N_PIXELS);
|
||||
|
||||
@@ -25,7 +25,7 @@ TEST(RamBuffer, simple_store)
|
||||
for (int i_module=0; i_module<n_modules; i_module++) {
|
||||
frame_meta.module_id = i_module;
|
||||
|
||||
buffer.write_frame(&frame_meta, (char *) (frame_buffer.get()));
|
||||
buffer.write_frame(frame_meta, (char *) (frame_buffer.get()));
|
||||
}
|
||||
|
||||
ImageMetadata image_meta;
|
||||
|
||||
Reference in New Issue
Block a user