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 | Private Attributes | List of all members
ScopeVis::Traces Struct Reference

Public Member Functions

 Traces ()
 
 ~Traces ()
 
bool isVerticalDisplayChange (const TraceData &traceData, uint32_t traceIndex)
 
void addTrace (const TraceData &traceData, int traceSize)
 
void changeTrace (const TraceData &traceData, uint32_t traceIndex)
 
void removeTrace (uint32_t traceIndex)
 
void moveTrace (uint32_t traceIndex, bool upElseDown)
 
void resize (int traceSize)
 
uint32_t currentBufferIndex () const
 
uint32_t size () const
 
void switchBuffer ()
 

Public Attributes

std::vector< TraceControl * > m_tracesControl
 Corresponding traces control data. More...
 
std::vector< TraceDatam_tracesData
 Corresponding traces data. More...
 
std::vector< float * > m_traces [2]
 Double buffer of traces processed by glScope. More...
 
int m_traceSize
 Current size of a trace in buffer. More...
 
int m_maxTraceSize
 Maximum Size of a trace in buffer. More...
 
bool evenOddIndex
 Even (true) or odd (false) index. More...
 

Private Attributes

float * m_x0
 
float * m_x1
 

Detailed Description

Definition at line 874 of file scopevis.h.

Constructor & Destructor Documentation

◆ Traces()

ScopeVis::Traces::Traces ( )
inline

Definition at line 883 of file scopevis.h.

883  :
884  m_traceSize(0),
885  m_maxTraceSize(0),
886  evenOddIndex(true),
887  m_x0(0),
888  m_x1(0)
889  {
890  }
int m_traceSize
Current size of a trace in buffer.
Definition: scopevis.h:879
bool evenOddIndex
Even (true) or odd (false) index.
Definition: scopevis.h:881
int m_maxTraceSize
Maximum Size of a trace in buffer.
Definition: scopevis.h:880

◆ ~Traces()

ScopeVis::Traces::~Traces ( )
inline

Definition at line 892 of file scopevis.h.

893  {
894  for (std::vector<TraceControl*>::iterator it = m_tracesControl.begin(); it != m_tracesControl.end(); ++it) {
895  delete *it;
896  }
897 
898  if (m_x0) {
899  delete[] m_x0;
900  }
901 
902  if (m_x1) {
903  delete[] m_x1;
904  }
905 
906  m_maxTraceSize = 0;
907  }
std::vector< TraceControl * > m_tracesControl
Corresponding traces control data.
Definition: scopevis.h:876
int m_maxTraceSize
Maximum Size of a trace in buffer.
Definition: scopevis.h:880

Member Function Documentation

◆ addTrace()

void ScopeVis::Traces::addTrace ( const TraceData traceData,
int  traceSize 
)
inline

Definition at line 917 of file scopevis.h.

References ScopeVis::TraceControl::initProjector(), and ScopeVis::TraceData::m_projectionType.

Referenced by ScopeVis::handleMessage().

918  {
919  if (m_traces[0].size() < m_maxNbTraces)
920  {
921  qDebug("ScopeVis::addTrace");
922  m_traces[0].push_back(0);
923  m_traces[1].push_back(0);
924  m_tracesData.push_back(traceData);
925  m_tracesControl.push_back(new TraceControl());
926  TraceControl *traceControl = m_tracesControl.back();
927  traceControl->initProjector(traceData.m_projectionType);
928 
929  resize(traceSize);
930  }
931  }
std::vector< TraceControl * > m_tracesControl
Corresponding traces control data.
Definition: scopevis.h:876
std::vector< TraceData > m_tracesData
Corresponding traces data.
Definition: scopevis.h:877
static const uint32_t m_maxNbTraces
Definition: scopevis.h:152
uint32_t size() const
Definition: scopevis.h:1014
void resize(int traceSize)
Definition: scopevis.h:989
std::vector< float * > m_traces[2]
Double buffer of traces processed by glScope.
Definition: scopevis.h:878
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeTrace()

void ScopeVis::Traces::changeTrace ( const TraceData traceData,
uint32_t  traceIndex 
)
inline

Definition at line 933 of file scopevis.h.

References ScopeVis::TraceControl::initProjector(), ScopeVis::TraceData::m_projectionType, and ScopeVis::TraceControl::releaseProjector().

Referenced by ScopeVis::handleMessage().

934  {
935  if (traceIndex < m_tracesControl.size()) {
936  TraceControl *traceControl = m_tracesControl[traceIndex];
937  traceControl->releaseProjector();
938  traceControl->initProjector(traceData.m_projectionType);
939  m_tracesData[traceIndex] = traceData;
940  }
941  }
std::vector< TraceControl * > m_tracesControl
Corresponding traces control data.
Definition: scopevis.h:876
std::vector< TraceData > m_tracesData
Corresponding traces data.
Definition: scopevis.h:877
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ currentBufferIndex()

uint32_t ScopeVis::Traces::currentBufferIndex ( ) const
inline

Definition at line 1013 of file scopevis.h.

Referenced by ScopeVis::processTraces().

1013 { return evenOddIndex? 0 : 1; }
bool evenOddIndex
Even (true) or odd (false) index.
Definition: scopevis.h:881
+ Here is the caller graph for this function:

◆ isVerticalDisplayChange()

bool ScopeVis::Traces::isVerticalDisplayChange ( const TraceData traceData,
uint32_t  traceIndex 
)
inline

Definition at line 909 of file scopevis.h.

References ScopeVis::TraceData::m_amp, ScopeVis::TraceData::m_ofs, ScopeVis::TraceData::m_projectionType, and ScopeVis::TraceData::m_traceColor.

Referenced by ScopeVis::handleMessage().

910  {
911  return (m_tracesData[traceIndex].m_projectionType != traceData.m_projectionType)
912  || (m_tracesData[traceIndex].m_amp != traceData.m_amp)
913  || (m_tracesData[traceIndex].m_ofs != traceData.m_ofs
914  || (m_tracesData[traceIndex].m_traceColor != traceData.m_traceColor));
915  }
std::vector< TraceData > m_tracesData
Corresponding traces data.
Definition: scopevis.h:877
+ Here is the caller graph for this function:

◆ moveTrace()

void ScopeVis::Traces::moveTrace ( uint32_t  traceIndex,
bool  upElseDown 
)
inline

Definition at line 960 of file scopevis.h.

References ScopeVis::TraceControl::initProjector(), and ScopeVis::TraceControl::releaseProjector().

Referenced by ScopeVis::handleMessage().

961  {
962  if ((!upElseDown) && (traceIndex == 0)) {
963  return;
964  }
965 
966  int nextControlIndex = (traceIndex + (upElseDown ? 1 : -1)) % (m_tracesControl.size());
967  int nextDataIndex = (traceIndex + (upElseDown ? 1 : -1)) % (m_tracesData.size()); // should be the same
968 
969  TraceControl *traceControl = m_tracesControl[traceIndex];
970  TraceControl *nextTraceControl = m_tracesControl[nextControlIndex];
971 
972  traceControl->releaseProjector();
973  nextTraceControl->releaseProjector();
974 
975  m_tracesControl[nextControlIndex] = traceControl;
976  m_tracesControl[traceIndex] = nextTraceControl;
977 
978  TraceData nextData = m_tracesData[nextDataIndex];
979  m_tracesData[nextDataIndex] = m_tracesData[traceIndex];
980  m_tracesData[traceIndex] = nextData;
981 
982  traceControl = m_tracesControl[traceIndex];
983  nextTraceControl = m_tracesControl[nextControlIndex];
984 
985  traceControl->initProjector(m_tracesData[traceIndex].m_projectionType);
986  nextTraceControl->initProjector(m_tracesData[nextDataIndex].m_projectionType);
987  }
std::vector< TraceControl * > m_tracesControl
Corresponding traces control data.
Definition: scopevis.h:876
std::vector< TraceData > m_tracesData
Corresponding traces data.
Definition: scopevis.h:877
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeTrace()

void ScopeVis::Traces::removeTrace ( uint32_t  traceIndex)
inline

Definition at line 943 of file scopevis.h.

References ScopeVis::TraceControl::releaseProjector().

Referenced by ScopeVis::handleMessage().

944  {
945  if (traceIndex < m_tracesControl.size())
946  {
947  qDebug("ScopeVis::removeTrace");
948  m_traces[0].erase(m_traces[0].begin() + traceIndex);
949  m_traces[1].erase(m_traces[1].begin() + traceIndex);
950  TraceControl *traceControl = m_tracesControl[traceIndex];
951  traceControl->releaseProjector();
952  m_tracesControl.erase(m_tracesControl.begin() + traceIndex);
953  m_tracesData.erase(m_tracesData.begin() + traceIndex);
954  delete traceControl;
955 
956  resize(m_traceSize); // reallocate pointers
957  }
958  }
std::vector< TraceControl * > m_tracesControl
Corresponding traces control data.
Definition: scopevis.h:876
std::vector< TraceData > m_tracesData
Corresponding traces data.
Definition: scopevis.h:877
int m_traceSize
Current size of a trace in buffer.
Definition: scopevis.h:879
void resize(int traceSize)
Definition: scopevis.h:989
std::vector< float * > m_traces[2]
Double buffer of traces processed by glScope.
Definition: scopevis.h:878
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resize()

void ScopeVis::Traces::resize ( int  traceSize)
inline

Definition at line 989 of file scopevis.h.

References i.

Referenced by ScopeVis::setTraceSize().

990  {
991  m_traceSize = traceSize;
992 
994  {
995  delete[] m_x0;
996  delete[] m_x1;
997  m_x0 = new float[2*m_traceSize*m_maxNbTraces];
998  m_x1 = new float[2*m_traceSize*m_maxNbTraces];
999 
1001  }
1002 
1003  std::fill_n(m_x0, 2*m_traceSize*m_traces[0].size(), 0.0f);
1004  std::fill_n(m_x1, 2*m_traceSize*m_traces[0].size(), 0.0f);
1005 
1006  for (unsigned int i = 0; i < m_traces[0].size(); i++)
1007  {
1008  (m_traces[0])[i] = &m_x0[2*m_traceSize*i];
1009  (m_traces[1])[i] = &m_x1[2*m_traceSize*i];
1010  }
1011  }
int m_traceSize
Current size of a trace in buffer.
Definition: scopevis.h:879
static const uint32_t m_maxNbTraces
Definition: scopevis.h:152
uint32_t size() const
Definition: scopevis.h:1014
int32_t i
Definition: decimators.h:244
int m_maxTraceSize
Maximum Size of a trace in buffer.
Definition: scopevis.h:880
std::vector< float * > m_traces[2]
Double buffer of traces processed by glScope.
Definition: scopevis.h:878
+ Here is the caller graph for this function:

◆ size()

uint32_t ScopeVis::Traces::size ( ) const
inline

Definition at line 1014 of file scopevis.h.

1014 { return m_tracesControl.size(); }
std::vector< TraceControl * > m_tracesControl
Corresponding traces control data.
Definition: scopevis.h:876

◆ switchBuffer()

void ScopeVis::Traces::switchBuffer ( )
inline

Definition at line 1016 of file scopevis.h.

Referenced by ScopeVis::processTraces().

1017  {
1019 
1020  for (std::vector<TraceControl*>::iterator it = m_tracesControl.begin(); it != m_tracesControl.end(); ++it)
1021  {
1022  (*it)->m_traceCount[currentBufferIndex()] = 0;
1023  }
1024  }
uint32_t currentBufferIndex() const
Definition: scopevis.h:1013
std::vector< TraceControl * > m_tracesControl
Corresponding traces control data.
Definition: scopevis.h:876
bool evenOddIndex
Even (true) or odd (false) index.
Definition: scopevis.h:881
+ Here is the caller graph for this function:

Member Data Documentation

◆ evenOddIndex

bool ScopeVis::Traces::evenOddIndex

Even (true) or odd (false) index.

Definition at line 881 of file scopevis.h.

◆ m_maxTraceSize

int ScopeVis::Traces::m_maxTraceSize

Maximum Size of a trace in buffer.

Definition at line 880 of file scopevis.h.

◆ m_traces

std::vector<float *> ScopeVis::Traces::m_traces[2]

Double buffer of traces processed by glScope.

Definition at line 878 of file scopevis.h.

Referenced by ScopeVis::initTraceBuffers(), ScopeVis::processTraces(), and ScopeVis::ScopeVis().

◆ m_tracesControl

std::vector<TraceControl*> ScopeVis::Traces::m_tracesControl

Corresponding traces control data.

Definition at line 876 of file scopevis.h.

Referenced by ScopeVis::processTraces(), and ScopeVis::updateMaxTraceDelay().

◆ m_tracesData

std::vector<TraceData> ScopeVis::Traces::m_tracesData

◆ m_traceSize

int ScopeVis::Traces::m_traceSize

Current size of a trace in buffer.

Definition at line 879 of file scopevis.h.

◆ m_x0

float* ScopeVis::Traces::m_x0
private

Definition at line 1027 of file scopevis.h.

◆ m_x1

float* ScopeVis::Traces::m_x1
private

Definition at line 1028 of file scopevis.h.


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