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
leansdr::datvconstellation< T > Struct Template Reference

#include <datvconstellation.h>

+ Inheritance diagram for leansdr::datvconstellation< T >:
+ Collaboration diagram for leansdr::datvconstellation< T >:

Public Member Functions

 datvconstellation (scheduler *sch, pipebuf< complex< T > > &_in, T _xymin, T _xymax, const char *_name=nullptr, TVScreen *objDATVScreen=nullptr)
 
void run ()
 
void draw_begin ()
 
void calculate_cstln_points ()
 
- Public Member Functions inherited from leansdr::runnable
 runnable (scheduler *_sch, const char *name)
 
- Public Member Functions inherited from leansdr::runnable_common
 runnable_common (const char *_name)
 
virtual ~runnable_common ()
 
virtual void shutdown ()
 

Public Attributes

xymin
 
xymax
 
unsigned long decimation
 
long pixels_per_frame
 
cstln_lut< eucl_ss, 256 > ** cstln
 
TVScreenm_objDATVScreen
 
pipereader< complex< T > > in
 
unsigned long phase
 
std::vector< int > cstln_rows
 
std::vector< int > cstln_cols
 
- Public Attributes inherited from leansdr::runnable_common
const char * name
 

Additional Inherited Members

- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

template<typename T>
struct leansdr::datvconstellation< T >

Definition at line 111 of file datvconstellation.h.

Constructor & Destructor Documentation

◆ datvconstellation()

template<typename T>
leansdr::datvconstellation< T >::datvconstellation ( scheduler sch,
pipebuf< complex< T > > &  _in,
_xymin,
_xymax,
const char *  _name = nullptr,
TVScreen objDATVScreen = nullptr 
)
inline

Definition at line 123 of file datvconstellation.h.

129  :
130  runnable(sch, _name ? _name : _in.name),
131  xymin(_xymin),
132  xymax(_xymax),
133  decimation(DEFAULT_GUI_DECIMATION),
134  pixels_per_frame(1024),
135  cstln(0),
136  m_objDATVScreen(objDATVScreen),
137  in(_in),
138  phase(0)
139  {
140  }
cstln_lut< eucl_ss, 256 > ** cstln
pipereader< complex< T > > in
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
scheduler * sch
Definition: framework.h:199

Member Function Documentation

◆ calculate_cstln_points()

template<typename T>
void leansdr::datvconstellation< T >::calculate_cstln_points ( )
inline

Definition at line 189 of file datvconstellation.h.

190  {
191  if (!(*cstln)) {
192  return;
193  }
194 
195  cstln_rows.clear();
196  cstln_cols.clear();
197 
198  for (int i = 0; i < (*cstln)->nsymbols; ++i)
199  {
200  complex<signed char> *p = &(*cstln)->symbols[i];
201  int x = 256 * (p->re - xymin) / (xymax - xymin);
202  int y = 256 - 256 * (p->im - xymin) / (xymax - xymin);
203 
204  for (int d = -4; d <= 4; ++d)
205  {
206  cstln_rows.push_back(x + d);
207  cstln_cols.push_back(y);
208  cstln_rows.push_back(x);
209  cstln_cols.push_back(y + d);
210  }
211  }
212  }
cstln_lut< eucl_ss, 256 > ** cstln
std::vector< int > cstln_cols
int32_t i
Definition: decimators.h:244
std::vector< int > cstln_rows

◆ draw_begin()

template<typename T>
void leansdr::datvconstellation< T >::draw_begin ( )
inline

Definition at line 185 of file datvconstellation.h.

186  {
187  }

◆ run()

template<typename T>
void leansdr::datvconstellation< T >::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 142 of file datvconstellation.h.

143  {
144  //Symbols
145  while (in.readable() >= pixels_per_frame)
146  {
147  if ((!phase) && m_objDATVScreen)
148  {
150 
151  complex<T> *p = in.rd(), *pend = p + pixels_per_frame;
152 
153  for (; p < pend; ++p)
154  {
155  m_objDATVScreen->selectRow(256 * (p->re - xymin) / (xymax - xymin));
157  256 - 256 * ((p->im - xymin) / (xymax - xymin)),
158  255, 0, 255);
159  }
160 
161  if (cstln && (*cstln))
162  {
163  // Plot constellation points
164  std::vector<int>::const_iterator row_it = cstln_rows.begin();
165  std::vector<int>::const_iterator col_it = cstln_cols.begin();
166 
167  for (;(row_it != cstln_rows.end()) && (col_it != cstln_cols.end()); ++row_it, ++col_it)
168  {
169  m_objDATVScreen->selectRow(*row_it);
170  m_objDATVScreen->setDataColor(*col_it, 250, 250, 5);
171  }
172  }
173 
175  }
176 
177  in.read(pixels_per_frame);
178 
179  if (++phase >= decimation) {
180  phase = 0;
181  }
182  }
183  }
bool setDataColor(int intCol, int intRed, int intGreen, int intBlue)
Definition: tvscreen.cpp:224
void resetImage()
Definition: tvscreen.cpp:76
cstln_lut< eucl_ss, 256 > ** cstln
std::vector< int > cstln_cols
pipereader< complex< T > > in
void renderImage(unsigned char *objData)
Definition: tvscreen.cpp:70
std::vector< int > cstln_rows
bool selectRow(int intLine)
Definition: tvscreen.cpp:212

Member Data Documentation

◆ cstln

template<typename T>
cstln_lut<eucl_ss, 256>** leansdr::datvconstellation< T >::cstln

Definition at line 116 of file datvconstellation.h.

◆ cstln_cols

template<typename T>
std::vector<int> leansdr::datvconstellation< T >::cstln_cols

Definition at line 121 of file datvconstellation.h.

◆ cstln_rows

template<typename T>
std::vector<int> leansdr::datvconstellation< T >::cstln_rows

Definition at line 120 of file datvconstellation.h.

◆ decimation

template<typename T>
unsigned long leansdr::datvconstellation< T >::decimation

Definition at line 114 of file datvconstellation.h.

◆ in

template<typename T>
pipereader<complex<T> > leansdr::datvconstellation< T >::in

Definition at line 118 of file datvconstellation.h.

◆ m_objDATVScreen

template<typename T>
TVScreen* leansdr::datvconstellation< T >::m_objDATVScreen

◆ phase

template<typename T>
unsigned long leansdr::datvconstellation< T >::phase

Definition at line 119 of file datvconstellation.h.

◆ pixels_per_frame

template<typename T>
long leansdr::datvconstellation< T >::pixels_per_frame

◆ xymax

template<typename T>
T leansdr::datvconstellation< T >::xymax

Definition at line 113 of file datvconstellation.h.

◆ xymin

template<typename T>
T leansdr::datvconstellation< T >::xymin

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