File: echoplot.h

package info (click to toggle)
js8call 2.2.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 22,416 kB
  • sloc: cpp: 563,285; f90: 9,265; ansic: 937; python: 132; sh: 93; makefile: 7
file content (93 lines) | stat: -rw-r--r-- 2,131 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
///////////////////////////////////////////////////////////////////////////
// Some code in this file and accompanying files is based on work by
// Moe Wheatley, AE4Y, released under the "Simplified BSD License".
// For more details see the accompanying file LICENSE_WHEATLEY.TXT
///////////////////////////////////////////////////////////////////////////

#ifndef EPLOTTER_H
#define EPLOTTER_H

#include <QtWidgets>
#include <QFrame>
#include <QImage>
#include <cstring>

#define VERT_DIVS 7	//specify grid screen divisions
#define HORZ_DIVS 20

class EPlotter : public QFrame
{
  Q_OBJECT
public:
  explicit EPlotter(QWidget *parent = 0);
  ~EPlotter();

  QSize minimumSizeHint() const;
  QSize sizeHint() const;
  float   m_fSpan;
  qint32  m_TxFreq;
  qint32  m_w;
  qint32  m_plotZero;
  qint32  m_plotGain;
  qint32  m_smooth;
  qint32  m_binsPerPixel;
  qint32  m_nColor;
  bool    m_blue;

  void draw();		                                    //Update the Echo plot
  void SetRunningState(bool running);
  void setPlotZero(int plotZero);
  int  getPlotZero();
  void setPlotGain(int plotGain);
  int  getPlotGain();
  int  plotWidth();
  void UpdateOverlay();
  void DrawOverlay();
  void setSmooth(int n);
  int  getSmooth();
  void setColors(qint32 n);

//  void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;}

protected:
  //re-implemented widget event handlers
  void paintEvent(QPaintEvent *event);
  void resizeEvent(QResizeEvent* event);

private:

  void MakeFrequencyStrs();
  int XfromFreq(float f);
  float FreqfromX(int x);
  qint64 RoundFreq(qint64 freq, int resolution);

  QPixmap m_2DPixmap;
  QPixmap m_ScalePixmap;
  QPixmap m_OverlayPixmap;
  QSize   m_Size;
  QString m_Str;
  QString m_HDivText[483];

  double  m_fftBinWidth;

  qint64  m_StartFreq;

  qint32  m_dBStepSize;
  qint32  m_hdivs;
  qint32  m_line;
  qint32  m_freqPerDiv;
  qint32  m_h;
  qint32  m_h1;
  qint32  m_h2;

  bool    m_Running;
  bool    m_paintEventBusy;

};

extern "C" {
//--------------------------------------------------- C and Fortran routines

void smo121_(float x[], int* npts);
}
#endif // EPLOTTER_H