SoDaRadio-5.0.3-master:8901fb5
mainwindow.hpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2017 Matthew H. Reilly (kb1vc)
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are
7 met:
8 
9  Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11  Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in
13  the documentation and/or other materials provided with the
14  distribution.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 
29 #ifndef MAINWINDOW_H
30 #define MAINWINDOW_H
31 
32 #include <QMainWindow>
33 #include <QCloseEvent>
34 #include <QSettings>
35 #include "soda_listener.hpp"
36 #include "../common/GuiParams.hxx"
37 #include "soda_band.hpp"
38 #include "soda_hamlib_server.hpp"
39 
40 namespace Ui {
41  class MainWindow;
42 }
43 
44 class MainWindow : public QMainWindow
45 {
46  Q_OBJECT
47 
48 public:
49  MainWindow(QWidget *parent, SoDa::GuiParams & params);
50  ~MainWindow();
51 
52 public slots:
66  void setRXFreq(double freq);
67 
81  void setTXFreq(double freq);
82 
83  void updateBandDisplay(double freq);
84 
85  void changeBand(const QString & band);
86  void writeBandMapEntry(bool);
87  void fillBandMapEntry(const QString & band);
88 
94  void handleFatalError(const QString & err_string);
95 
96  void logContact(bool);
97 
98  void evalNav(const QString & dummy);
99 
100  void updateTime(int h, int m, int s);
101  void updatePosition(double lat, double lon);
102 
103  void restoreSettings();
104  void saveConfig();
105  void saveConfigAs_dlg();
106  void restoreConfig_dlg();
107 
108  void displayAppInfo(bool dummy);
109 
110 protected:
111  void setupTopControls();
112  void setupMidControls();
113  void setupLogGPS();
114 
115  void setupSettings();
116  void setupBandConfig();
117  void setupLogEditor();
118 
119  void setupWaterFall();
120  void setupSpectrum();
121 
122  void setupHamlib();
123 
124  void widgetSaveRestore(QObject * op, const QString & par, bool save);
125 
126  void bandMapSaveRestore(GUISoDa::BandMap & bmap, bool save);
127  void saveCurrentFreqs();
128 
129  void sendCannedCW(const QString & txt);
130 
131 private:
132  void closeEvent(QCloseEvent * event) {
133  listener->closeRadio();
134  event->accept();
135  }
136 
137  QSettings * settings_p;
138 
139  // Band map
140  // QMap<QString, GUISoDa::Band> band_map;
142 
145 
146  void setRXFreq_nocross(double freq);
147  void setTXFreq_nocross(double freq);
148 
149  Ui::MainWindow *ui;
150 
152 
154 };
155 
156 #endif // MAINWINDOW_H
GUISoDa::Listener * listener
Definition: mainwindow.hpp:151
Ui::MainWindow * ui
Definition: mainwindow.hpp:149
void closeEvent(QCloseEvent *event)
Definition: mainwindow.hpp:132
QString auto_bandswitch_target
Definition: mainwindow.hpp:144
QSettings * settings_p
Definition: mainwindow.hpp:137
GUISoDa::HamlibServer * hlib_server
Definition: mainwindow.hpp:153
GUISoDa::BandMap band_map
Definition: mainwindow.hpp:141
QString current_band_selector
Definition: mainwindow.hpp:143