ngscopeclient 0.1-dev+51fbda87c
Public Member Functions | Public Attributes | Protected Attributes | List of all members
HistoryManager Class Reference

Keeps track of recently acquired waveforms. More...

#include <HistoryManager.h>

Collaboration diagram for HistoryManager:
Collaboration graph
[legend]

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< HistoryPointGetHistory (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

Sessionm_session
 

Detailed Description

Keeps track of recently acquired waveforms.

Member Function Documentation

◆ AddHistory()

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.

Parameters
scopesThe instruments to add
deleteOldTrue to delete old data that rolled off the end of the history buffer Set false when loading waveforms from a session
pinTrue to pin into history
nickNickname

◆ LoadEmptyHistoryToSession()

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.


The documentation for this class was generated from the following files: