forked from csete/qthid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
142 lines (121 loc) · 5 KB
/
mainwindow.h
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
/***************************************************************************
* This file is part of Qthid.
*
* Copyright (C) 2010 Howard Long, G6LVB
* CopyRight (C) 2011 Alexandru Csete, OZ9AEC
* Mario Lorenz, DL5MLO
*
* Qthid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Qthid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qthid. If not, see <http://www.gnu.org/licenses/>.
*
***************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QComboBox>
#include <QLabel>
#include "fcd.h"
#include "fcddiagram.h"
#include "dockifgain.h"
#include "firmware.h"
namespace Ui {
class MainWindow;
}
/** \brief Data definition for combo box items.
* This data structure represents an item in a combo box used for
* gain and filter parameters. Each combo box has an array of these
* data defining the set of options.
*/
typedef struct {
const char *pszDesc; /*!< The display name of the item. */
qint8 u8Val; /*!< The numerical value of the item. */
} COMBO_ITEM_STRUCT;
/** \brief Data definition for a combo box.
* This data structure represents a combo box that is used for gain and
* filter parameters. Each such parameter has a 'set' and 'get' command
* as well as a list of options (COMBO_ITEM_STRUCT[]).
* \sa _acs
*/
typedef struct {
quint8 u8CommandSet; /*!< The command for setting the parameter in the FCD. */
quint8 u8CommandGet; /*!< The command for retrieveing the parameter from the FCD. */
qint8 nIdxDefault; /*!< Index pointing to the default value for this parameter in the pacis array. */
QComboBox *pComboBox; /*!< Pointer to the combo box. */
const COMBO_ITEM_STRUCT *pacis; /*!< Pointer to the array of items. */
} COMBO_STRUCT;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui; /*! UI generated by Qt Designer. */
QTimer *timer; /*! Timer for cyclic polling of FCD. */
QLabel *fcdStatus; /*! Label showing FCD status in statusbar. */
FCD_MODE_ENUM prevMode; /*! Previous mode to detect FCd mode changes (bootloader/app). */
FcdDiagram *diagramDialog; /*! Dialog window showing FCD diagram. */
DockIfGain *uiDockIfGain; /*! Dock widget with IF gain and filter controls. */
CFirmware *fwDialog; /*! Firmware tools (uplaod and verify firmware). */
qint64 lnbOffset; /*! Frequency offset when using up- and downconverters (Hz). */
double StrToDouble(QString s);
void populateCombo(QComboBox *box, int nIdxDefault, const COMBO_ITEM_STRUCT *pcis);
void populateCombos();
void enableCombos(bool enabled);
void readDevice();
void bandChange();
public slots:
void setNewFrequency(qint64 freq);
private slots:
void on_spinBoxCorr_valueChanged(int);
void on_spinBoxLnb_valueChanged(double value);
void on_pushButtonBiasT_toggled(bool isOn);
void on_comboBoxLNAGain_activated(int index);
void on_comboBoxBand_activated(int index);
void on_comboBoxRfFilter_activated(int index);
void on_comboBoxMixerGain_activated(int index);
void on_comboBoxMixerFilter_activated(int index);
//void on_comboBoxIFGain1_activated(int index);
//void on_comboBoxIFRCFilter_activated(int index);
//void on_comboBoxIFGain2_activated(int index);
//void on_comboBoxIFGain3_activated(int index);
//void on_comboBoxIFFilter_activated(int index);
//void on_comboBoxIFGain4_activated(int index);
//void on_comboBoxIFGain5_activated(int index);
//void on_comboBoxIFGain6_activated(int index);
void on_comboBoxLNAEnhance_activated(int index);
void on_comboBoxBiasCurrent_activated(int index);
//void on_comboBoxIFGainMode_activated(int index);
/* if gain */
void setIfGainMode(int index);
void setIfRcFilter(int index);
void setIfFilter(int index);
void setIfGain1(int index);
void setIfGain2(int index);
void setIfGain3(int index);
void setIfGain4(int index);
void setIfGain5(int index);
void setIfGain6(int index);
void enableControls();
void fwDialogFinished(int result);
/* actions */
void on_actionLoad_triggered();
void on_actionSave_triggered();
void on_actionBalance_triggered();
void on_actionFirmware_triggered();
void on_actionDefault_triggered();
void on_actionAbout_triggered();
void on_actionAboutQt_triggered();
void on_actionDiagram_triggered();
};
#endif // MAINWINDOW_H