35#ifndef HistoryManager_h
36#define HistoryManager_h
41typedef std::map<StreamDescriptor, WaveformBase*> WaveformHistory;
64 std::map<std::shared_ptr<Oscilloscope>, WaveformHistory>
m_history;
83 const std::vector<std::shared_ptr<Oscilloscope>>&
scopes,
86 std::string
nick =
"",
93 void SetMaxToCurrentDepth()
103 { m_history.clear(); }
105 std::list<std::shared_ptr<HistoryPoint>> m_history;
MemoryPressureLevel
Levels of memory pressure.
Definition AcceleratorBuffer.h:172
MemoryPressureType
Types of memory pressure.
Definition AcceleratorBuffer.h:189
Definition AcceleratorBuffer.h:204
Keeps track of recently acquired waveforms.
Definition HistoryManager.h:73
void LoadEmptyHistoryToSession(Session &session)
Loads an empty history (no data) to the current session.
Definition HistoryManager.cpp:194
int m_maxDepth
has to be an int for imgui compatibility
Definition HistoryManager.h:108
TimePoint GetMostRecentPoint()
Gets the timestamp of the most recent waveform.
Definition HistoryManager.cpp:398
bool HasHistory(TimePoint t)
Checks if we have a history point for a specific timestamp.
Definition HistoryManager.cpp:423
void Retcon(std::shared_ptr< Oscilloscope > scope, size_t chan, size_t stream, WaveformBase *wfm)
Retroactively modify history for an instrument.
Definition HistoryManager.cpp:223
bool OnMemoryPressure(MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize)
Called when we run out of memory.
Definition HistoryManager.cpp:437
std::shared_ptr< HistoryPoint > GetHistory(TimePoint t)
Gets the history point for a specific timestamp.
Definition HistoryManager.cpp:409
bool empty()
Returns true if we have no historical waveform data whatsoever (markers are allowed)
Definition HistoryManager.cpp:173
void AddHistory(const std::vector< std::shared_ptr< Oscilloscope > > &scopes, bool deleteOld=true, bool pin=false, std::string nick="", TimePoint refTimeIfNoWaveforms=TimePoint(0, 0))
Adds new data to the history.
Definition HistoryManager.cpp:253
A single point of waveform history.
Definition HistoryManager.h:47
bool m_pinned
Set true to "pin" this waveform so it won't be purged from history regardless of age.
Definition HistoryManager.h:58
bool IsInUse()
Returns true if at least one waveform in this history point is currently loaded into a scope.
Definition HistoryManager.cpp:78
TimePoint m_time
Timestamp of the point.
Definition HistoryManager.h:55
std::map< std::shared_ptr< Oscilloscope >, WaveformHistory > m_history
Waveform data.
Definition HistoryManager.h:64
void LoadHistoryToSession(Session &session)
Update all instruments in the specified session with our saved historical data.
Definition HistoryManager.cpp:99
std::string m_nickname
Free-form text nickname for this acquisition (may be blank)
Definition HistoryManager.h:61
A Session stores all of the instrument configuration and other state the user has open.
Definition Session.h:126
A timestamp, measured in seconds + femtoseconds.
Definition Marker.h:42