|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Per-sensor ring of recent samples, and the capture decision over it. More...
#include <CaptureWindow.hpp>
Public Member Functions | |
| void | push (uint16_t uid, int32_t adc, uint64_t ts_ns, uint64_t rx_ns) |
| Record one sample. | |
| CaptureResult | capture (uint16_t uid, uint64_t now_rx_ns) const |
| What this sensor reads now, or why that cannot be answered. | |
| void | clear () |
| Forget everything. | |
| void | clear (uint16_t uid) |
| std::vector< uint16_t > | uids () const |
| Every uid with at least one sample. | |
| size_t | size (uint16_t uid) const |
| Samples currently held for a uid (diagnostics and tests). | |
Private Attributes | |
| std::unordered_map< uint16_t, std::deque< AdcSample > > | rings_ |
Per-sensor ring of recent samples, and the capture decision over it.
Keyed by the calibration uid (board_id * 100 + connector). Nothing here reads a clock: push is told when the sample was taken and when it arrived, capture is told what time it is now.
Definition at line 126 of file CaptureWindow.hpp.
| CaptureResult fsw::calibration::CaptureWindow::capture | ( | uint16_t | uid, |
| uint64_t | now_rx_ns ) const |
What this sensor reads now, or why that cannot be answered.
Definition at line 45 of file CaptureWindow.cpp.
Forget everything.
Used on an Elodin reconnect, where the samples either side of the gap are not a continuous record and must never be averaged together.
Definition at line 137 of file CaptureWindow.cpp.
| void fsw::calibration::CaptureWindow::clear | ( | uint16_t | uid | ) |
Definition at line 141 of file CaptureWindow.cpp.
| void fsw::calibration::CaptureWindow::push | ( | uint16_t | uid, |
| int32_t | adc, | ||
| uint64_t | ts_ns, | ||
| uint64_t | rx_ns ) |
| size_t fsw::calibration::CaptureWindow::size | ( | uint16_t | uid | ) | const |
Samples currently held for a uid (diagnostics and tests).
Definition at line 156 of file CaptureWindow.cpp.
| std::vector< uint16_t > fsw::calibration::CaptureWindow::uids | ( | ) | const |
Every uid with at least one sample.
Zero-All iterates this rather than a last-value map, so a sensor that has gone quiet is skipped instead of being zeroed from a stale reading.
Definition at line 145 of file CaptureWindow.cpp.
|
private |
Definition at line 148 of file CaptureWindow.hpp.