SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Public Attributes | List of all members
ScopeVis::TraceBackDiscreteMemory Struct Reference

Public Member Functions

 TraceBackDiscreteMemory (uint32_t size)
 
void resize (uint32_t size)
 
TraceBackBufferstore (int samplesToReport)
 
TraceBackBufferrecall (uint32_t shift)
 
TraceBackBuffercurrent ()
 
TraceBackBufferat (int index)
 
uint32_t currentIndex () const
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

std::vector< TraceBackBufferm_traceBackBuffers
 
uint32_t m_memSize
 
uint32_t m_currentMemIndex
 
uint32_t m_traceSize
 

Detailed Description

Definition at line 703 of file scopevis.h.

Constructor & Destructor Documentation

◆ TraceBackDiscreteMemory()

ScopeVis::TraceBackDiscreteMemory::TraceBackDiscreteMemory ( uint32_t  size)
inline

Give memory size in number of traces

Definition at line 713 of file scopevis.h.

713  : m_memSize(size), m_currentMemIndex(0), m_traceSize(0)
714  {
716  }
std::vector< TraceBackBuffer > m_traceBackBuffers
Definition: scopevis.h:705

Member Function Documentation

◆ at()

TraceBackBuffer& ScopeVis::TraceBackDiscreteMemory::at ( int  index)
inline

Return trace at given memory position

Definition at line 766 of file scopevis.h.

Referenced by ScopeVis::processMemoryTrace().

767  {
768  return m_traceBackBuffers[index];
769  }
std::vector< TraceBackBuffer > m_traceBackBuffers
Definition: scopevis.h:705
+ Here is the caller graph for this function:

◆ current()

TraceBackBuffer& ScopeVis::TraceBackDiscreteMemory::current ( )
inline

Return trace at current memory position

Definition at line 758 of file scopevis.h.

Referenced by ScopeVis::processTrace().

759  {
761  }
std::vector< TraceBackBuffer > m_traceBackBuffers
Definition: scopevis.h:705
+ Here is the caller graph for this function:

◆ currentIndex()

uint32_t ScopeVis::TraceBackDiscreteMemory::currentIndex ( ) const
inline

Return current memory index

Definition at line 774 of file scopevis.h.

Referenced by ScopeVis::processMemoryTrace().

774 { return m_currentMemIndex; }
+ Here is the caller graph for this function:

◆ deserialize()

bool ScopeVis::TraceBackDiscreteMemory::deserialize ( const QByteArray &  data)
inline

Deserializer

Definition at line 799 of file scopevis.h.

References SimpleDeserializer::getVersion(), i, SimpleDeserializer::isValid(), SimpleDeserializer::readBlob(), and SimpleDeserializer::readU32().

800  {
801  SimpleDeserializer d(data);
802 
803  if(!d.isValid()) {
804  return false;
805  }
806 
807  if (d.getVersion() == 1)
808  {
809  d.readU32(1, &m_memSize, 0);
810  d.readU32(2, &m_currentMemIndex, 0);
811  uint32_t traceSize;
812  d.readU32(3, &traceSize, 0);
814 
815  if (traceSize != m_traceSize) {
816  resize(traceSize);
817  }
818 
819  for (unsigned int i = 0; i < m_memSize; i++)
820  {
821  QByteArray buffer;
822  d.readBlob(100+i, &buffer);
823  m_traceBackBuffers[i].deserialize(buffer);
824  }
825 
826  return true;
827  }
828  else
829  {
830  return false;
831  }
832  }
std::vector< TraceBackBuffer > m_traceBackBuffers
Definition: scopevis.h:705
unsigned int uint32_t
Definition: rtptypes_win.h:46
int32_t i
Definition: decimators.h:244
void resize(uint32_t size)
Definition: scopevis.h:721
+ Here is the call graph for this function:

◆ recall()

TraceBackBuffer& ScopeVis::TraceBackDiscreteMemory::recall ( uint32_t  shift)
inline

Recalls trace at shift positions back. Therefore 0 is current. Wraps around memory size.

Definition at line 749 of file scopevis.h.

750  {
751  int index = (m_currentMemIndex + (m_memSize - (shift % m_memSize))) % m_memSize;
752  return m_traceBackBuffers[index];
753  }
std::vector< TraceBackBuffer > m_traceBackBuffers
Definition: scopevis.h:705

◆ resize()

void ScopeVis::TraceBackDiscreteMemory::resize ( uint32_t  size)
inline

Resize all trace buffers in memory

Definition at line 721 of file scopevis.h.

Referenced by ScopeVis::ScopeVis(), and ScopeVis::setTraceSize().

722  {
723  m_traceSize = size;
724 
725  for (std::vector<TraceBackBuffer>::iterator it = m_traceBackBuffers.begin(); it != m_traceBackBuffers.end(); ++it)
726  {
727  it->resize(2*m_traceSize); // was multiplied by 4
728  }
729  }
std::vector< TraceBackBuffer > m_traceBackBuffers
Definition: scopevis.h:705
+ Here is the caller graph for this function:

◆ serialize()

QByteArray ScopeVis::TraceBackDiscreteMemory::serialize ( ) const
inline

Serializer

Definition at line 779 of file scopevis.h.

References SimpleSerializer::final(), i, SimpleSerializer::writeBlob(), and SimpleSerializer::writeU32().

780  {
781  SimpleSerializer s(1);
782 
783  s.writeU32(1, m_memSize);
784  s.writeU32(2, m_currentMemIndex);
785  s.writeU32(3, m_traceSize);
786 
787  for (unsigned int i = 0; i < m_memSize; i++)
788  {
789  QByteArray buffer = m_traceBackBuffers[i].serialize();
790  s.writeBlob(100+i, buffer);
791  }
792 
793  return s.final();
794  }
std::vector< TraceBackBuffer > m_traceBackBuffers
Definition: scopevis.h:705
int32_t i
Definition: decimators.h:244
+ Here is the call graph for this function:

◆ store()

TraceBackBuffer& ScopeVis::TraceBackDiscreteMemory::store ( int  samplesToReport)
inline

Move index forward by one position and return reference to the trace at this position Copy a trace length of samples into the new memory slot samplesToReport are the number of samples to report on the next trace

Definition at line 736 of file scopevis.h.

References ScopeVis::TraceBackBuffer::reset().

Referenced by ScopeVis::processTrace().

737  {
738  uint32_t nextMemIndex = m_currentMemIndex < (m_memSize-1) ? m_currentMemIndex+1 : 0;
739  m_traceBackBuffers[nextMemIndex].reset();
740  m_traceBackBuffers[nextMemIndex].write(m_traceBackBuffers[m_currentMemIndex].m_endPoint - samplesToReport,
742  m_currentMemIndex = nextMemIndex;
743  return m_traceBackBuffers[m_currentMemIndex]; // new trace
744  }
std::vector< TraceBackBuffer > m_traceBackBuffers
Definition: scopevis.h:705
unsigned int uint32_t
Definition: rtptypes_win.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_currentMemIndex

uint32_t ScopeVis::TraceBackDiscreteMemory::m_currentMemIndex

Definition at line 707 of file scopevis.h.

◆ m_memSize

uint32_t ScopeVis::TraceBackDiscreteMemory::m_memSize

Definition at line 706 of file scopevis.h.

◆ m_traceBackBuffers

std::vector<TraceBackBuffer> ScopeVis::TraceBackDiscreteMemory::m_traceBackBuffers

Definition at line 705 of file scopevis.h.

◆ m_traceSize

uint32_t ScopeVis::TraceBackDiscreteMemory::m_traceSize

Definition at line 708 of file scopevis.h.


The documentation for this struct was generated from the following file: