2
* Kenwood TS2000 driver
6
* Copyright 2009, Dave Freese, W1HKJ
14
static const char TS2000name_[] = "TS-2000";
16
static const char *TS2000modes_[] = {
17
"LSB", "USB", "CW", "FM", "AM", "FSK", "CW-R", "FSK-R", "DIGI-L", "DIGI-U", NULL};
19
static const char TS2000_mode_chr[] = { '1', '2', '3', '4', '5', '6', '7', '9' };
20
static const char TS2000_mode_type[] = { 'L', 'U', 'U', 'U', 'U', 'L', 'L', 'U' };
22
static const char *TS2000_empty[] = { "N/A", NULL };
23
//------------------------------------------------------------------------------
24
static const char *TS2000_lo[] = {
25
"10", "50", "100", "200", "300",
26
"400", "500", "600", "700", "800",
27
"900", "1000", NULL };
28
static const char *TS2000_CAT_lo[] = {
29
"SL00;", "SL01;", "SL02;", "SL03;", "SL04;",
30
"SL05;", "SL06;", "SL07;", "SL08;", "SL09;",
31
"SL10;", "SL11;", NULL };
32
static const char *TS2000_lo_tooltip = "lo cutoff";
33
static const char *TS2000_SSB_btn_lo_label = "L";
34
//------------------------------------------------------------------------------
35
static const char *TS2000_hi[] = {
36
"1400", "1600", "1800", "2000", "2200",
37
"2400", "2600", "2800", "3000", "3400",
38
"4000", "5000", NULL };
39
static const char *TS2000_CAT_hi[] = {
40
"SH00;", "SH01;", "SH02;", "SH03;", "SH04;",
41
"SH05;", "SH06;", "SH07;", "SH08;", "SH09;",
42
"SH10;", "SH11;", NULL };
43
static const char *TS2000_hi_tooltip = "hi cutoff";
44
static const char *TS2000_SSB_btn_hi_label = "H";
45
//------------------------------------------------------------------------------
46
static const char *TS2000_AM_lo[] = {
47
"0", "100", "200", "500",
49
static const char *TS2000_AM_hi[] = {
50
"2500", "3000", "4000", "5000",
52
//------------------------------------------------------------------------------
53
static const char *TS2000_CWwidths[] = {
54
"50", "80", "100", "150", "200",
55
"300", "400", "500", "600", "1000",
57
static const char *TS2000_CWbw[] = {
58
"FW0050;", "FW0080;", "FW0100;", "FW0150;", "FW0200;",
59
"FW0300;", "FW0400;", "FW0500;", "FW0600;", "FW1000;",
61
//------------------------------------------------------------------------------
62
static const char *TS2000_FSKwidths[] = {
63
"250", "500", "1000", "1500", NULL};
64
static const char *TS2000_FSKbw[] = {
65
"FW0250;", "FW0500;", "FW1000;", "FW1500;" };
66
//------------------------------------------------------------------------------
68
static GUI rig_widgets[]= {
69
{ (Fl_Widget *)btnVol, 2, 125, 50 },
70
{ (Fl_Widget *)sldrVOLUME, 54, 125, 156 },
71
{ (Fl_Widget *)sldrRFGAIN, 54, 145, 156 },
72
{ (Fl_Widget *)btnIFsh, 214, 105, 50 },
73
{ (Fl_Widget *)sldrIFSHIFT, 266, 105, 156 },
74
{ (Fl_Widget *)btnNotch, 214, 125, 50 },
75
{ (Fl_Widget *)sldrNOTCH, 266, 125, 156 },
76
{ (Fl_Widget *)sldrMICGAIN, 266, 145, 156 },
77
{ (Fl_Widget *)sldrPOWER, 54, 165, 368 },
78
{ (Fl_Widget *)NULL, 0, 0, 0 }
81
// mid range on loudness
82
static string menu012 = "EX01200004";
84
void RIG_TS2000::initialize()
86
rig_widgets[0].W = btnVol;
87
rig_widgets[1].W = sldrVOLUME;
88
rig_widgets[2].W = sldrRFGAIN;
89
rig_widgets[3].W = btnIFsh;
90
rig_widgets[4].W = sldrIFSHIFT;
91
rig_widgets[5].W = btnNotch;
92
rig_widgets[6].W = sldrNOTCH;
93
rig_widgets[7].W = sldrMICGAIN;
94
rig_widgets[8].W = sldrPOWER;
97
cmd = "EX0120000;"; // read menu 012 state
98
//might return something like EX01200004;
100
if (waitN(11, 100, "read ex 012", ASC) == 11)
103
// disable beeps before resetting front panel display to SWR
108
// restore state of xcvr beeps
112
// get current noise reduction values for NR1 and NR2
115
if (waitN(4, 100, "read current NR", ASC) == 4)
116
current_nr = replystr;
120
waitN(5, 100, "GET noise reduction val", ASC);
121
size_t p = replystr.rfind("RL");
122
if (p != string::npos)
123
_nrval1 = atoi(&replystr[p+2]);
127
waitN(5, 100, "GET noise reduction val", ASC);
128
p = replystr.rfind("RL");
129
if (p != string::npos)
130
_nrval2 = atoi(&replystr[p+2]);
131
// restore xcvr setting for NR
136
void RIG_TS2000::shutdown()
138
// restore state of xcvr beeps
144
RIG_TS2000::RIG_TS2000() {
147
modes_ = TS2000modes_;
148
bandwidths_ = TS2000_empty;
151
lo_tooltip = TS2000_lo_tooltip;
152
lo_label = TS2000_SSB_btn_lo_label;
155
hi_tooltip = TS2000_hi_tooltip;
156
hi_label = TS2000_SSB_btn_hi_label;
158
widgets = rig_widgets;
160
comm_baudrate = BR4800;
166
comm_rtsplus = false;
167
comm_dtrplus = false;
171
B.imode = A.imode = 1;
172
B.iBW = A.iBW = 0x8803;
173
B.freq = A.freq = 14070000;
174
can_change_alt_vfo = true;
185
has_ifshift_control =
187
has_noise_reduction =
188
has_noise_reduction_control =
190
has_micgain_control =
194
has_attenuator_control =
197
has_bandwidth_control =
198
has_ptt_control = true;
207
_noise_reduction_level = 0;
212
const char * RIG_TS2000::get_bwname_(int n, int md)
214
static char bwname[20];
216
int hi = (n >> 8) & 0x7F;
218
snprintf(bwname, sizeof(bwname), "%s/%s",
219
(md == LSB || md == USB || md == FM) ? TS2000_lo[lo] : TS2000_AM_lo[lo],
220
(md == LSB || md == USB || md == FM) ? TS2000_hi[hi] : TS2000_AM_hi[hi] );
222
snprintf(bwname, sizeof(bwname), "%s",
223
(md == CW || md == CWR) ? TS2000_CWwidths[n] : TS2000_FSKwidths[n]);
228
void RIG_TS2000::selectA()
232
showresp(WARN, ASC, "Rx on A", cmd, replystr);
235
showresp(WARN, ASC, "Tx on A", cmd, replystr);
239
void RIG_TS2000::selectB()
243
showresp(WARN, ASC, "Rx on B", cmd, replystr);
246
showresp(WARN, ASC, "Tx on B", cmd, replystr);
250
void RIG_TS2000::set_split(bool val)
257
showresp(WARN, ASC, "Rx on B", cmd, replystr);
260
showresp(WARN, ASC, "Tx on A", cmd, replystr);
264
showresp(WARN, ASC, "Rx on B", cmd, replystr);
267
showresp(WARN, ASC, "Tx on B", cmd, replystr);
274
showresp(WARN, ASC, "Rx on A", cmd, replystr);
277
showresp(WARN, ASC, "Tx on B", cmd, replystr);
281
showresp(WARN, ASC, "Rx on A", cmd, replystr);
284
showresp(WARN, ASC, "Tx on A", cmd, replystr);
288
Fl::awake(highlight_vfo, (void *)0);
291
int RIG_TS2000::get_split()
298
waitN(4, 100, "get split tx vfo", ASC);
299
p = replystr.rfind("FT");
300
if (p == string::npos) return split;
301
tx = replystr[p+2] - '0';
305
waitN(4, 100, "get split rx vfo", ASC);
307
p = replystr.rfind("FR");
308
if (p == string::npos) return split;
309
rx = replystr[p+2] - '0';
316
long RIG_TS2000::get_vfoA ()
319
waitN(14, 100, "get vfo A", ASC);
320
size_t p = replystr.rfind("FA");
321
if (p != string::npos) {
323
for (size_t n = 2; n < 13; n++)
324
f = f*10 + replystr[p+n] - '0';
330
void RIG_TS2000::set_vfoA (long freq)
333
cmd = "FA00000000000;";
334
for (int i = 12; i > 1; i--) {
339
showresp(WARN, ASC, "set vfo A", cmd, replystr);
342
long RIG_TS2000::get_vfoB ()
345
waitN(14, 100, "get vfo B", ASC);
346
size_t p = replystr.rfind("FB");
347
if (p != string::npos) {
349
for (size_t n = 2; n < 13; n++)
350
f = f*10 + replystr[p+n] - '0';
356
void RIG_TS2000::set_vfoB (long freq)
359
cmd = "FB00000000000;";
360
for (int i = 12; i > 1; i--) {
365
showresp(WARN, ASC, "set vfo B", cmd, replystr);
368
int RIG_TS2000::get_smeter()
374
waitN(8, 100, "get smeter", ASC);
375
size_t p = replystr.rfind("SM");
376
if (p != string::npos) {
377
int mtr = fm_decimal(&replystr[p+3],4);
379
mtr = (mtr * 100) / 30;
381
mtr = (mtr * 100) / 15;
387
int RIG_TS2000::get_swr()
390
waitN(8, 100, "get swr", ASC);
391
size_t p = replystr.rfind("RM1");
392
if (p != string::npos) {
393
int mtr = fm_decimal(&replystr[p+3], 4);
394
mtr = (mtr * 10) / 3;
400
int RIG_TS2000::get_alc(void)
403
waitN(8, 100, "get alc", ASC);
404
size_t p = replystr.rfind("RM3");
405
if (p != string::npos) {
406
int mtr = fm_decimal(&replystr[p+3], 4);
407
mtr = (mtr * 10) / 3;
413
void RIG_TS2000::select_swr()
419
void RIG_TS2000::select_alc()
425
// Transceiver power level
426
void RIG_TS2000::set_power_control(double val)
430
cmd.append(to_decimal(ival, 3)).append(";");
432
showresp(WARN, ASC, "set pwr ctrl", cmd, replystr);
435
int RIG_TS2000::get_power_out()
438
waitN(8, 100, "get power out", ASC);
439
size_t p = replystr.rfind("SM0");
440
if (p != string::npos) {
441
int mtr = fm_decimal(&replystr[p+3],4);
442
if (mtr <= 6) mtr = mtr * 2;
443
else if (mtr <= 11) mtr = 11 + (mtr - 6)*(26 - 11)/(11 - 6);
444
else if (mtr <= 18) mtr = 26 + (mtr - 11)*(50 - 26)/(18 - 11);
445
else mtr = 50 + (mtr - 18)*(100 - 50)/(27 - 18);
446
if (mtr > 100) mtr = 100;
452
int RIG_TS2000::get_power_control()
455
waitN(6, 100, "get pout", ASC);
456
size_t p = replystr.rfind("PC");
457
if (p != string::npos) {
458
int mtr = fm_decimal(&replystr[p+2], 3);
464
// Volume control return 0 ... 100
465
int RIG_TS2000::get_volume_control()
468
waitN(7, 100, "get vol", ASC);
469
size_t p = replystr.rfind("AG");
470
if (p != string::npos) {
471
int val = fm_decimal(&replystr[p+3],3);
472
return (int)(val / 2.55);
477
void RIG_TS2000::set_volume_control(int val)
479
int ivol = (int)(val * 2.55);
481
cmd.append(to_decimal(ivol, 3)).append(";");
483
showresp(WARN, ASC, "set vol", cmd, replystr);
486
// Tranceiver PTT on/off
487
void RIG_TS2000::set_PTT_control(int val)
489
if (val) cmd = "TX;";
492
showresp(WARN, ASC, "set PTT", cmd, replystr);
495
void RIG_TS2000::tune_rig()
499
showresp(WARN, ASC, "tune", cmd, replystr);
502
void RIG_TS2000::set_attenuator(int val)
505
if (val) cmd = "RA01;";
508
showresp(WARN, ASC, "set ATT", cmd, replystr);
511
int RIG_TS2000::get_attenuator()
514
waitN(7, 100, "get ATT", ASC);
515
size_t p = replystr.rfind("RA");
516
if (p != string::npos && (p+3 < replystr.length())) {
517
if (replystr[p+2] == '0' && replystr[p+3] == '0')
525
void RIG_TS2000::set_preamp(int val)
528
if (val) cmd = "PA1;";
531
showresp(WARN, ASC, "set PRE", cmd, replystr);
534
int RIG_TS2000::get_preamp()
537
waitN(5, 100, "get PRE", ASC);
538
size_t p = replystr.rfind("PA");
539
if (p != string::npos && (p+2 < replystr.length())) {
540
if (replystr[p+2] == '1')
548
int RIG_TS2000::set_widths(int val)
552
case LSB: case USB: case FM:
553
bandwidths_ = TS2000_hi;
555
lo_tooltip = TS2000_lo_tooltip;
556
lo_label = TS2000_SSB_btn_lo_label;
558
hi_tooltip = TS2000_hi_tooltip;
559
hi_label = TS2000_SSB_btn_hi_label;
560
if (val == FM) bw = 0x8A03; // 200 ... 4000 Hz
561
else bw = 0x8803; // 200 ... 3000 Hz
564
bandwidths_ = TS2000_CWwidths;
565
dsp_lo = TS2000_empty;
566
dsp_hi = TS2000_empty;
570
bandwidths_ = TS2000_FSKwidths;
571
dsp_lo = TS2000_empty;
572
dsp_hi = TS2000_empty;
576
bandwidths_ = TS2000_AM_hi;
577
dsp_lo = TS2000_AM_lo;
578
dsp_hi = TS2000_AM_hi;
585
const char **RIG_TS2000::bwtable(int val)
587
if (val == LSB || val == USB || val == FM)
589
else if (val == CW || val == CWR)
590
return TS2000_CWwidths;
591
else if (val == FSK || val == FSKR)
592
return TS2000_FSKwidths;
597
const char **RIG_TS2000::lotable(int val)
599
if (val == LSB || val == USB || val == FM)
601
else if (val == CW || val == CWR)
603
else if (val == FSK || val == FSKR)
608
const char **RIG_TS2000::hitable(int val)
610
if (val == LSB || val == USB || val == FM)
612
else if (val == CW || val == CWR)
614
else if (val == FSK || val == FSKR)
619
void RIG_TS2000::set_modeA(int val)
621
_currmode = A.imode = val;
623
cmd += TS2000_mode_chr[val];
626
showresp(WARN, ASC, "set mode", cmd, replystr);
627
A.iBW = set_widths(val);
630
int RIG_TS2000::get_modeA()
633
waitN(4, 100, "get mode A", ASC);
634
size_t p = replystr.rfind("MD");
635
if (p != string::npos) {
636
int md = replystr[p+2];
640
A.iBW = set_widths(A.imode);
646
void RIG_TS2000::set_modeB(int val)
648
_currmode = B.imode = val;
650
cmd += TS2000_mode_chr[val];
653
showresp(WARN, ASC, "set mode B", cmd, replystr);
654
B.iBW = set_widths(val);
657
int RIG_TS2000::get_modeB()
660
waitN(4, 100, "get mode B", ASC);
661
size_t p = replystr.rfind("MD");
662
if (p != string::npos) {
663
int md = replystr[p+2];
667
B.iBW = set_widths(B.imode);
673
int RIG_TS2000::adjust_bandwidth(int val)
676
if (val == LSB || val == USB)
682
else if (val == CW || val == CWR)
684
else if (val == FSK || val == FSKR)
689
int RIG_TS2000::def_bandwidth(int val)
691
return adjust_bandwidth(val);
694
void RIG_TS2000::set_bwA(int val)
696
if (A.imode == LSB || A.imode == USB || A.imode == FM || A.imode == AM) {
697
if (val < 256) return;
700
cmd = TS2000_CAT_lo[A.iBW & 0x7F];
702
showresp(WARN, ASC, "set lower", cmd, replystr);
704
cmd = TS2000_CAT_hi[(A.iBW >> 8) & 0x7F];
706
showresp(WARN, ASC, "set upper", cmd, replystr);
708
if (val > 256) return;
709
else if (A.imode == CW || A.imode == CWR) {
711
cmd = TS2000_CWbw[A.iBW];
713
showresp(WARN, ASC, "set CW bw", cmd, replystr);
714
}else if (A.imode == FSK || A.imode == FSKR) {
716
cmd = TS2000_FSKbw[A.iBW];
718
showresp(WARN, ASC, "set FSK bw", cmd, replystr);
722
int RIG_TS2000::get_bwA()
726
if (A.imode == LSB || A.imode == USB || A.imode == FM || A.imode == AM) {
727
int lo = A.iBW & 0xFF, hi = (A.iBW >> 8) & 0x7F;
729
waitN(5, 100, "get SL", ASC);
730
p = replystr.rfind("SL");
731
if (p != string::npos)
732
lo = fm_decimal(&replystr[2], 2);
734
waitN(5, 100, "get SH", ASC);
735
p = replystr.rfind("SH");
736
if (p != string::npos)
737
hi = fm_decimal(&replystr[2], 2);
738
A.iBW = ((hi << 8) | (lo & 0xFF)) | 0x8000;
739
} else if (A.imode == CW || A.imode == CWR) { // CW
741
waitN(7, 100, "get FW", ASC);
742
p = replystr.rfind("FW");
743
if (p != string::npos) {
744
for (i = 0; i < 11; i++)
745
if (replystr.find(TS2000_CWbw[i]) == p)
750
} else if (A.imode == FSK || A.imode == FSKR) {
752
waitN(7, 100, "get FW", ASC);
753
p = replystr.rfind("FW");
754
if (p != string::npos) {
755
for (i = 0; i < 4; i++)
756
if (replystr.find(TS2000_FSKbw[i]) == p)
765
void RIG_TS2000::set_bwB(int val)
767
if (B.imode == LSB || B.imode == USB || B.imode == FM || B.imode == AM) {
768
if (val < 256) return;
771
cmd = TS2000_CAT_lo[B.iBW & 0x7F];
773
showresp(WARN, ASC, "set lower", cmd, replystr);
775
cmd = TS2000_CAT_hi[(B.iBW >> 8) & 0x7F];
777
showresp(WARN, ASC, "set upper", cmd, replystr);
779
if (val > 256) return;
780
else if (B.imode == CW || B.imode == CWR) { // CW
782
cmd = TS2000_CWbw[B.iBW];
784
showresp(WARN, ASC, "set CW bw", cmd, replystr);
785
}else if (B.imode == FSK || B.imode == FSKR) {
787
cmd = TS2000_FSKbw[B.iBW];
789
showresp(WARN, ASC, "set FSK bw", cmd, replystr);
793
int RIG_TS2000::get_bwB()
797
if (B.imode == LSB || B.imode == USB || B.imode == FM || B.imode == AM) {
798
int lo = B.iBW & 0xFF, hi = (B.iBW >> 8) & 0x7F;
800
waitN(5, 100, "get SL", ASC);
801
p = replystr.rfind("SL");
802
if (p != string::npos)
803
lo = fm_decimal(&replystr[2], 2);
805
waitN(5, 100, "get SH", ASC);
806
p = replystr.rfind("SH");
807
if (p != string::npos)
808
hi = fm_decimal(&replystr[2], 2);
809
B.iBW = ((hi << 8) | (lo & 0xFF)) | 0x8000;
810
} else if (B.imode == CW || B.imode == CWR) {
812
waitN(7, 100, "get FW", ASC);
813
p = replystr.rfind("FW");
814
if (p != string::npos) {
815
for (i = 0; i < 11; i++)
816
if (replystr.find(TS2000_CWbw[i]) == p)
821
} else if (B.imode == FSK || B.imode == FSKR) {
823
waitN(7, 100, "get FW", ASC);
824
p = replystr.rfind("FW");
825
if (p != string::npos) {
826
for (i = 0; i < 4; i++)
827
if (replystr.find(TS2000_FSKbw[i]) == p)
836
int RIG_TS2000::get_modetype(int n)
838
return TS2000_mode_type[n];
842
void RIG_TS2000::set_mic_gain(int val)
845
cmd.append(to_decimal(val,3)).append(";");
847
showresp(WARN, ASC, "set mic", cmd, replystr);
850
int RIG_TS2000::get_mic_gain()
853
waitN(6, 100, "get mic", ASC);
854
size_t p = replystr.rfind("MG");
855
if (p != string::npos)
856
return fm_decimal(&replystr[p+2], 3);
860
void RIG_TS2000::get_mic_min_max_step(int &min, int &max, int &step)
867
void RIG_TS2000::set_noise(bool b)
874
showresp(WARN, ASC, "set NB", cmd, replystr);
877
int RIG_TS2000::get_noise()
880
waitN(4, 100, "get Noise Blanker", ASC);
881
size_t p = replystr.rfind("NB");
882
if (p == string::npos) return 0;
883
if (replystr[p+2] == '0') return 0;
887
//======================================================================
888
// IF shift only available if the transceiver is in the CW mode
889
// step size is 50 Hz
890
//======================================================================
892
void RIG_TS2000::set_if_shift(int val)
894
bool cw = (useB && (B.imode == 2 || B.imode == 6)) ||
895
(!useB && (A.imode == 2 || A.imode == 6));
897
setIFshiftButton((void*)0);
902
cmd.append(to_decimal(val,4)).append(";");
904
showresp(WARN, ASC, "set IF shift", cmd, replystr);
907
bool RIG_TS2000::get_if_shift(int &val)
910
waitN(8, 100, "get IF shift", ASC);
911
size_t p = replystr.rfind("IS ");
912
if (p != string::npos) {
913
val = fm_decimal(&replystr[p+3], 4);
920
void RIG_TS2000::get_if_min_max_step(int &min, int &max, int &step)
922
if_shift_min = min = 400;
923
if_shift_max = max = 1000;
924
if_shift_step = step = 50;
928
void RIG_TS2000::set_notch(bool on, int val)
931
cmd = "BC2;"; // set manual notch
933
showresp(WARN, ASC, "set notch on", cmd, replystr);
935
val = round((val - 300) * 64.0 / 2700.0);
936
cmd.append(to_decimal(val, 3)).append(";");
938
showresp(WARN, ASC, "set notch val", cmd, replystr);
940
cmd = "BC0;"; // no notch action
942
showresp(WARN, ASC, "set notch off", cmd, replystr);
946
bool RIG_TS2000::get_notch(int &val)
950
waitN(4, 100, "get notch on/off", ASC);
951
size_t p = replystr.rfind("BC");
952
if (p != string::npos) {
953
if (replystr[p+2] == '2') {
956
waitN(6, 100, "get notch val", ASC);
957
p = replystr.rfind("BP");
958
if (p != string::npos)
959
val = 300 + (2700.0 / 64.0) * fm_decimal(&replystr[p+2],3);
965
void RIG_TS2000::get_notch_min_max_step(int &min, int &max, int &step)
972
void RIG_TS2000::set_auto_notch(int v)
974
cmd = v ? "NT1;" : "NT0;";
976
showresp(WARN, ASC, "set auto notch", cmd, replystr);
979
int RIG_TS2000::get_auto_notch()
982
waitN(4, 100, "get auto notch", ASC);
983
size_t p = replystr.rfind("NT");
984
if (p != string::npos)
985
return (replystr[p+2] == '1');
989
void RIG_TS2000::set_rf_gain(int val)
992
cmd.append(to_decimal(val * 255 / 100, 3)).append(";");
994
showresp(WARN, ASC, "set rf gain", cmd, replystr);
997
int RIG_TS2000::get_rf_gain()
1000
waitN(6, 100, "get rf gain", ASC);
1001
size_t p = replystr.rfind("RG");
1002
if (p != string::npos)
1003
return fm_decimal(&replystr[p+2] ,3) * 100 / 255;
1007
void RIG_TS2000::set_noise_reduction(int val)
1010
// if (_noise_reduction_level == 1) {
1011
// nr_label("NR1", true);
1012
// } else if (_noise_reduction_level == 2) {
1013
// nr_label("NR2", true);
1017
_noise_reduction_level = val;
1018
if (_noise_reduction_level == 0) {
1019
nr_label("NR", false);
1020
} else if (_noise_reduction_level == 1) {
1021
nr_label("NR1", true);
1022
} else if (_noise_reduction_level == 2) {
1023
nr_label("NR2", true);
1026
cmd += '0' + _noise_reduction_level;
1029
showresp(WARN, ASC, "SET noise reduction", cmd, replystr);
1032
int RIG_TS2000::get_noise_reduction()
1036
waitN(4, 100, "GET noise reduction", ASC);
1037
size_t p = replystr.rfind(rsp);
1038
if (p == string::npos) return _noise_reduction_level;
1039
_noise_reduction_level = replystr[p+2] - '0';
1041
if (_noise_reduction_level == 1) {
1042
nr_label("NR1", true);
1043
} else if (_noise_reduction_level == 2) {
1044
nr_label("NR2", true);
1046
nr_label("NR", false);
1049
return _noise_reduction_level;
1052
void RIG_TS2000::set_noise_reduction_val(int val)
1054
if (_noise_reduction_level == 0) return;
1055
if (_noise_reduction_level == 1) _nrval1 = val;
1058
cmd.assign("RL").append(to_decimal(val, 2)).append(";");
1060
showresp(WARN, ASC, "SET_noise_reduction_val", cmd, replystr);
1063
int RIG_TS2000::get_noise_reduction_val()
1065
if (_noise_reduction_level == 0) return 0;
1066
int val = progStatus.noise_reduction_val;
1069
waitN(5, 100, "GET noise reduction val", ASC);
1070
size_t p = replystr.rfind(rsp);
1071
if (p == string::npos)
1072
return (_noise_reduction_level == 1 ? _nrval1 : _nrval2);
1074
val = atoi(&replystr[p+2]);
1076
if (_noise_reduction_level == 1) _nrval1 = val;