Codebase list flrig / 297c37d
Import Debian changes 1.3.26-1 flrig (1.3.26-1) unstable; urgency=medium * New upstream release * debian: - 0001-C11-errors.patch from upstream (Closes: #822718) - update debian/watch - bump Standards-Version to 3.9.8 Kamal Mostafa authored 7 years ago Christoph Berg committed 5 years ago
36 changed file(s) with 2914 addition(s) and 422 deletion(s). Raw diff Collapse all Expand all
0
1
2 =Version 1.3.26=
3
4 2016-05-13 David Freese <iam_w1hkj@w1hkj.com>
5
6 8547731: IC7200 update
7
8
9 =Version 1.3.25=
10
11 52a21b6: FT900 update
12 acf388b: IC7300
13 50b07b3: FT950
14 9aaab6b: IC-7600 mods
15 c5f6adf: UI small sliders
16 8b73bbb: IC7200 update
17 23604a6: IC7000 exchange vfos
18 db07bd2: key_fldigi
019
120
221 =Version 1.3.24=
3
4 2016-01-16 David Freese <iam_w1hkj@w1hkj.com>
522
623 29f82e6: K3 KX3 mods
724 c1645f0: xmlserver update
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for FLRIG 1.3.24.
2 # Generated by GNU Autoconf 2.69 for FLRIG 1.3.26.
33 #
44 # Report bugs to <w1hkj AT w1hkj DOT com>.
55 #
581581 # Identity of this package.
582582 PACKAGE_NAME='FLRIG'
583583 PACKAGE_TARNAME='flrig'
584 PACKAGE_VERSION='1.3.24'
585 PACKAGE_STRING='FLRIG 1.3.24'
584 PACKAGE_VERSION='1.3.26'
585 PACKAGE_STRING='FLRIG 1.3.26'
586586 PACKAGE_BUGREPORT='w1hkj AT w1hkj DOT com'
587587 PACKAGE_URL=''
588588
13641364 # Omit some internal or obsolete options to make the list less imposing.
13651365 # This message is too long to be a string in the A/UX 3.1 sh.
13661366 cat <<_ACEOF
1367 \`configure' configures FLRIG 1.3.24 to adapt to many kinds of systems.
1367 \`configure' configures FLRIG 1.3.26 to adapt to many kinds of systems.
13681368
13691369 Usage: $0 [OPTION]... [VAR=VALUE]...
13701370
14351435
14361436 if test -n "$ac_init_help"; then
14371437 case $ac_init_help in
1438 short | recursive ) echo "Configuration of FLRIG 1.3.24:";;
1438 short | recursive ) echo "Configuration of FLRIG 1.3.26:";;
14391439 esac
14401440 cat <<\_ACEOF
14411441
15621562 test -n "$ac_init_help" && exit $ac_status
15631563 if $ac_init_version; then
15641564 cat <<\_ACEOF
1565 FLRIG configure 1.3.24
1565 FLRIG configure 1.3.26
15661566 generated by GNU Autoconf 2.69
15671567
15681568 Copyright (C) 2012 Free Software Foundation, Inc.
20712071 This file contains any messages produced by compilers while
20722072 running configure, to aid debugging if configure makes a mistake.
20732073
2074 It was created by FLRIG $as_me 1.3.24, which was
2074 It was created by FLRIG $as_me 1.3.26, which was
20752075 generated by GNU Autoconf 2.69. Invocation command line was
20762076
20772077 $ $0 $@
24242424
24252425 FLRIG_VERSION_MINOR=3
24262426
2427 FLRIG_VERSION_PATCH=.24
2428
2429 FLRIG_VERSION=1.3.24
2427 FLRIG_VERSION_PATCH=.26
2428
2429 FLRIG_VERSION=1.3.26
24302430
24312431
24322432
24362436 $as_echo "#define FLRIG_VERSION_MINOR 3" >>confdefs.h
24372437
24382438
2439 $as_echo "#define FLRIG_VERSION_PATCH \".24\"" >>confdefs.h
2440
2441
2442 $as_echo "#define FLRIG_VERSION \"1.3.24\"" >>confdefs.h
2439 $as_echo "#define FLRIG_VERSION_PATCH \".26\"" >>confdefs.h
2440
2441
2442 $as_echo "#define FLRIG_VERSION \"1.3.26\"" >>confdefs.h
24432443
24442444
24452445 AC_CONFIG_ARGS=$ac_configure_args
30743074
30753075 # Define the identity of the package.
30763076 PACKAGE='flrig'
3077 VERSION='1.3.24'
3077 VERSION='1.3.26'
30783078
30793079
30803080 cat >>confdefs.h <<_ACEOF
74987498 # report actual input values of CONFIG_FILES etc. instead of their
74997499 # values after options handling.
75007500 ac_log="
7501 This file was extended by FLRIG $as_me 1.3.24, which was
7501 This file was extended by FLRIG $as_me 1.3.26, which was
75027502 generated by GNU Autoconf 2.69. Invocation command line was
75037503
75047504 CONFIG_FILES = $CONFIG_FILES
75647564 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
75657565 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
75667566 ac_cs_version="\\
7567 FLRIG config.status 1.3.24
7567 FLRIG config.status 1.3.26
75687568 configured by $0, generated by GNU Autoconf 2.69,
75697569 with options \\"\$ac_cs_config\\"
75707570
1111 dnl contain other characters or be empty
1212 m4_define(FLRIG_MAJOR, [1])
1313 m4_define(FLRIG_MINOR, [3])
14 m4_define(FLRIG_PATCH, [.24])
14 m4_define(FLRIG_PATCH, [.26])
1515
1616 AC_INIT([FLRIG], FLRIG_MAJOR.FLRIG_MINOR[]FLRIG_PATCH, [w1hkj AT w1hkj DOT com])
1717
0 flrig (1.3.26-1) unstable; urgency=medium
1
2 * New upstream release
3 * debian:
4 - 0001-C11-errors.patch from upstream (Closes: #822718)
5 - update debian/watch
6 - bump Standards-Version to 3.9.8
7
8 -- Kamal Mostafa <kamal@whence.com> Thu, 30 Jun 2016 18:55:35 -0700
9
010 flrig (1.3.24-1) unstable; urgency=medium
111
212 * New upstream release
33 Maintainer: Debian Hamradio Maintainers <debian-hams@lists.debian.org>
44 Uploaders: Kamal Mostafa <kamal@whence.com>
55 Build-Depends: debhelper (>= 9.0.0), autotools-dev, libfltk1.3-dev
6 Standards-Version: 3.9.7
6 Standards-Version: 3.9.8
77 Homepage: http://www.w1hkj.com/flrig-help/index.html
88 #Vcs-Git: git://git.debian.org/collab-maint/flrig.git
99 #Vcs-Browser: http://git.debian.org/?p=collab-maint/flrig.git;a=summary
0 From 765519d61e1079a9846a81a3beba5c49d5ed1dae Mon Sep 17 00:00:00 2001
1 From: David Freese <iam_w1hkj@w1hkj.com>
2 Date: Sun, 26 Jun 2016 20:08:41 -0500
3 Subject: C11 errors
4
5 * changes to correct C11 reported warnings/errors
6 ---
7 src/rigs/DELTA-II.cxx | 2 +-
8 src/rigs/IC7600.cxx | 3 ++-
9 src/support/debug.cxx | 1 -
10 src/support/xml_io.cxx | 30 +++++++++++++++---------------
11 4 files changed, 18 insertions(+), 18 deletions(-)
12
13 diff --git a/src/rigs/DELTA-II.cxx b/src/rigs/DELTA-II.cxx
14 index 0cfcbcc..79ee6f2 100644
15 --- a/src/rigs/DELTA-II.cxx
16 +++ b/src/rigs/DELTA-II.cxx
17 @@ -74,7 +74,7 @@ void RIG_TT535::set_vfoA (long freq)
18 cmd.append( to_bcd_be( freq, 8 ) );
19 cmd.append( post );
20 int ret = sendCommand(cmd);
21 - if (ret != 6);
22 + if (ret != 6)
23 checkresponse();
24 }
25
26 diff --git a/src/rigs/IC7600.cxx b/src/rigs/IC7600.cxx
27 index 6a462ec..6c47484 100644
28 --- a/src/rigs/IC7600.cxx
29 +++ b/src/rigs/IC7600.cxx
30 @@ -930,7 +930,7 @@ int RIG_IC7600::get_preamp()
31 cmd.append( post );
32 if (waitFOR(8, "get Pre")) {
33 size_t p = replystr.rfind(resp);
34 - if (p != string::npos)
35 + if (p != string::npos) {
36 preamp_level = replystr[p+6];
37 if (preamp_level == 1) {
38 preamp_label("Amp 1", true);
39 @@ -940,6 +940,7 @@ int RIG_IC7600::get_preamp()
40 preamp_label("OFF", false);
41 preamp_level = 0;
42 }
43 + }
44 }
45 return progStatus.preamp = preamp_level;
46 }
47 diff --git a/src/support/debug.cxx b/src/support/debug.cxx
48 index b866e4e..7f02935 100644
49 --- a/src/support/debug.cxx
50 +++ b/src/support/debug.cxx
51 @@ -164,7 +164,6 @@ void debug::slog(level_e level, const char* func, const char* srcf, int line, co
52
53 void debug::elog(const char* func, const char* srcf, int line, const char* text)
54 {
55 - if (level > debug::level) return;
56 log(ERROR_LEVEL, func, srcf, line, "%s: %s", text, strerror(errno));
57 }
58
59 diff --git a/src/support/xml_io.cxx b/src/support/xml_io.cxx
60 index c0c1cbe..abe37e9 100644
61 --- a/src/support/xml_io.cxx
62 +++ b/src/support/xml_io.cxx
63 @@ -85,7 +85,7 @@ int err_count = 5;
64
65 bool ptt_on = false;
66
67 -int ignore = 0; // skip next "ignore" read loops
68 +int xml_ignore = 0; // skip next "xml_ignore" read loops
69
70 int try_count = CHECK_UPDATE_COUNT;
71
72 @@ -155,7 +155,7 @@ void send_modes() {
73
74 try {
75 execute(rig_set_modes, modes, res);
76 - ignore = 2;
77 + xml_ignore = 2;
78 err_count = 5;
79 } catch (const XmlRpc::XmlRpcException& e) {
80 err_count--;
81 @@ -176,7 +176,7 @@ void send_bandwidths()
82
83 try {
84 execute(rig_set_bandwidths, bandwidths, res);
85 - ignore = 2;
86 + xml_ignore = 2;
87 err_count = 5;
88 } catch (const XmlRpc::XmlRpcException& e) {
89 err_count--;
90 @@ -190,7 +190,7 @@ void send_name()
91 try {
92 XmlRpcValue res;
93 execute(rig_set_name, XmlRpcValue(selrig->name_), res);
94 - ignore = 2;
95 + xml_ignore = 2;
96 err_count = 5;
97 } catch (const XmlRpc::XmlRpcException& e) {
98 err_count--;
99 @@ -204,7 +204,7 @@ void send_ptt_changed(bool PTT)
100 try {
101 XmlRpcValue res;
102 execute((PTT ? main_set_tx : main_set_rx), XmlRpcValue(), res);
103 - ignore = 2;
104 + xml_ignore = 2;
105 err_count = 5;
106 } catch (const XmlRpc::XmlRpcException& e) {
107 err_count--;
108 @@ -219,7 +219,7 @@ void send_new_freq(long freq)
109 xmlvfo.freq = freq;
110 XmlRpcValue f((double)freq), res;
111 execute(rig_set_frequency, f, res);
112 - ignore = 2;
113 + xml_ignore = 2;
114 err_count = 5;
115 } catch (const XmlRpc::XmlRpcException& e) {
116 err_count--;
117 @@ -233,7 +233,7 @@ void send_smeter_val(int val)
118 try {
119 XmlRpcValue mval((int)val), res;
120 execute(rig_set_smeter, mval, res);
121 - ignore = 2;
122 + xml_ignore = 2;
123 err_count = 5;
124 } catch (const XmlRpc::XmlRpcException& e) {
125 err_count--;
126 @@ -247,7 +247,7 @@ void send_pwrmeter_val(int val)
127 try {
128 XmlRpcValue mval((int)val), res;
129 execute(rig_set_pwrmeter, mval, res);
130 - ignore = 2;
131 + xml_ignore = 2;
132 err_count = 5;
133 } catch (const XmlRpc::XmlRpcException& e) {
134 err_count--;
135 @@ -261,7 +261,7 @@ void send_new_notch(int freq)
136 try {
137 XmlRpcValue i(freq), res;
138 execute(rig_set_notch, i, res);
139 - ignore = 2;
140 + xml_ignore = 2;
141 err_count = 5;
142 if (freq == 0)
143 xml_notch_on = false;
144 @@ -299,7 +299,7 @@ void send_new_mode(int md)
145 xmlvfo.imode = md;
146 XmlRpcValue mode(selrig->modes_[md]), res;
147 execute(rig_set_mode, mode, res);
148 - ignore = 2;
149 + xml_ignore = 2;
150 err_count = 5;
151 } catch (const XmlRpc::XmlRpcException& e) {
152 err_count--;
153 @@ -315,7 +315,7 @@ void send_new_bandwidth(int bw)
154 int selbw = (bw > 0x80) ? (bw >> 8 & 0x7F) : bw;
155 XmlRpcValue bandwidth(selrig->bandwidths_[selbw]), res;
156 execute(rig_set_bandwidth, bandwidth, res);
157 - ignore = 2;
158 + xml_ignore = 2;
159 err_count = 5;
160 } catch (const XmlRpc::XmlRpcException& e) {
161 err_count--;
162 @@ -329,7 +329,7 @@ void send_sideband()
163 try {
164 XmlRpcValue sideband(selrig->get_modetype(vfo.imode) == 'U' ? "USB" : "LSB"), res;
165 execute(main_set_wf_sideband, sideband, res);
166 - ignore = 2;
167 + xml_ignore = 2;
168 err_count = 5;
169 } catch (const XmlRpc::XmlRpcException& e) {
170 err_count--;
171 @@ -501,7 +501,7 @@ MilliSleep(500);
172 LOG_ERROR("Connected");
173 Fl::awake(set_fldigi_connect, (void *)1);
174 err_count = 5;
175 - ignore = 2;
176 + xml_ignore = 2;
177 } catch (const XmlRpc::XmlRpcException& e) {
178 throw e;
179 }
180 @@ -526,8 +526,8 @@ void send_no_rig()
181
182 static void get_fldigi_status()
183 {
184 - if (ignore) {
185 - --ignore;
186 + if (xml_ignore) {
187 + --xml_ignore;
188 return;
189 }
190 XmlRpcValue status;
191 --
192 2.7.4
193
0 0001-C11-errors.patch
00 version=3
1 http://www.w1hkj.com/downloads/flrig/flrig-(.+).tar.gz
1 http://sf.net/fldigi/flrig-(\d\S*)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
162162 rigs/IC7000.cxx \
163163 rigs/IC7100.cxx \
164164 rigs/IC7200.cxx \
165 rigs/IC7300.cxx \
165166 rigs/IC7410.cxx \
166167 rigs/IC7600.cxx \
167168 rigs/IC7800.cxx \
280281 include/IC7100.h \
281282 include/IC7410.h \
282283 include/IC7200.h \
284 include/IC7300.h \
283285 include/IC7600.h \
284286 include/IC7700.h \
285287 include/IC7800.h \
129129 rigs/IC718.cxx rigs/IC728.cxx rigs/IC735.cxx rigs/IC746.cxx \
130130 rigs/IC756.cxx rigs/IC756PRO2.cxx rigs/IC756PRO3.cxx \
131131 rigs/IC910.cxx rigs/IC7000.cxx rigs/IC7100.cxx rigs/IC7200.cxx \
132 rigs/IC7410.cxx rigs/IC7600.cxx rigs/IC7800.cxx \
133 rigs/IC9100.cxx rigs/IC7700.cxx rigs/K2.cxx rigs/K3.cxx \
134 rigs/KX3.cxx rigs/PCR1000.cxx rigs/RAY152.cxx rigs/TS140.cxx \
135 rigs/TS450S.cxx rigs/TS480HX.cxx rigs/TS480SAT.cxx \
136 rigs/TS570.cxx rigs/TS590S.cxx rigs/TS590SG.cxx rigs/TS990.cxx \
137 rigs/TS870S.cxx rigs/TS2000.cxx rigs/TT516.cxx \
138 rigs/DELTA-II.cxx rigs/TT538.cxx rigs/TT550.cxx rigs/TT563.cxx \
139 rigs/TT566.cxx rigs/TT588.cxx rigs/TT599.cxx support/debug.cxx \
132 rigs/IC7300.cxx rigs/IC7410.cxx rigs/IC7600.cxx \
133 rigs/IC7800.cxx rigs/IC9100.cxx rigs/IC7700.cxx rigs/K2.cxx \
134 rigs/K3.cxx rigs/KX3.cxx rigs/PCR1000.cxx rigs/RAY152.cxx \
135 rigs/TS140.cxx rigs/TS450S.cxx rigs/TS480HX.cxx \
136 rigs/TS480SAT.cxx rigs/TS570.cxx rigs/TS590S.cxx \
137 rigs/TS590SG.cxx rigs/TS990.cxx rigs/TS870S.cxx \
138 rigs/TS2000.cxx rigs/TT516.cxx rigs/DELTA-II.cxx \
139 rigs/TT538.cxx rigs/TT550.cxx rigs/TT563.cxx rigs/TT566.cxx \
140 rigs/TT588.cxx rigs/TT599.cxx support/debug.cxx \
140141 support/dialogs.cxx support/ptt.cxx support/rig_io.cxx \
141142 support/serial.cxx support/socket.cxx support/socket_io.cxx \
142143 support/status.cxx support/support.cxx support/threads.cxx \
182183 rigs/flrig-IC756.$(OBJEXT) rigs/flrig-IC756PRO2.$(OBJEXT) \
183184 rigs/flrig-IC756PRO3.$(OBJEXT) rigs/flrig-IC910.$(OBJEXT) \
184185 rigs/flrig-IC7000.$(OBJEXT) rigs/flrig-IC7100.$(OBJEXT) \
185 rigs/flrig-IC7200.$(OBJEXT) rigs/flrig-IC7410.$(OBJEXT) \
186 rigs/flrig-IC7600.$(OBJEXT) rigs/flrig-IC7800.$(OBJEXT) \
187 rigs/flrig-IC9100.$(OBJEXT) rigs/flrig-IC7700.$(OBJEXT) \
188 rigs/flrig-K2.$(OBJEXT) rigs/flrig-K3.$(OBJEXT) \
189 rigs/flrig-KX3.$(OBJEXT) rigs/flrig-PCR1000.$(OBJEXT) \
190 rigs/flrig-RAY152.$(OBJEXT) rigs/flrig-TS140.$(OBJEXT) \
191 rigs/flrig-TS450S.$(OBJEXT) rigs/flrig-TS480HX.$(OBJEXT) \
192 rigs/flrig-TS480SAT.$(OBJEXT) rigs/flrig-TS570.$(OBJEXT) \
193 rigs/flrig-TS590S.$(OBJEXT) rigs/flrig-TS590SG.$(OBJEXT) \
194 rigs/flrig-TS990.$(OBJEXT) rigs/flrig-TS870S.$(OBJEXT) \
195 rigs/flrig-TS2000.$(OBJEXT) rigs/flrig-TT516.$(OBJEXT) \
196 rigs/flrig-DELTA-II.$(OBJEXT) rigs/flrig-TT538.$(OBJEXT) \
197 rigs/flrig-TT550.$(OBJEXT) rigs/flrig-TT563.$(OBJEXT) \
198 rigs/flrig-TT566.$(OBJEXT) rigs/flrig-TT588.$(OBJEXT) \
199 rigs/flrig-TT599.$(OBJEXT) support/flrig-debug.$(OBJEXT) \
200 support/flrig-dialogs.$(OBJEXT) support/flrig-ptt.$(OBJEXT) \
201 support/flrig-rig_io.$(OBJEXT) support/flrig-serial.$(OBJEXT) \
202 support/flrig-socket.$(OBJEXT) \
186 rigs/flrig-IC7200.$(OBJEXT) rigs/flrig-IC7300.$(OBJEXT) \
187 rigs/flrig-IC7410.$(OBJEXT) rigs/flrig-IC7600.$(OBJEXT) \
188 rigs/flrig-IC7800.$(OBJEXT) rigs/flrig-IC9100.$(OBJEXT) \
189 rigs/flrig-IC7700.$(OBJEXT) rigs/flrig-K2.$(OBJEXT) \
190 rigs/flrig-K3.$(OBJEXT) rigs/flrig-KX3.$(OBJEXT) \
191 rigs/flrig-PCR1000.$(OBJEXT) rigs/flrig-RAY152.$(OBJEXT) \
192 rigs/flrig-TS140.$(OBJEXT) rigs/flrig-TS450S.$(OBJEXT) \
193 rigs/flrig-TS480HX.$(OBJEXT) rigs/flrig-TS480SAT.$(OBJEXT) \
194 rigs/flrig-TS570.$(OBJEXT) rigs/flrig-TS590S.$(OBJEXT) \
195 rigs/flrig-TS590SG.$(OBJEXT) rigs/flrig-TS990.$(OBJEXT) \
196 rigs/flrig-TS870S.$(OBJEXT) rigs/flrig-TS2000.$(OBJEXT) \
197 rigs/flrig-TT516.$(OBJEXT) rigs/flrig-DELTA-II.$(OBJEXT) \
198 rigs/flrig-TT538.$(OBJEXT) rigs/flrig-TT550.$(OBJEXT) \
199 rigs/flrig-TT563.$(OBJEXT) rigs/flrig-TT566.$(OBJEXT) \
200 rigs/flrig-TT588.$(OBJEXT) rigs/flrig-TT599.$(OBJEXT) \
201 support/flrig-debug.$(OBJEXT) support/flrig-dialogs.$(OBJEXT) \
202 support/flrig-ptt.$(OBJEXT) support/flrig-rig_io.$(OBJEXT) \
203 support/flrig-serial.$(OBJEXT) support/flrig-socket.$(OBJEXT) \
203204 support/flrig-socket_io.$(OBJEXT) \
204205 support/flrig-status.$(OBJEXT) support/flrig-support.$(OBJEXT) \
205206 support/flrig-threads.$(OBJEXT) support/flrig-util.$(OBJEXT) \
483484 rigs/IC728.cxx rigs/IC735.cxx rigs/IC746.cxx rigs/IC756.cxx \
484485 rigs/IC756PRO2.cxx rigs/IC756PRO3.cxx rigs/IC910.cxx \
485486 rigs/IC7000.cxx rigs/IC7100.cxx rigs/IC7200.cxx \
486 rigs/IC7410.cxx rigs/IC7600.cxx rigs/IC7800.cxx \
487 rigs/IC9100.cxx rigs/IC7700.cxx rigs/K2.cxx rigs/K3.cxx \
488 rigs/KX3.cxx rigs/PCR1000.cxx rigs/RAY152.cxx rigs/TS140.cxx \
489 rigs/TS450S.cxx rigs/TS480HX.cxx rigs/TS480SAT.cxx \
490 rigs/TS570.cxx rigs/TS590S.cxx rigs/TS590SG.cxx rigs/TS990.cxx \
491 rigs/TS870S.cxx rigs/TS2000.cxx rigs/TT516.cxx \
492 rigs/DELTA-II.cxx rigs/TT538.cxx rigs/TT550.cxx rigs/TT563.cxx \
493 rigs/TT566.cxx rigs/TT588.cxx rigs/TT599.cxx support/debug.cxx \
487 rigs/IC7300.cxx rigs/IC7410.cxx rigs/IC7600.cxx \
488 rigs/IC7800.cxx rigs/IC9100.cxx rigs/IC7700.cxx rigs/K2.cxx \
489 rigs/K3.cxx rigs/KX3.cxx rigs/PCR1000.cxx rigs/RAY152.cxx \
490 rigs/TS140.cxx rigs/TS450S.cxx rigs/TS480HX.cxx \
491 rigs/TS480SAT.cxx rigs/TS570.cxx rigs/TS590S.cxx \
492 rigs/TS590SG.cxx rigs/TS990.cxx rigs/TS870S.cxx \
493 rigs/TS2000.cxx rigs/TT516.cxx rigs/DELTA-II.cxx \
494 rigs/TT538.cxx rigs/TT550.cxx rigs/TT563.cxx rigs/TT566.cxx \
495 rigs/TT588.cxx rigs/TT599.cxx support/debug.cxx \
494496 support/dialogs.cxx support/ptt.cxx support/rig_io.cxx \
495497 support/serial.cxx support/socket.cxx support/socket_io.cxx \
496498 support/status.cxx support/support.cxx support/threads.cxx \
546548 include/IC728.h include/IC735.h include/IC746.h \
547549 include/IC756.h include/IC756PRO2.h include/IC756PRO3.h \
548550 include/IC910.h include/IC7000.h include/IC7100.h \
549 include/IC7410.h include/IC7200.h include/IC7600.h \
550 include/IC7700.h include/IC7800.h include/IC9100.h \
551 include/images.h include/K2.h include/K3.h include/K3_ui.h \
552 include/KX3.h include/KX3_ui.h include/PCR1000.h \
553 include/RAY152.h include/mingw.h include/ptt.h include/rig.h \
554 include/rigs.h include/rigbase.h include/rig_io.h \
555 include/rigpanel.h include/serial.h include/xml_io.h \
556 include/socket.h include/socket_io.h include/status.h \
557 include/support.h include/threads.h include/TS140.h \
558 include/TS450S.h include/TS480HX.h include/TS480SAT.h \
559 include/TS570.h include/TS590S.h include/TS590SG.h \
560 include/TS870S.h include/TS990.h include/TS2000.h \
561 include/TT516.h include/DELTA-II.h include/TT538.h \
562 include/TT550.h include/TT563.h include/TT566.h \
563 include/TT588.h include/TT599.h include/ui.h include/util.h \
564 include/ValueSlider.h include/xml_server.h images/alc.xbm \
565 images/P25.xbm images/P50.xbm images/P100.xbm images/P200.xbm \
566 images/P200log.xbm images/S60.xbm images/SWR.xbm \
567 $(srcdir)/../data/flrig.desktop $(srcdir)/../data/flrig.xpm \
568 $(srcdir)/../data/win32/fl_app.nsi \
551 include/IC7410.h include/IC7200.h include/IC7300.h \
552 include/IC7600.h include/IC7700.h include/IC7800.h \
553 include/IC9100.h include/images.h include/K2.h include/K3.h \
554 include/K3_ui.h include/KX3.h include/KX3_ui.h \
555 include/PCR1000.h include/RAY152.h include/mingw.h \
556 include/ptt.h include/rig.h include/rigs.h include/rigbase.h \
557 include/rig_io.h include/rigpanel.h include/serial.h \
558 include/xml_io.h include/socket.h include/socket_io.h \
559 include/status.h include/support.h include/threads.h \
560 include/TS140.h include/TS450S.h include/TS480HX.h \
561 include/TS480SAT.h include/TS570.h include/TS590S.h \
562 include/TS590SG.h include/TS870S.h include/TS990.h \
563 include/TS2000.h include/TT516.h include/DELTA-II.h \
564 include/TT538.h include/TT550.h include/TT563.h \
565 include/TT566.h include/TT588.h include/TT599.h include/ui.h \
566 include/util.h include/ValueSlider.h include/xml_server.h \
567 images/alc.xbm images/P25.xbm images/P50.xbm images/P100.xbm \
568 images/P200.xbm images/P200log.xbm images/S60.xbm \
569 images/SWR.xbm $(srcdir)/../data/flrig.desktop \
570 $(srcdir)/../data/flrig.xpm $(srcdir)/../data/win32/fl_app.nsi \
569571 $(srcdir)/../data/win32/flrig.ico \
570572 $(srcdir)/../scripts/mknsisinst.sh \
571573 $(srcdir)/../scripts/buildmxe.sh \
810812 rigs/$(DEPDIR)/$(am__dirstamp)
811813 rigs/flrig-IC7200.$(OBJEXT): rigs/$(am__dirstamp) \
812814 rigs/$(DEPDIR)/$(am__dirstamp)
815 rigs/flrig-IC7300.$(OBJEXT): rigs/$(am__dirstamp) \
816 rigs/$(DEPDIR)/$(am__dirstamp)
813817 rigs/flrig-IC7410.$(OBJEXT): rigs/$(am__dirstamp) \
814818 rigs/$(DEPDIR)/$(am__dirstamp)
815819 rigs/flrig-IC7600.$(OBJEXT): rigs/$(am__dirstamp) \
987991 @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC718.Po@am__quote@
988992 @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC7200.Po@am__quote@
989993 @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC728.Po@am__quote@
994 @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC7300.Po@am__quote@
990995 @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC735.Po@am__quote@
991996 @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC7410.Po@am__quote@
992997 @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC746.Po@am__quote@
18301835 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
18311836 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flrig_CPPFLAGS) $(CPPFLAGS) $(flrig_CXXFLAGS) $(CXXFLAGS) -c -o rigs/flrig-IC7200.obj `if test -f 'rigs/IC7200.cxx'; then $(CYGPATH_W) 'rigs/IC7200.cxx'; else $(CYGPATH_W) '$(srcdir)/rigs/IC7200.cxx'; fi`
18321837
1838 rigs/flrig-IC7300.o: rigs/IC7300.cxx
1839 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flrig_CPPFLAGS) $(CPPFLAGS) $(flrig_CXXFLAGS) $(CXXFLAGS) -MT rigs/flrig-IC7300.o -MD -MP -MF rigs/$(DEPDIR)/flrig-IC7300.Tpo -c -o rigs/flrig-IC7300.o `test -f 'rigs/IC7300.cxx' || echo '$(srcdir)/'`rigs/IC7300.cxx
1840 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) rigs/$(DEPDIR)/flrig-IC7300.Tpo rigs/$(DEPDIR)/flrig-IC7300.Po
1841 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='rigs/IC7300.cxx' object='rigs/flrig-IC7300.o' libtool=no @AMDEPBACKSLASH@
1842 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1843 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flrig_CPPFLAGS) $(CPPFLAGS) $(flrig_CXXFLAGS) $(CXXFLAGS) -c -o rigs/flrig-IC7300.o `test -f 'rigs/IC7300.cxx' || echo '$(srcdir)/'`rigs/IC7300.cxx
1844
1845 rigs/flrig-IC7300.obj: rigs/IC7300.cxx
1846 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flrig_CPPFLAGS) $(CPPFLAGS) $(flrig_CXXFLAGS) $(CXXFLAGS) -MT rigs/flrig-IC7300.obj -MD -MP -MF rigs/$(DEPDIR)/flrig-IC7300.Tpo -c -o rigs/flrig-IC7300.obj `if test -f 'rigs/IC7300.cxx'; then $(CYGPATH_W) 'rigs/IC7300.cxx'; else $(CYGPATH_W) '$(srcdir)/rigs/IC7300.cxx'; fi`
1847 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) rigs/$(DEPDIR)/flrig-IC7300.Tpo rigs/$(DEPDIR)/flrig-IC7300.Po
1848 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='rigs/IC7300.cxx' object='rigs/flrig-IC7300.obj' libtool=no @AMDEPBACKSLASH@
1849 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1850 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flrig_CPPFLAGS) $(CPPFLAGS) $(flrig_CXXFLAGS) $(CXXFLAGS) -c -o rigs/flrig-IC7300.obj `if test -f 'rigs/IC7300.cxx'; then $(CYGPATH_W) 'rigs/IC7300.cxx'; else $(CYGPATH_W) '$(srcdir)/rigs/IC7300.cxx'; fi`
1851
18331852 rigs/flrig-IC7410.o: rigs/IC7410.cxx
18341853 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(flrig_CPPFLAGS) $(CPPFLAGS) $(flrig_CXXFLAGS) $(CXXFLAGS) -MT rigs/flrig-IC7410.o -MD -MP -MF rigs/$(DEPDIR)/flrig-IC7410.Tpo -c -o rigs/flrig-IC7410.o `test -f 'rigs/IC7410.cxx' || echo '$(srcdir)/'`rigs/IC7410.cxx
18351854 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) rigs/$(DEPDIR)/flrig-IC7410.Tpo rigs/$(DEPDIR)/flrig-IC7410.Po
496496 }
497497
498498 static void cb_sldrRFGAIN(Fl_Wheel_Value_Slider*, void*) {
499 if ( Fl::event_button() == FL_RIGHT_MOUSE )
500 progStatus.ft950_rg_reverse = !progStatus.ft950_rg_reverse;
499501 setRFGAIN();
500502 }
501503
12881288
12891289 mnuRestoreData = (menu_small_menu+12);
12901290 mnuKeepData = (menu_small_menu+13);
1291 mnuTooltips = (menu_small_menu+18);
1292 mnuSchema = (menu_small_menu+17);
1291 mnuSchema = (menu_small_menu+18);
1292 mnuTooltips = (menu_small_menu+19);
12931293
12941294 txt_encA = new Fl_Output( 425 - 90, 1, 90, 20, "");
12951295 txt_encA->box(FL_THIN_DOWN_BOX);
3939 Fl_Int_Input *txtCIV=(Fl_Int_Input *)0;
4040 Fl_Button *btnCIVdefault=(Fl_Button *)0;
4141 Fl_Check_Button *btnUSBaudio=(Fl_Check_Button *)0;
42 Fl_Check_Button *btn_key_fldigi=(Fl_Check_Button *)0;
4342 Fl_Group *tabTCPIP = (Fl_Group *)0;
4443 Fl_Input2 *inp_tcpip_addr = (Fl_Input2 *)0;
4544 Fl_Input2 *inp_tcpip_port = (Fl_Input2 *)0;
255254 cbUSBaudio();
256255 }
257256
258 static void cb_btn_key_fldigi(Fl_Check_Button* o, void*) {
259 progStatus.key_fldigi = o->value();
260 }
261
262257 static void cb_selectSepPTTPort(Fl_ComboBox*, void*) {
263258 btnOkXcvrDialog->labelcolor(FL_RED);
264259 btnOkXcvrDialog->redraw();
633628 btnUSBaudio->down_box(FL_DOWN_BOX);
634629 btnUSBaudio->callback((Fl_Callback*)cb_btnUSBaudio);
635630
636 btn_key_fldigi = new Fl_Check_Button(375, 222, 85, 15, _("key fldigi"));
637 btn_key_fldigi->tooltip(_("PTT keys fldigi modem"));
638 btn_key_fldigi->down_box(FL_DOWN_BOX);
639 btn_key_fldigi->callback((Fl_Callback*)cb_btn_key_fldigi);
640 btn_key_fldigi->value(progStatus.key_fldigi);
641
642631 xcr_grp6->end();
643632
644633 tabPrimary->end();
44 #define BUILD_BUILD_PLATFORM "i686-pc-linux-gnu"
55
66 /* Compiler */
7 #define BUILD_COMPILER "gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) "
7 #define BUILD_COMPILER "gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) "
88
99 /* Configure arguments */
1010 #define BUILD_CONFIGURE_ARGS ""
1111
1212 /* Build date */
13 #define BUILD_DATE "Thu Jan 21 17:45:13 CST 2016"
13 #define BUILD_DATE "Thu Jun 9 05:28:06 CDT 2016"
1414
1515 /* Build host */
1616 #define BUILD_HOST "dave-dc7600"
3737 #define FLRIG_FLTK_API_MINOR 3
3838
3939 /* version string */
40 #define FLRIG_VERSION "1.3.24"
40 #define FLRIG_VERSION "1.3.26"
4141
4242 /* major version number */
4343 #define FLRIG_VERSION_MAJOR 1
4646 #define FLRIG_VERSION_MINOR 3
4747
4848 /* patch/alpha version string */
49 #define FLRIG_VERSION_PATCH ".24"
49 #define FLRIG_VERSION_PATCH ".26"
5050
5151 /* FLTK version */
5252 #define FLTK_BUILD_VERSION "1.3.3"
190190 #define PACKAGE_NAME "FLRIG"
191191
192192 /* Define to the full name and version of this package. */
193 #define PACKAGE_STRING "FLRIG 1.3.24"
193 #define PACKAGE_STRING "FLRIG 1.3.26"
194194
195195 /* Define to the one symbol short name of this package. */
196196 #define PACKAGE_TARNAME "flrig"
199199 #define PACKAGE_URL ""
200200
201201 /* Define to the version of this package. */
202 #define PACKAGE_VERSION "1.3.24"
202 #define PACKAGE_VERSION "1.3.26"
203203
204204 /* Define to 1 if you have the ANSI C header files. */
205205 #define STDC_HEADERS 1
233233 #define USE_X 1
234234
235235 /* Version number of package */
236 #define VERSION "1.3.24"
236 #define VERSION "1.3.26"
237237
238238 /* x version */
239239 #define X_BUILD_VERSION "1.6.2"
11 // Copyright (C) 2014
22 // David Freese, W1HKJ
33 //
4 // 2015-10-04
5 // adapted from FT890.h by Ernst F. Schroeder DJ7HS
4 // 2015-10-04 adapted from FT890.h by Ernst F. Schroeder DJ7HS
5 // 2016-04-03 made getinfo() private DJ7HS
66 //
77 // This file is part of flrig.
88 //
4646
4747 void initialize();
4848
49 bool get_info();
50
5149 bool can_split() { return true;}
5250 void set_split(bool val);
5351 int get_split();
7977
8078 private:
8179 void init_cmd();
80 bool get_info();
81
8282 };
8383
8484
7171 void set_split(bool v);
7272 int get_split();
7373
74 bool canswap() { return true; }
75 void swapvfos();
76
7477 int get_mic_gain();
7578 void set_mic_gain(int val);
7679 void get_mic_gain_min_max_step(int &min, int &max, int &step);
2323 #include "ICbase.h"
2424
2525 class RIG_IC7200 : public RIG_ICOM {
26 private:
27 int atten_level;
2628 public:
2729 RIG_IC7200();
2830 ~RIG_IC7200(){}
5456 int get_volume_control();
5557 void get_vol_min_max_step(int &min, int &max, int &step);
5658 void set_attenuator(int val);
59 int get_attenuator();
5760 int get_smeter();
5861 int get_power_out(void);
5962 int get_swr(void);
7073 int get_rf_gain();
7174 void set_squelch(int val);
7275 int get_squelch();
76
7377 void set_power_control(double val);
7478 int get_power_control();
79
7580 void set_mic_gain(int val);
7681 int get_mic_gain();
7782 void get_mic_gain_min_max_step(int &min, int &max, int &step);
83
84 void set_notch(bool on, int val);
85 bool get_notch(int &val);
86 void get_notch_min_max_step(int &min, int &max, int &step);
87
7888 int adjust_bandwidth(int m);
7989 int def_bandwidth(int m);
8090 void set_compression();
0 // ----------------------------------------------------------------------------
1 // Copyright (C) 2014
2 // David Freese, W1HKJ
3 //
4 // This file is part of flrig.
5 //
6 // flrig is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // flrig is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 // ----------------------------------------------------------------------------
19
20 #ifndef _IC7300_H
21 #define _IC7300_H
22
23 #include "IC746.h"
24
25 class RIG_IC7300 : public RIG_ICOM {
26 protected:
27 int preamp_level;
28 int atten_level;
29 public:
30 RIG_IC7300();
31 ~RIG_IC7300(){}
32
33 void initialize();
34
35 void selectA();
36 void selectB();
37
38 long get_vfoA ();
39 void set_vfoA (long freq);
40
41 long get_vfoB(void);
42 void set_vfoB(long f);
43
44 void set_modeA(int val);
45 int get_modeA();
46
47 void set_modeB(int val);
48 int get_modeB();
49
50 bool can_split();
51 void set_split(bool);
52 int get_split();
53
54 void swapvfos();
55 bool canswap() { return true;}
56
57 void set_bwA(int val);
58 int get_bwA();
59
60 void set_bwB(int val);
61 int get_bwB();
62
63 int adjust_bandwidth(int m);
64 int def_bandwidth(int m);
65
66 void set_mic_gain(int v);
67 void get_mic_gain_min_max_step(int &min, int &max, int &step);
68 int get_mic_gain();
69
70 void set_compression();
71 void get_comp_min_max_step(int &min, int &max, int &step) {
72 min = 0; max = 10; step = 1; }
73
74 void set_vox_onoff();
75 void set_vox_gain();
76 void set_vox_anti();
77 void set_vox_hang();
78 void get_vox_hang_min_max_step(int &min, int &max, int &step) {
79 min = 0; max = 200; step = 10; } //alh
80
81 void get_cw_wpm_min_max(int &min, int &max) {
82 min = 6; max = 60; }
83
84 void get_cw_qsk_min_max_step(double &min, double &max, double &step) {
85 min = 2.0; max = 13.0; step = 0.1; }
86
87 void get_cw_spot_tone_min_max_step(int &min, int &max, int &step) {
88 min = 300; max = 900; step = 5; }
89
90 void set_cw_wpm();
91 void set_cw_qsk();
92 void set_cw_spot_tone();
93 void set_cw_vol();
94
95 const char **bwtable(int m) {return bandwidths_;}
96
97 void set_PTT_control(int val);
98
99 void set_volume_control(int val);
100 int get_volume_control();
101 void get_vol_min_max_step(int &min, int &max, int &step);
102
103 int get_smeter();
104 int get_power_out(void);
105 int get_swr(void);
106 int get_alc(void);
107
108 void set_power_control(double val);
109 int get_power_control();
110 void get_pc_min_max_step(double &min, double &max, double &step);
111
112 void set_rf_gain(int val);
113 int get_rf_gain();
114 void get_rf_min_max_step(double &min, double &max, double &step);
115
116 void set_preamp(int val);
117 int get_preamp();
118
119 void set_attenuator(int val);
120 int get_attenuator();
121
122 void set_noise(bool val);
123 int get_noise();
124 void set_noise_reduction(int val);
125 int get_noise_reduction();
126 void set_noise_reduction_val(int val);
127 int get_noise_reduction_val();
128
129 void set_squelch(int val);
130 int get_squelch();
131
132 void set_notch(bool on, int val);
133 bool get_notch(int &val);
134 void get_notch_min_max_step(int &min, int &max, int &step);
135
136 void set_auto_notch(int val);
137 int get_auto_notch();
138
139 void tune_rig();
140
141 };
142
143 #endif
2222
2323 #include "IC746.h"
2424
25 class RIG_IC7600 : public RIG_IC746PRO {
25 class RIG_IC7600 : public RIG_ICOM {
26 protected:
27 int preamp_level;
28 int atten_level;
2629 public:
2730 RIG_IC7600();
2831 ~RIG_IC7600(){}
3134
3235 void selectA();
3336 void selectB();
37
38 long get_vfoA ();
39 void set_vfoA (long freq);
40
41 long get_vfoB(void);
42 void set_vfoB(long f);
3443
3544 void set_modeA(int val);
3645 int get_modeA();
5463 int adjust_bandwidth(int m);
5564 int def_bandwidth(int m);
5665
57 void set_attenuator( int val ); //alh
58 int get_attenuator(); //alh
5966 void set_mic_gain(int v);
67 void get_mic_gain_min_max_step(int &min, int &max, int &step);
68 int get_mic_gain();
6069
6170 void set_compression();
6271 void get_comp_min_max_step(int &min, int &max, int &step) {
6372 min = 0; max = 10; step = 1; }
73
6474 void set_vox_onoff();
6575 void set_vox_gain();
6676 void set_vox_anti();
8494
8595 const char **bwtable(int m) {return bandwidths_;}
8696
97 void set_PTT_control(int val);
98
99 void set_volume_control(int val);
100 int get_volume_control();
101 void get_vol_min_max_step(int &min, int &max, int &step);
102
103 int get_smeter();
104 int get_power_out(void);
105 int get_swr(void);
106 int get_alc(void);
107
108 void set_power_control(double val);
109 int get_power_control();
110 void get_pc_min_max_step(double &min, double &max, double &step);
111
112 void set_rf_gain(int val);
113 int get_rf_gain();
114 void get_rf_min_max_step(double &min, double &max, double &step);
115
116 void set_preamp(int val);
117 int get_preamp();
118
119 void set_attenuator(int val);
120 int get_attenuator();
121
122 void set_noise(bool val);
123 int get_noise();
124 void set_noise_reduction(int val);
125 int get_noise_reduction();
126 void set_noise_reduction_val(int val);
127 int get_noise_reduction_val();
128
129 void set_squelch(int val);
130 int get_squelch();
131
132 void set_notch(bool on, int val);
133 bool get_notch(int &val);
134 void get_notch_min_max_step(int &min, int &max, int &step);
135
136 void set_auto_notch(int val);
137 int get_auto_notch();
138
139 void tune_rig();
87140
88141 };
89142
6363 const char * SH_tooltip;
6464 const char * SH_label;
6565 const int * bw_vals_;
66
67 int bw_size_;
6668
6769 GUI *widgets;
6870
5757 #include "IC7100.h"
5858 #include "IC7410.h"
5959 #include "IC7200.h"
60 #include "IC7300.h"
6061 #include "IC7600.h"
6162 #include "IC7700.h"
6263 #include "IC7800.h"
122123 extern RIG_IC7000 rig_IC7000; // 34
123124 extern RIG_IC7100 rig_IC7100; // 35
124125 extern RIG_IC7200 rig_IC7200; // 36
125 extern RIG_IC7410 rig_IC7410; // 37
126 extern RIG_IC7600 rig_IC7600; // 38
127 extern RIG_IC7700 rig_IC7700; // 39
128 extern RIG_IC7800 rig_IC7800; // 40
129 extern RIG_IC9100 rig_IC9100; // 41
130 extern RIG_IC910H rig_IC910H; // 42
131 extern RIG_K2 rig_K2; // 43
132 extern RIG_K3 rig_K3; // 44
133 extern RIG_KX3 rig_KX3; // 45
134 extern RIG_PCR1000 rig_PCR1000; // 46
135 extern RIG_RAY152 rig_RAY152; // 47
136 extern RIG_TS140 rig_TS140; // 48
137 extern RIG_TS450S rig_TS450S; // 49
138 extern RIG_TS480HX rig_TS480HX; // 50
139 extern RIG_TS480SAT rig_TS480SAT; // 51
140 extern RIG_TS570 rig_TS570; // 52
141 extern RIG_TS590S rig_TS590S; // 53
142 extern RIG_TS590SG rig_TS590SG; // 54
143 extern RIG_TS870S rig_TS870S; // 55 wbx
144 extern RIG_TS990 rig_TS990; // 56 G0HIX
145 extern RIG_TS2000 rig_TS2000; // 57
146 extern RIG_TT516 rig_TT516; // 58
147 extern RIG_TT535 rig_TT535; // 59
148 extern RIG_TT538 rig_TT538; // 60
149 extern RIG_TT550 rig_TT550; // 61
150 extern RIG_TT563 rig_TT563; // 62
151 extern RIG_TT566 rig_TT566; // 63
152 extern RIG_TT588 rig_TT588; // 64
153 extern RIG_TT599 rig_TT599; // 65
126 extern RIG_IC7300 rig_IC7300; // 37
127 extern RIG_IC7410 rig_IC7410; // 38
128 extern RIG_IC7600 rig_IC7600; // 39
129 extern RIG_IC7700 rig_IC7700; // 40
130 extern RIG_IC7800 rig_IC7800; // 41
131 extern RIG_IC9100 rig_IC9100; // 42
132 extern RIG_IC910H rig_IC910H; // 43
133 extern RIG_K2 rig_K2; // 44
134 extern RIG_K3 rig_K3; // 45
135 extern RIG_KX3 rig_KX3; // 46
136 extern RIG_PCR1000 rig_PCR1000; // 47
137 extern RIG_RAY152 rig_RAY152; // 48
138 extern RIG_TS140 rig_TS140; // 49
139 extern RIG_TS450S rig_TS450S; // 50
140 extern RIG_TS480HX rig_TS480HX; // 51
141 extern RIG_TS480SAT rig_TS480SAT; // 52
142 extern RIG_TS570 rig_TS570; // 53
143 extern RIG_TS590S rig_TS590S; // 54
144 extern RIG_TS590SG rig_TS590SG; // 55
145 extern RIG_TS870S rig_TS870S; // 56 wbx
146 extern RIG_TS990 rig_TS990; // 57 G0HIX
147 extern RIG_TS2000 rig_TS2000; // 58
148 extern RIG_TT516 rig_TT516; // 59
149 extern RIG_TT535 rig_TT535; // 60
150 extern RIG_TT538 rig_TT538; // 61
151 extern RIG_TT550 rig_TT550; // 62
152 extern RIG_TT563 rig_TT563; // 63
153 extern RIG_TT566 rig_TT566; // 64
154 extern RIG_TT588 rig_TT588; // 65
155 extern RIG_TT599 rig_TT599; // 66
154156
155157 #endif
140140
141141 int split;
142142
143 bool key_fldigi;
144
145143 int rx_avg;
146144 int rx_peak;
147145 int pwr_avg;
148146 int pwr_peak;
149147 int pwr_scale;
148
149 // ft950 reverse RG0; readings
150
151 bool ft950_rg_reverse;
150152
151153 //============= transceiver specific prameters
152154 //tt550 controls
276278 void loadLastState();
277279 bool loadXcvrState(string);
278280 void UI_laststate();
281
282 string info();
279283 };
280284
281285 extern status progStatus;
55 // the FT-900 has two vfos and can work split
66 // but it cannot change the (hidden) alternate vfo
77 // 2015-12-03 1st stable version DJ7HS
8 // 2016-04-03 call get_info() within get_vfoA and get_vfoB DJ7HS
89 //
910 // This file is part of flrig.
1011 //
6263
6364 has_smeter =
6465 has_power_out =
65 has_get_info =
6666 has_ptt_control =
6767 has_split =
6868 has_split_AB =
6969 has_getvfoAorB =
7070 has_mode_control = true;
71
72 has_get_info = false; // to be sure, it's needed that way
7173
7274 precision = 10;
7375 ndigits = 7;
272274
273275 long RIG_FT900::get_vfoA ()
274276 {
277 if (!useB) {
278 get_info();
279 }
275280 return A.freq;
276281 }
277282
302307
303308 long RIG_FT900::get_vfoB()
304309 {
310 if (useB) {
311 get_info();
312 }
305313 return B.freq;
306314 }
307315
11431143 void RIG_FT950::set_rf_gain(int val)
11441144 {
11451145 cmd = "RG0000;";
1146 int rfval = (int)(val * 2.50);
1146
1147 if (progStatus.ft950_rg_reverse) val = 100 - val;
1148 if (val > 100) val = 100;
1149 if (val < 0) val = 0;
1150 int rfval = (int)(val * 2.5);
11471151 for (int i = 5; i > 2; i--) {
11481152 cmd[i] = rfval % 10 + '0';
11491153 rfval /= 10;
11651169 rfval *= 10;
11661170 rfval += replystr[p+i] - '0';
11671171 }
1168 rfval = (int)(rfval / 2.50);
1172 rfval = (int)(rfval / 2.5);
11691173 if (rfval > 100) rfval = 100;
1170 return ceil(rfval);
1174 if (rfval < 0) rfval = 0;
1175 if (progStatus.ft950_rg_reverse) rfval = 100 - rfval;
1176 return rfval;
11711177 }
11721178
11731179 void RIG_FT950::get_rf_min_max_step(int &min, int &max, int &step)
250250 waitFB("set vfo B");
251251 }
252252
253 void RIG_IC7000::swapvfos()
254 {
255 cmd = pre_to;
256 cmd += '\x07';
257 cmd += '\xB0';
258 cmd.append( post );
259 waitFB("swap VFO A/B");
260 }
261
253262 void RIG_IC7000::set_modeA(int val)
254263 {
255264 A.imode = val;
206206 cmd.append( post );
207207 string resp = pre_fm;
208208 resp.append("\x15\x02");
209 if (waitFOR(9, "get smeter")) {
209 if (waitFOR(9, "get smeter")) { // SHOULD BE 10 bytes
210210 size_t p = replystr.rfind(resp);
211211 if (p != string::npos)
212212 return (int)ceil(fm_bcd(&replystr[p+6], 3) / 2.55);
8080 { (Fl_Widget *)sldrSQUELCH, 266, 125, 156 },
8181 { (Fl_Widget *)btnNR, 214, 145, 50 },
8282 { (Fl_Widget *)sldrNR, 266, 145, 156 },
83 { (Fl_Widget *)sldrPOWER, 266, 165, 156 },
83 { (Fl_Widget *)btnNotch, 214, 165, 50 },
84 { (Fl_Widget *)sldrNOTCH, 266, 165, 156 },
85 { (Fl_Widget *)sldrPOWER, 54, 185, 156 },
8486 { (Fl_Widget *)NULL, 0, 0, 0 }
8587 };
8688
133135 has_noise_reduction = true;
134136 has_noise_reduction_control = true;
135137 has_auto_notch = true;
138 has_notch_control = true;
136139 has_rf_control = true;
137140 has_compON = true;
138141 has_vox_onoff = true;
156159 rig_widgets[4].W = sldrSQUELCH;
157160 rig_widgets[5].W = btnNR;
158161 rig_widgets[6].W = sldrNR;
159 rig_widgets[7].W = sldrPOWER;
162 rig_widgets[7].W = btnNotch;
163 rig_widgets[8].W = sldrNOTCH;
164 rig_widgets[9].W = sldrPOWER;
160165 }
161166
162167 //=============================================================================
220225
221226 void RIG_IC7200::set_vfoB (long freq)
222227 {
223 selectB();
224228 B.freq = freq;
225229 cmd = pre_to;
226230 cmd += '\x05';
369373 cmd += val ? '\x20' : '\x00';
370374 cmd.append( post );
371375 waitFB("set att");
376 atten_level = val;
377 }
378
379 int RIG_IC7200::get_attenuator()
380 {
381 cmd = pre_to;
382 cmd += '\x11';
383 cmd.append( post );
384 string resp = pre_fm;
385 resp += '\x11';
386 if (waitFOR(7, "get ATT")) {
387 size_t p = replystr.rfind(resp);
388 if (p != string::npos)
389 atten_level = replystr[p+5];
390 if (atten_level == 0x20) {
391 atten_label("20 dB", true);
392 } else {
393 atten_level = 0;
394 atten_label("ATT", false);
395 }
396 }
397 return atten_level;
372398 }
373399
374400 void RIG_IC7200::set_noise(bool val)
452478 cmd = pre_to;
453479 cmd += '\x16';
454480 cmd += '\x02';
455 cmd += (unsigned char)val;
481 cmd += val ? 0x01 : 0x00;
456482 cmd.append( post );
457483 waitFB("set Pre");
458484 }
469495 size_t p = replystr.rfind(resp);
470496 if (p != string::npos) {
471497 if (replystr[p+6] == 0x01) {
472 preamp_label("Pre", true);
498 preamp_label("Pre ON", true);
473499 return true;
474500 } else {
475501 preamp_label("Pre", false);
605631 }
606632 }
607633 cmd = pre_to;
608 cmd += "\x1A\04";
634 cmd += "\x1A\x04";
609635 cmd.append(post);
610636 resp = pre_fm;
611 resp += "\x1A\04";
637 resp += "\x1A\x04";
612638 if (waitFOR(9, "data mode?")) {
613639 size_t p = replystr.rfind(resp);
614640 if (p != string::npos) {
656682 }
657683 }
658684 cmd = pre_to;
659 cmd += "x1A\04";
685 cmd += "\x1A\x04";
660686 cmd.append(post);
661687 resp = pre_fm;
662 resp += "x1A\04";
688 resp += "\x1A\x04";
663689 if (waitFOR(9, "get data B")) {
664690 size_t p = replystr.rfind(resp);
665691 if (p != string::npos) {
881907 waitFB("tune rig");
882908 }
883909
910 static bool IC7200_notchon = false;
911
912 void RIG_IC7200::set_notch(bool on, int val)
913 {
914 int notch = val / 20 + 53;
915 if (notch > 255) notch = 255;
916 if (on != IC7200_notchon) {
917 cmd = pre_to;
918 cmd.append("\x16\x48");
919 cmd += on ? '\x01' : '\x00';
920 cmd.append(post);
921 waitFB("set notch");
922 IC7200_notchon = on;
923 }
924
925 if (on) {
926 cmd = pre_to;
927 cmd.append("\x14\x0D");
928 cmd.append(to_bcd(notch,3));
929 cmd.append(post);
930 waitFB("set notch val");
931 }
932 }
933
934 bool RIG_IC7200::get_notch(int &val)
935 {
936 bool on = false;
937 val = 0;
938
939 string cstr = "\x16\x48";
940 string resp = pre_fm;
941 resp.append(cstr);
942 cmd = pre_to;
943 cmd.append(cstr);
944 cmd.append( post );
945 if (waitFOR(8, "get notch")) {
946 size_t p = replystr.rfind(resp);
947 if (p != string::npos)
948 on = replystr[p + 6] ? 1 : 0;
949 cmd = pre_to;
950 resp = pre_fm;
951 cstr = "\x14\x0D";
952 cmd.append(cstr);
953 resp.append(cstr);
954 cmd.append(post);
955 if (waitFOR(9, "get notch val")) {
956 size_t p = replystr.rfind(resp);
957 if (p != string::npos) {
958 val = fm_bcd(&replystr[p+6],3);
959 val = (val - 53) * 20;
960 if (val < 0) val = 0;
961 if (val > 4040) val = 4040;
962 }
963 }
964 }
965 return on;
966 }
967
968 void RIG_IC7200::get_notch_min_max_step(int &min, int &max, int &step)
969 {
970 min = 0;
971 max = 4040;
972 step = 20;
973 }
0 // ----------------------------------------------------------------------------
1 // Copyright (C) 2014
2 // David Freese, W1HKJ
3 //
4 // This file is part of flrig.
5 //
6 // flrig is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // flrig is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 // ----------------------------------------------------------------------------
19
20 #include "IC7300.h"
21
22 bool IC7300_DEBUG = true;
23
24 //=============================================================================
25 // IC-7300
26
27 const char IC7300name_[] = "IC-7300";
28
29 const char *IC7300modes_[] = {
30 "LSB", "USB", "AM", "CW", "RTTY", "FM", "CW-R", "RTTY-R", "PSK", "PSK-R",
31 "LSB-D1", "LSB-D2", "LSB-D3",
32 "USB-D1", "USB-D2", "USB-D3", NULL};
33
34 const char IC7300_mode_type[] = {
35 'L', 'U', 'U', 'U', 'L', 'U', 'L', 'U', 'U', 'L',
36 'L', 'L', 'L',
37 'U', 'U', 'U' };
38
39 const char IC7300_mode_nbr[] = {
40 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x08, 0x12, 0x13,
41 0x00, 0x00, 0x00,
42 0x01, 0x01, 0x01 };
43
44 const char *IC7300_ssb_bws[] = {
45 "50", "100", "150", "200", "250", "300", "350", "400", "450", "500",
46 "600", "700", "800", "900", "1000", "1100", "1200", "1300", "1400", "1500",
47 "1600", "1700", "1800", "1900", "2000", "2100", "2200", "2300", "2400", "2500",
48 "2600", "2700", "2800", "2900", "3000", "3100", "3200", "3300", "3400", "3500",
49 "3600", NULL };
50 static int IC7300_bw_vals_SSB[] = {
51 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
52 10,11,12,13,14,15,16,17,18,19,
53 20,21,22,23,24,25,26,27,28,29,
54 30,31,32,33,34,35,36,37,38,39,
55 40, WVALS_LIMIT};
56
57 const char *IC7300_rtty_bws[] = {
58 "50", "100", "150", "200", "250", "300", "350", "400", "450", "500",
59 "600", "700", "800", "900", "1000", "1100", "1200", "1300", "1400", "1500",
60 "1600", "1700", "1800", "1900", "2000", "2100", "2200", "2300", "2400", "2500",
61 "2600", "2700", NULL };
62 static int IC7300_bw_vals_RTTY[] = {
63 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
64 10,11,12,13,14,15,16,17,18,19,
65 20,21,22,23,24,25,26,27,28,29,
66 30,31, WVALS_LIMIT};
67
68 const char *IC7300_am_bws[] = {
69 "200", "400", "600", "800", "1000", "1200", "1400", "1600", "1800", "2000",
70 "2200", "2400", "2600", "2800", "3000", "3200", "3400", "3600", "3800", "4000",
71 "4200", "4400", "4600", "4800", "5000", "5200", "5400", "5600", "5800", "6000",
72 "6200", "6400", "6600", "6800", "7000", "7300", "7400", "7300", "7800", "8000",
73 "8200", "8400", "8600", "8800", "9000", "9200", "9400", "9600", "9800", "10000", NULL };
74 static int IC7300_bw_vals_AM[] = {
75 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
76 10,11,12,13,14,15,16,17,18,19,
77 20,21,22,23,24,25,26,27,28,29,
78 30,31,32,33,34,35,36,37,38,39,
79 40,41,42,43,44,45,46,47,48,49
80 WVALS_LIMIT};
81
82 const char *IC7300_fm_bws[] = { "FIXED", NULL };
83 static int IC7300_bw_vals_FM[] = { 1, WVALS_LIMIT};
84
85 static GUI IC7300_widgets[]= {
86 { (Fl_Widget *)btnVol, 2, 125, 50 },
87 { (Fl_Widget *)sldrVOLUME, 54, 125, 156 },
88 { (Fl_Widget *)sldrRFGAIN, 54, 145, 156 },
89 { (Fl_Widget *)sldrSQUELCH, 54, 165, 156 },
90 { (Fl_Widget *)btnNR, 2, 185, 50 },
91 { (Fl_Widget *)sldrNR, 54, 185, 156 },
92 { (Fl_Widget *)btnIFsh, 214, 125, 50 },
93 { (Fl_Widget *)sldrIFSHIFT, 266, 125, 156 },
94 { (Fl_Widget *)btnNotch, 214, 145, 50 },
95 { (Fl_Widget *)sldrNOTCH, 266, 145, 156 },
96 { (Fl_Widget *)sldrMICGAIN, 266, 165, 156 },
97 { (Fl_Widget *)sldrPOWER, 266, 185, 156 },
98 { (Fl_Widget *)NULL, 0, 0, 0 }
99 };
100
101 RIG_IC7300::RIG_IC7300() {
102 defaultCIV = 0x94;
103 adjustCIV(defaultCIV);
104
105 name_ = IC7300name_;
106 modes_ = IC7300modes_;
107 bandwidths_ = IC7300_ssb_bws;
108 bw_vals_ = IC7300_bw_vals_SSB;
109
110 _mode_type = IC7300_mode_type;
111
112 widgets = IC7300_widgets;
113
114 A.freq = 14070000;
115 A.imode = 13;
116 A.iBW = 34;
117 B.freq = 7070000;
118 B.imode = 13;
119 B.iBW = 34;
120
121 has_extras = true;
122
123 has_cw_wpm = true;
124 has_cw_spot_tone = true;
125 has_cw_qsk = true;
126
127 has_vox_onoff = true;
128 has_vox_gain = true;
129 has_vox_anti = true;
130 has_vox_hang = true;
131
132 has_compON = true;
133 has_compression = true;
134
135 has_split = true;
136 has_split_AB = true;
137
138 has_micgain_control = true;
139 has_bandwidth_control = true;
140
141 has_smeter = true;
142
143 has_power_out =
144 has_swr_control =
145 has_alc_control =
146 has_sql_control = true;
147
148 has_power_control = true;
149 has_volume_control = true;
150 has_mode_control = true;
151
152 has_attenuator_control = true;
153 has_preamp_control = true;
154
155 has_noise_control = true;
156 has_noise_reduction = true;
157 has_noise_reduction_control = true;
158
159 has_auto_notch = true;
160 has_notch_control = true;
161
162 has_rf_control = true;
163
164 has_ptt_control = true;
165 has_tune_control = true;
166
167 precision = 1;
168 ndigits = 8;
169
170 };
171
172 //======================================================================
173 // IC7300 unique commands
174 //======================================================================
175
176 void RIG_IC7300::initialize()
177 {
178 IC7300_widgets[0].W = btnVol;
179 IC7300_widgets[1].W = sldrVOLUME;
180 IC7300_widgets[2].W = sldrRFGAIN;
181 IC7300_widgets[3].W = sldrSQUELCH;
182 IC7300_widgets[4].W = btnNR;
183 IC7300_widgets[5].W = sldrNR;
184 IC7300_widgets[6].W = btnIFsh;
185 IC7300_widgets[7].W = sldrIFSHIFT;
186 IC7300_widgets[8].W = btnNotch;
187 IC7300_widgets[9].W = sldrNOTCH;
188 IC7300_widgets[10].W = sldrMICGAIN;
189 IC7300_widgets[11].W = sldrPOWER;
190 }
191
192 static inline void minmax(int min, int max, int &val)
193 {
194 if (val > max) val = max;
195 if (val < min) val = min;
196 }
197
198 void RIG_IC7300::selectA()
199 {
200 cmd.assign(pre_to).append("\x07\xD0").append(post);
201 waitFB("select A");
202 }
203
204 void RIG_IC7300::selectB()
205 {
206 cmd.assign(pre_to).append("\x07\xD1").append(post);
207 waitFB("select B");
208 }
209
210 long RIG_IC7300::get_vfoA ()
211 {
212 string resp;
213 cmd.assign(pre_to).append("\x03").append( post );
214 if (waitFOR(11, "get vfo A")) {
215 resp.assign(pre_fm).append("\x03");
216 size_t p = replystr.rfind(resp);
217 if (p != string::npos)
218 A.freq = fm_bcd_be(&replystr[p+5], 10);
219 }
220 return A.freq;
221 }
222
223 void RIG_IC7300::set_vfoA (long freq)
224 {
225 A.freq = freq;
226 cmd.assign(pre_to).append("\x05");
227 cmd.append( to_bcd_be( freq, 10 ) );
228 cmd.append( post );
229 waitFB("set vfo A");
230 }
231
232 long RIG_IC7300::get_vfoB ()
233 {
234 string resp = pre_fm;
235 cmd.assign(pre_to).append("\x03").append(post);
236 if (waitFOR(11, "get vfo B")) {
237 resp.assign(pre_fm).append("\x03");
238 size_t p = replystr.rfind(resp);
239 if (p != string::npos)
240 B.freq = fm_bcd_be(&replystr[p+5], 10);
241 }
242 return B.freq;
243 }
244
245 void RIG_IC7300::set_vfoB (long freq)
246 {
247 B.freq = freq;
248 cmd.assign(pre_to).append("\x05");
249 cmd.append( to_bcd_be( freq, 10 ) );
250 cmd.append( post );
251 waitFB("set vfo B");
252 }
253
254 bool RIG_IC7300::can_split()
255 {
256 return true;
257 }
258
259 void RIG_IC7300::set_split(bool val)
260 {
261 split = val;
262 if (val) {
263 cmd.assign(pre_to).append("\x0F\x01").append( post );
264 waitFB("Split ON");
265 } else {
266 cmd.assign(pre_to).append("\x0F");
267 cmd += '\x00';
268 cmd.append( post );
269 waitFB("Split OFF");
270 }
271 }
272
273 int RIG_IC7300::get_split()
274 {
275 int split = 0;
276 cmd.assign(pre_to);
277 cmd.append("\x0F");
278 cmd.append( post );
279 if (waitFOR(7, "get split")) {
280 string resp = pre_fm;
281 resp.append("\x0F");
282 size_t p = replystr.find(resp);
283 if (p != string::npos)
284 split = replystr[p+5];
285 }
286 return split;
287 }
288
289 void RIG_IC7300::swapvfos()
290 {
291 cmd = pre_to;
292 cmd += 0x07; cmd += 0xB0;
293 cmd.append(post);
294 if (IC7300_DEBUG)
295 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
296 waitFB("swap vfos");
297 }
298
299 void RIG_IC7300::set_modeA(int val)
300 {
301 A.imode = val;
302 cmd = pre_to;
303 cmd += '\x06';
304 cmd += IC7300_mode_nbr[val];
305 cmd.append( post );
306 waitFB("set modeA");
307
308 // digital set / clear
309 if (val >= 10) {
310 cmd = pre_to;
311 cmd.append("\x1A\x06");
312 switch (val) {
313 case 10 : case 13 : cmd.append("\x01\x01"); break;
314 case 11 : case 14 : cmd.append("\x02\x01"); break;
315 case 12 : case 15 : cmd.append("\x03\x01"); break;
316 }
317 cmd.append( post);
318 waitFB("set digital mode ON/OFF");
319 }
320 }
321
322 int RIG_IC7300::get_modeA()
323 {
324 int md = 0;
325 string resp;
326 size_t p;
327 cmd.assign(pre_to).append("\x04").append(post);
328 if (waitFOR(8, "get mode A")) {
329 resp.assign(pre_fm).append("\x04");
330 p = replystr.rfind(resp);
331 if (p == string::npos) return A.imode;
332 for (md = 0; md < 10; md++) {
333 if (replystr[p+5] == IC7300_mode_nbr[md]) {
334 A.imode = md;
335 }
336 }
337 if (A.imode < 2) {
338 cmd.assign(pre_to).append("\x1A\x06").append(post);
339 if (waitFOR(9, "data mode?")) {
340 resp.assign(pre_fm).append("\x1A\x06");
341 p = replystr.rfind(resp);
342 if (p == string::npos) return A.imode;
343 int dmode = replystr[p+6];
344 if (A.imode == 0) A.imode = 9 + dmode;
345 else if (A.imode == 1) A.imode = 12 + dmode;
346 }
347 }
348 }
349 if (A.imode > 15) A.imode = 0;
350 return A.imode;
351 }
352
353 void RIG_IC7300::set_modeB(int val)
354 {
355 B.imode = val;
356 cmd.assign(pre_to).append("\x06");
357 cmd += IC7300_mode_nbr[val];
358 cmd.append( post );
359 waitFB("set modeB");
360
361 // digital set / clear
362 if (val >= 10) {
363 cmd = pre_to;
364 cmd.append("\x1A\x06");
365 switch (val) {
366 case 10 : case 13 : cmd.append("\x01\x01"); break;
367 case 11 : case 14 : cmd.append("\x02\x01"); break;
368 case 12 : case 15 : cmd.append("\x03\x01"); break;
369 }
370 cmd.append( post);
371 waitFB("set digital mode ON/OFF");
372 }
373 }
374
375 int RIG_IC7300::get_modeB()
376 {
377 int md = 0;
378 string resp;
379 size_t p;
380 cmd.assign(pre_to).append("\x04").append(post);
381 if (waitFOR(8, "get mode B")) {
382 resp.assign(pre_fm).append("\x04");
383 p = replystr.rfind(resp);
384 if (p == string::npos) return B.imode;
385 for (md = 0; md < 10; md++) if (replystr[p+5] == IC7300_mode_nbr[md]) break;
386 if (md == 10) md = 0;
387 B.imode = md;
388
389 if (B.imode < 2) {
390 cmd.assign(pre_to).append("\x1A\x06").append(post);
391 if (waitFOR(9, "data mode?")) {
392 resp.assign(pre_fm).append("\x1A\x06");
393 p = replystr.rfind(resp);
394 if (p == string::npos) return B.imode;
395 int dmode = replystr[p+6];
396 if (B.imode == 0) B.imode = 9 + dmode;
397 else if (B.imode == 1) B.imode = 12 + dmode;
398 }
399 }
400 }
401 if (B.imode > 15) B.imode = 0;
402 return B.imode;
403 }
404
405 int RIG_IC7300::get_bwA()
406 {
407 if (A.imode == 5) return 0;
408 cmd = pre_to;
409 cmd.append("\x1a\x03");
410 cmd.append(post);
411 if (waitFOR(8, "get_bwA")) {
412 string resp = pre_fm;
413 resp.append("\x1A\x02");
414 size_t p = replystr.find(resp);
415 if (p != string::npos)
416 A.iBW = fm_bcd(&replystr[p+6], 2);
417 }
418 return A.iBW;
419 }
420
421 void RIG_IC7300::set_bwA(int val)
422 {
423 A.iBW = val;
424 if (A.imode == 5) return;
425 if (A.imode > bw_size_) A.imode = bw_size_;
426 cmd = pre_to;
427 cmd.append("\x1a\x03");
428 cmd.append(to_bcd(A.iBW, 2));
429 cmd.append(post);
430 waitFB("set bwA");
431 }
432
433 int RIG_IC7300::get_bwB()
434 {
435 if (B.imode == 5) return 0;
436 cmd = pre_to;
437 cmd.append("\x1a\x03");
438 cmd.append(post);
439 if (waitFOR(8, "get_bwB")) {
440 string resp = pre_fm;
441 resp.append("\x1A\x02");
442 size_t p = replystr.find(resp);
443 if (p != string::npos)
444 B.iBW = fm_bcd(&replystr[p+6], 2);
445 }
446 return B.iBW;
447 }
448
449 void RIG_IC7300::set_bwB(int val)
450 {
451 B.iBW = val;
452 if (B.imode == 5) return;
453 if (B.iBW > bw_size_) B.iBW = bw_size_;
454 cmd = pre_to;
455 cmd.append("\x1a\x03");
456 cmd.append(to_bcd(A.iBW, 2));
457 cmd.append(post);
458 waitFB("set bwB");
459 }
460
461 int RIG_IC7300::adjust_bandwidth(int m)
462 {
463 int bw = 0;
464 switch (m) {
465 case 2: // AM
466 bandwidths_ = IC7300_am_bws;
467 bw_vals_ = IC7300_bw_vals_AM;
468 bw_size_ = sizeof(IC7300_bw_vals_AM);
469 bw = 19;
470 break;
471 case 5: // FM
472 bandwidths_ = IC7300_fm_bws;
473 bw_vals_ = IC7300_bw_vals_FM;
474 bw_size_ = sizeof(IC7300_bw_vals_FM);
475 bw = 0;
476 break;
477 case 4: case 7: // RTTY
478 bandwidths_ = IC7300_rtty_bws;
479 bw_vals_ = IC7300_bw_vals_RTTY;
480 bw_size_ = sizeof(IC7300_bw_vals_RTTY);
481 bw = 12;
482 break;
483 case 3: case 6: // CW
484 bandwidths_ = IC7300_ssb_bws;
485 bw_vals_ = IC7300_bw_vals_SSB;
486 bw_size_ = sizeof(IC7300_bw_vals_SSB);
487 bw = 12;
488 break;
489 case 8: case 9: // PKT
490 bandwidths_ = IC7300_ssb_bws;
491 bw_vals_ = IC7300_bw_vals_SSB;
492 bw_size_ = sizeof(IC7300_bw_vals_SSB);
493 bw = 34;
494 break;
495 case 0: case 1: // SSB
496 case 10: case 11 : case 12 :
497 case 13: case 14 : case 15 :
498 default:
499 bandwidths_ = IC7300_ssb_bws;
500 bw_vals_ = IC7300_bw_vals_SSB;
501 bw_size_ = sizeof(IC7300_bw_vals_SSB);
502 bw = 34;
503 }
504 return bw;
505 }
506
507 int RIG_IC7300::def_bandwidth(int m)
508 {
509 int bw = 0;
510 switch (m) {
511 case 2: // AM
512 bw = 19;
513 break;
514 case 5: // FM
515 bw = 0;
516 break;
517 case 4: case 7: // RTTY
518 bw = 12;
519 break;
520 case 3: case 6: // CW
521 bw = 12;
522 break;
523 case 8: case 9: // PKT
524 bw = 34;
525 break;
526 case 0: case 1: // SSB
527 case 10: case 11 : case 12 :
528 case 13: case 14 : case 15 :
529 default:
530 bw = 34;
531 }
532 return bw;
533 }
534
535 int RIG_IC7300::get_mic_gain()
536 {
537 int val = 0;
538 string cstr = "\x14\x0B";
539 string resp = pre_fm;
540 resp.append(cstr);
541 cmd = pre_to;
542 cmd.append(cstr);
543 cmd.append(post);
544 if (waitFOR(9, "get mic")) {
545 size_t p = replystr.rfind(resp);
546 if (p != string::npos)
547 val = (int)ceil(fm_bcd(&replystr[p+6],3) / 2.55);
548 }
549 minmax(0,100,val);
550 return val;
551 }
552
553 void RIG_IC7300::set_mic_gain(int v)
554 {
555 int ICvol = (int)(v * 255 / 100);
556 minmax(0, 255, ICvol);
557 if (!progStatus.USBaudio) {
558 cmd = pre_to;
559 cmd.append("\x14\x0B");
560 cmd.append(to_bcd(ICvol, 3));
561 cmd.append( post );
562 } else {
563 cmd = pre_to;
564 cmd += '\x1A'; cmd += '\x05';
565 cmd += '\x00'; cmd += '\x29';
566 cmd.append(to_bcd(ICvol, 3));
567 cmd.append( post );
568 }
569 waitFB("set mic gain");
570 }
571
572 void RIG_IC7300::get_mic_gain_min_max_step(int &min, int &max, int &step)
573 {
574 min = 0;
575 max = 100;
576 step = 1;
577 }
578
579
580 // alh added ++++++++++++++++++++++++++++
581
582 void RIG_IC7300::set_compression()
583 {
584 if (progStatus.compON) {
585 cmd.assign(pre_to).append("\x14\x0E");
586 cmd.append(to_bcd(progStatus.compression * 255 / 100, 3));
587 cmd.append( post );
588 waitFB("set comp");
589
590 cmd = pre_to;
591 cmd.append("\x16\x44");
592 cmd += '\x01';
593 cmd.append(post);
594 waitFB("set Comp ON");
595
596 } else{
597 cmd.assign(pre_to).append("\x16\x44");
598 cmd += '\x00';
599 cmd.append(post);
600 waitFB("set Comp OFF");
601 }
602 }
603
604 void RIG_IC7300::set_vox_onoff()
605 {
606 if (progStatus.vox_onoff) {
607 cmd.assign(pre_to).append("\x16\x46\x01");
608 cmd.append( post );
609 waitFB("set vox ON");
610 } else {
611 cmd.assign(pre_to).append("\x16\x46");
612 cmd += '\x00'; // ALH
613 cmd.append( post );
614 waitFB("set vox OFF");
615 }
616 }
617
618 void RIG_IC7300::set_vox_gain()
619 {
620 cmd.assign(pre_to).append("\x1A\x05"); // ALH values 0-255
621 cmd +='\x01';
622 cmd +='\x65';
623 cmd.append(to_bcd((int)(progStatus.vox_gain * 2.55), 3));
624 cmd.append( post );
625 waitFB("SET vox gain");
626 }
627
628 void RIG_IC7300::set_vox_anti()
629 {
630 cmd.assign(pre_to).append("\x1A\x05"); //ALH values 0-255
631 cmd +='\x01';
632 cmd +='\x66';
633 cmd.append(to_bcd((int)(progStatus.vox_anti * 2.55), 3));
634 cmd.append( post );
635 waitFB("SET anti-vox");
636 }
637
638 void RIG_IC7300::set_vox_hang()
639 {
640 cmd.assign(pre_to).append("\x1A\x05"); //ALH values 00-20 = 0.0 - 2.0 sec
641 cmd +='\x01'; // ALH
642 cmd +='\x67'; // ALH
643 cmd.append(to_bcd((int)(progStatus.vox_hang / 10 ), 2));
644 cmd.append( post );
645 waitFB("SET vox hang");
646 }
647
648 // CW controls
649
650 void RIG_IC7300::set_cw_wpm()
651 {
652 cmd.assign(pre_to).append("\x14\x0C"); // values 0-255
653 cmd.append(to_bcd(round((progStatus.cw_wpm - 6) * 255 / (60 - 6)), 3));
654 cmd.append( post );
655 waitFB("SET cw wpm");
656 }
657
658 void RIG_IC7300::set_cw_qsk()
659 {
660 int n = round(progStatus.cw_qsk * 10); // values 0-255
661 cmd.assign(pre_to).append("\x14\x0F");
662 cmd.append(to_bcd(n, 3));
663 cmd.append(post);
664 waitFB("Set cw qsk delay");
665 }
666
667 void RIG_IC7300::set_cw_spot_tone()
668 {
669 cmd.assign(pre_to).append("\x14\x09"); // values 0=300Hz 255=900Hz
670 int n = round((progStatus.cw_spot_tone - 300) * 255.0 / 600.0);
671 if (n > 255) n = 255;
672 if (n < 0) n = 0;
673 cmd.append(to_bcd(n, 3));
674 cmd.append( post );
675 waitFB("SET cw spot tone");
676 }
677
678 void RIG_IC7300::set_cw_vol()
679 {
680 cmd.assign(pre_to);
681 cmd.append("\x1A\x05");
682 cmd += '\x00';
683 cmd += '\x24'; // ALH / DF
684 cmd.append(to_bcd((int)(progStatus.cw_vol * 2.55), 3));
685 cmd.append( post );
686 waitFB("SET cw sidetone volume");
687 }
688
689 // Tranceiver PTT on/off
690 void RIG_IC7300::set_PTT_control(int val)
691 {
692 cmd = pre_to;
693 cmd += '\x1c';
694 cmd += '\x00';
695 cmd += (unsigned char) val;
696 cmd.append( post );
697 waitFB("set ptt");
698 }
699
700 // Volume control val 0 ... 100
701 void RIG_IC7300::set_volume_control(int val)
702 {
703 int ICvol = (int)(val * 255 / 100);
704 minmax(0, 255, ICvol);
705 cmd = pre_to;
706 cmd.append("\x14\x01");
707 cmd.append(to_bcd(ICvol, 3));
708 cmd.append( post );
709 waitFB("set vol");
710 }
711
712 /*
713
714 I:12:20:22: get vol ans in 0 ms, OK
715 cmd FE FE 7A E0 14 01 FD
716 ans FE FE 7A E0 14 01 FD
717 FE FE E0 7A 14 01 00 65 FD
718 0 1 2 3 4 5 6 7 8
719 */
720 int RIG_IC7300::get_volume_control()
721 {
722 int val = 0;
723 string cstr = "\x14\x01";
724 string resp = pre_fm;
725 resp.append(cstr);
726 cmd = pre_to;
727 cmd.append(cstr);
728 cmd.append( post );
729 if (waitFOR(9, "get vol")) {
730 size_t p = replystr.rfind(resp);
731 if (p != string::npos)
732 val = (int)ceil(fm_bcd(&replystr[p + 6],3) * 100 / 255);
733 }
734 minmax(0, 100, val);
735 progStatus.volume = val;
736 return (progStatus.volume);
737 }
738
739 void RIG_IC7300::get_vol_min_max_step(int &min, int &max, int &step)
740 {
741 min = 0; max = 100; step = 1;
742 }
743
744 void RIG_IC7300::set_power_control(double value)
745 {
746 int val = (int)(value * 255 / 100);
747 minmax(0, 255, val);
748 cmd = pre_to;
749 cmd.append("\x14\x0A");
750 cmd.append(to_bcd(val, 3));
751 cmd.append( post );
752 waitFB("set power");
753 }
754
755 int RIG_IC7300::get_power_control()
756 {
757 int val = progStatus.power_level;
758 string cstr = "\x14\x0A";
759 string resp = pre_fm;
760 cmd = pre_to;
761 cmd.append(cstr).append(post);
762 resp.append(cstr);
763 if (waitFOR(9, "get power")) {
764 size_t p = replystr.rfind(resp);
765 if (p != string::npos)
766 val = (int)ceil(fm_bcd(&replystr[p + 6],3) * 100 / 255);
767 }
768 minmax(0, 100, val);
769 progStatus.power_level = val;
770 return (progStatus.power_level);
771 }
772
773 void RIG_IC7300::get_pc_min_max_step(double &min, double &max, double &step)
774 {
775 min = 2; max = 100; step = 1;
776 }
777
778 int RIG_IC7300::get_smeter()
779 {
780 string cstr = "\x15\x02";
781 string resp = pre_fm;
782 resp.append(cstr);
783 cmd = pre_to;
784 cmd.append(cstr);
785 cmd.append( post );
786 int mtr= -1;
787 if (waitFOR(9, "get smeter")) {
788 size_t p = replystr.rfind(resp);
789 if (p != string::npos) {
790 mtr = fm_bcd(&replystr[p+6], 3);
791 mtr = (int)ceil(mtr /2.41);
792 if (mtr > 100) mtr = 100;
793 }
794 }
795 return mtr;
796 }
797
798 int RIG_IC7300::get_power_out(void)
799 {
800 string cstr = "\x15\x11";
801 string resp = pre_fm;
802 resp.append(cstr);
803 cmd = pre_to;
804 cmd.append(cstr);
805 cmd.append( post );
806 int mtr= -1;
807 if (waitFOR(9, "get power out")) {
808 size_t p = replystr.rfind(resp);
809 if (p != string::npos) {
810 mtr = fm_bcd(&replystr[p+6], 3);
811 mtr = (int)ceil(mtr /2.13);
812 if (mtr > 100) mtr = 100;
813 }
814 }
815 return mtr;
816 }
817
818 int RIG_IC7300::get_swr(void)
819 {
820 string cstr = "\x15\x12";
821 string resp = pre_fm;
822 resp.append(cstr);
823 cmd = pre_to;
824 cmd.append(cstr);
825 cmd.append( post );
826 int mtr= -1;
827 if (waitFOR(9, "get swr")) {
828 size_t p = replystr.rfind(resp);
829 if (p != string::npos) {
830 mtr = fm_bcd(&replystr[p+6], 3);
831 mtr = (int)ceil(mtr /2.55);
832 if (mtr > 100) mtr = 100;
833 }
834 }
835 return mtr;
836 }
837
838 int RIG_IC7300::get_alc(void)
839 {
840 string cstr = "\x15\x13";
841 string resp = pre_fm;
842 resp.append(cstr);
843 cmd = pre_to;
844 cmd.append(cstr);
845 cmd.append( post );
846 int mtr= -1;
847 if (waitFOR(9, "get alc")) {
848 size_t p = replystr.rfind(resp);
849 if (p != string::npos) {
850 mtr = fm_bcd(&replystr[p+6], 3);
851 mtr = (int)ceil(mtr /1.2);
852 if (mtr > 100) mtr = 100;
853 }
854 }
855 return mtr;
856 }
857
858 void RIG_IC7300::set_rf_gain(int val)
859 {
860 int ICrfg = (int)(val * 255 / 100);
861 minmax(0, 255, ICrfg);
862 cmd = pre_to;
863 cmd.append("\x14\x02");
864 cmd.append(to_bcd(ICrfg, 3));
865 cmd.append( post );
866 waitFB("set RF");
867 }
868
869 int RIG_IC7300::get_rf_gain()
870 {
871 int val = progStatus.rfgain;
872 string cstr = "\x14\x02";
873 string resp = pre_fm;
874 cmd = pre_to;
875 cmd.append(cstr).append(post);
876 resp.append(cstr);
877 if (waitFOR(9, "get RF")) {
878 size_t p = replystr.rfind(resp);
879 if (p != string::npos)
880 val = (int)(fm_bcd(&replystr[p + 6],3) * 100 / 255);
881 }
882 minmax(0, 100, val);
883 progStatus.rfgain = val;
884 return (progStatus.rfgain);
885 }
886
887 void RIG_IC7300::get_rf_min_max_step(double &min, double &max, double &step)
888 {
889 min = 0; max = 100; step = 1;
890 }
891
892 void RIG_IC7300::tune_rig()
893 {
894 cmd = pre_to;
895 cmd.append("\x1c\x01\x02");
896 cmd.append( post );
897 waitFB("tune rig");
898 }
899
900 void RIG_IC7300::set_preamp(int val)
901 {
902 cmd = pre_to;
903 cmd += '\x16';
904 cmd += '\x02';
905
906 if (preamp_level == 0) {
907 preamp_level = 1;
908 preamp_label("Amp 1", true);
909 } else if (preamp_level == 1) {
910 preamp_level = 2;
911 preamp_label("Amp 2", true);
912 } else if (preamp_level == 2) {
913 preamp_level = 0;
914 preamp_label("OFF", false);
915 }
916
917 cmd += (unsigned char)preamp_level;
918 cmd.append( post );
919 waitFB("set Pre");
920 }
921
922 int RIG_IC7300::get_preamp()
923 {
924 string cstr = "\x16\x02";
925 string resp = pre_fm;
926 resp.append(cstr);
927 cmd = pre_to;
928 cmd.append(cstr);
929 cmd.append( post );
930 if (waitFOR(8, "get Pre")) {
931 size_t p = replystr.rfind(resp);
932 if (p != string::npos)
933 preamp_level = replystr[p+6];
934 if (preamp_level == 1) {
935 preamp_label("Amp 1", true);
936 } else if (preamp_level == 2) {
937 preamp_label("Amp 2", true);
938 } else {
939 preamp_label("OFF", false);
940 preamp_level = 0;
941 }
942 }
943 return progStatus.preamp = preamp_level;
944 }
945
946 void RIG_IC7300::set_attenuator(int val)
947 {
948 unsigned char level = 0x00;
949 if (atten_level == 0x00) {
950 atten_level = 0x06;
951 atten_label("6 dB", true);
952 } else if (atten_level == 0x06) {
953 atten_level = 0x12;
954 atten_label("12 dB", true);
955 } else if (atten_level == 0x12) {
956 atten_level = 0x18;
957 atten_label("18 dB", true);
958 } else if (atten_level == 0x18) {
959 atten_level = 0x00;
960 atten_label("ATT", false);
961 }
962 cmd = pre_to;
963 cmd += '\x11';
964 cmd += atten_level;
965 cmd.append( post );
966 waitFB("set att");
967 }
968
969 int RIG_IC7300::get_attenuator()
970 {
971 cmd = pre_to;
972 string resp = pre_fm;
973 cmd += '\x11';
974 resp += '\x11';
975 cmd.append( post );
976
977 if (waitFOR(7, "get ATT")) {
978 size_t p = replystr.rfind(resp);
979 if (p != string::npos)
980 atten_level = replystr[p+5];
981 if (atten_level == 0x06) {
982 atten_label("6 dB", true);
983 } else if (atten_level == 0x12) {
984 atten_label("12 dB", true);
985 } else if (atten_level == 0x18) {
986 atten_label("18 dB", true);
987 } else {
988 atten_level = 0;
989 atten_label("ATT", false);
990 }
991 }
992 return atten_level;
993 }
994
995
996 void RIG_IC7300::set_noise(bool val)
997 {
998 cmd = pre_to;
999 cmd.append("\x16\x22");
1000 cmd += val ? 1 : 0;
1001 cmd.append(post);
1002 waitFB("set noise");
1003 }
1004
1005
1006 /*
1007
1008 I:12:06:50: get noise ans in 0 ms, OK
1009 cmd FE FE 7A E0 16 22 FD
1010 ans FE FE 7A E0 16 22 FD FE FE E0 7A 16 22 00 FD
1011
1012 */
1013
1014 int RIG_IC7300::get_noise()
1015 {
1016 string cstr = "\x16\x22";
1017 string resp = pre_fm;
1018 resp.append(cstr);
1019 cmd = pre_to;
1020 cmd.append(cstr);
1021 cmd.append(post);
1022 if (waitFOR(8, "get noise")) {
1023 size_t p = replystr.rfind(resp);
1024 if (p != string::npos)
1025 return (replystr[p+6] ? 1 : 0);
1026 }
1027 return progStatus.noise;
1028 }
1029
1030 void RIG_IC7300::set_noise_reduction(int val)
1031 {
1032 cmd = pre_to;
1033 cmd.append("\x16\x40");
1034 cmd += val ? 1 : 0;
1035 cmd.append(post);
1036 waitFB("set NR");
1037 }
1038
1039 int RIG_IC7300::get_noise_reduction()
1040 {
1041 string cstr = "\x16\x40";
1042 string resp = pre_fm;
1043 resp.append(cstr);
1044 cmd = pre_to;
1045 cmd.append(cstr);
1046 cmd.append(post);
1047 if (waitFOR(8, "get NR")) {
1048 size_t p = replystr.rfind(resp);
1049 if (p != string::npos)
1050 return (replystr[p+6] ? 1 : 0);
1051 }
1052 return progStatus.noise_reduction;
1053 }
1054
1055 /*
1056
1057 I:12:06:50: get NR ans in 0 ms, OK
1058 cmd FE FE 7A E0 16 40 FD
1059 ans FE FE 7A E0 16 40 FD
1060 FE FE E0 7A 16 40 01 FD
1061 0 1 2 3 4 5 6 7
1062
1063 I:12:06:50: get NRval ans in 0 ms, OK
1064 cmd FE FE 7A E0 14 06 FD
1065 ans FE FE 7A E0 14 06 FD
1066 FE FE E0 7A 14 06 00 24 FD
1067 0 1 2 3 4 5 6 7 8
1068
1069 */
1070
1071 void RIG_IC7300::set_noise_reduction_val(int val)
1072 {
1073 cmd = pre_to;
1074 cmd.append("\x14\x06");
1075 cmd.append(to_bcd(val * 255 / 100, 3));
1076 cmd.append(post);
1077 waitFB("set NRval");
1078 }
1079
1080 int RIG_IC7300::get_noise_reduction_val()
1081 {
1082 int val = 0;
1083 string cstr = "\x14\x06";
1084 string resp = pre_fm;
1085 resp.append(cstr);
1086 cmd = pre_to;
1087 cmd.append(cstr);
1088 cmd.append(post);
1089 if (waitFOR(9, "get NRval")) {
1090 size_t p = replystr.rfind(resp);
1091 if (p != string::npos)
1092 val = (int)ceil(fm_bcd(&replystr[p+6],3) * 100 / 255);
1093 }
1094 minmax(0, 100, val);
1095 progStatus.noise_reduction_val = val;
1096 return progStatus.noise_reduction_val;
1097 }
1098
1099 void RIG_IC7300::set_squelch(int val)
1100 {
1101 int ICsql = (int)(val * 255 / 100);
1102 minmax(0, 255, ICsql);
1103 cmd = pre_to;
1104 cmd.append("\x14\x03");
1105 cmd.append(to_bcd(ICsql, 3));
1106 cmd.append( post );
1107 waitFB("set Sqlch");
1108 }
1109
1110 int RIG_IC7300::get_squelch()
1111 {
1112 int val = progStatus.squelch;
1113 string cstr = "\x14\x03";
1114 string resp = pre_fm;
1115 resp.append(cstr);
1116 cmd = pre_to;
1117 cmd.append(cstr);
1118 cmd.append(post);
1119 if (waitFOR(9, "get squelch")) {
1120 size_t p = replystr.rfind(resp);
1121 if (p != string::npos)
1122 val = (int)ceil(fm_bcd(&replystr[p+6], 3) * 100 / 255);
1123 }
1124 minmax(0, 100, val);
1125 progStatus.squelch = val;
1126 return (progStatus.squelch);
1127 }
1128
1129 void RIG_IC7300::set_auto_notch(int val)
1130 {
1131 cmd = pre_to;
1132 cmd += '\x16';
1133 cmd += '\x41';
1134 cmd += (unsigned char)val;
1135 cmd.append( post );
1136 waitFB("set AN");
1137 }
1138
1139 int RIG_IC7300::get_auto_notch()
1140 {
1141 string cstr = "\x16\x41";
1142 string resp = pre_fm;
1143 resp.append(cstr);
1144 cmd = pre_to;
1145 cmd.append(cstr);
1146 cmd.append( post );
1147 if (waitFOR(8, "get AN")) {
1148 size_t p = replystr.rfind(resp);
1149 if (p != string::npos) {
1150 if (replystr[p+6] == 0x01) {
1151 auto_notch_label("AN", true);
1152 return true;
1153 } else {
1154 auto_notch_label("AN", false);
1155 return false;
1156 }
1157 }
1158 }
1159 return progStatus.auto_notch;
1160 }
1161
1162 static bool IC7300_notchon = false;
1163
1164 void RIG_IC7300::set_notch(bool on, int val)
1165 {
1166 int notch = val / 20 + 53;
1167 minmax(0, 255, notch);
1168 if (on != IC7300_notchon) {
1169 cmd = pre_to;
1170 cmd.append("\x16\x48");
1171 cmd += on ? '\x01' : '\x00';
1172 cmd.append(post);
1173 waitFB("set notch");
1174 IC7300_notchon = on;
1175 }
1176
1177 if (on) {
1178 cmd = pre_to;
1179 cmd.append("\x14\x0D");
1180 cmd.append(to_bcd(notch,3));
1181 cmd.append(post);
1182 waitFB("set notch val");
1183 }
1184 }
1185
1186 bool RIG_IC7300::get_notch(int &val)
1187 {
1188 bool on = false;
1189 val = 0;
1190
1191 string cstr = "\x16\x48";
1192 string resp = pre_fm;
1193 resp.append(cstr);
1194 cmd = pre_to;
1195 cmd.append(cstr);
1196 cmd.append( post );
1197 if (waitFOR(8, "get notch")) {
1198 size_t p = replystr.rfind(resp);
1199 if (p != string::npos)
1200 on = replystr[p + 6] ? 1 : 0;
1201 cmd = pre_to;
1202 resp = pre_fm;
1203 cstr = "\x14\x0D";
1204 cmd.append(cstr);
1205 resp.append(cstr);
1206 cmd.append(post);
1207 if (waitFOR(9, "get notch val")) {
1208 size_t p = replystr.rfind(resp);
1209 if (p != string::npos) {
1210 val = fm_bcd(&replystr[p+6],3);
1211 val = (val - 53) * 20;
1212 if (val < 0) val = 0;
1213 if (val > 4040) val = 4040;
1214 }
1215 }
1216 }
1217 return (IC7300_notchon = on);
1218 }
1219
1220 void RIG_IC7300::get_notch_min_max_step(int &min, int &max, int &step)
1221 {
1222 min = 0;
1223 max = 4040;
1224 step = 20;
1225 }
1226
4848 "2600", "2700", "2800", "2900", "3000", "3100", "3200", "3300", "3400", "3500",
4949 "3600", NULL };
5050 static int IC7600_bw_vals_SSB[] = {
51 1, 2, 3, 4, 5, 6, 7, 8, 9,10,
52 11,12,13,14,15,16,17,18,19,20,
53 21,22,23,24,25,26,27,28,29,30,
54 31,32,33,34,35,36,37,38,39,40,
55 41, WVALS_LIMIT};
51 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
52 10,11,12,13,14,15,16,17,18,19,
53 20,21,22,23,24,25,26,27,28,29,
54 30,31,32,33,34,35,36,37,38,39,
55 40, WVALS_LIMIT};
5656
5757 const char *IC7600_rtty_bws[] = {
5858 "50", "100", "150", "200", "250", "300", "350", "400", "450", "500",
6060 "1600", "1700", "1800", "1900", "2000", "2100", "2200", "2300", "2400", "2500",
6161 "2600", "2700", NULL };
6262 static int IC7600_bw_vals_RTTY[] = {
63 1, 2, 3, 4, 5, 6, 7, 8, 9,10,
64 11,12,13,14,15,16,17,18,19,20,
65 21,22,23,24,25,26,27,28,29,30,
66 31,32, WVALS_LIMIT};
63 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
64 10,11,12,13,14,15,16,17,18,19,
65 20,21,22,23,24,25,26,27,28,29,
66 30,31, WVALS_LIMIT};
6767
6868 const char *IC7600_am_bws[] = {
6969 "200", "400", "600", "800", "1000", "1200", "1400", "1600", "1800", "2000",
7070 "2200", "2400", "2600", "2800", "3000", "3200", "3400", "3600", "3800", "4000",
7171 "4200", "4400", "4600", "4800", "5000", "5200", "5400", "5600", "5800", "6000",
72 "6200", "6400", "6600", "6800", "7000", "7200", "7400", "7600", "7800", "8000",
72 "6200", "6400", "6600", "6800", "7000", "7600", "7400", "7600", "7800", "8000",
7373 "8200", "8400", "8600", "8800", "9000", "9200", "9400", "9600", "9800", "10000", NULL };
7474 static int IC7600_bw_vals_AM[] = {
75 1, 2, 3, 4, 5, 6, 7, 8, 9,10,
76 11,12,13,14,15,16,17,18,19,20,
77 21,22,23,24,25,26,27,28,29,30,
78 31,32,33,34,35,36,37,38,39,40,
79 41,42,43,44,45,46,47,48,49,50,
75 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
76 10,11,12,13,14,15,16,17,18,19,
77 20,21,22,23,24,25,26,27,28,29,
78 30,31,32,33,34,35,36,37,38,39,
79 40,41,42,43,44,45,46,47,48,49
8080 WVALS_LIMIT};
8181
8282 const char *IC7600_fm_bws[] = { "FIXED", NULL };
100100
101101 RIG_IC7600::RIG_IC7600() {
102102 defaultCIV = 0x7A;
103 adjustCIV(defaultCIV);
104
103105 name_ = IC7600name_;
104106 modes_ = IC7600modes_;
105107 bandwidths_ = IC7600_ssb_bws;
106108 bw_vals_ = IC7600_bw_vals_SSB;
107109
108110 _mode_type = IC7600_mode_type;
109 adjustCIV(defaultCIV);
110111
111112 widgets = IC7600_widgets;
112113
113 has_extras =
114
115 has_cw_wpm =
116 has_cw_spot_tone =
117 has_cw_qsk =
118
119 has_vox_onoff =
120 has_vox_gain =
121 has_vox_anti =
122 has_vox_hang =
123
124 has_compON =
125 has_compression =
126
127 has_split =
128 has_split_AB =
129
130 has_micgain_control =
114 A.freq = 14070000;
115 A.imode = 13;
116 A.iBW = 34;
117 B.freq = 7070000;
118 B.imode = 13;
119 B.iBW = 34;
120
121 has_extras = true;
122
123 has_cw_wpm = true;
124 has_cw_spot_tone = true;
125 has_cw_qsk = true;
126
127 has_vox_onoff = true;
128 has_vox_gain = true;
129 has_vox_anti = true;
130 has_vox_hang = true;
131
132 has_compON = true;
133 has_compression = true;
134
135 has_split = true;
136 has_split_AB = true;
137
138 has_micgain_control = true;
131139 has_bandwidth_control = true;
140
141 has_smeter = true;
142
143 has_power_out =
144 has_swr_control =
145 has_alc_control =
146 has_sql_control = true;
147
148 has_power_control = true;
149 has_volume_control = true;
150 has_mode_control = true;
151
152 has_attenuator_control = true;
153 has_preamp_control = true;
154
155 has_noise_control = true;
156 has_noise_reduction = true;
157 has_noise_reduction_control = true;
158
159 has_auto_notch = true;
160 has_notch_control = true;
161
162 has_rf_control = true;
163
164 has_ptt_control = true;
165 has_tune_control = true;
132166
133167 precision = 1;
134168 ndigits = 8;
155189 IC7600_widgets[11].W = sldrPOWER;
156190 }
157191
192 static inline void minmax(int min, int max, int &val)
193 {
194 if (val > max) val = max;
195 if (val < min) val = min;
196 }
197
158198 void RIG_IC7600::selectA()
159199 {
160 cmd = pre_to;
161 cmd += '\x07';
162 cmd += '\xD0';
163 cmd.append(post);
164 sendICcommand(cmd, 6);
165 checkresponse();
200 cmd.assign(pre_to).append("\x07\xD0").append(post);
201 waitFB("select A");
166202 }
167203
168204 void RIG_IC7600::selectB()
169205 {
170 cmd = pre_to;
171 cmd += '\x07';
172 cmd += '\xD1';
173 cmd.append(post);
174 sendICcommand(cmd, 6);
175 checkresponse();
206 cmd.assign(pre_to).append("\x07\xD1").append(post);
207 waitFB("select B");
208 }
209
210 long RIG_IC7600::get_vfoA ()
211 {
212 string resp;
213 cmd.assign(pre_to).append("\x03").append( post );
214 if (waitFOR(11, "get vfo A")) {
215 resp.assign(pre_fm).append("\x03");
216 size_t p = replystr.rfind(resp);
217 if (p != string::npos)
218 A.freq = fm_bcd_be(&replystr[p+5], 10);
219 }
220 return A.freq;
221 }
222
223 void RIG_IC7600::set_vfoA (long freq)
224 {
225 A.freq = freq;
226 cmd.assign(pre_to).append("\x05");
227 cmd.append( to_bcd_be( freq, 10 ) );
228 cmd.append( post );
229 waitFB("set vfo A");
230 }
231
232 long RIG_IC7600::get_vfoB ()
233 {
234 string resp = pre_fm;
235 cmd.assign(pre_to).append("\x03").append(post);
236 if (waitFOR(11, "get vfo B")) {
237 resp.assign(pre_fm).append("\x03");
238 size_t p = replystr.rfind(resp);
239 if (p != string::npos)
240 B.freq = fm_bcd_be(&replystr[p+5], 10);
241 }
242 return B.freq;
243 }
244
245 void RIG_IC7600::set_vfoB (long freq)
246 {
247 B.freq = freq;
248 cmd.assign(pre_to).append("\x05");
249 cmd.append( to_bcd_be( freq, 10 ) );
250 cmd.append( post );
251 waitFB("set vfo B");
176252 }
177253
178254 bool RIG_IC7600::can_split()
184260 {
185261 split = val;
186262 if (val) {
187 cmd.assign(pre_to);
188 cmd.append("\x0F");
189 cmd += '\x01';
190 cmd.append( post );
263 cmd.assign(pre_to).append("\x0F\x01").append( post );
191264 waitFB("Split ON");
192265 } else {
193 cmd.assign(pre_to);
194 cmd.append("\x0F");
266 cmd.assign(pre_to).append("\x0F");
195267 cmd += '\x00';
196268 cmd.append( post );
197269 waitFB("Split OFF");
204276 cmd.assign(pre_to);
205277 cmd.append("\x0F");
206278 cmd.append( post );
207 if (sendICcommand (cmd, 7))
208 split = replystr[5];
279 if (waitFOR(7, "get split")) {
280 string resp = pre_fm;
281 resp.append("\x0F");
282 size_t p = replystr.find(resp);
283 if (p != string::npos)
284 split = replystr[p+5];
285 }
209286 return split;
210287 }
211288
216293 cmd.append(post);
217294 if (IC7600_DEBUG)
218295 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
219 sendICcommand (cmd, 6);
220 checkresponse();
296 waitFB("swap vfos");
221297 }
222298
223299 void RIG_IC7600::set_modeA(int val)
227303 cmd += '\x06';
228304 cmd += IC7600_mode_nbr[val];
229305 cmd.append( post );
230 if (IC7600_DEBUG)
231 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
232 sendICcommand (cmd, 6);
233 checkresponse();
306 waitFB("set modeA");
307
234308 // digital set / clear
235 if (A.imode >= 10) {
309 if (val >= 10) {
236310 cmd = pre_to;
237 cmd += '\x1A'; cmd += '\x06';
238 switch (A.imode) {
239 case 10 : case 13 : cmd += '\x01'; cmd += '\x01';break;
240 case 11 : case 14 : cmd += '\x02'; cmd += '\x01';break;
241 case 12 : case 15 : cmd += '\x03'; cmd += '\x01';break;
242 default :
243 cmd += '\x00'; cmd += '\x00';
311 cmd.append("\x1A\x06");
312 switch (val) {
313 case 10 : case 13 : cmd.append("\x01\x01"); break;
314 case 11 : case 14 : cmd.append("\x02\x01"); break;
315 case 12 : case 15 : cmd.append("\x03\x01"); break;
244316 }
245317 cmd.append( post);
246 if (IC7600_DEBUG)
247 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
248 sendICcommand (cmd, 6);
249 checkresponse();
318 waitFB("set digital mode ON/OFF");
250319 }
251320 }
252321
253322 int RIG_IC7600::get_modeA()
254323 {
255324 int md = 0;
256 cmd = pre_to;
257 cmd += '\x04';
258 cmd.append(post);
259 if (sendICcommand (cmd, 8 )) {
260 for (md = 0; md < 10; md++) if (replystr[5] == IC7600_mode_nbr[md]) break;
261 if (md == 10) md = 0;
262 A.imode = md;
263 } else
264 checkresponse();
265 if (md == 0 || md == 1) {
266 cmd = pre_to;
267 cmd += '\x1A'; cmd += '\x06';
268 cmd.append(post);
269 if (sendICcommand(cmd, 9)) {
270 if (replystr[6] > 0 && A.imode < 2) {
271 if (replystr[6] < 4)
272 A.imode = 9 + A.imode * 3 + replystr[6];
325 string resp;
326 size_t p;
327 cmd.assign(pre_to).append("\x04").append(post);
328 if (waitFOR(8, "get mode A")) {
329 resp.assign(pre_fm).append("\x04");
330 p = replystr.rfind(resp);
331 if (p == string::npos) return A.imode;
332 for (md = 0; md < 10; md++) {
333 if (replystr[p+5] == IC7600_mode_nbr[md]) {
334 A.imode = md;
273335 }
274336 }
275 }
337 if (A.imode < 2) {
338 cmd.assign(pre_to).append("\x1A\x06").append(post);
339 if (waitFOR(9, "data mode?")) {
340 resp.assign(pre_fm).append("\x1A\x06");
341 p = replystr.rfind(resp);
342 if (p == string::npos) return A.imode;
343 int dmode = replystr[p+6];
344 if (A.imode == 0) A.imode = 9 + dmode;
345 else if (A.imode == 1) A.imode = 12 + dmode;
346 }
347 }
348 }
349 if (A.imode > 15) A.imode = 0;
276350 return A.imode;
277351 }
278352
279353 void RIG_IC7600::set_modeB(int val)
280354 {
281355 B.imode = val;
282 cmd = pre_to;
283 cmd += '\x06';
356 cmd.assign(pre_to).append("\x06");
284357 cmd += IC7600_mode_nbr[val];
285358 cmd.append( post );
286 if (IC7600_DEBUG)
287 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
288 sendICcommand (cmd, 6);
289 checkresponse();
359 waitFB("set modeB");
360
290361 // digital set / clear
291 if (B.imode >= 10) {
362 if (val >= 10) {
292363 cmd = pre_to;
293 cmd += '\x1A'; cmd += '\x06';
294 switch (B.imode) {
295 case 10 : case 13 : cmd += '\x01'; cmd += '\x01';break;
296 case 11 : case 14 : cmd += '\x02'; cmd += '\x01';break;
297 case 12 : case 15 : cmd += '\x03'; cmd += '\x01';break;
298 default :
299 cmd += '\x00'; cmd += '\x00';
364 cmd.append("\x1A\x06");
365 switch (val) {
366 case 10 : case 13 : cmd.append("\x01\x01"); break;
367 case 11 : case 14 : cmd.append("\x02\x01"); break;
368 case 12 : case 15 : cmd.append("\x03\x01"); break;
300369 }
301370 cmd.append( post);
302 if (IC7600_DEBUG)
303 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
304 sendICcommand (cmd, 6);
305 checkresponse();
371 waitFB("set digital mode ON/OFF");
306372 }
307373 }
308374
309375 int RIG_IC7600::get_modeB()
310376 {
311377 int md = 0;
312 cmd = pre_to;
313 cmd += '\x04';
314 cmd.append(post);
315 if (sendICcommand (cmd, 8 )) {
316 for (md = 0; md < 10; md++) if (replystr[5] == IC7600_mode_nbr[md]) break;
378 string resp;
379 size_t p;
380 cmd.assign(pre_to).append("\x04").append(post);
381 if (waitFOR(8, "get mode B")) {
382 resp.assign(pre_fm).append("\x04");
383 p = replystr.rfind(resp);
384 if (p == string::npos) return B.imode;
385 for (md = 0; md < 10; md++) if (replystr[p+5] == IC7600_mode_nbr[md]) break;
317386 if (md == 10) md = 0;
318387 B.imode = md;
319 } else
320 checkresponse();
321 if (md == 0 || md == 1) {
322 cmd = pre_to;
323 cmd += '\x1A'; cmd += '\x06';
324 cmd.append(post);
325 if (sendICcommand(cmd, 9)) {
326 if (replystr[6] > 0 && B.imode < 2) {
327 if (replystr[6] < 4)
328 B.imode = 9 + B.imode * 3 + replystr[6];
388
389 if (B.imode < 2) {
390 cmd.assign(pre_to).append("\x1A\x06").append(post);
391 if (waitFOR(9, "data mode?")) {
392 resp.assign(pre_fm).append("\x1A\x06");
393 p = replystr.rfind(resp);
394 if (p == string::npos) return B.imode;
395 int dmode = replystr[p+6];
396 if (B.imode == 0) B.imode = 9 + dmode;
397 else if (B.imode == 1) B.imode = 12 + dmode;
329398 }
330399 }
331400 }
401 if (B.imode > 15) B.imode = 0;
332402 return B.imode;
333403 }
334404
338408 cmd = pre_to;
339409 cmd.append("\x1a\x03");
340410 cmd.append(post);
341 if (sendICcommand (cmd, 8)) {
342 A.iBW = fm_bcd(&replystr[6], 2);
411 if (waitFOR(8, "get_bwA")) {
412 string resp = pre_fm;
413 resp.append("\x1A\x02");
414 size_t p = replystr.find(resp);
415 if (p != string::npos)
416 A.iBW = fm_bcd(&replystr[p+6], 2);
343417 }
344418 return A.iBW;
345419 }
348422 {
349423 A.iBW = val;
350424 if (A.imode == 5) return;
425 if (A.imode > bw_size_) A.imode = bw_size_;
351426 cmd = pre_to;
352427 cmd.append("\x1a\x03");
353428 cmd.append(to_bcd(A.iBW, 2));
354429 cmd.append(post);
355 if (IC7600_DEBUG)
356 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
357 sendICcommand (cmd, 6);
358 checkresponse();
430 waitFB("set bwA");
359431 }
360432
361433 int RIG_IC7600::get_bwB()
364436 cmd = pre_to;
365437 cmd.append("\x1a\x03");
366438 cmd.append(post);
367 if (sendICcommand (cmd, 8)) {
368 B.iBW = fm_bcd(&replystr[6], 2);
439 if (waitFOR(8, "get_bwB")) {
440 string resp = pre_fm;
441 resp.append("\x1A\x02");
442 size_t p = replystr.find(resp);
443 if (p != string::npos)
444 B.iBW = fm_bcd(&replystr[p+6], 2);
369445 }
370446 return B.iBW;
371447 }
374450 {
375451 B.iBW = val;
376452 if (B.imode == 5) return;
453 if (B.iBW > bw_size_) B.iBW = bw_size_;
377454 cmd = pre_to;
378455 cmd.append("\x1a\x03");
379456 cmd.append(to_bcd(A.iBW, 2));
380457 cmd.append(post);
381 if (IC7600_DEBUG)
382 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
383 sendICcommand (cmd, 6);
384 checkresponse();
458 waitFB("set bwB");
385459 }
386460
387461 int RIG_IC7600::adjust_bandwidth(int m)
391465 case 2: // AM
392466 bandwidths_ = IC7600_am_bws;
393467 bw_vals_ = IC7600_bw_vals_AM;
468 bw_size_ = sizeof(IC7600_bw_vals_AM);
394469 bw = 19;
395470 break;
396471 case 5: // FM
397472 bandwidths_ = IC7600_fm_bws;
398473 bw_vals_ = IC7600_bw_vals_FM;
474 bw_size_ = sizeof(IC7600_bw_vals_FM);
399475 bw = 0;
400476 break;
401477 case 4: case 7: // RTTY
402478 bandwidths_ = IC7600_rtty_bws;
403479 bw_vals_ = IC7600_bw_vals_RTTY;
480 bw_size_ = sizeof(IC7600_bw_vals_RTTY);
404481 bw = 12;
405482 break;
406483 case 3: case 6: // CW
407484 bandwidths_ = IC7600_ssb_bws;
408485 bw_vals_ = IC7600_bw_vals_SSB;
486 bw_size_ = sizeof(IC7600_bw_vals_SSB);
409487 bw = 12;
410488 break;
411489 case 8: case 9: // PKT
412490 bandwidths_ = IC7600_ssb_bws;
413491 bw_vals_ = IC7600_bw_vals_SSB;
492 bw_size_ = sizeof(IC7600_bw_vals_SSB);
414493 bw = 34;
415494 break;
416495 case 0: case 1: // SSB
419498 default:
420499 bandwidths_ = IC7600_ssb_bws;
421500 bw_vals_ = IC7600_bw_vals_SSB;
501 bw_size_ = sizeof(IC7600_bw_vals_SSB);
422502 bw = 34;
423503 }
424504 return bw;
452532 return bw;
453533 }
454534
535 int RIG_IC7600::get_mic_gain()
536 {
537 int val = 0;
538 string cstr = "\x14\x0B";
539 string resp = pre_fm;
540 resp.append(cstr);
541 cmd = pre_to;
542 cmd.append(cstr);
543 cmd.append(post);
544 if (waitFOR(9, "get mic")) {
545 size_t p = replystr.rfind(resp);
546 if (p != string::npos)
547 val = (int)ceil(fm_bcd(&replystr[p+6],3) / 2.55);
548 }
549 minmax(0,100,val);
550 return val;
551 }
552
455553 void RIG_IC7600::set_mic_gain(int v)
456554 {
457 ICvol = (int)(v * 255 / 100);
555 int ICvol = (int)(v * 255 / 100);
556 minmax(0, 255, ICvol);
458557 if (!progStatus.USBaudio) {
459558 cmd = pre_to;
460559 cmd.append("\x14\x0B");
467566 cmd.append(to_bcd(ICvol, 3));
468567 cmd.append( post );
469568 }
470 sendICcommand (cmd, 6);
471 checkresponse();
472 if (RIG_DEBUG)
473 LOG_WARN("%s", str2hex(cmd.data(), cmd.length()));
474 }
569 waitFB("set mic gain");
570 }
571
572 void RIG_IC7600::get_mic_gain_min_max_step(int &min, int &max, int &step)
573 {
574 min = 0;
575 max = 100;
576 step = 1;
577 }
578
475579
476580 // alh added ++++++++++++++++++++++++++++
477
478 void RIG_IC7600::set_attenuator(int val)
479 {
480 int cmdval = 0;
481 if (atten_level == 0) {
482 atten_level = 1;
483 atten_label("6 dB", true);
484 cmdval = 0x06;
485 } else if (atten_level == 1) {
486 atten_level = 2;
487 atten_label("12 dB", true);
488 cmdval = 0x12;
489 } else if (atten_level == 2) {
490 atten_level = 3;
491 atten_label("18 dB", true);
492 cmdval = 0x18;
493 } else if (atten_level == 3) {
494 atten_level = 0;
495 atten_label("Att", false);
496 cmdval = 0x00;
497 }
498 cmd = pre_to;
499 cmd += '\x11';
500 cmd += cmdval;
501 cmd.append( post );
502 sendICcommand(cmd,6);
503 checkresponse();
504 if (RIG_DEBUG)
505 LOG_INFO("%s", str2hex(cmd.data(), cmd.length()));
506 }
507
508 int RIG_IC7600::get_attenuator()
509 {
510 cmd = pre_to;
511 cmd += '\x11';
512 cmd.append( post );
513 if (sendICcommand(cmd,7)) {
514 if (replystr[5] == 0x06) {
515 atten_level = 1;
516 atten_label("6 dB", true);
517 } else if (replystr[6] == 0x12) {
518 atten_level = 2;
519 atten_label("12 dB", true);
520 } else if (replystr[6] == 0x18) {
521 atten_level = 3;
522 atten_label("18 dB", true);
523 } else if (replystr[6] == 0x00) {
524 atten_level = 0;
525 atten_label("Att", false);
526 }
527 }
528 return atten_level;
529 }
530581
531582 void RIG_IC7600::set_compression()
532583 {
635686 waitFB("SET cw sidetone volume");
636687 }
637688
689 // Tranceiver PTT on/off
690 void RIG_IC7600::set_PTT_control(int val)
691 {
692 cmd = pre_to;
693 cmd += '\x1c';
694 cmd += '\x00';
695 cmd += (unsigned char) val;
696 cmd.append( post );
697 waitFB("set ptt");
698 }
699
700 // Volume control val 0 ... 100
701 void RIG_IC7600::set_volume_control(int val)
702 {
703 int ICvol = (int)(val * 255 / 100);
704 minmax(0, 255, ICvol);
705 cmd = pre_to;
706 cmd.append("\x14\x01");
707 cmd.append(to_bcd(ICvol, 3));
708 cmd.append( post );
709 waitFB("set vol");
710 }
711
712 /*
713
714 I:12:20:22: get vol ans in 0 ms, OK
715 cmd FE FE 7A E0 14 01 FD
716 ans FE FE 7A E0 14 01 FD
717 FE FE E0 7A 14 01 00 65 FD
718 0 1 2 3 4 5 6 7 8
719 */
720 int RIG_IC7600::get_volume_control()
721 {
722 int val = 0;
723 string cstr = "\x14\x01";
724 string resp = pre_fm;
725 resp.append(cstr);
726 cmd = pre_to;
727 cmd.append(cstr);
728 cmd.append( post );
729 if (waitFOR(9, "get vol")) {
730 size_t p = replystr.rfind(resp);
731 if (p != string::npos)
732 val = (int)ceil(fm_bcd(&replystr[p + 6],3) * 100 / 255);
733 }
734 minmax(0, 100, val);
735 progStatus.volume = val;
736 return (progStatus.volume);
737 }
738
739 void RIG_IC7600::get_vol_min_max_step(int &min, int &max, int &step)
740 {
741 min = 0; max = 100; step = 1;
742 }
743
744 void RIG_IC7600::set_power_control(double value)
745 {
746 int val = (int)(value * 255 / 100);
747 minmax(0, 255, val);
748 cmd = pre_to;
749 cmd.append("\x14\x0A");
750 cmd.append(to_bcd(val, 3));
751 cmd.append( post );
752 waitFB("set power");
753 }
754
755 int RIG_IC7600::get_power_control()
756 {
757 int val = progStatus.power_level;
758 string cstr = "\x14\x0A";
759 string resp = pre_fm;
760 cmd = pre_to;
761 cmd.append(cstr).append(post);
762 resp.append(cstr);
763 if (waitFOR(9, "get power")) {
764 size_t p = replystr.rfind(resp);
765 if (p != string::npos)
766 val = (int)ceil(fm_bcd(&replystr[p + 6],3) * 100 / 255);
767 }
768 minmax(0, 100, val);
769 progStatus.power_level = val;
770 return (progStatus.power_level);
771 }
772
773 void RIG_IC7600::get_pc_min_max_step(double &min, double &max, double &step)
774 {
775 min = 2; max = 100; step = 1;
776 }
777
778 int RIG_IC7600::get_smeter()
779 {
780 string cstr = "\x15\x02";
781 string resp = pre_fm;
782 resp.append(cstr);
783 cmd = pre_to;
784 cmd.append(cstr);
785 cmd.append( post );
786 int mtr= -1;
787 if (waitFOR(9, "get smeter")) {
788 size_t p = replystr.rfind(resp);
789 if (p != string::npos) {
790 mtr = fm_bcd(&replystr[p+6], 3);
791 mtr = (int)ceil(mtr /2.41);
792 if (mtr > 100) mtr = 100;
793 }
794 }
795 return mtr;
796 }
797
798 int RIG_IC7600::get_power_out(void)
799 {
800 string cstr = "\x15\x11";
801 string resp = pre_fm;
802 resp.append(cstr);
803 cmd = pre_to;
804 cmd.append(cstr);
805 cmd.append( post );
806 int mtr= -1;
807 if (waitFOR(9, "get power out")) {
808 size_t p = replystr.rfind(resp);
809 if (p != string::npos) {
810 mtr = fm_bcd(&replystr[p+6], 3);
811 mtr = (int)ceil(mtr /2.13);
812 if (mtr > 100) mtr = 100;
813 }
814 }
815 return mtr;
816 }
817
818 int RIG_IC7600::get_swr(void)
819 {
820 string cstr = "\x15\x12";
821 string resp = pre_fm;
822 resp.append(cstr);
823 cmd = pre_to;
824 cmd.append(cstr);
825 cmd.append( post );
826 int mtr= -1;
827 if (waitFOR(9, "get swr")) {
828 size_t p = replystr.rfind(resp);
829 if (p != string::npos) {
830 mtr = fm_bcd(&replystr[p+6], 3);
831 mtr = (int)ceil(mtr /2.55);
832 if (mtr > 100) mtr = 100;
833 }
834 }
835 return mtr;
836 }
837
838 int RIG_IC7600::get_alc(void)
839 {
840 string cstr = "\x15\x13";
841 string resp = pre_fm;
842 resp.append(cstr);
843 cmd = pre_to;
844 cmd.append(cstr);
845 cmd.append( post );
846 int mtr= -1;
847 if (waitFOR(9, "get alc")) {
848 size_t p = replystr.rfind(resp);
849 if (p != string::npos) {
850 mtr = fm_bcd(&replystr[p+6], 3);
851 mtr = (int)ceil(mtr /1.2);
852 if (mtr > 100) mtr = 100;
853 }
854 }
855 return mtr;
856 }
857
858 void RIG_IC7600::set_rf_gain(int val)
859 {
860 int ICrfg = (int)(val * 255 / 100);
861 minmax(0, 255, ICrfg);
862 cmd = pre_to;
863 cmd.append("\x14\x02");
864 cmd.append(to_bcd(ICrfg, 3));
865 cmd.append( post );
866 waitFB("set RF");
867 }
868
869 int RIG_IC7600::get_rf_gain()
870 {
871 int val = progStatus.rfgain;
872 string cstr = "\x14\x02";
873 string resp = pre_fm;
874 cmd = pre_to;
875 cmd.append(cstr).append(post);
876 resp.append(cstr);
877 if (waitFOR(9, "get RF")) {
878 size_t p = replystr.rfind(resp);
879 if (p != string::npos)
880 val = (int)(fm_bcd(&replystr[p + 6],3) * 100 / 255);
881 }
882 minmax(0, 100, val);
883 progStatus.rfgain = val;
884 return (progStatus.rfgain);
885 }
886
887 void RIG_IC7600::get_rf_min_max_step(double &min, double &max, double &step)
888 {
889 min = 0; max = 100; step = 1;
890 }
891
892 void RIG_IC7600::tune_rig()
893 {
894 cmd = pre_to;
895 cmd.append("\x1c\x01\x02");
896 cmd.append( post );
897 waitFB("tune rig");
898 }
899
900 void RIG_IC7600::set_preamp(int val)
901 {
902 cmd = pre_to;
903 cmd += '\x16';
904 cmd += '\x02';
905
906 if (preamp_level == 0) {
907 preamp_level = 1;
908 preamp_label("Amp 1", true);
909 } else if (preamp_level == 1) {
910 preamp_level = 2;
911 preamp_label("Amp 2", true);
912 } else if (preamp_level == 2) {
913 preamp_level = 0;
914 preamp_label("OFF", false);
915 }
916
917 cmd += (unsigned char)preamp_level;
918 cmd.append( post );
919 waitFB("set Pre");
920 }
921
922 int RIG_IC7600::get_preamp()
923 {
924 string cstr = "\x16\x02";
925 string resp = pre_fm;
926 resp.append(cstr);
927 cmd = pre_to;
928 cmd.append(cstr);
929 cmd.append( post );
930 if (waitFOR(8, "get Pre")) {
931 size_t p = replystr.rfind(resp);
932 if (p != string::npos)
933 preamp_level = replystr[p+6];
934 if (preamp_level == 1) {
935 preamp_label("Amp 1", true);
936 } else if (preamp_level == 2) {
937 preamp_label("Amp 2", true);
938 } else {
939 preamp_label("OFF", false);
940 preamp_level = 0;
941 }
942 }
943 return progStatus.preamp = preamp_level;
944 }
945
946 void RIG_IC7600::set_attenuator(int val)
947 {
948 unsigned char level = 0x00;
949 if (atten_level == 0x00) {
950 atten_level = 0x06;
951 atten_label("6 dB", true);
952 } else if (atten_level == 0x06) {
953 atten_level = 0x12;
954 atten_label("12 dB", true);
955 } else if (atten_level == 0x12) {
956 atten_level = 0x18;
957 atten_label("18 dB", true);
958 } else if (atten_level == 0x18) {
959 atten_level = 0x00;
960 atten_label("ATT", false);
961 }
962 cmd = pre_to;
963 cmd += '\x11';
964 cmd += atten_level;
965 cmd.append( post );
966 waitFB("set att");
967 }
968
969 int RIG_IC7600::get_attenuator()
970 {
971 cmd = pre_to;
972 string resp = pre_fm;
973 cmd += '\x11';
974 resp += '\x11';
975 cmd.append( post );
976
977 if (waitFOR(7, "get ATT")) {
978 size_t p = replystr.rfind(resp);
979 if (p != string::npos)
980 atten_level = replystr[p+5];
981 if (atten_level == 0x06) {
982 atten_label("6 dB", true);
983 } else if (atten_level == 0x12) {
984 atten_label("12 dB", true);
985 } else if (atten_level == 0x18) {
986 atten_label("18 dB", true);
987 } else {
988 atten_level = 0;
989 atten_label("ATT", false);
990 }
991 }
992 return atten_level;
993 }
994
995
996 void RIG_IC7600::set_noise(bool val)
997 {
998 cmd = pre_to;
999 cmd.append("\x16\x22");
1000 cmd += val ? 1 : 0;
1001 cmd.append(post);
1002 waitFB("set noise");
1003 }
1004
1005
1006 /*
1007
1008 I:12:06:50: get noise ans in 0 ms, OK
1009 cmd FE FE 7A E0 16 22 FD
1010 ans FE FE 7A E0 16 22 FD FE FE E0 7A 16 22 00 FD
1011
1012 */
1013
1014 int RIG_IC7600::get_noise()
1015 {
1016 string cstr = "\x16\x22";
1017 string resp = pre_fm;
1018 resp.append(cstr);
1019 cmd = pre_to;
1020 cmd.append(cstr);
1021 cmd.append(post);
1022 if (waitFOR(8, "get noise")) {
1023 size_t p = replystr.rfind(resp);
1024 if (p != string::npos)
1025 return (replystr[p+6] ? 1 : 0);
1026 }
1027 return progStatus.noise;
1028 }
1029
1030 void RIG_IC7600::set_noise_reduction(int val)
1031 {
1032 cmd = pre_to;
1033 cmd.append("\x16\x40");
1034 cmd += val ? 1 : 0;
1035 cmd.append(post);
1036 waitFB("set NR");
1037 }
1038
1039 int RIG_IC7600::get_noise_reduction()
1040 {
1041 string cstr = "\x16\x40";
1042 string resp = pre_fm;
1043 resp.append(cstr);
1044 cmd = pre_to;
1045 cmd.append(cstr);
1046 cmd.append(post);
1047 if (waitFOR(8, "get NR")) {
1048 size_t p = replystr.rfind(resp);
1049 if (p != string::npos)
1050 return (replystr[p+6] ? 1 : 0);
1051 }
1052 return progStatus.noise_reduction;
1053 }
1054
1055 /*
1056
1057 I:12:06:50: get NR ans in 0 ms, OK
1058 cmd FE FE 7A E0 16 40 FD
1059 ans FE FE 7A E0 16 40 FD
1060 FE FE E0 7A 16 40 01 FD
1061 0 1 2 3 4 5 6 7
1062
1063 I:12:06:50: get NRval ans in 0 ms, OK
1064 cmd FE FE 7A E0 14 06 FD
1065 ans FE FE 7A E0 14 06 FD
1066 FE FE E0 7A 14 06 00 24 FD
1067 0 1 2 3 4 5 6 7 8
1068
1069 */
1070
1071 void RIG_IC7600::set_noise_reduction_val(int val)
1072 {
1073 cmd = pre_to;
1074 cmd.append("\x14\x06");
1075 cmd.append(to_bcd(val * 255 / 100, 3));
1076 cmd.append(post);
1077 waitFB("set NRval");
1078 }
1079
1080 int RIG_IC7600::get_noise_reduction_val()
1081 {
1082 int val = 0;
1083 string cstr = "\x14\x06";
1084 string resp = pre_fm;
1085 resp.append(cstr);
1086 cmd = pre_to;
1087 cmd.append(cstr);
1088 cmd.append(post);
1089 if (waitFOR(9, "get NRval")) {
1090 size_t p = replystr.rfind(resp);
1091 if (p != string::npos)
1092 val = (int)ceil(fm_bcd(&replystr[p+6],3) * 100 / 255);
1093 }
1094 minmax(0, 100, val);
1095 progStatus.noise_reduction_val = val;
1096 return progStatus.noise_reduction_val;
1097 }
1098
1099 void RIG_IC7600::set_squelch(int val)
1100 {
1101 int ICsql = (int)(val * 255 / 100);
1102 minmax(0, 255, ICsql);
1103 cmd = pre_to;
1104 cmd.append("\x14\x03");
1105 cmd.append(to_bcd(ICsql, 3));
1106 cmd.append( post );
1107 waitFB("set Sqlch");
1108 }
1109
1110 int RIG_IC7600::get_squelch()
1111 {
1112 int val = progStatus.squelch;
1113 string cstr = "\x14\x03";
1114 string resp = pre_fm;
1115 resp.append(cstr);
1116 cmd = pre_to;
1117 cmd.append(cstr);
1118 cmd.append(post);
1119 if (waitFOR(9, "get squelch")) {
1120 size_t p = replystr.rfind(resp);
1121 if (p != string::npos)
1122 val = (int)ceil(fm_bcd(&replystr[p+6], 3) * 100 / 255);
1123 }
1124 minmax(0, 100, val);
1125 progStatus.squelch = val;
1126 return (progStatus.squelch);
1127 }
1128
1129 void RIG_IC7600::set_auto_notch(int val)
1130 {
1131 cmd = pre_to;
1132 cmd += '\x16';
1133 cmd += '\x41';
1134 cmd += (unsigned char)val;
1135 cmd.append( post );
1136 waitFB("set AN");
1137 }
1138
1139 int RIG_IC7600::get_auto_notch()
1140 {
1141 string cstr = "\x16\x41";
1142 string resp = pre_fm;
1143 resp.append(cstr);
1144 cmd = pre_to;
1145 cmd.append(cstr);
1146 cmd.append( post );
1147 if (waitFOR(8, "get AN")) {
1148 size_t p = replystr.rfind(resp);
1149 if (p != string::npos) {
1150 if (replystr[p+6] == 0x01) {
1151 auto_notch_label("AN", true);
1152 return true;
1153 } else {
1154 auto_notch_label("AN", false);
1155 return false;
1156 }
1157 }
1158 }
1159 return progStatus.auto_notch;
1160 }
1161
1162 static bool IC7600_notchon = false;
1163
1164 void RIG_IC7600::set_notch(bool on, int val)
1165 {
1166 int notch = val / 20 + 53;
1167 minmax(0, 255, notch);
1168 if (on != IC7600_notchon) {
1169 cmd = pre_to;
1170 cmd.append("\x16\x48");
1171 cmd += on ? '\x01' : '\x00';
1172 cmd.append(post);
1173 waitFB("set notch");
1174 IC7600_notchon = on;
1175 }
1176
1177 if (on) {
1178 cmd = pre_to;
1179 cmd.append("\x14\x0D");
1180 cmd.append(to_bcd(notch,3));
1181 cmd.append(post);
1182 waitFB("set notch val");
1183 }
1184 }
1185
1186 bool RIG_IC7600::get_notch(int &val)
1187 {
1188 bool on = false;
1189 val = 0;
1190
1191 string cstr = "\x16\x48";
1192 string resp = pre_fm;
1193 resp.append(cstr);
1194 cmd = pre_to;
1195 cmd.append(cstr);
1196 cmd.append( post );
1197 if (waitFOR(8, "get notch")) {
1198 size_t p = replystr.rfind(resp);
1199 if (p != string::npos)
1200 on = replystr[p + 6] ? 1 : 0;
1201 cmd = pre_to;
1202 resp = pre_fm;
1203 cstr = "\x14\x0D";
1204 cmd.append(cstr);
1205 resp.append(cstr);
1206 cmd.append(post);
1207 if (waitFOR(9, "get notch val")) {
1208 size_t p = replystr.rfind(resp);
1209 if (p != string::npos) {
1210 val = fm_bcd(&replystr[p+6],3);
1211 val = (val - 53) * 20;
1212 if (val < 0) val = 0;
1213 if (val > 4040) val = 4040;
1214 }
1215 }
1216 }
1217 return (IC7600_notchon = on);
1218 }
1219
1220 void RIG_IC7600::get_notch_min_max_step(int &min, int &max, int &step)
1221 {
1222 min = 0;
1223 max = 4040;
1224 step = 20;
1225 }
1226
4747 SH_tooltip = szdsptooltip;
4848 SH_label = szbtnlabel;
4949 bw_vals_ = &ibw_val;
50 bw_size_ = 0;
5051
5152 widgets = basewidgets;
5253
6565 RIG_IC7100 rig_IC7100;
6666 RIG_IC7410 rig_IC7410;
6767 RIG_IC7200 rig_IC7200;
68 RIG_IC7300 rig_IC7300;
6869 RIG_IC7600 rig_IC7600;
6970 RIG_IC7700 rig_IC7700;
7071 RIG_IC7800 rig_IC7800;
136137 &rig_IC7000, // 34
137138 &rig_IC7100, // 35
138139 &rig_IC7200, // 36
139 &rig_IC7410, // 37
140 &rig_IC7600, // 38
141 &rig_IC7700, // 39
142 &rig_IC7800, // 40
143 &rig_IC9100, // 41
144 &rig_IC910H, // 42
145 &rig_K2, // 43
146 &rig_K3, // 44
147 &rig_KX3, // 45
148 &rig_PCR1000, // 46
149 &rig_RAY152, // 47
150 &rig_TS140, // 48
151 &rig_TS450S, // 49
152 &rig_TS480HX, // 50
153 &rig_TS480SAT, // 51
154 &rig_TS570, // 52
155 &rig_TS590S, // 53
156 &rig_TS590SG, // 54
157 &rig_TS870S, // 55 wbx
158 &rig_TS990, // 56
159 &rig_TS2000, // 57
160 &rig_TT516, // 58
161 &rig_TT535, // 59
162 &rig_TT538, // 60
163 &rig_TT550, // 61
164 &rig_TT563, // 62
165 &rig_TT566, // 63
166 &rig_TT588, // 64
167 &rig_TT599, // 65
140 &rig_IC7300, // 37
141 &rig_IC7410, // 38
142 &rig_IC7600, // 39
143 &rig_IC7700, // 40
144 &rig_IC7800, // 41
145 &rig_IC9100, // 42
146 &rig_IC910H, // 43
147 &rig_K2, // 44
148 &rig_K3, // 45
149 &rig_KX3, // 46
150 &rig_PCR1000, // 47
151 &rig_RAY152, // 48
152 &rig_TS140, // 49
153 &rig_TS450S, // 50
154 &rig_TS480HX, // 51
155 &rig_TS480SAT, // 52
156 &rig_TS570, // 53
157 &rig_TS590S, // 54
158 &rig_TS590SG, // 55
159 &rig_TS870S, // 56 wbx
160 &rig_TS990, // 57
161 &rig_TS2000, // 58
162 &rig_TT516, // 59
163 &rig_TT535, // 60
164 &rig_TT538, // 61
165 &rig_TT550, // 62
166 &rig_TT563, // 63
167 &rig_TT566, // 64
168 &rig_TT588, // 65
169 &rig_TT599, // 66
168170 NULL
169171 };
170172
679679 else srvr_vfo = vfoA;
680680 }
681681 srvr_vfo.iBW = bw;
682 printf("srvr_vfo.iBW: %X\n", bw);
683682 push_xml();
684683 }
685684 std::string help() { return std::string("set_bw to VAL"); }
5959 static string buffer;
6060
6161 debug* debug::inst = 0;
62 debug::level_e debug::level = debug::ERROR_LEVEL;
62 //debug::level_e debug::level = debug::ERROR_LEVEL;
63 debug::level_e debug::level = debug::INFO_LEVEL;
64
6365 uint32_t debug::mask = ~0u;
6466
6567 const char* prefix[] = { _("Quiet"), _("Error"), _("Warning"), _("Info"), _("Debug") };
105107 }
106108
107109 static char fmt[1024];
108 static char sztemp[1024];
110 static char sztemp[8096];
109111 static string estr = "";
110112 bool debug_in_use = false;
111113
468468 txtCIV->value(hexstr);
469469 txtCIV->activate();
470470 btnCIVdefault->activate();
471 if (xcvr_name == rig_IC7200.name_ || xcvr_name == rig_IC7600.name_ ) {
471 if (xcvr_name == rig_IC7200.name_ ||
472 xcvr_name == rig_IC7300.name_ ||
473 xcvr_name == rig_IC7600.name_ ) {
472474 btnUSBaudio->value(progStatus.USBaudio);
473475 btnUSBaudio->activate();
474476 } else
1919
2020 #include <iostream>
2121 #include <fstream>
22 #include <sstream>
2223 #include <string>
2324
2425 #include <FL/Fl_Preferences.H>
3233 #include "config.h"
3334 #include "rigpanel.h"
3435 #include "ui.h"
36 #include "debug.h"
3537
3638 string xcvr_name = "NONE";
3739
150152
151153 0, // int split;
152154
153 true, // bool key_fldigi;
154
155155 5, // int rx_avg;
156156 5, // int rx_peak;
157157 5, // int pwr_avg;
158158 5, // int pwr_peak;
159159 4, // int pwr_scale ==> Autoselect
160160
161 //ft950 reversed RF gain values
162 false, // bool ft950_rg_reverse
161163 //tt550 controls
162164 80, // tt550_line_out;
163165 1, // tt550_agc_level;
335337 spref.set("sep_dtrptt", sep_dtrptt);
336338 spref.set("sep_rtsplus", sep_rtsplus);
337339 spref.set("set_dtrplus", sep_dtrplus);
338
339 spref.set("key_fldigi", key_fldigi);
340340
341341 spref.set("poll_smeter", poll_smeter);
342342 spref.set("poll_frequency", poll_frequency);
389389 spref.set("pwr_peak", pwr_peak);
390390 spref.set("pwr_scale", pwr_scale);
391391
392 spref.set("ft950_rg_reverse", ft950_rg_reverse);
393
392394 if (selrig->name_ == rig_TT550.name_) {
393395 spref.set("tt550_line_out", tt550_line_out);
394396 spref.set("tt550_agc_level", tt550_agc_level);
613615 if (spref.get("sep_rtsplus", i, i)) sep_rtsplus = i;
614616 if (spref.get("sep_dtrplus", i, i)) sep_dtrplus = i;
615617
616 if (spref.get("key_fldigi", i, key_fldigi)) key_fldigi = i;
617
618618 spref.get("poll_smeter", poll_smeter, poll_smeter);
619619 spref.get("poll_frequency", poll_frequency, poll_frequency);
620620 spref.get("poll_mode", poll_mode, poll_mode);
665665 spref.get("pwr_avg", pwr_avg, pwr_avg);
666666 spref.get("pwr_peak", pwr_peak, pwr_peak);
667667 spref.get("pwr_scale", pwr_scale, pwr_scale);
668
669 if (spref.get("ft950_rg_reverse", i, i)) ft950_rg_reverse = i;
668670
669671 if (selrig->name_ == rig_TT550.name_) {
670672 spref.get("tt550_line_out", tt550_line_out, tt550_line_out);
824826
825827 if (spref.get("hrd_buttons", i, i)) hrd_buttons = i;
826828 }
829
830 LOG_INFO("%s", info().c_str());
827831
828832 return true;
829833 }
949953 if (spnrMICGAIN) spnrMICGAIN->color(bg_slider);
950954 if (spnrMICGAIN) spnrMICGAIN->selection_color(btn_slider);
951955
952 if (use_rig_data) mnuKeepData->set();
953 else mnuKeepData->clear();
954
955956 if (restore_rig_data) mnuRestoreData->set();
956957 else mnuRestoreData->clear();
957958
958959 Fl::scheme(ui_scheme.c_str());
959960 }
961
962 string status::info()
963 {
964 stringstream info;
965
966 info << "\n ============= Prefs File Contents =============\n\n";
967 info << "xcvr_serial_port : " << xcvr_serial_port << "\n";
968 info << "comm_baudrate : " << comm_baudrate << "\n";
969 info << "comm_stopbits : " << stopbits << "\n";
970 info << "comm_retries : " << comm_retries << "\n";
971 info << "comm_wait : " << comm_wait << "\n";
972 info << "comm_timeout : " << comm_timeout << "\n";
973 info << "serloop_timing : " << serloop_timing << "\n";
974 info << "byte_interval : " << byte_interval << "\n";
975 info << "\n";
976 info << "comm_echo : " << comm_echo << "\n";
977 info << "ptt_via_cat : " << comm_catptt << "\n";
978 info << "ptt_via_rts : " << comm_rtsptt << "\n";
979 info << "ptt_via_dtr : " << comm_dtrptt << "\n";
980 info << "rts_cts_flow : " << comm_rtscts << "\n";
981 info << "rts_plus : " << comm_rtsplus << "\n";
982 info << "dtr_plus : " << comm_dtrplus << "\n";
983 info << "civadr : " << CIV << "\n";
984 info << "usbaudio : " << USBaudio << "\n";
985 info << "\n";
986 info << "aux_serial_port : " << aux_serial_port.c_str() << "\n";
987 info << "aux_rts : " << aux_rts << "\n";
988 info << "aux_dtr : " << aux_dtr << "\n";
989 info << "\n";
990 info << "sep_serial_port : " << sep_serial_port.c_str() << "\n";
991 info << "sep_rtsptt : " << sep_rtsptt << "\n";
992 info << "sep_dtrptt : " << sep_dtrptt << "\n";
993 info << "sep_rtsplus : " << sep_rtsplus << "\n";
994 info << "set_dtrplus : " << sep_dtrplus << "\n";
995 info << "\n";
996 info << "poll_smeter : " << poll_smeter << "\n";
997 info << "poll_frequency : " << poll_frequency << "\n";
998 info << "poll_mode : " << poll_mode << "\n";
999 info << "poll_bandwidth : " << poll_bandwidth << "\n";
1000 info << "poll_volume : " << poll_volume << "\n";
1001 info << "poll_auto_notch : " << poll_auto_notch << "\n";
1002 info << "poll_notch : " << poll_notch << "\n";
1003 info << "poll_ifshift : " << poll_ifshift << "\n";
1004 info << "poll_power_control : " << poll_power_control << "\n";
1005 info << "poll_pre_att : " << poll_pre_att << "\n";
1006 info << "poll_micgain : " << poll_micgain << "\n";
1007 info << "poll_squelch : " << poll_squelch << "\n";
1008 info << "poll_rfgain : " << poll_rfgain << "\n";
1009 info << "poll_pout : " << poll_pout << "\n";
1010 info << "poll_swr : " << poll_swr << "\n";
1011 info << "poll_alc : " << poll_alc << "\n";
1012 info << "poll_split : " << poll_split << "\n";
1013 info << "poll_noise : " << poll_noise << "\n";
1014 info << "poll_nr : " << poll_nr << "\n";
1015 info << "poll_all : " << poll_all << "\n";
1016 info << "\n";
1017 info << "freq_A : " << freq_A << "\n";
1018 info << "mode_A : " << imode_A << "\n";
1019 info << "bw_A : " << iBW_A << "\n";
1020 info << "\n";
1021 info << "freq_B : " << freq_B << "\n";
1022 info << "mode_B : " << imode_B << "\n";
1023 info << "bw_B : " << iBW_B << "\n";
1024 info << "\n";
1025 info << "use_rig_data : " << use_rig_data << "\n";
1026 info << "restore_rig_data : " << restore_rig_data << "\n";
1027 info << "\n";
1028 info << "bool_spkr_on : " << spkr_on << "\n";
1029 info << "int_volume : " << volume << "\n";
1030 info << "dbl_power : " << power_level << "\n";
1031 info << "int_mic : " << mic_gain << "\n";
1032 info << "bool_notch : " << notch << "\n";
1033 info << "int_notch : " << notch_val << "\n";
1034 info << "bool_shift : " << shift << "\n";
1035 info << "int_shift : " << shift_val << "\n";
1036 info << "rfgain : " << rfgain << "\n";
1037 info << "squelch : " << squelch << "\n";
1038 info << "\n";
1039 info << "schema : " << schema << "\n";
1040 info << "\n";
1041 info << "rx_avg : " << rx_avg << "\n";
1042 info << "rx_peak : " << rx_peak << "\n";
1043 info << "pwr_avg : " << pwr_avg << "\n";
1044 info << "pwr_peak : " << pwr_peak << "\n";
1045 info << "pwr_scale : " << pwr_scale << "\n";
1046
1047 return info.str();
1048 }
1049
5454
5555 int freqval = 0;
5656
57 FREQMODE vfoA = {14070000, 0, 0, UI};
58 FREQMODE vfoB = {7070000, 0, 0, UI};
59 FREQMODE vfo = {0, 0, 0, UI};
60 FREQMODE transceiverA;
61 FREQMODE transceiverB;
62 FREQMODE xmlvfo = vfoA;
57 FREQMODE vfoA = {14070000, 0, 0, UI};
58 FREQMODE vfoB = {7070000, 0, 0, UI};
59 FREQMODE vfo = {0, 0, 0, UI};
60 FREQMODE transceiverA = {14070000, 0, 0, UI};
61 FREQMODE transceiverB = {7070000, 0, 0, UI};
62 FREQMODE xmlvfo = {14070000, 0, 0, UI};
6363
6464 enum {VOL, MIC, PWR, SQL, IFSH, NOTCH, RFGAIN, NR };
6565
128128
129129 char *print(FREQMODE data)
130130 {
131 static char str[100];
131 static char str[256];
132132 const char **bwt = selrig->bwtable(data.imode);
133133 const char **dsplo = selrig->lotable(data.imode);
134134 const char **dsphi = selrig->hitable(data.imode);
135 snprintf(str, sizeof(str), "%3s,%10ld, %4s, %x => %5s %5s",
135 snprintf(str,
136 sizeof(str),
137 "---------------------------------\n%3s,%10ld, %4s, %02d => %5s %5s",
136138 data.src == XML ? "xml" : data.src == UI ? "ui" : "srvr",
137139 data.freq,
138140 selrig->modes_ ? selrig->modes_[data.imode] : "modes n/a",
691693 }
692694
693695 // if (RIG_DEBUG)
694 LOG_INFO("%s", print(vfoA));
696 LOG_INFO("%s", print(vfoA));
695697
696698 if (!selrig->can_change_alt_vfo && useB) return;
697699
743745 }
744746
745747 // if (RIG_DEBUG)
746 LOG_INFO("%s", print(vfoB));
748 LOG_INFO("%s", print(vfoB));
747749
748750 if (!selrig->can_change_alt_vfo && !useB) return;
749751
783785
784786 void servicePTT()
785787 {
786 // if (!tcpip && !RigSerial.IsOpen()) return;
788 if (quePTT.empty()) return;
789
787790 guard_lock ptt_lock(&mutex_ptt, 28);
788791 while (!quePTT.empty()) {
789792 PTT = quePTT.front();
795798
796799 void serviceSliders()
797800 {
798 if (!tcpip && !RigSerial.IsOpen()) return;
801 if (sliders.empty()) return;
799802
800803 SLIDER working(0,0);
801804 guard_lock serial_lock(&mutex_serial, 29);
922925 if (!loopcount--) {
923926 loopcount = progStatus.serloop_timing / 10;
924927 poll_nbr++;
928 //LOG_INFO("============ query xcvr ============");
925929
926930 if (xcvr_name == rig_K3.name_) {
927931 if (que_pending()) continue;
10731077
10741078 if (bypass_serial_thread_loop) goto serial_bypass_loop;
10751079
1080 //LOG_INFO("--");
10761081 }
10771082 } else {
10781083 if (resetxmt) {
14321437 queA.push(vfoA);
14331438 }
14341439 } else {
1435 {
1440 // {
14361441 guard_lock serial_lock(&mutex_serial, 39);
1437 bypass_serial_thread_loop = true;
1438 }
1442 // bypass_serial_thread_loop = true;
1443 // }
14391444 if (!useB) { // vfoA is used, swap vfos and update display B
14401445 vfoB.freq = FreqDispB->value();
14411446 FREQMODE temp = vfoB;
14511456 FreqDispA->value(vfoA.freq);
14521457 FreqDispA->redraw();
14531458 }
1454 {
1459 // {
14551460 guard_lock queA_lock(&mutex_queA, 40);
14561461 while (!queA.empty()) queA.pop();
14571462 queA.push(vfoA);
1458 }
1459 {
1463 // }
1464 // {
14601465 guard_lock queB_lock(&mutex_queB, 41);
14611466 while (!queB.empty()) queB.pop();
14621467 queB.push(vfoB);
1463 }
1468 // }
14641469 pushedB = true;
1465 {
1466 guard_lock serial_lock(&mutex_serial, 42);
1467 bypass_serial_thread_loop = false;
1468 }
1470 // {
1471 // guard_lock serial_lock(&mutex_serial, 42);
1472 // bypass_serial_thread_loop = false;
1473 // }
14691474 }
14701475 }
14711476
21232128 void closeRig()
21242129 {
21252130 // restore initial rig settings
2131 if (!progStatus.restore_rig_data) return;
2132
21262133 guard_lock serial_lock(&mutex_serial, 65);
2134 selrig->selectB();
2135 selrig->set_vfoB(transceiverB.freq);
2136 selrig->set_modeB(transceiverB.imode);
2137 selrig->set_bwB(transceiverB.iBW);
2138 selrig->selectA();
21272139 selrig->set_vfoA(transceiverA.freq);
21282140 selrig->set_modeA(transceiverA.imode);
21292141 selrig->set_bwA(transceiverA.iBW);
2130 selrig->set_vfoB(transceiverB.freq);
2131 selrig->set_modeB(transceiverB.imode);
2132 selrig->set_bwB(transceiverB.iBW);
21332142 }
21342143
21352144
21812190 pthread_join(*serial_thread, NULL);
21822191
21832192 if (progStatus.restore_rig_data){
2193 LOG_INFO("Restore Xcvr Data");
2194 selrig->selectB();
2195 selrig->set_vfoB(transceiverB.freq);
2196 selrig->set_modeB(transceiverB.imode);
2197 selrig->set_bwB(transceiverB.iBW);
2198 selrig->selectA();
21842199 selrig->set_vfoA(transceiverA.freq);
21852200 selrig->set_modeA(transceiverA.imode);
21862201 selrig->set_bwA(transceiverA.iBW);
2187 selrig->set_vfoB(transceiverB.freq);
2188 selrig->set_modeB(transceiverB.imode);
2189 selrig->set_bwB(transceiverB.iBW);
21902202 }
21912203
21922204 selrig->shutdown();
30193031 if (progStatus.CIV > 0)
30203032 selrig->adjustCIV(progStatus.CIV);
30213033
3022 if (progStatus.use_rig_data) {
3034 if (progStatus.restore_rig_data) { //if (progStatus.use_rig_data) {
3035 LOG_INFO("Use rig data\n");
3036
30233037 selrig->selectA();
3038
30243039 if (selrig->has_get_info)
30253040 selrig->get_info();
3041
30263042 transceiverA.freq = selrig->get_vfoA();
30273043 transceiverA.imode = selrig->get_modeA();
3028
30293044 selrig->adjust_bandwidth(transceiverA.imode);
30303045 transceiverA.iBW = selrig->get_bwA();
3046
30313047 selrig->selectB();
3048
30323049 if (selrig->has_get_info)
30333050 selrig->get_info();
30343051
30353052 transceiverB.freq = selrig->get_vfoB();
30363053 transceiverB.imode = selrig->get_modeB();
3037
30383054 selrig->adjust_bandwidth(transceiverB.imode);
30393055 transceiverB.iBW = selrig->get_bwB();
3056
30403057 progStatus.freq_A = transceiverA.freq;
30413058 progStatus.imode_A = transceiverA.imode;
3042
30433059 progStatus.iBW_A = transceiverA.iBW;
3060
30443061 progStatus.freq_B = transceiverB.freq;
30453062 progStatus.imode_B = transceiverB.imode;
30463063 progStatus.iBW_B = transceiverB.iBW;
30473064
3048 mnuKeepData->set();
30493065 if (selrig->restore_mbw) selrig->last_bw = transceiverA.iBW;
30503066
3051 } else
3052 mnuKeepData->clear();
3067 }
30533068
30543069 rigmodes_.clear();
30553070 opMODE->clear();
37693784 txtCIV->activate();
37703785 btnCIVdefault->activate();
37713786 if (selrig->name_ == rig_IC7200.name_ ||
3787 selrig->name_ == rig_IC7300.name_ ||
37723788 selrig->name_ == rig_IC7600.name_ ||
37733789 selrig->name_ == rig_IC7800.name_ ) {
3774 // if (strstr(selrig->name_, "IC-7200") || strstr(selrig->name_, "IC-7600")
3775 // || strstr(selrig->name_, "IC-7800")) {
37763790 btnUSBaudio->value(progStatus.USBaudio = true);
37773791 btnUSBaudio->activate();
37783792 } else
39033917 txtCIV->activate();
39043918 btnCIVdefault->activate();
39053919 if (xcvr_name == rig_IC7200.name_ ||
3920 xcvr_name == rig_IC7300.name_ ||
39063921 xcvr_name == rig_IC7600.name_ ||
39073922 xcvr_name == rig_IC7800.name_) {
39083923 btnUSBaudio->value(progStatus.USBaudio = true);