ngscopeclient 0.1-dev+51fbda87c
|
Keeps track of recently acquired waveforms. More...
#include <HistoryManager.h>
Public Member Functions | |
HistoryManager (Session &session) | |
bool | OnMemoryPressure (MemoryPressureLevel level, MemoryPressureType type, size_t requestedSize) |
Called when we run out of memory. | |
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. More... | |
void | LoadEmptyHistoryToSession (Session &session) |
Loads an empty history (no data) to the current session. More... | |
bool | empty () |
Returns true if we have no historical waveform data whatsoever (markers are allowed) | |
void | SetMaxToCurrentDepth () |
std::shared_ptr< HistoryPoint > | GetHistory (TimePoint t) |
Gets the history point for a specific timestamp. | |
bool | HasHistory (TimePoint t) |
Checks if we have a history point for a specific timestamp. | |
TimePoint | GetMostRecentPoint () |
Gets the timestamp of the most recent waveform. | |
void | clear () |
Public Attributes | |
std::list< std::shared_ptr< HistoryPoint > > | m_history |
int | m_maxDepth |
has to be an int for imgui compatibility | |
Protected Attributes | |
Session & | m_session |
Keeps track of recently acquired waveforms.
void HistoryManager::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.
scopes | The instruments to add |
deleteOld | True to delete old data that rolled off the end of the history buffer Set false when loading waveforms from a session |
pin | True to pin into history |
nick | Nickname |
void HistoryManager::LoadEmptyHistoryToSession | ( | Session & | session | ) |
Loads an empty history (no data) to the current session.
This is normally called after the user manually deletes the last waveform in history.