File: meter.h

package info (click to toggle)
cutesdr 1.20-4
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 2,848 kB
  • sloc: cpp: 18,902; makefile: 21; sh: 5
file content (53 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download | duplicates (2)
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
//////////////////////////////////////////////////////////////////////
// meter.h: interface for the CMeter class.
//
// History:
//	2013-10-02  Initial creation MSW
//	2014-07-11  Added Squelch level position MSW
/////////////////////////////////////////////////////////////////////
#ifndef METER_H
#define METER_H

#include <QtGui>
#include <QFrame>
#include <QImage>
#include "dsp/datatypes.h"

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

	QSize minimumSizeHint() const;
	QSize sizeHint() const;

	void draw();		//call to draw new fft data onto screen plot
	void UpdateOverlay(){DrawOverlay();}
    void SetSquelchPos(TYPEREAL db);		//{ m_SquelchPos = CalcPosFromdB(db);}

signals:

public slots:
    void SetdBmLevel(TYPEREAL dbm, bool Overload);

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

private:
	void DrawOverlay();
    int CalcPosFromdB(TYPEREAL db);
	QPixmap m_Pixmap;
	QPixmap m_OverlayPixmap;
	QSize m_Size;
	QString m_Str;
	bool m_Overload;
	int m_Slevel;
	int m_SquelchPos;
	int m_dBm;
};

#endif // METER_H