mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-08 17:22:05 +02:00
Rename struct according to terminology
This commit is contained in:
@@ -10,8 +10,8 @@ struct ImageMetadataBlock
|
||||
uint64_t frame_index[core_buffer::BUFFER_BLOCK_SIZE];
|
||||
uint32_t daq_rec[core_buffer::BUFFER_BLOCK_SIZE];
|
||||
uint8_t is_good_image[core_buffer::BUFFER_BLOCK_SIZE];
|
||||
uint64_t block_first_pulse_id;
|
||||
uint64_t block_last_pulse_id;
|
||||
uint64_t block_start_pulse_id;
|
||||
uint64_t block_stop_pulse_id;
|
||||
};
|
||||
|
||||
const char BUFFER_FORMAT_START_BYTE = 0xBE;
|
||||
|
||||
@@ -42,9 +42,9 @@ void ImageAssembler::process(
|
||||
|
||||
// TODO: Temp workaround. Make proper initialization.
|
||||
if (i_module == 0) {
|
||||
metadata_buffer_[slot_id].block_first_pulse_id =
|
||||
metadata_buffer_[slot_id].block_start_pulse_id =
|
||||
block_buffer->frame[0].metadata.pulse_id;
|
||||
metadata_buffer_[slot_id].block_last_pulse_id =
|
||||
metadata_buffer_[slot_id].block_stop_pulse_id =
|
||||
block_buffer->frame[BUFFER_BLOCK_SIZE-1].metadata.pulse_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,8 +131,8 @@ void JFH5Writer::write(
|
||||
const ImageMetadataBlock* metadata, const char* data)
|
||||
{
|
||||
size_t n_images_offset = 0;
|
||||
if (start_pulse_id_ > metadata->block_first_pulse_id) {
|
||||
n_images_offset = start_pulse_id_ - metadata->block_first_pulse_id;
|
||||
if (start_pulse_id_ > metadata->block_start_pulse_id) {
|
||||
n_images_offset = start_pulse_id_ - metadata->block_start_pulse_id;
|
||||
}
|
||||
|
||||
if (n_images_offset > BUFFER_BLOCK_SIZE) {
|
||||
@@ -140,8 +140,8 @@ void JFH5Writer::write(
|
||||
}
|
||||
|
||||
size_t n_images_to_copy = BUFFER_BLOCK_SIZE - n_images_offset;
|
||||
if (stop_pulse_id_ < metadata->block_last_pulse_id) {
|
||||
n_images_to_copy -= metadata->block_last_pulse_id - stop_pulse_id_;
|
||||
if (stop_pulse_id_ < metadata->block_stop_pulse_id) {
|
||||
n_images_to_copy -= metadata->block_stop_pulse_id - stop_pulse_id_;
|
||||
}
|
||||
|
||||
if (n_images_to_copy < 1) {
|
||||
|
||||
Reference in New Issue
Block a user