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
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 | |
0 | 19 | |
1 | 20 | |
2 | 21 | =Version 1.3.24= |
3 | ||
4 | 2016-01-16 David Freese <iam_w1hkj@w1hkj.com> | |
5 | 22 | |
6 | 23 | 29f82e6: K3 KX3 mods |
7 | 24 | c1645f0: xmlserver update |
0 | 0 | #! /bin/sh |
1 | 1 | # 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. | |
3 | 3 | # |
4 | 4 | # Report bugs to <w1hkj AT w1hkj DOT com>. |
5 | 5 | # |
581 | 581 | # Identity of this package. |
582 | 582 | PACKAGE_NAME='FLRIG' |
583 | 583 | 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' | |
586 | 586 | PACKAGE_BUGREPORT='w1hkj AT w1hkj DOT com' |
587 | 587 | PACKAGE_URL='' |
588 | 588 | |
1364 | 1364 | # Omit some internal or obsolete options to make the list less imposing. |
1365 | 1365 | # This message is too long to be a string in the A/UX 3.1 sh. |
1366 | 1366 | 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. | |
1368 | 1368 | |
1369 | 1369 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1370 | 1370 | |
1435 | 1435 | |
1436 | 1436 | if test -n "$ac_init_help"; then |
1437 | 1437 | 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:";; | |
1439 | 1439 | esac |
1440 | 1440 | cat <<\_ACEOF |
1441 | 1441 | |
1562 | 1562 | test -n "$ac_init_help" && exit $ac_status |
1563 | 1563 | if $ac_init_version; then |
1564 | 1564 | cat <<\_ACEOF |
1565 | FLRIG configure 1.3.24 | |
1565 | FLRIG configure 1.3.26 | |
1566 | 1566 | generated by GNU Autoconf 2.69 |
1567 | 1567 | |
1568 | 1568 | Copyright (C) 2012 Free Software Foundation, Inc. |
2071 | 2071 | This file contains any messages produced by compilers while |
2072 | 2072 | running configure, to aid debugging if configure makes a mistake. |
2073 | 2073 | |
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 | |
2075 | 2075 | generated by GNU Autoconf 2.69. Invocation command line was |
2076 | 2076 | |
2077 | 2077 | $ $0 $@ |
2424 | 2424 | |
2425 | 2425 | FLRIG_VERSION_MINOR=3 |
2426 | 2426 | |
2427 | FLRIG_VERSION_PATCH=.24 | |
2428 | ||
2429 | FLRIG_VERSION=1.3.24 | |
2427 | FLRIG_VERSION_PATCH=.26 | |
2428 | ||
2429 | FLRIG_VERSION=1.3.26 | |
2430 | 2430 | |
2431 | 2431 | |
2432 | 2432 | |
2436 | 2436 | $as_echo "#define FLRIG_VERSION_MINOR 3" >>confdefs.h |
2437 | 2437 | |
2438 | 2438 | |
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 | |
2443 | 2443 | |
2444 | 2444 | |
2445 | 2445 | AC_CONFIG_ARGS=$ac_configure_args |
3074 | 3074 | |
3075 | 3075 | # Define the identity of the package. |
3076 | 3076 | PACKAGE='flrig' |
3077 | VERSION='1.3.24' | |
3077 | VERSION='1.3.26' | |
3078 | 3078 | |
3079 | 3079 | |
3080 | 3080 | cat >>confdefs.h <<_ACEOF |
7498 | 7498 | # report actual input values of CONFIG_FILES etc. instead of their |
7499 | 7499 | # values after options handling. |
7500 | 7500 | 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 | |
7502 | 7502 | generated by GNU Autoconf 2.69. Invocation command line was |
7503 | 7503 | |
7504 | 7504 | CONFIG_FILES = $CONFIG_FILES |
7564 | 7564 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
7565 | 7565 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
7566 | 7566 | ac_cs_version="\\ |
7567 | FLRIG config.status 1.3.24 | |
7567 | FLRIG config.status 1.3.26 | |
7568 | 7568 | configured by $0, generated by GNU Autoconf 2.69, |
7569 | 7569 | with options \\"\$ac_cs_config\\" |
7570 | 7570 |
11 | 11 | dnl contain other characters or be empty |
12 | 12 | m4_define(FLRIG_MAJOR, [1]) |
13 | 13 | m4_define(FLRIG_MINOR, [3]) |
14 | m4_define(FLRIG_PATCH, [.24]) | |
14 | m4_define(FLRIG_PATCH, [.26]) | |
15 | 15 | |
16 | 16 | AC_INIT([FLRIG], FLRIG_MAJOR.FLRIG_MINOR[]FLRIG_PATCH, [w1hkj AT w1hkj DOT com]) |
17 | 17 |
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 | ||
0 | 10 | flrig (1.3.24-1) unstable; urgency=medium |
1 | 11 | |
2 | 12 | * New upstream release |
3 | 3 | Maintainer: Debian Hamradio Maintainers <debian-hams@lists.debian.org> |
4 | 4 | Uploaders: Kamal Mostafa <kamal@whence.com> |
5 | 5 | Build-Depends: debhelper (>= 9.0.0), autotools-dev, libfltk1.3-dev |
6 | Standards-Version: 3.9.7 | |
6 | Standards-Version: 3.9.8 | |
7 | 7 | Homepage: http://www.w1hkj.com/flrig-help/index.html |
8 | 8 | #Vcs-Git: git://git.debian.org/collab-maint/flrig.git |
9 | 9 | #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 |
0 | 0 | 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))) |
162 | 162 | rigs/IC7000.cxx \ |
163 | 163 | rigs/IC7100.cxx \ |
164 | 164 | rigs/IC7200.cxx \ |
165 | rigs/IC7300.cxx \ | |
165 | 166 | rigs/IC7410.cxx \ |
166 | 167 | rigs/IC7600.cxx \ |
167 | 168 | rigs/IC7800.cxx \ |
280 | 281 | include/IC7100.h \ |
281 | 282 | include/IC7410.h \ |
282 | 283 | include/IC7200.h \ |
284 | include/IC7300.h \ | |
283 | 285 | include/IC7600.h \ |
284 | 286 | include/IC7700.h \ |
285 | 287 | include/IC7800.h \ |
129 | 129 | rigs/IC718.cxx rigs/IC728.cxx rigs/IC735.cxx rigs/IC746.cxx \ |
130 | 130 | rigs/IC756.cxx rigs/IC756PRO2.cxx rigs/IC756PRO3.cxx \ |
131 | 131 | 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 \ | |
140 | 141 | support/dialogs.cxx support/ptt.cxx support/rig_io.cxx \ |
141 | 142 | support/serial.cxx support/socket.cxx support/socket_io.cxx \ |
142 | 143 | support/status.cxx support/support.cxx support/threads.cxx \ |
182 | 183 | rigs/flrig-IC756.$(OBJEXT) rigs/flrig-IC756PRO2.$(OBJEXT) \ |
183 | 184 | rigs/flrig-IC756PRO3.$(OBJEXT) rigs/flrig-IC910.$(OBJEXT) \ |
184 | 185 | 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) \ | |
203 | 204 | support/flrig-socket_io.$(OBJEXT) \ |
204 | 205 | support/flrig-status.$(OBJEXT) support/flrig-support.$(OBJEXT) \ |
205 | 206 | support/flrig-threads.$(OBJEXT) support/flrig-util.$(OBJEXT) \ |
483 | 484 | rigs/IC728.cxx rigs/IC735.cxx rigs/IC746.cxx rigs/IC756.cxx \ |
484 | 485 | rigs/IC756PRO2.cxx rigs/IC756PRO3.cxx rigs/IC910.cxx \ |
485 | 486 | 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 \ | |
494 | 496 | support/dialogs.cxx support/ptt.cxx support/rig_io.cxx \ |
495 | 497 | support/serial.cxx support/socket.cxx support/socket_io.cxx \ |
496 | 498 | support/status.cxx support/support.cxx support/threads.cxx \ |
546 | 548 | include/IC728.h include/IC735.h include/IC746.h \ |
547 | 549 | include/IC756.h include/IC756PRO2.h include/IC756PRO3.h \ |
548 | 550 | 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 \ | |
569 | 571 | $(srcdir)/../data/win32/flrig.ico \ |
570 | 572 | $(srcdir)/../scripts/mknsisinst.sh \ |
571 | 573 | $(srcdir)/../scripts/buildmxe.sh \ |
810 | 812 | rigs/$(DEPDIR)/$(am__dirstamp) |
811 | 813 | rigs/flrig-IC7200.$(OBJEXT): rigs/$(am__dirstamp) \ |
812 | 814 | rigs/$(DEPDIR)/$(am__dirstamp) |
815 | rigs/flrig-IC7300.$(OBJEXT): rigs/$(am__dirstamp) \ | |
816 | rigs/$(DEPDIR)/$(am__dirstamp) | |
813 | 817 | rigs/flrig-IC7410.$(OBJEXT): rigs/$(am__dirstamp) \ |
814 | 818 | rigs/$(DEPDIR)/$(am__dirstamp) |
815 | 819 | rigs/flrig-IC7600.$(OBJEXT): rigs/$(am__dirstamp) \ |
987 | 991 | @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC718.Po@am__quote@ |
988 | 992 | @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC7200.Po@am__quote@ |
989 | 993 | @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@ | |
990 | 995 | @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC735.Po@am__quote@ |
991 | 996 | @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC7410.Po@am__quote@ |
992 | 997 | @AMDEP_TRUE@@am__include@ @am__quote@rigs/$(DEPDIR)/flrig-IC746.Po@am__quote@ |
1830 | 1835 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
1831 | 1836 | @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` |
1832 | 1837 | |
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 | ||
1833 | 1852 | rigs/flrig-IC7410.o: rigs/IC7410.cxx |
1834 | 1853 | @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 |
1835 | 1854 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) rigs/$(DEPDIR)/flrig-IC7410.Tpo rigs/$(DEPDIR)/flrig-IC7410.Po |
496 | 496 | } |
497 | 497 | |
498 | 498 | 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; | |
499 | 501 | setRFGAIN(); |
500 | 502 | } |
501 | 503 |
1288 | 1288 | |
1289 | 1289 | mnuRestoreData = (menu_small_menu+12); |
1290 | 1290 | 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); | |
1293 | 1293 | |
1294 | 1294 | txt_encA = new Fl_Output( 425 - 90, 1, 90, 20, ""); |
1295 | 1295 | txt_encA->box(FL_THIN_DOWN_BOX); |
39 | 39 | Fl_Int_Input *txtCIV=(Fl_Int_Input *)0; |
40 | 40 | Fl_Button *btnCIVdefault=(Fl_Button *)0; |
41 | 41 | Fl_Check_Button *btnUSBaudio=(Fl_Check_Button *)0; |
42 | Fl_Check_Button *btn_key_fldigi=(Fl_Check_Button *)0; | |
43 | 42 | Fl_Group *tabTCPIP = (Fl_Group *)0; |
44 | 43 | Fl_Input2 *inp_tcpip_addr = (Fl_Input2 *)0; |
45 | 44 | Fl_Input2 *inp_tcpip_port = (Fl_Input2 *)0; |
255 | 254 | cbUSBaudio(); |
256 | 255 | } |
257 | 256 | |
258 | static void cb_btn_key_fldigi(Fl_Check_Button* o, void*) { | |
259 | progStatus.key_fldigi = o->value(); | |
260 | } | |
261 | ||
262 | 257 | static void cb_selectSepPTTPort(Fl_ComboBox*, void*) { |
263 | 258 | btnOkXcvrDialog->labelcolor(FL_RED); |
264 | 259 | btnOkXcvrDialog->redraw(); |
633 | 628 | btnUSBaudio->down_box(FL_DOWN_BOX); |
634 | 629 | btnUSBaudio->callback((Fl_Callback*)cb_btnUSBaudio); |
635 | 630 | |
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 | ||
642 | 631 | xcr_grp6->end(); |
643 | 632 | |
644 | 633 | tabPrimary->end(); |
4 | 4 | #define BUILD_BUILD_PLATFORM "i686-pc-linux-gnu" |
5 | 5 | |
6 | 6 | /* 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) " | |
8 | 8 | |
9 | 9 | /* Configure arguments */ |
10 | 10 | #define BUILD_CONFIGURE_ARGS "" |
11 | 11 | |
12 | 12 | /* 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" | |
14 | 14 | |
15 | 15 | /* Build host */ |
16 | 16 | #define BUILD_HOST "dave-dc7600" |
37 | 37 | #define FLRIG_FLTK_API_MINOR 3 |
38 | 38 | |
39 | 39 | /* version string */ |
40 | #define FLRIG_VERSION "1.3.24" | |
40 | #define FLRIG_VERSION "1.3.26" | |
41 | 41 | |
42 | 42 | /* major version number */ |
43 | 43 | #define FLRIG_VERSION_MAJOR 1 |
46 | 46 | #define FLRIG_VERSION_MINOR 3 |
47 | 47 | |
48 | 48 | /* patch/alpha version string */ |
49 | #define FLRIG_VERSION_PATCH ".24" | |
49 | #define FLRIG_VERSION_PATCH ".26" | |
50 | 50 | |
51 | 51 | /* FLTK version */ |
52 | 52 | #define FLTK_BUILD_VERSION "1.3.3" |
190 | 190 | #define PACKAGE_NAME "FLRIG" |
191 | 191 | |
192 | 192 | /* 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" | |
194 | 194 | |
195 | 195 | /* Define to the one symbol short name of this package. */ |
196 | 196 | #define PACKAGE_TARNAME "flrig" |
199 | 199 | #define PACKAGE_URL "" |
200 | 200 | |
201 | 201 | /* Define to the version of this package. */ |
202 | #define PACKAGE_VERSION "1.3.24" | |
202 | #define PACKAGE_VERSION "1.3.26" | |
203 | 203 | |
204 | 204 | /* Define to 1 if you have the ANSI C header files. */ |
205 | 205 | #define STDC_HEADERS 1 |
233 | 233 | #define USE_X 1 |
234 | 234 | |
235 | 235 | /* Version number of package */ |
236 | #define VERSION "1.3.24" | |
236 | #define VERSION "1.3.26" | |
237 | 237 | |
238 | 238 | /* x version */ |
239 | 239 | #define X_BUILD_VERSION "1.6.2" |
1 | 1 | // Copyright (C) 2014 |
2 | 2 | // David Freese, W1HKJ |
3 | 3 | // |
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 | |
6 | 6 | // |
7 | 7 | // This file is part of flrig. |
8 | 8 | // |
46 | 46 | |
47 | 47 | void initialize(); |
48 | 48 | |
49 | bool get_info(); | |
50 | ||
51 | 49 | bool can_split() { return true;} |
52 | 50 | void set_split(bool val); |
53 | 51 | int get_split(); |
79 | 77 | |
80 | 78 | private: |
81 | 79 | void init_cmd(); |
80 | bool get_info(); | |
81 | ||
82 | 82 | }; |
83 | 83 | |
84 | 84 |
71 | 71 | void set_split(bool v); |
72 | 72 | int get_split(); |
73 | 73 | |
74 | bool canswap() { return true; } | |
75 | void swapvfos(); | |
76 | ||
74 | 77 | int get_mic_gain(); |
75 | 78 | void set_mic_gain(int val); |
76 | 79 | void get_mic_gain_min_max_step(int &min, int &max, int &step); |
23 | 23 | #include "ICbase.h" |
24 | 24 | |
25 | 25 | class RIG_IC7200 : public RIG_ICOM { |
26 | private: | |
27 | int atten_level; | |
26 | 28 | public: |
27 | 29 | RIG_IC7200(); |
28 | 30 | ~RIG_IC7200(){} |
54 | 56 | int get_volume_control(); |
55 | 57 | void get_vol_min_max_step(int &min, int &max, int &step); |
56 | 58 | void set_attenuator(int val); |
59 | int get_attenuator(); | |
57 | 60 | int get_smeter(); |
58 | 61 | int get_power_out(void); |
59 | 62 | int get_swr(void); |
70 | 73 | int get_rf_gain(); |
71 | 74 | void set_squelch(int val); |
72 | 75 | int get_squelch(); |
76 | ||
73 | 77 | void set_power_control(double val); |
74 | 78 | int get_power_control(); |
79 | ||
75 | 80 | void set_mic_gain(int val); |
76 | 81 | int get_mic_gain(); |
77 | 82 | 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 | ||
78 | 88 | int adjust_bandwidth(int m); |
79 | 89 | int def_bandwidth(int m); |
80 | 90 | 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 |
22 | 22 | |
23 | 23 | #include "IC746.h" |
24 | 24 | |
25 | class RIG_IC7600 : public RIG_IC746PRO { | |
25 | class RIG_IC7600 : public RIG_ICOM { | |
26 | protected: | |
27 | int preamp_level; | |
28 | int atten_level; | |
26 | 29 | public: |
27 | 30 | RIG_IC7600(); |
28 | 31 | ~RIG_IC7600(){} |
31 | 34 | |
32 | 35 | void selectA(); |
33 | 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); | |
34 | 43 | |
35 | 44 | void set_modeA(int val); |
36 | 45 | int get_modeA(); |
54 | 63 | int adjust_bandwidth(int m); |
55 | 64 | int def_bandwidth(int m); |
56 | 65 | |
57 | void set_attenuator( int val ); //alh | |
58 | int get_attenuator(); //alh | |
59 | 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(); | |
60 | 69 | |
61 | 70 | void set_compression(); |
62 | 71 | void get_comp_min_max_step(int &min, int &max, int &step) { |
63 | 72 | min = 0; max = 10; step = 1; } |
73 | ||
64 | 74 | void set_vox_onoff(); |
65 | 75 | void set_vox_gain(); |
66 | 76 | void set_vox_anti(); |
84 | 94 | |
85 | 95 | const char **bwtable(int m) {return bandwidths_;} |
86 | 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(); | |
87 | 140 | |
88 | 141 | }; |
89 | 142 |
63 | 63 | const char * SH_tooltip; |
64 | 64 | const char * SH_label; |
65 | 65 | const int * bw_vals_; |
66 | ||
67 | int bw_size_; | |
66 | 68 | |
67 | 69 | GUI *widgets; |
68 | 70 |
57 | 57 | #include "IC7100.h" |
58 | 58 | #include "IC7410.h" |
59 | 59 | #include "IC7200.h" |
60 | #include "IC7300.h" | |
60 | 61 | #include "IC7600.h" |
61 | 62 | #include "IC7700.h" |
62 | 63 | #include "IC7800.h" |
122 | 123 | extern RIG_IC7000 rig_IC7000; // 34 |
123 | 124 | extern RIG_IC7100 rig_IC7100; // 35 |
124 | 125 | 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 | |
154 | 156 | |
155 | 157 | #endif |
140 | 140 | |
141 | 141 | int split; |
142 | 142 | |
143 | bool key_fldigi; | |
144 | ||
145 | 143 | int rx_avg; |
146 | 144 | int rx_peak; |
147 | 145 | int pwr_avg; |
148 | 146 | int pwr_peak; |
149 | 147 | int pwr_scale; |
148 | ||
149 | // ft950 reverse RG0; readings | |
150 | ||
151 | bool ft950_rg_reverse; | |
150 | 152 | |
151 | 153 | //============= transceiver specific prameters |
152 | 154 | //tt550 controls |
276 | 278 | void loadLastState(); |
277 | 279 | bool loadXcvrState(string); |
278 | 280 | void UI_laststate(); |
281 | ||
282 | string info(); | |
279 | 283 | }; |
280 | 284 | |
281 | 285 | extern status progStatus; |
5 | 5 | // the FT-900 has two vfos and can work split |
6 | 6 | // but it cannot change the (hidden) alternate vfo |
7 | 7 | // 2015-12-03 1st stable version DJ7HS |
8 | // 2016-04-03 call get_info() within get_vfoA and get_vfoB DJ7HS | |
8 | 9 | // |
9 | 10 | // This file is part of flrig. |
10 | 11 | // |
62 | 63 | |
63 | 64 | has_smeter = |
64 | 65 | has_power_out = |
65 | has_get_info = | |
66 | 66 | has_ptt_control = |
67 | 67 | has_split = |
68 | 68 | has_split_AB = |
69 | 69 | has_getvfoAorB = |
70 | 70 | has_mode_control = true; |
71 | ||
72 | has_get_info = false; // to be sure, it's needed that way | |
71 | 73 | |
72 | 74 | precision = 10; |
73 | 75 | ndigits = 7; |
272 | 274 | |
273 | 275 | long RIG_FT900::get_vfoA () |
274 | 276 | { |
277 | if (!useB) { | |
278 | get_info(); | |
279 | } | |
275 | 280 | return A.freq; |
276 | 281 | } |
277 | 282 | |
302 | 307 | |
303 | 308 | long RIG_FT900::get_vfoB() |
304 | 309 | { |
310 | if (useB) { | |
311 | get_info(); | |
312 | } | |
305 | 313 | return B.freq; |
306 | 314 | } |
307 | 315 |
1143 | 1143 | void RIG_FT950::set_rf_gain(int val) |
1144 | 1144 | { |
1145 | 1145 | 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); | |
1147 | 1151 | for (int i = 5; i > 2; i--) { |
1148 | 1152 | cmd[i] = rfval % 10 + '0'; |
1149 | 1153 | rfval /= 10; |
1165 | 1169 | rfval *= 10; |
1166 | 1170 | rfval += replystr[p+i] - '0'; |
1167 | 1171 | } |
1168 | rfval = (int)(rfval / 2.50); | |
1172 | rfval = (int)(rfval / 2.5); | |
1169 | 1173 | 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; | |
1171 | 1177 | } |
1172 | 1178 | |
1173 | 1179 | void RIG_FT950::get_rf_min_max_step(int &min, int &max, int &step) |
250 | 250 | waitFB("set vfo B"); |
251 | 251 | } |
252 | 252 | |
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 | ||
253 | 262 | void RIG_IC7000::set_modeA(int val) |
254 | 263 | { |
255 | 264 | A.imode = val; |
206 | 206 | cmd.append( post ); |
207 | 207 | string resp = pre_fm; |
208 | 208 | resp.append("\x15\x02"); |
209 | if (waitFOR(9, "get smeter")) { | |
209 | if (waitFOR(9, "get smeter")) { // SHOULD BE 10 bytes | |
210 | 210 | size_t p = replystr.rfind(resp); |
211 | 211 | if (p != string::npos) |
212 | 212 | return (int)ceil(fm_bcd(&replystr[p+6], 3) / 2.55); |
80 | 80 | { (Fl_Widget *)sldrSQUELCH, 266, 125, 156 }, |
81 | 81 | { (Fl_Widget *)btnNR, 214, 145, 50 }, |
82 | 82 | { (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 }, | |
84 | 86 | { (Fl_Widget *)NULL, 0, 0, 0 } |
85 | 87 | }; |
86 | 88 | |
133 | 135 | has_noise_reduction = true; |
134 | 136 | has_noise_reduction_control = true; |
135 | 137 | has_auto_notch = true; |
138 | has_notch_control = true; | |
136 | 139 | has_rf_control = true; |
137 | 140 | has_compON = true; |
138 | 141 | has_vox_onoff = true; |
156 | 159 | rig_widgets[4].W = sldrSQUELCH; |
157 | 160 | rig_widgets[5].W = btnNR; |
158 | 161 | 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; | |
160 | 165 | } |
161 | 166 | |
162 | 167 | //============================================================================= |
220 | 225 | |
221 | 226 | void RIG_IC7200::set_vfoB (long freq) |
222 | 227 | { |
223 | selectB(); | |
224 | 228 | B.freq = freq; |
225 | 229 | cmd = pre_to; |
226 | 230 | cmd += '\x05'; |
369 | 373 | cmd += val ? '\x20' : '\x00'; |
370 | 374 | cmd.append( post ); |
371 | 375 | 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; | |
372 | 398 | } |
373 | 399 | |
374 | 400 | void RIG_IC7200::set_noise(bool val) |
452 | 478 | cmd = pre_to; |
453 | 479 | cmd += '\x16'; |
454 | 480 | cmd += '\x02'; |
455 | cmd += (unsigned char)val; | |
481 | cmd += val ? 0x01 : 0x00; | |
456 | 482 | cmd.append( post ); |
457 | 483 | waitFB("set Pre"); |
458 | 484 | } |
469 | 495 | size_t p = replystr.rfind(resp); |
470 | 496 | if (p != string::npos) { |
471 | 497 | if (replystr[p+6] == 0x01) { |
472 | preamp_label("Pre", true); | |
498 | preamp_label("Pre ON", true); | |
473 | 499 | return true; |
474 | 500 | } else { |
475 | 501 | preamp_label("Pre", false); |
605 | 631 | } |
606 | 632 | } |
607 | 633 | cmd = pre_to; |
608 | cmd += "\x1A\04"; | |
634 | cmd += "\x1A\x04"; | |
609 | 635 | cmd.append(post); |
610 | 636 | resp = pre_fm; |
611 | resp += "\x1A\04"; | |
637 | resp += "\x1A\x04"; | |
612 | 638 | if (waitFOR(9, "data mode?")) { |
613 | 639 | size_t p = replystr.rfind(resp); |
614 | 640 | if (p != string::npos) { |
656 | 682 | } |
657 | 683 | } |
658 | 684 | cmd = pre_to; |
659 | cmd += "x1A\04"; | |
685 | cmd += "\x1A\x04"; | |
660 | 686 | cmd.append(post); |
661 | 687 | resp = pre_fm; |
662 | resp += "x1A\04"; | |
688 | resp += "\x1A\x04"; | |
663 | 689 | if (waitFOR(9, "get data B")) { |
664 | 690 | size_t p = replystr.rfind(resp); |
665 | 691 | if (p != string::npos) { |
881 | 907 | waitFB("tune rig"); |
882 | 908 | } |
883 | 909 | |
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 |
48 | 48 | "2600", "2700", "2800", "2900", "3000", "3100", "3200", "3300", "3400", "3500", |
49 | 49 | "3600", NULL }; |
50 | 50 | 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}; | |
56 | 56 | |
57 | 57 | const char *IC7600_rtty_bws[] = { |
58 | 58 | "50", "100", "150", "200", "250", "300", "350", "400", "450", "500", |
60 | 60 | "1600", "1700", "1800", "1900", "2000", "2100", "2200", "2300", "2400", "2500", |
61 | 61 | "2600", "2700", NULL }; |
62 | 62 | 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}; | |
67 | 67 | |
68 | 68 | const char *IC7600_am_bws[] = { |
69 | 69 | "200", "400", "600", "800", "1000", "1200", "1400", "1600", "1800", "2000", |
70 | 70 | "2200", "2400", "2600", "2800", "3000", "3200", "3400", "3600", "3800", "4000", |
71 | 71 | "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", | |
73 | 73 | "8200", "8400", "8600", "8800", "9000", "9200", "9400", "9600", "9800", "10000", NULL }; |
74 | 74 | 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 | |
80 | 80 | WVALS_LIMIT}; |
81 | 81 | |
82 | 82 | const char *IC7600_fm_bws[] = { "FIXED", NULL }; |
100 | 100 | |
101 | 101 | RIG_IC7600::RIG_IC7600() { |
102 | 102 | defaultCIV = 0x7A; |
103 | adjustCIV(defaultCIV); | |
104 | ||
103 | 105 | name_ = IC7600name_; |
104 | 106 | modes_ = IC7600modes_; |
105 | 107 | bandwidths_ = IC7600_ssb_bws; |
106 | 108 | bw_vals_ = IC7600_bw_vals_SSB; |
107 | 109 | |
108 | 110 | _mode_type = IC7600_mode_type; |
109 | adjustCIV(defaultCIV); | |
110 | 111 | |
111 | 112 | widgets = IC7600_widgets; |
112 | 113 | |
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; | |
131 | 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; | |
132 | 166 | |
133 | 167 | precision = 1; |
134 | 168 | ndigits = 8; |
155 | 189 | IC7600_widgets[11].W = sldrPOWER; |
156 | 190 | } |
157 | 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 | ||
158 | 198 | void RIG_IC7600::selectA() |
159 | 199 | { |
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"); | |
166 | 202 | } |
167 | 203 | |
168 | 204 | void RIG_IC7600::selectB() |
169 | 205 | { |
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"); | |
176 | 252 | } |
177 | 253 | |
178 | 254 | bool RIG_IC7600::can_split() |
184 | 260 | { |
185 | 261 | split = val; |
186 | 262 | 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 ); | |
191 | 264 | waitFB("Split ON"); |
192 | 265 | } else { |
193 | cmd.assign(pre_to); | |
194 | cmd.append("\x0F"); | |
266 | cmd.assign(pre_to).append("\x0F"); | |
195 | 267 | cmd += '\x00'; |
196 | 268 | cmd.append( post ); |
197 | 269 | waitFB("Split OFF"); |
204 | 276 | cmd.assign(pre_to); |
205 | 277 | cmd.append("\x0F"); |
206 | 278 | 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 | } | |
209 | 286 | return split; |
210 | 287 | } |
211 | 288 | |
216 | 293 | cmd.append(post); |
217 | 294 | if (IC7600_DEBUG) |
218 | 295 | LOG_INFO("%s", str2hex(cmd.data(), cmd.length())); |
219 | sendICcommand (cmd, 6); | |
220 | checkresponse(); | |
296 | waitFB("swap vfos"); | |
221 | 297 | } |
222 | 298 | |
223 | 299 | void RIG_IC7600::set_modeA(int val) |
227 | 303 | cmd += '\x06'; |
228 | 304 | cmd += IC7600_mode_nbr[val]; |
229 | 305 | 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 | ||
234 | 308 | // digital set / clear |
235 | if (A.imode >= 10) { | |
309 | if (val >= 10) { | |
236 | 310 | 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; | |
244 | 316 | } |
245 | 317 | 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"); | |
250 | 319 | } |
251 | 320 | } |
252 | 321 | |
253 | 322 | int RIG_IC7600::get_modeA() |
254 | 323 | { |
255 | 324 | 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; | |
273 | 335 | } |
274 | 336 | } |
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; | |
276 | 350 | return A.imode; |
277 | 351 | } |
278 | 352 | |
279 | 353 | void RIG_IC7600::set_modeB(int val) |
280 | 354 | { |
281 | 355 | B.imode = val; |
282 | cmd = pre_to; | |
283 | cmd += '\x06'; | |
356 | cmd.assign(pre_to).append("\x06"); | |
284 | 357 | cmd += IC7600_mode_nbr[val]; |
285 | 358 | 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 | ||
290 | 361 | // digital set / clear |
291 | if (B.imode >= 10) { | |
362 | if (val >= 10) { | |
292 | 363 | 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; | |
300 | 369 | } |
301 | 370 | 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"); | |
306 | 372 | } |
307 | 373 | } |
308 | 374 | |
309 | 375 | int RIG_IC7600::get_modeB() |
310 | 376 | { |
311 | 377 | 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; | |
317 | 386 | if (md == 10) md = 0; |
318 | 387 | 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; | |
329 | 398 | } |
330 | 399 | } |
331 | 400 | } |
401 | if (B.imode > 15) B.imode = 0; | |
332 | 402 | return B.imode; |
333 | 403 | } |
334 | 404 | |
338 | 408 | cmd = pre_to; |
339 | 409 | cmd.append("\x1a\x03"); |
340 | 410 | 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); | |
343 | 417 | } |
344 | 418 | return A.iBW; |
345 | 419 | } |
348 | 422 | { |
349 | 423 | A.iBW = val; |
350 | 424 | if (A.imode == 5) return; |
425 | if (A.imode > bw_size_) A.imode = bw_size_; | |
351 | 426 | cmd = pre_to; |
352 | 427 | cmd.append("\x1a\x03"); |
353 | 428 | cmd.append(to_bcd(A.iBW, 2)); |
354 | 429 | 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"); | |
359 | 431 | } |
360 | 432 | |
361 | 433 | int RIG_IC7600::get_bwB() |
364 | 436 | cmd = pre_to; |
365 | 437 | cmd.append("\x1a\x03"); |
366 | 438 | 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); | |
369 | 445 | } |
370 | 446 | return B.iBW; |
371 | 447 | } |
374 | 450 | { |
375 | 451 | B.iBW = val; |
376 | 452 | if (B.imode == 5) return; |
453 | if (B.iBW > bw_size_) B.iBW = bw_size_; | |
377 | 454 | cmd = pre_to; |
378 | 455 | cmd.append("\x1a\x03"); |
379 | 456 | cmd.append(to_bcd(A.iBW, 2)); |
380 | 457 | 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"); | |
385 | 459 | } |
386 | 460 | |
387 | 461 | int RIG_IC7600::adjust_bandwidth(int m) |
391 | 465 | case 2: // AM |
392 | 466 | bandwidths_ = IC7600_am_bws; |
393 | 467 | bw_vals_ = IC7600_bw_vals_AM; |
468 | bw_size_ = sizeof(IC7600_bw_vals_AM); | |
394 | 469 | bw = 19; |
395 | 470 | break; |
396 | 471 | case 5: // FM |
397 | 472 | bandwidths_ = IC7600_fm_bws; |
398 | 473 | bw_vals_ = IC7600_bw_vals_FM; |
474 | bw_size_ = sizeof(IC7600_bw_vals_FM); | |
399 | 475 | bw = 0; |
400 | 476 | break; |
401 | 477 | case 4: case 7: // RTTY |
402 | 478 | bandwidths_ = IC7600_rtty_bws; |
403 | 479 | bw_vals_ = IC7600_bw_vals_RTTY; |
480 | bw_size_ = sizeof(IC7600_bw_vals_RTTY); | |
404 | 481 | bw = 12; |
405 | 482 | break; |
406 | 483 | case 3: case 6: // CW |
407 | 484 | bandwidths_ = IC7600_ssb_bws; |
408 | 485 | bw_vals_ = IC7600_bw_vals_SSB; |
486 | bw_size_ = sizeof(IC7600_bw_vals_SSB); | |
409 | 487 | bw = 12; |
410 | 488 | break; |
411 | 489 | case 8: case 9: // PKT |
412 | 490 | bandwidths_ = IC7600_ssb_bws; |
413 | 491 | bw_vals_ = IC7600_bw_vals_SSB; |
492 | bw_size_ = sizeof(IC7600_bw_vals_SSB); | |
414 | 493 | bw = 34; |
415 | 494 | break; |
416 | 495 | case 0: case 1: // SSB |
419 | 498 | default: |
420 | 499 | bandwidths_ = IC7600_ssb_bws; |
421 | 500 | bw_vals_ = IC7600_bw_vals_SSB; |
501 | bw_size_ = sizeof(IC7600_bw_vals_SSB); | |
422 | 502 | bw = 34; |
423 | 503 | } |
424 | 504 | return bw; |
452 | 532 | return bw; |
453 | 533 | } |
454 | 534 | |
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 | ||
455 | 553 | void RIG_IC7600::set_mic_gain(int v) |
456 | 554 | { |
457 | ICvol = (int)(v * 255 / 100); | |
555 | int ICvol = (int)(v * 255 / 100); | |
556 | minmax(0, 255, ICvol); | |
458 | 557 | if (!progStatus.USBaudio) { |
459 | 558 | cmd = pre_to; |
460 | 559 | cmd.append("\x14\x0B"); |
467 | 566 | cmd.append(to_bcd(ICvol, 3)); |
468 | 567 | cmd.append( post ); |
469 | 568 | } |
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 | ||
475 | 579 | |
476 | 580 | // 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 | } | |
530 | 581 | |
531 | 582 | void RIG_IC7600::set_compression() |
532 | 583 | { |
635 | 686 | waitFB("SET cw sidetone volume"); |
636 | 687 | } |
637 | 688 | |
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 |
47 | 47 | SH_tooltip = szdsptooltip; |
48 | 48 | SH_label = szbtnlabel; |
49 | 49 | bw_vals_ = &ibw_val; |
50 | bw_size_ = 0; | |
50 | 51 | |
51 | 52 | widgets = basewidgets; |
52 | 53 |
65 | 65 | RIG_IC7100 rig_IC7100; |
66 | 66 | RIG_IC7410 rig_IC7410; |
67 | 67 | RIG_IC7200 rig_IC7200; |
68 | RIG_IC7300 rig_IC7300; | |
68 | 69 | RIG_IC7600 rig_IC7600; |
69 | 70 | RIG_IC7700 rig_IC7700; |
70 | 71 | RIG_IC7800 rig_IC7800; |
136 | 137 | &rig_IC7000, // 34 |
137 | 138 | &rig_IC7100, // 35 |
138 | 139 | &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 | |
168 | 170 | NULL |
169 | 171 | }; |
170 | 172 |
679 | 679 | else srvr_vfo = vfoA; |
680 | 680 | } |
681 | 681 | srvr_vfo.iBW = bw; |
682 | printf("srvr_vfo.iBW: %X\n", bw); | |
683 | 682 | push_xml(); |
684 | 683 | } |
685 | 684 | std::string help() { return std::string("set_bw to VAL"); } |
59 | 59 | static string buffer; |
60 | 60 | |
61 | 61 | 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 | ||
63 | 65 | uint32_t debug::mask = ~0u; |
64 | 66 | |
65 | 67 | const char* prefix[] = { _("Quiet"), _("Error"), _("Warning"), _("Info"), _("Debug") }; |
105 | 107 | } |
106 | 108 | |
107 | 109 | static char fmt[1024]; |
108 | static char sztemp[1024]; | |
110 | static char sztemp[8096]; | |
109 | 111 | static string estr = ""; |
110 | 112 | bool debug_in_use = false; |
111 | 113 |
468 | 468 | txtCIV->value(hexstr); |
469 | 469 | txtCIV->activate(); |
470 | 470 | 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_ ) { | |
472 | 474 | btnUSBaudio->value(progStatus.USBaudio); |
473 | 475 | btnUSBaudio->activate(); |
474 | 476 | } else |
19 | 19 | |
20 | 20 | #include <iostream> |
21 | 21 | #include <fstream> |
22 | #include <sstream> | |
22 | 23 | #include <string> |
23 | 24 | |
24 | 25 | #include <FL/Fl_Preferences.H> |
32 | 33 | #include "config.h" |
33 | 34 | #include "rigpanel.h" |
34 | 35 | #include "ui.h" |
36 | #include "debug.h" | |
35 | 37 | |
36 | 38 | string xcvr_name = "NONE"; |
37 | 39 | |
150 | 152 | |
151 | 153 | 0, // int split; |
152 | 154 | |
153 | true, // bool key_fldigi; | |
154 | ||
155 | 155 | 5, // int rx_avg; |
156 | 156 | 5, // int rx_peak; |
157 | 157 | 5, // int pwr_avg; |
158 | 158 | 5, // int pwr_peak; |
159 | 159 | 4, // int pwr_scale ==> Autoselect |
160 | 160 | |
161 | //ft950 reversed RF gain values | |
162 | false, // bool ft950_rg_reverse | |
161 | 163 | //tt550 controls |
162 | 164 | 80, // tt550_line_out; |
163 | 165 | 1, // tt550_agc_level; |
335 | 337 | spref.set("sep_dtrptt", sep_dtrptt); |
336 | 338 | spref.set("sep_rtsplus", sep_rtsplus); |
337 | 339 | spref.set("set_dtrplus", sep_dtrplus); |
338 | ||
339 | spref.set("key_fldigi", key_fldigi); | |
340 | 340 | |
341 | 341 | spref.set("poll_smeter", poll_smeter); |
342 | 342 | spref.set("poll_frequency", poll_frequency); |
389 | 389 | spref.set("pwr_peak", pwr_peak); |
390 | 390 | spref.set("pwr_scale", pwr_scale); |
391 | 391 | |
392 | spref.set("ft950_rg_reverse", ft950_rg_reverse); | |
393 | ||
392 | 394 | if (selrig->name_ == rig_TT550.name_) { |
393 | 395 | spref.set("tt550_line_out", tt550_line_out); |
394 | 396 | spref.set("tt550_agc_level", tt550_agc_level); |
613 | 615 | if (spref.get("sep_rtsplus", i, i)) sep_rtsplus = i; |
614 | 616 | if (spref.get("sep_dtrplus", i, i)) sep_dtrplus = i; |
615 | 617 | |
616 | if (spref.get("key_fldigi", i, key_fldigi)) key_fldigi = i; | |
617 | ||
618 | 618 | spref.get("poll_smeter", poll_smeter, poll_smeter); |
619 | 619 | spref.get("poll_frequency", poll_frequency, poll_frequency); |
620 | 620 | spref.get("poll_mode", poll_mode, poll_mode); |
665 | 665 | spref.get("pwr_avg", pwr_avg, pwr_avg); |
666 | 666 | spref.get("pwr_peak", pwr_peak, pwr_peak); |
667 | 667 | spref.get("pwr_scale", pwr_scale, pwr_scale); |
668 | ||
669 | if (spref.get("ft950_rg_reverse", i, i)) ft950_rg_reverse = i; | |
668 | 670 | |
669 | 671 | if (selrig->name_ == rig_TT550.name_) { |
670 | 672 | spref.get("tt550_line_out", tt550_line_out, tt550_line_out); |
824 | 826 | |
825 | 827 | if (spref.get("hrd_buttons", i, i)) hrd_buttons = i; |
826 | 828 | } |
829 | ||
830 | LOG_INFO("%s", info().c_str()); | |
827 | 831 | |
828 | 832 | return true; |
829 | 833 | } |
949 | 953 | if (spnrMICGAIN) spnrMICGAIN->color(bg_slider); |
950 | 954 | if (spnrMICGAIN) spnrMICGAIN->selection_color(btn_slider); |
951 | 955 | |
952 | if (use_rig_data) mnuKeepData->set(); | |
953 | else mnuKeepData->clear(); | |
954 | ||
955 | 956 | if (restore_rig_data) mnuRestoreData->set(); |
956 | 957 | else mnuRestoreData->clear(); |
957 | 958 | |
958 | 959 | Fl::scheme(ui_scheme.c_str()); |
959 | 960 | } |
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 |
54 | 54 | |
55 | 55 | int freqval = 0; |
56 | 56 | |
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}; | |
63 | 63 | |
64 | 64 | enum {VOL, MIC, PWR, SQL, IFSH, NOTCH, RFGAIN, NR }; |
65 | 65 | |
128 | 128 | |
129 | 129 | char *print(FREQMODE data) |
130 | 130 | { |
131 | static char str[100]; | |
131 | static char str[256]; | |
132 | 132 | const char **bwt = selrig->bwtable(data.imode); |
133 | 133 | const char **dsplo = selrig->lotable(data.imode); |
134 | 134 | 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", | |
136 | 138 | data.src == XML ? "xml" : data.src == UI ? "ui" : "srvr", |
137 | 139 | data.freq, |
138 | 140 | selrig->modes_ ? selrig->modes_[data.imode] : "modes n/a", |
691 | 693 | } |
692 | 694 | |
693 | 695 | // if (RIG_DEBUG) |
694 | LOG_INFO("%s", print(vfoA)); | |
696 | LOG_INFO("%s", print(vfoA)); | |
695 | 697 | |
696 | 698 | if (!selrig->can_change_alt_vfo && useB) return; |
697 | 699 | |
743 | 745 | } |
744 | 746 | |
745 | 747 | // if (RIG_DEBUG) |
746 | LOG_INFO("%s", print(vfoB)); | |
748 | LOG_INFO("%s", print(vfoB)); | |
747 | 749 | |
748 | 750 | if (!selrig->can_change_alt_vfo && !useB) return; |
749 | 751 | |
783 | 785 | |
784 | 786 | void servicePTT() |
785 | 787 | { |
786 | // if (!tcpip && !RigSerial.IsOpen()) return; | |
788 | if (quePTT.empty()) return; | |
789 | ||
787 | 790 | guard_lock ptt_lock(&mutex_ptt, 28); |
788 | 791 | while (!quePTT.empty()) { |
789 | 792 | PTT = quePTT.front(); |
795 | 798 | |
796 | 799 | void serviceSliders() |
797 | 800 | { |
798 | if (!tcpip && !RigSerial.IsOpen()) return; | |
801 | if (sliders.empty()) return; | |
799 | 802 | |
800 | 803 | SLIDER working(0,0); |
801 | 804 | guard_lock serial_lock(&mutex_serial, 29); |
922 | 925 | if (!loopcount--) { |
923 | 926 | loopcount = progStatus.serloop_timing / 10; |
924 | 927 | poll_nbr++; |
928 | //LOG_INFO("============ query xcvr ============"); | |
925 | 929 | |
926 | 930 | if (xcvr_name == rig_K3.name_) { |
927 | 931 | if (que_pending()) continue; |
1073 | 1077 | |
1074 | 1078 | if (bypass_serial_thread_loop) goto serial_bypass_loop; |
1075 | 1079 | |
1080 | //LOG_INFO("--"); | |
1076 | 1081 | } |
1077 | 1082 | } else { |
1078 | 1083 | if (resetxmt) { |
1432 | 1437 | queA.push(vfoA); |
1433 | 1438 | } |
1434 | 1439 | } else { |
1435 | { | |
1440 | // { | |
1436 | 1441 | guard_lock serial_lock(&mutex_serial, 39); |
1437 | bypass_serial_thread_loop = true; | |
1438 | } | |
1442 | // bypass_serial_thread_loop = true; | |
1443 | // } | |
1439 | 1444 | if (!useB) { // vfoA is used, swap vfos and update display B |
1440 | 1445 | vfoB.freq = FreqDispB->value(); |
1441 | 1446 | FREQMODE temp = vfoB; |
1451 | 1456 | FreqDispA->value(vfoA.freq); |
1452 | 1457 | FreqDispA->redraw(); |
1453 | 1458 | } |
1454 | { | |
1459 | // { | |
1455 | 1460 | guard_lock queA_lock(&mutex_queA, 40); |
1456 | 1461 | while (!queA.empty()) queA.pop(); |
1457 | 1462 | queA.push(vfoA); |
1458 | } | |
1459 | { | |
1463 | // } | |
1464 | // { | |
1460 | 1465 | guard_lock queB_lock(&mutex_queB, 41); |
1461 | 1466 | while (!queB.empty()) queB.pop(); |
1462 | 1467 | queB.push(vfoB); |
1463 | } | |
1468 | // } | |
1464 | 1469 | 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 | // } | |
1469 | 1474 | } |
1470 | 1475 | } |
1471 | 1476 | |
2123 | 2128 | void closeRig() |
2124 | 2129 | { |
2125 | 2130 | // restore initial rig settings |
2131 | if (!progStatus.restore_rig_data) return; | |
2132 | ||
2126 | 2133 | 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(); | |
2127 | 2139 | selrig->set_vfoA(transceiverA.freq); |
2128 | 2140 | selrig->set_modeA(transceiverA.imode); |
2129 | 2141 | selrig->set_bwA(transceiverA.iBW); |
2130 | selrig->set_vfoB(transceiverB.freq); | |
2131 | selrig->set_modeB(transceiverB.imode); | |
2132 | selrig->set_bwB(transceiverB.iBW); | |
2133 | 2142 | } |
2134 | 2143 | |
2135 | 2144 | |
2181 | 2190 | pthread_join(*serial_thread, NULL); |
2182 | 2191 | |
2183 | 2192 | 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(); | |
2184 | 2199 | selrig->set_vfoA(transceiverA.freq); |
2185 | 2200 | selrig->set_modeA(transceiverA.imode); |
2186 | 2201 | selrig->set_bwA(transceiverA.iBW); |
2187 | selrig->set_vfoB(transceiverB.freq); | |
2188 | selrig->set_modeB(transceiverB.imode); | |
2189 | selrig->set_bwB(transceiverB.iBW); | |
2190 | 2202 | } |
2191 | 2203 | |
2192 | 2204 | selrig->shutdown(); |
3019 | 3031 | if (progStatus.CIV > 0) |
3020 | 3032 | selrig->adjustCIV(progStatus.CIV); |
3021 | 3033 | |
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 | ||
3023 | 3037 | selrig->selectA(); |
3038 | ||
3024 | 3039 | if (selrig->has_get_info) |
3025 | 3040 | selrig->get_info(); |
3041 | ||
3026 | 3042 | transceiverA.freq = selrig->get_vfoA(); |
3027 | 3043 | transceiverA.imode = selrig->get_modeA(); |
3028 | ||
3029 | 3044 | selrig->adjust_bandwidth(transceiverA.imode); |
3030 | 3045 | transceiverA.iBW = selrig->get_bwA(); |
3046 | ||
3031 | 3047 | selrig->selectB(); |
3048 | ||
3032 | 3049 | if (selrig->has_get_info) |
3033 | 3050 | selrig->get_info(); |
3034 | 3051 | |
3035 | 3052 | transceiverB.freq = selrig->get_vfoB(); |
3036 | 3053 | transceiverB.imode = selrig->get_modeB(); |
3037 | ||
3038 | 3054 | selrig->adjust_bandwidth(transceiverB.imode); |
3039 | 3055 | transceiverB.iBW = selrig->get_bwB(); |
3056 | ||
3040 | 3057 | progStatus.freq_A = transceiverA.freq; |
3041 | 3058 | progStatus.imode_A = transceiverA.imode; |
3042 | ||
3043 | 3059 | progStatus.iBW_A = transceiverA.iBW; |
3060 | ||
3044 | 3061 | progStatus.freq_B = transceiverB.freq; |
3045 | 3062 | progStatus.imode_B = transceiverB.imode; |
3046 | 3063 | progStatus.iBW_B = transceiverB.iBW; |
3047 | 3064 | |
3048 | mnuKeepData->set(); | |
3049 | 3065 | if (selrig->restore_mbw) selrig->last_bw = transceiverA.iBW; |
3050 | 3066 | |
3051 | } else | |
3052 | mnuKeepData->clear(); | |
3067 | } | |
3053 | 3068 | |
3054 | 3069 | rigmodes_.clear(); |
3055 | 3070 | opMODE->clear(); |
3769 | 3784 | txtCIV->activate(); |
3770 | 3785 | btnCIVdefault->activate(); |
3771 | 3786 | if (selrig->name_ == rig_IC7200.name_ || |
3787 | selrig->name_ == rig_IC7300.name_ || | |
3772 | 3788 | selrig->name_ == rig_IC7600.name_ || |
3773 | 3789 | selrig->name_ == rig_IC7800.name_ ) { |
3774 | // if (strstr(selrig->name_, "IC-7200") || strstr(selrig->name_, "IC-7600") | |
3775 | // || strstr(selrig->name_, "IC-7800")) { | |
3776 | 3790 | btnUSBaudio->value(progStatus.USBaudio = true); |
3777 | 3791 | btnUSBaudio->activate(); |
3778 | 3792 | } else |
3903 | 3917 | txtCIV->activate(); |
3904 | 3918 | btnCIVdefault->activate(); |
3905 | 3919 | if (xcvr_name == rig_IC7200.name_ || |
3920 | xcvr_name == rig_IC7300.name_ || | |
3906 | 3921 | xcvr_name == rig_IC7600.name_ || |
3907 | 3922 | xcvr_name == rig_IC7800.name_) { |
3908 | 3923 | btnUSBaudio->value(progStatus.USBaudio = true); |