File: mainwindow.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 (147 lines) | stat: -rw-r--r-- 3,639 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
//////////////////////////////////////////////////////////////////////
// mainwindow.h: interface for the MainWindow GUI class.
//
// History:
//	2010-09-15  Initial creation MSW
//	2011-03-27  Initial release
/////////////////////////////////////////////////////////////////////
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include "interface/sdrinterface.h"
#include <QHostAddress>
#include "gui/demodsetupdlg.h"
#include "gui/chatdialog.h"
#include "rdsdecode.h"


namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

	void SetupDemod(int index);
	void SetupNoiseProc();
	tDemodInfo m_DemodSettings[NUM_DEMODS];	//not all fields are saved in Settings

private slots:
	void closeEvent(QCloseEvent *event);
	void AlwaysOnTop();
	void OnExit();
	void OnAbout();
	void OnDisplayDlg();
	void OnSoundCardDlg();
	void OnSdrDlg();
	void OnNetworkDlg();
	void OnDemodDlg();
	void OnNoiseProcDlg();
	void OnVolumeSlider(int value);
	void OnRecordSetupDlg();
	void OnRecord();
	void OnFileSendDlg();

	void OnRun();
	void OnSpanChanged(int spanKhz);
	void OnMaxdBChanged(int maxdb);
	void OnVertScaleChanged(int index);

	void OnTimer();
	void OnStatus(int status);
	void OnNewInfoData();
	void OnNewFftData();
	void OnNewScreenDemodFreq(qint64 freq);
	void OnNewScreenCenterFreq(qint64 freq);
	void OnNewCenterFrequency(qint64 freq);	//called when center frequency has changed
	void OnNewDemodFrequency(qint64 freq);	//called when demod frequency has changed
	void OnNewLowCutFreq(int freq);
	void OnNewHighCutFreq(int freq);

protected:
	void mousePressEvent(QMouseEvent *);

private:
	void readSettings();
	void writeSettings();
	void UpdateInfoBox();
	void InitDemodSettings();
	void SetChatDialogState(int state);
	void StopRecord();

	/////////////////////////
	//Persistant Settings Variables saved
	/////////////////////////
	bool m_StereoOut;
	bool m_UseTestBench;
	bool m_AlwaysOnTop;
	bool m_AgcOn;
	bool m_InvertSpectrum;
	bool m_USFm;
	bool m_UseCursorText;
	bool m_UseUdpFwd;
	bool m_TxRepeat;
	bool m_UseTxFile;
	qint64 m_CenterFrequency;
	qint64 m_TxFrequency;
	qint64 m_DemodFrequency;
	quint32 m_SpanFrequency;
	QHostAddress m_IPAdr;
	quint32 m_Port;
	QHostAddress m_IPFwdAdr;
	quint32 m_FwdPort;
	qint32 m_RadioType;
	qint32 m_BandwidthIndex;
	qint32 m_SoundInIndex;
	qint32 m_SoundOutIndex;
	qint32 m_MaxDisplayRate;
	qint32 m_VertScaleIndex;
	qint32 m_dBStepSize;
	qint32 m_MaxdB;
	qint32 m_RfGain;
	qint32 m_LastSpanKhz;
	qint32 m_FftAve;
	qint32 m_FftSize;
	qint32 m_Volume;
	qint32 m_Percent2DScreen;
	qint32 m_DemodMode;
	qint32 m_RecordMode;
	int m_ActiveHostAdrIndex;
	TYPEREAL m_NCOSpurOffsetI;	//NCO spur reduction variables
	TYPEREAL m_NCOSpurOffsetQ;
	tNoiseProcdInfo m_NoiseProcSettings;
	QString m_RecordFilePath;
	QString m_TxFilePath;
	TYPEREAL m_TxSignalPower;
	TYPEREAL m_TxNoisePower;
	qint32 m_TxSweepStartFrequency;
	qint32 m_TxSweepStopFrequency;
	qint32 m_TxSweepRate;

	bool m_FreqChanged;
	bool m_Recording;
	QRect m_TestBenchRect;
	QString m_Str;
	QString m_Str2;
	QString m_ActiveDevice;
	QString m_ProgramExeName;
	CSdrInterface::eStatus m_Status;
	CSdrInterface::eStatus m_LastStatus;
	QTimer *m_pTimer;
	CSdrInterface* m_pSdrInterface;
	CDemodSetupDlg* m_pDemodSetupDlg;
	QRect m_ChatDialogRect;

	CRdsDecode m_RdsDecode;
	qint32 m_KeepAliveTimer;
	Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H