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 | Private Member Functions | Private Attributes | List of all members
ScopeVisXY Class Reference

#include <scopevisxy.h>

+ Inheritance diagram for ScopeVisXY:
+ Collaboration diagram for ScopeVisXY:

Public Member Functions

 ScopeVisXY (TVScreen *tvScreen)
 
virtual ~ScopeVisXY ()
 
virtual void feed (const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool positiveOnly)
 
virtual void start ()
 
virtual void stop ()
 
virtual bool handleMessage (const Message &message)
 Processing of a message. Returns true if message has actually been processed. More...
 
void setScale (float scale)
 
void setStroke (int stroke)
 
void setDecay (int decay)
 
void setPixelsPerFrame (int pixelsPerFrame)
 
void setPlotRGB (const QRgb &plotRGB)
 
void setGridRGB (const QRgb &gridRGB)
 
void addGraticulePoint (const std::complex< float > &z)
 
void calculateGraticule (int rows, int cols)
 
void clearGraticule ()
 
- Public Member Functions inherited from BasebandSampleSink
 BasebandSampleSink ()
 
virtual ~BasebandSampleSink ()
 
MessageQueuegetInputMessageQueue ()
 Get the queue for asynchronous inbound communication. More...
 
virtual void setMessageQueueToGUI (MessageQueue *queue)
 
MessageQueuegetMessageQueueToGUI ()
 

Private Member Functions

void drawGraticule ()
 

Private Attributes

TVScreenm_tvScreen
 
float m_scale
 
int m_cols
 
int m_rows
 
int m_pixelsPerFrame
 
int m_pixelCount
 
int m_alphaTrace
 this is the stroke value [0:255] More...
 
int m_alphaReset
 alpha channel of screen blanking (blackening) is 255 minus decay value [0:255] More...
 
QRgb m_plotRGB
 
QRgb m_gridRGB
 
std::vector< std::complex< float > > m_graticule
 
std::vector< int > m_graticuleRows
 
std::vector< int > m_graticuleCols
 

Additional Inherited Members

- Protected Slots inherited from BasebandSampleSink
void handleInputMessages ()
 
- Protected Attributes inherited from BasebandSampleSink
MessageQueue m_inputMessageQueue
 Queue for asynchronous inbound communication. More...
 
MessageQueuem_guiMessageQueue
 Input message queue to the GUI. More...
 

Detailed Description

Definition at line 32 of file scopevisxy.h.

Constructor & Destructor Documentation

◆ ScopeVisXY()

ScopeVisXY::ScopeVisXY ( TVScreen tvScreen)

Definition at line 25 of file scopevisxy.cpp.

References m_pixelsPerFrame, m_tvScreen, TVScreen::setAlphaBlend(), and setPixelsPerFrame().

25  :
26  m_tvScreen(tvScreen),
27  m_scale(1.0),
28  m_cols(0),
29  m_rows(0),
30  m_pixelsPerFrame(480),
31  m_pixelCount(0),
32  m_alphaTrace(128),
33  m_alphaReset(128),
34  m_plotRGB(qRgb(0, 255, 0)),
35  m_gridRGB(qRgb(255, 255 ,255))
36 {
37  setObjectName("ScopeVisXY");
40 }
TVScreen * m_tvScreen
Definition: scopevisxy.h:57
void setAlphaBlend(bool blnAlphaBlend)
Definition: tvscreen.h:59
QRgb m_gridRGB
Definition: scopevisxy.h:66
int m_pixelCount
Definition: scopevisxy.h:62
float m_scale
Definition: scopevisxy.h:58
int m_pixelsPerFrame
Definition: scopevisxy.h:61
QRgb m_plotRGB
Definition: scopevisxy.h:65
int m_alphaReset
alpha channel of screen blanking (blackening) is 255 minus decay value [0:255]
Definition: scopevisxy.h:64
int m_cols
Definition: scopevisxy.h:59
void setPixelsPerFrame(int pixelsPerFrame)
Definition: scopevisxy.cpp:46
int m_alphaTrace
this is the stroke value [0:255]
Definition: scopevisxy.h:63
int m_rows
Definition: scopevisxy.h:60
+ Here is the call graph for this function:

◆ ~ScopeVisXY()

ScopeVisXY::~ScopeVisXY ( )
virtual

Definition at line 42 of file scopevisxy.cpp.

43 {
44 }

Member Function Documentation

◆ addGraticulePoint()

void ScopeVisXY::addGraticulePoint ( const std::complex< float > &  z)

Definition at line 111 of file scopevisxy.cpp.

References m_graticule.

Referenced by DSDDemodGUI::DSDDemodGUI().

111  {
112  m_graticule.push_back(z);
113 }
std::vector< std::complex< float > > m_graticule
Definition: scopevisxy.h:67
+ Here is the caller graph for this function:

◆ calculateGraticule()

void ScopeVisXY::calculateGraticule ( int  rows,
int  cols 
)

Definition at line 119 of file scopevisxy.cpp.

References m_graticule, m_graticuleCols, and m_graticuleRows.

Referenced by DSDDemodGUI::DSDDemodGUI(), and feed().

120 {
121  m_graticuleRows.clear();
122  m_graticuleCols.clear();
123 
124  std::vector<std::complex<float> >::const_iterator grIt = m_graticule.begin();
125 
126  for (; grIt != m_graticule.end(); ++grIt)
127  {
128  int y = rows * ((1.0 - grIt->imag()) / 2.0);
129  int x = cols * ((1.0 + grIt->real()) / 2.0);
130 
131  for (int d = -4; d <= 4; ++d)
132  {
133  m_graticuleRows.push_back(y+d);
134  m_graticuleCols.push_back(x);
135  m_graticuleRows.push_back(y);
136  m_graticuleCols.push_back(x+d);
137  }
138  }
139 }
std::vector< int > m_graticuleCols
Definition: scopevisxy.h:69
std::vector< std::complex< float > > m_graticule
Definition: scopevisxy.h:67
std::vector< int > m_graticuleRows
Definition: scopevisxy.h:68
+ Here is the caller graph for this function:

◆ clearGraticule()

void ScopeVisXY::clearGraticule ( )

Definition at line 115 of file scopevisxy.cpp.

References m_graticule.

115  {
116  m_graticule.clear();
117 }
std::vector< std::complex< float > > m_graticule
Definition: scopevisxy.h:67

◆ drawGraticule()

void ScopeVisXY::drawGraticule ( )
private

Definition at line 141 of file scopevisxy.cpp.

References m_graticuleCols, m_graticuleRows, m_gridRGB, m_tvScreen, TVScreen::selectRow(), and TVScreen::setDataColor().

Referenced by feed().

142 {
143  std::vector<int>::const_iterator rowIt = m_graticuleRows.begin();
144  std::vector<int>::const_iterator colIt = m_graticuleCols.begin();
145 
146  for(; (rowIt != m_graticuleRows.end()) && (colIt != m_graticuleCols.end()); ++rowIt, ++colIt)
147  {
148  m_tvScreen->selectRow(*rowIt);
149  m_tvScreen->setDataColor(*colIt, qRed(m_gridRGB), qGreen(m_gridRGB), qBlue(m_gridRGB));
150  }
151 }
bool setDataColor(int intCol, int intRed, int intGreen, int intBlue)
Definition: tvscreen.cpp:224
TVScreen * m_tvScreen
Definition: scopevisxy.h:57
std::vector< int > m_graticuleCols
Definition: scopevisxy.h:69
QRgb m_gridRGB
Definition: scopevisxy.h:66
std::vector< int > m_graticuleRows
Definition: scopevisxy.h:68
bool selectRow(int intLine)
Definition: tvscreen.cpp:212
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ feed()

void ScopeVisXY::feed ( const SampleVector::const_iterator &  begin,
const SampleVector::const_iterator &  end,
bool  positiveOnly 
)
virtual

Implements BasebandSampleSink.

Definition at line 53 of file scopevisxy.cpp.

References calculateGraticule(), drawGraticule(), TVScreen::getSize(), m_alphaReset, m_alphaTrace, m_cols, m_pixelCount, m_pixelsPerFrame, m_plotRGB, m_rows, m_scale, m_tvScreen, TVScreen::renderImage(), TVScreen::resetImage(), SDR_RX_SCALEF, TVScreen::selectRow(), and TVScreen::setDataColor().

54 {
55  (void) positiveOnly;
56  SampleVector::const_iterator begin(cbegin);
57 
58  while (begin < end)
59  {
60  float x = m_scale * (begin->m_real/SDR_RX_SCALEF);
61  float y = m_scale * (begin->m_imag/SDR_RX_SCALEF);
62 
63  int row = m_rows * ((1.0 - y) / 2.0);
64  int col = m_cols * ((1.0 + x) / 2.0);
65 
66  row = row < 0 ? 0 : row >= m_rows ? m_rows-1 : row;
67  col = col < 0 ? 0 : col >= m_cols ? m_cols-1 : col;
68 
69  m_tvScreen->selectRow(row);
70  m_tvScreen->setDataColor(col, qRed(m_plotRGB), qGreen(m_plotRGB), qBlue(m_plotRGB), m_alphaTrace);
71 
72  ++begin;
73  m_pixelCount++;
74 
76  {
77  int rows, cols;
78  m_tvScreen->getSize(rows, cols);
79 
80  if ((rows != m_rows) || (cols != m_cols))
81  {
82  calculateGraticule(rows, cols);
83  m_rows = rows;
84  m_cols = cols;
85  }
86 
88  m_tvScreen->update();
89  std::this_thread::sleep_for(std::chrono::microseconds(5000));
91  drawGraticule();
92  m_pixelCount = 0;
93  }
94  }
95 }
void drawGraticule()
Definition: scopevisxy.cpp:141
bool setDataColor(int intCol, int intRed, int intGreen, int intBlue)
Definition: tvscreen.cpp:224
void resetImage()
Definition: tvscreen.cpp:76
TVScreen * m_tvScreen
Definition: scopevisxy.h:57
void renderImage(unsigned char *objData)
Definition: tvscreen.cpp:70
int m_pixelCount
Definition: scopevisxy.h:62
void getSize(int &intCols, int &intRows) const
Definition: tvscreen.cpp:95
float m_scale
Definition: scopevisxy.h:58
int m_pixelsPerFrame
Definition: scopevisxy.h:61
#define SDR_RX_SCALEF
Definition: dsptypes.h:33
QRgb m_plotRGB
Definition: scopevisxy.h:65
int m_alphaReset
alpha channel of screen blanking (blackening) is 255 minus decay value [0:255]
Definition: scopevisxy.h:64
int m_cols
Definition: scopevisxy.h:59
int m_alphaTrace
this is the stroke value [0:255]
Definition: scopevisxy.h:63
int m_rows
Definition: scopevisxy.h:60
void calculateGraticule(int rows, int cols)
Definition: scopevisxy.cpp:119
bool selectRow(int intLine)
Definition: tvscreen.cpp:212
+ Here is the call graph for this function:

◆ handleMessage()

bool ScopeVisXY::handleMessage ( const Message cmd)
virtual

Processing of a message. Returns true if message has actually been processed.

Implements BasebandSampleSink.

Definition at line 105 of file scopevisxy.cpp.

106 {
107  (void) message;
108  return false;
109 }

◆ setDecay()

void ScopeVisXY::setDecay ( int  decay)
inline

Definition at line 44 of file scopevisxy.h.

Referenced by DSDDemodGUI::displaySettings(), and DSDDemodGUI::on_traceDecay_valueChanged().

44 { m_alphaReset = 255 - decay; }
int m_alphaReset
alpha channel of screen blanking (blackening) is 255 minus decay value [0:255]
Definition: scopevisxy.h:64
+ Here is the caller graph for this function:

◆ setGridRGB()

void ScopeVisXY::setGridRGB ( const QRgb &  gridRGB)
inline

Definition at line 48 of file scopevisxy.h.

Referenced by DSDDemodGUI::DSDDemodGUI().

48 { m_gridRGB = gridRGB; }
QRgb m_gridRGB
Definition: scopevisxy.h:66
+ Here is the caller graph for this function:

◆ setPixelsPerFrame()

void ScopeVisXY::setPixelsPerFrame ( int  pixelsPerFrame)

Definition at line 46 of file scopevisxy.cpp.

References m_pixelCount, m_pixelsPerFrame, m_tvScreen, and TVScreen::setAlphaReset().

Referenced by DSDDemodGUI::displaySettings(), DSDDemodGUI::DSDDemodGUI(), DSDDemodGUI::on_traceLength_valueChanged(), and ScopeVisXY().

47 {
48  m_pixelsPerFrame = pixelsPerFrame;
49  m_pixelCount = 0;
51 }
TVScreen * m_tvScreen
Definition: scopevisxy.h:57
int m_pixelCount
Definition: scopevisxy.h:62
int m_pixelsPerFrame
Definition: scopevisxy.h:61
void setAlphaReset()
Definition: tvscreen.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPlotRGB()

void ScopeVisXY::setPlotRGB ( const QRgb &  plotRGB)
inline

Definition at line 47 of file scopevisxy.h.

Referenced by DSDDemodGUI::DSDDemodGUI().

47 { m_plotRGB = plotRGB; }
QRgb m_plotRGB
Definition: scopevisxy.h:65
+ Here is the caller graph for this function:

◆ setScale()

void ScopeVisXY::setScale ( float  scale)
inline

Definition at line 42 of file scopevisxy.h.

Referenced by DSDDemodGUI::DSDDemodGUI().

42 { m_scale = scale; }
float m_scale
Definition: scopevisxy.h:58
+ Here is the caller graph for this function:

◆ setStroke()

void ScopeVisXY::setStroke ( int  stroke)
inline

Definition at line 43 of file scopevisxy.h.

Referenced by DSDDemodGUI::displaySettings(), and DSDDemodGUI::on_traceStroke_valueChanged().

43 { m_alphaTrace = stroke; }
int m_alphaTrace
this is the stroke value [0:255]
Definition: scopevisxy.h:63
+ Here is the caller graph for this function:

◆ start()

void ScopeVisXY::start ( )
virtual

Implements BasebandSampleSink.

Definition at line 97 of file scopevisxy.cpp.

98 {
99 }

◆ stop()

void ScopeVisXY::stop ( )
virtual

Implements BasebandSampleSink.

Definition at line 101 of file scopevisxy.cpp.

102 {
103 }

Member Data Documentation

◆ m_alphaReset

int ScopeVisXY::m_alphaReset
private

alpha channel of screen blanking (blackening) is 255 minus decay value [0:255]

Definition at line 64 of file scopevisxy.h.

Referenced by feed().

◆ m_alphaTrace

int ScopeVisXY::m_alphaTrace
private

this is the stroke value [0:255]

Definition at line 63 of file scopevisxy.h.

Referenced by feed().

◆ m_cols

int ScopeVisXY::m_cols
private

Definition at line 59 of file scopevisxy.h.

Referenced by feed().

◆ m_graticule

std::vector<std::complex<float> > ScopeVisXY::m_graticule
private

Definition at line 67 of file scopevisxy.h.

Referenced by addGraticulePoint(), calculateGraticule(), and clearGraticule().

◆ m_graticuleCols

std::vector<int> ScopeVisXY::m_graticuleCols
private

Definition at line 69 of file scopevisxy.h.

Referenced by calculateGraticule(), and drawGraticule().

◆ m_graticuleRows

std::vector<int> ScopeVisXY::m_graticuleRows
private

Definition at line 68 of file scopevisxy.h.

Referenced by calculateGraticule(), and drawGraticule().

◆ m_gridRGB

QRgb ScopeVisXY::m_gridRGB
private

Definition at line 66 of file scopevisxy.h.

Referenced by drawGraticule().

◆ m_pixelCount

int ScopeVisXY::m_pixelCount
private

Definition at line 62 of file scopevisxy.h.

Referenced by feed(), and setPixelsPerFrame().

◆ m_pixelsPerFrame

int ScopeVisXY::m_pixelsPerFrame
private

Definition at line 61 of file scopevisxy.h.

Referenced by feed(), ScopeVisXY(), and setPixelsPerFrame().

◆ m_plotRGB

QRgb ScopeVisXY::m_plotRGB
private

Definition at line 65 of file scopevisxy.h.

Referenced by feed().

◆ m_rows

int ScopeVisXY::m_rows
private

Definition at line 60 of file scopevisxy.h.

Referenced by feed().

◆ m_scale

float ScopeVisXY::m_scale
private

Definition at line 58 of file scopevisxy.h.

Referenced by feed().

◆ m_tvScreen

TVScreen* ScopeVisXY::m_tvScreen
private

Definition at line 57 of file scopevisxy.h.

Referenced by drawGraticule(), feed(), ScopeVisXY(), and setPixelsPerFrame().


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