SoDaRadio-5.0.3-master:8901fb5
main_setup_hamlib.cpp
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 #include "mainwindow.hpp"
30 #include "ui_mainwindow.h"
31 #include <iostream>
32 #include <boost/format.hpp>
33 #include "soda_comboboxes.hpp"
34 #include "soda_listener.hpp"
35 
37 {
38  // connect updates or status reports to the hamlib handler
39  // so that it can maintain its own view of the radio state.
40  connect(ui->RXFreq_lab, SIGNAL(newFreq(double)),
41  hlib_server->getHandler(), SLOT(reportRXFreq(double)));
42 
43  connect(ui->TXFreq_lab, SIGNAL(newFreq(double)),
44  hlib_server->getHandler(), SLOT(reportTXFreq(double)));
45 
46  connect(ui->Mode_cb, SIGNAL(valueChanged(int)),
47  hlib_server->getHandler(), SLOT(reportModulation(int)));
48 
49  connect(hlib_server->getHandler(), SIGNAL(setRXFreq(double)),
50  this, SLOT(setRXFreq(double)));
51 
52  connect(hlib_server->getHandler(), SIGNAL(setRXFreq(double)),
53  this, SLOT(updateBandDisplay(double)));
54 
55  connect(hlib_server->getHandler(), SIGNAL(setTXFreq(double)),
56  this, SLOT(setTXFreq(double)));
57 
58  connect(hlib_server->getHandler(), SIGNAL(setRXFreq(double)),
59  this->listener, SLOT(setSpectrumCenter(double)));
60 
61  connect(hlib_server->getHandler(), SIGNAL(setTXFreq(double)),
62  this, SLOT(setTXFreq(double)));
63 
64  connect(hlib_server->getHandler(), SIGNAL(setTXOn(bool)),
65  this->listener, SLOT(setPTT(bool)));
66 
67 }
68 
69 
GUISoDa::Listener * listener
Definition: mainwindow.hpp:151
Ui::MainWindow * ui
Definition: mainwindow.hpp:149
HamlibHandler * getHandler()
GUISoDa::HamlibServer * hlib_server
Definition: mainwindow.hpp:153
void updateBandDisplay(double freq)
void setTXFreq(double freq)
set the TX frequency label to freq, and send the requested frequency to the SDR radio server...
void setRXFreq(double freq)
set the RX frequency label to freq, and send the requested frequency to the SDR radio server...