35#ifndef HistoryManager_h
36#define HistoryManager_h
41typedef std::map<StreamDescriptor, WaveformBase*> WaveformHistory;
64 std::map<std::shared_ptr<Oscilloscope>, WaveformHistory>
m_history;
81 const std::vector<std::shared_ptr<Oscilloscope>>& scopes,
82 bool deleteOld =
true,
84 std::string nick =
"",
91 void SetMaxToCurrentDepth()
101 { m_history.clear(); }
103 std::list<std::shared_ptr<HistoryPoint>> m_history;
MemoryPressureLevel
Levels of memory pressure.
Definition: AcceleratorBuffer.h:67
MemoryPressureType
Types of memory pressure.
Definition: AcceleratorBuffer.h:84
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:106
TimePoint GetMostRecentPoint()
Gets the timestamp of the most recent waveform.
Definition: HistoryManager.cpp:331
bool HasHistory(TimePoint t)
Checks if we have a history point for a specific timestamp.
Definition: HistoryManager.cpp:356
bool OnMemoryPressure(MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize)
Called when we run out of memory.
Definition: HistoryManager.cpp:370
std::shared_ptr< HistoryPoint > GetHistory(TimePoint t)
Gets the history point for a specific timestamp.
Definition: HistoryManager.cpp:342
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:226
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:95
A timestamp, measured in seconds + femtoseconds.
Definition: Marker.h:42