1
// ----------------------------------------------------------------------------
5
// This file is part of flrig.
7
// flrig is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation; either version 3 of the License, or
10
// (at your option) any later version.
12
// flrig is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with this program. If not, see <http://www.gnu.org/licenses/>.
19
// ----------------------------------------------------------------------------
27
#include <sys/types.h>
46
extern queue<FREQMODE> queA;
47
extern queue<FREQMODE> queB;
48
extern queue<bool> quePTT;
52
pthread_mutex_lock(&mutex_serial);
54
if (progStatus.poll_frequency) {
56
freq = selrig->get_vfoA();
57
if (freq != vfoA.freq) {
58
pthread_mutex_lock(&mutex_xmlrpc);
60
Fl::awake(setFreqDispA, (void *)vfoA.freq);
63
send_xml_freq(vfo.freq);
65
pthread_mutex_unlock(&mutex_xmlrpc);
67
freq = selrig->get_vfoB();
68
if (freq != vfoB.freq) {
70
Fl::awake(setFreqDispB, (void *)vfoB.freq);
73
if (!quePTT.empty()) goto exit_read;
75
if (progStatus.poll_mode) {
77
nu_mode = selrig->get_modeA();
78
if (nu_mode != vfoA.imode) {
79
pthread_mutex_lock(&mutex_xmlrpc);
80
vfoA.imode = vfo.imode = nu_mode;
81
selrig->set_bwA(vfo.iBW = selrig->adjust_bandwidth(nu_mode));
84
send_new_mode(nu_mode);
86
send_new_bandwidth(vfo.iBW);
88
pthread_mutex_unlock(&mutex_xmlrpc);
89
Fl::awake(setModeControl);
90
Fl::awake(updateBandwidthControl);
92
nu_mode = selrig->get_modeB();
93
if (nu_mode != vfoB.imode) {
97
if (!quePTT.empty()) goto exit_read;
99
if (progStatus.poll_bandwidth) {
101
nu_BW = selrig->get_bwA();
102
if (nu_BW != vfoA.iBW) {
103
pthread_mutex_lock(&mutex_xmlrpc);
104
vfoA.iBW = vfo.iBW = nu_BW;
105
Fl::awake(setBWControl);
107
send_new_bandwidth(vfo.iBW);
109
pthread_mutex_unlock(&mutex_xmlrpc);
111
nu_BW = selrig->get_bwB();
112
if (nu_BW != vfoB.iBW) {
118
pthread_mutex_unlock(&mutex_serial);
121
void K3_set_split(int val)
123
pthread_mutex_lock(&mutex_serial);
124
selrig->set_split(val);
125
pthread_mutex_unlock(&mutex_serial);
129
extern char *print(FREQMODE data);
133
pthread_mutex_lock(&mutex_serial);
135
selrig->set_vfoB(vfoB.freq);
136
selrig->set_bwB(vfoB.iBW);
137
selrig->set_modeB(vfoB.imode);
138
FreqDispB->value(vfoB.freq);
139
pthread_mutex_unlock(&mutex_serial);
140
Fl::focus(FreqDispA);
145
FREQMODE temp = vfoA;
146
pthread_mutex_lock(&mutex_serial);
151
selrig->set_vfoB(vfoB.freq);
152
selrig->set_bwB(vfoB.iBW);
153
selrig->set_modeB(vfoB.imode);
155
selrig->set_vfoA(vfoA.freq);
156
selrig->set_bwA(vfoA.iBW);
157
selrig->set_modeA(vfoA.imode);
159
opBW->index(vfoA.iBW);
160
opMODE->index(vfoA.imode);
161
FreqDispA->value(vfoA.freq);
163
FreqDispB->value(vfoB.freq);
165
pthread_mutex_unlock(&mutex_serial);
167
Fl::focus(FreqDispA);