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.
scopevisxy.h
Go to the documentation of this file.
1 // Copyright (C) 2018 F4EXB //
3 // written by Edouard Griffiths //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef SDRGUI_DSP_SCOPEVISXY_H_
20 #define SDRGUI_DSP_SCOPEVISXY_H_
21 
22 #include "dsp/basebandsamplesink.h"
23 #include "export.h"
24 #include "util/message.h"
25 
26 #include <QColor>
27 #include <vector>
28 #include <complex>
29 
30 class TVScreen;
31 
33 public:
34  ScopeVisXY(TVScreen *tvScreen);
35  virtual ~ScopeVisXY();
36 
37  virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly);
38  virtual void start();
39  virtual void stop();
40  virtual bool handleMessage(const Message& message);
41 
42  void setScale(float scale) { m_scale = scale; }
43  void setStroke(int stroke) { m_alphaTrace = stroke; }
44  void setDecay(int decay) { m_alphaReset = 255 - decay; }
45 
46  void setPixelsPerFrame(int pixelsPerFrame);
47  void setPlotRGB(const QRgb& plotRGB) { m_plotRGB = plotRGB; }
48  void setGridRGB(const QRgb& gridRGB) { m_gridRGB = gridRGB; }
49 
50  void addGraticulePoint(const std::complex<float>& z);
51  void calculateGraticule(int rows, int cols);
52  void clearGraticule();
53 
54 private:
55  void drawGraticule();
56 
58  float m_scale;
59  int m_cols;
60  int m_rows;
65  QRgb m_plotRGB;
66  QRgb m_gridRGB;
67  std::vector<std::complex<float> > m_graticule;
68  std::vector<int> m_graticuleRows;
69  std::vector<int> m_graticuleCols;
70 };
71 
72 
73 #endif /* SDRGUI_DSP_SCOPEVISXY_H_ */
TVScreen * m_tvScreen
Definition: scopevisxy.h:57
std::vector< int > m_graticuleCols
Definition: scopevisxy.h:69
QRgb m_gridRGB
Definition: scopevisxy.h:66
int m_pixelCount
Definition: scopevisxy.h:62
std::vector< std::complex< float > > m_graticule
Definition: scopevisxy.h:67
virtual void feed(const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool positiveOnly)=0
float m_scale
Definition: scopevisxy.h:58
int m_pixelsPerFrame
Definition: scopevisxy.h:61
virtual void start()=0
QRgb m_plotRGB
Definition: scopevisxy.h:65
#define SDRGUI_API
Definition: export.h:52
void setStroke(int stroke)
Definition: scopevisxy.h:43
virtual bool handleMessage(const Message &cmd)=0
Processing of a message. Returns true if message has actually been processed.
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
std::vector< int > m_graticuleRows
Definition: scopevisxy.h:68
int m_alphaTrace
this is the stroke value [0:255]
Definition: scopevisxy.h:63
int m_rows
Definition: scopevisxy.h:60
void setDecay(int decay)
Definition: scopevisxy.h:44
void setScale(float scale)
Definition: scopevisxy.h:42
virtual void stop()=0
void setGridRGB(const QRgb &gridRGB)
Definition: scopevisxy.h:48
void setPlotRGB(const QRgb &plotRGB)
Definition: scopevisxy.h:47