mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-11-17 19:40:13 +01:00
Add is_valid_frame logic
This commit is contained in:
1 parent
aff1d22c17
commit
6c1f7421f1
3 files changed
+3
-6
No files matched your search
@@ -53,6 +53,7 @@ struct ModuleFrame {
|
||||
struct CompressedModuleFrame {
|
||||
ModuleFrame module_frame;
|
||||
uint64_t compressed_size;
|
||||
bool is_valid_frame;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ bool ReplayH5Reader::get_frame(
|
||||
|
||||
if (metadata->pulse_id == 0) {
|
||||
// Signal that there is no frame at this pulse_id.
|
||||
metadata->pulse_id = pulse_id;
|
||||
return false;
|
||||
|
||||
}else if (metadata->pulse_id != pulse_id) {
|
||||
|
||||
@@ -50,16 +50,11 @@ void sf_replay (
|
||||
|
||||
auto start_time = chrono::steady_clock::now();
|
||||
|
||||
auto is_frame_present = file_reader.get_frame(
|
||||
metadata_buffer.is_valid_frame = file_reader.get_frame(
|
||||
curr_pulse_id,
|
||||
&(metadata_buffer.module_frame),
|
||||
(char*)(frame_buffer.get()));
|
||||
|
||||
if (!is_frame_present) {
|
||||
// TODO: Improve signaling to sf_writer about missing frame.
|
||||
metadata_buffer.module_frame.pulse_id = curr_pulse_id;
|
||||
}
|
||||
|
||||
auto end_time = chrono::steady_clock::now();
|
||||
auto read_us_duration = chrono::duration_cast<chrono::microseconds>(
|
||||
end_time-start_time).count();
|
||||
|
||||
Reference in new issue
Block a user