pflib v3.12.0-1-g716e801
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
SingleECONTCaptureFrame.h
1#pragma once
2#ifndef PFLIB_PACKING_SINGLEECONTCAPTUREFRAME_H
3#define PFLIB_PACKING_SINGLEECONTCAPTUREFRAME_H
4
5#include <optional>
6
7#include "pflib/logging/Logging.h"
8#include "pflib/packing/ECONTCaptureHeader.h"
9#include "pflib/packing/Reader.h"
10
11namespace pflib::packing {
12
19 mutable ::pflib::logging::logger the_log_{::pflib::logging::get("decoding")};
20
21 public:
53 mutable ::pflib::logging::logger the_log_{
54 ::pflib::logging::get("decoding")};
55 static constexpr std::size_t N_STC = 8;
57 std::array<int, N_STC> stc_sums_;
58 int bx_;
59
60 public:
61 void from(std::span<uint32_t> data);
62 int bx() const;
63 int stc_sum(int i_stc) const;
64 int max_tc(int i_stc) const;
65 };
66
67 SingleECONTCaptureFrame() = default;
68 SingleECONTCaptureFrame(std::span<uint32_t> data);
69 Reader& read(Reader& r);
70 void from(std::span<uint32_t> data);
71 const SingleECONTSample& sample(std::optional<int> i_sample = {}) const;
72 int bx(std::optional<int> i_sample = {}) const;
73 int stc_sum(int i_stc, std::optional<int> i_sample = {}) const;
74 int max_tc(int i_stc, std::optional<int> i_sample = {}) const;
75 const ECONTCaptureHeader& header() const;
76 int length() const;
77 int version() const;
78 int econ_id() const;
79 int pre_samples() const;
80 std::size_t n_samples() const;
81
82 private:
83 ECONTCaptureHeader header_;
85};
86
87} // namespace pflib::packing
88
89#endif
Reading a raw data stream with some underlying backend.
Definition Reader.h:19
Each ECON-T sample has the following struture, assuming.
Definition SingleECONTCaptureFrame.h:52
A capture frame has one or more SingleECONTSamples along with two headers written by the firmware tha...
Definition SingleECONTCaptureFrame.h:18
void from(std::span< uint32_t > data)
Definition SingleECONTCaptureFrame.cxx:44
logger get(const std::string &name)
Gets a logger with the input name for its channel.
Definition Logging.cxx:24