Updated local storage

This commit is contained in:
Martino Ferrari committed 2026-10-02 11:30:54 +02:00
1 parent 30db44eaa0
commit 2218aed839
10 files changed
+548 -5

No files matched your search

+8
View File
@@ -11,6 +11,7 @@
#include <plot/data/ring_buffer.hpp>
#include <atomic>
#include <unordered_map>
#include <cstdint>
#include <memory>
#include <mutex>
@@ -183,6 +184,11 @@ class ScopeModel {
static bool is_time_signal(const std::vector<SignalInfo>& signals,
std::size_t signal);
void set_signal_enabled(std::size_t signal, bool on);
/// Stores the calibration for a signal's *name* and applies it to that signal's
/// live channels. Keyed by name, not index: a CONFIG renumbers and an
/// enable/disable rebuilds the channel list, and `rebuild_channels()` re-applies
/// from here -- so a calibration set before a signal was enabled, or surviving a
/// CONFIG, is not silently dropped.
void set_calibration(std::size_t signal, double gain, double offset);
std::size_t channel_count() const noexcept { return channels_.size(); }
@@ -352,6 +358,8 @@ class ScopeModel {
std::atomic<bool> trigger_pending_{false};
std::atomic<double> capture_edge_{0.0};
std::atomic<std::shared_ptr<const EventSnapshot>> event_; ///< the event on screen
/// Per-signal-name calibration (see `set_calibration`).
std::unordered_map<std::string, std::pair<double, double>> calibration_;
std::atomic<std::uint64_t> event_seq_{0};
std::atomic<double> display_epoch_{0.0};
std::atomic<bool> trigger_armed_{false};