2
* Yaesu FT-5000 drivers
6
* Copyright 2009, Dave Freese, W1HKJ
7
* Copyright 2011, Terry Embry, KJ4EED
16
#define WVALS_LIMIT -1
18
mLSB, mUSB, mCW, mFM, mAM, mRTTY_L, mCW_R, mPKT_L, mRTTY_U, mPKT_FM, mFM_N, mPKT_U };
19
// mLSB, mUSB, mCW, mFM, mAM, mRTTY_L, mCW_R, mPKT_L, mRTTY_U, mPKT_FM, mFM_N, mPKT_U
20
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 // mode index
21
// 19, 19, 9, 0, 0, 10, 9, 15, 10, 0, 0, 15 // FTdx5000_def_bw
24
static const char FT5000name_[] = "FTdx5000";
26
static const char *FT5000modes_[] = {
27
"LSB", "USB", "CW", "FM", "AM",
28
"RTTY-L", "CW-R", "PSK-L", "RTTY-U", "PKT-FM",
29
"FM-N", "PSK-U", NULL};
31
static const int FT5000_def_bw[] = {
36
static const char FT5000_mode_chr[] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C' };
37
static const char FT5000_mode_type[] = { 'L', 'U', 'U', 'U', 'U', 'L', 'L', 'L', 'U', 'U', 'U', 'U' };
39
static const char *FT5000_widths_SSB[] = {
40
"200", "400", "600", "850", "1100", "1350", "1500", // NA = 1 widths
41
"1650", "1800", "1950", "2100", "2250", "2400",
42
"2500", "2600", "2700", "2800", "2900", "3000",
43
"3200", "3400", "3600", "3800", "4000", // NA = 0 widths
46
static int FT5000_wvals_SSB[] = {
47
1,2,3,4,5,6,7, 8,9,10,11,12,13, 15,16,17,18,19,20, 21,22,23,24,25, WVALS_LIMIT};
49
static const char *FT5000_widths_CW[] = {
50
"50", "100", "150", "200", "250", "300", "350", "400", "450", "500", // NA1
51
"800", "1200", "1400", "1700", "2000", "2400", // NA0
54
static int FT5000_wvals_CW[] = {
55
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, WVALS_LIMIT };
57
static const char *FT5000_widths_RTTY[] = {
58
"50", "100", "150", "200", "250", "300", "350", "400", "450", "500", // NA1
59
"800", "1200", "1400", "1700", "2000", "2400", // NA0
62
static int FT5000_wvals_RTTY[] = {
63
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, WVALS_LIMIT };
65
static const char *FT5000_widths_PSK[] = {
66
"50", "100", "150", "200", "250", "300", "350", "400", "450", "500", // NA1
67
"800", "1200", "1400", "1700", "2000", "2400", // NA0
70
static int FT5000_wvals_PSK[] = {
71
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, WVALS_LIMIT };
73
static const int FT5000_wvals_AMFM[] = { 0, WVALS_LIMIT };
75
static const char *FT5000_widths_AMwide[] = { "AM-bw", NULL };
76
static const char *FT5000_widths_FMnar[] = { "FM-nar", NULL };
77
static const char *FT5000_widths_FMwide[] = { "FM-wid", NULL };
78
static const char *FT5000_widths_FMpkt[] = { "FM-pkt", NULL };
80
static const char *FT5000_US_60m[] = {NULL, "126", "127", "128", "130", NULL};
81
// US has 5 60M presets. Using dummy numbers for all.
82
// First NULL means skip 60m sets in set_band_selection().
83
// Maybe someone can do a cat command MC; on all 5 presets and add returned numbers above.
84
// To send cat commands in flrig goto menu Config->Xcvr select->Send Cmd.
86
// UK has 7 60M presets. Using dummy numbers for all. If you want support,
87
// Maybe someone can do a cat command MC; on all 7 presets and add returned numbers below.
88
// static const char *FT5000_UK_60m[] = {NULL, "126", "127", "128", "130", "131", "132", NULL};
90
static const char **Channels_60m = FT5000_US_60m;
92
static GUI rig_widgets[]= {
93
{ (Fl_Widget *)btnVol, 2, 125, 50 },
94
{ (Fl_Widget *)sldrVOLUME, 54, 125, 156 },
95
{ (Fl_Widget *)sldrRFGAIN, 54, 145, 156 },
96
{ (Fl_Widget *)btnIFsh, 214, 105, 50 },
97
{ (Fl_Widget *)sldrIFSHIFT, 266, 105, 156 },
98
{ (Fl_Widget *)btnNotch, 214, 125, 50 },
99
{ (Fl_Widget *)sldrNOTCH, 266, 125, 156 },
100
{ (Fl_Widget *)sldrMICGAIN, 266, 145, 156 },
101
{ (Fl_Widget *)sldrPOWER, 54, 165, 368 },
102
{ (Fl_Widget *)NULL, 0, 0, 0 }
105
void RIG_FT5000::initialize()
107
rig_widgets[0].W = btnVol;
108
rig_widgets[1].W = sldrVOLUME;
109
rig_widgets[2].W = sldrRFGAIN;
110
rig_widgets[3].W = btnIFsh;
111
rig_widgets[4].W = sldrIFSHIFT;
112
rig_widgets[5].W = btnNotch;
113
rig_widgets[6].W = sldrNOTCH;
114
rig_widgets[7].W = sldrMICGAIN;
115
rig_widgets[8].W = sldrPOWER;
119
showresp(WARN, ASC, "Auto Info OFF", cmd, replystr);
122
RIG_FT5000::RIG_FT5000() {
125
modes_ = FT5000modes_;
126
bandwidths_ = FT5000_widths_SSB;
127
bw_vals_ = FT5000_wvals_SSB;
129
widgets = rig_widgets;
131
comm_baudrate = BR38400;
137
comm_rtsplus = false;
138
comm_dtrplus = false;
143
A.imode = B.imode = modeB = modeA = def_mode = 1;
144
A.iBW = B.iBW = bwA = bwB = def_bw = 19;
145
A.freq = B.freq = freqA = freqB = def_freq = 14070000;
155
has_vox_on_dataport =
161
// has_cw_spot_tone = // does not exist???
173
has_micgain_control =
176
has_bandwidth_control =
179
has_attenuator_control =
181
has_ifshift_control =
183
has_tune_control = true;
196
void RIG_FT5000::set_band_selection(int v)
200
waitN(27, 100, "get vfo mode in set_band_selection", ASC);
201
size_t p = replystr.rfind("IF");
202
if (p == string::npos) return;
203
if (replystr[p+21] != '0') { // vfo 60M memory mode
207
if (v == 12) { // 5MHz 60m presets
208
if (Channels_60m[0] == NULL) return; // no 60m Channels so skip
210
if (Channels_60m[++m_60m_indx] == NULL)
213
cmd.assign("MC").append(Channels_60m[m_60m_indx]).append(";");
214
} else { // v == 1..11 band selection OR return to vfo mode == 0
220
cmd.assign("BS").append(to_decimal(v, 2)).append(";");
225
showresp(WARN, ASC, "Select Band Stacks", cmd, replystr);
228
long RIG_FT5000::get_vfoA ()
232
waitN(11, 100, "get vfo A", ASC);
234
size_t p = replystr.rfind(rsp);
235
if (p == string::npos) return freqA;
237
for (size_t n = 2; n < 10; n++)
238
f = f*10 + replystr[p+n] - '0';
243
void RIG_FT5000::set_vfoA (long freq)
247
for (int i = 9; i > 1; i--) {
252
showresp(WARN, ASC, "SET vfo A", cmd, replystr);
255
long RIG_FT5000::get_vfoB ()
259
waitN(11, 100, "get vfo B", ASC);
261
size_t p = replystr.rfind(rsp);
262
if (p == string::npos) return freqB;
264
for (size_t n = 2; n < 10; n++)
265
f = f*10 + replystr[p+n] - '0';
271
void RIG_FT5000::set_vfoB (long freq)
275
for (int i = 9; i > 1; i--) {
280
showresp(WARN, ASC, "SET vfo B", cmd, replystr);
284
bool RIG_FT5000::twovfos()
289
void RIG_FT5000::selectA()
293
showresp(WARN, ASC, "select A", cmd, replystr);
296
void RIG_FT5000::selectB()
300
showresp(WARN, ASC, "select B", cmd, replystr);
303
void RIG_FT5000::A2B()
307
showresp(WARN, ASC, "vfo A --> B", cmd, replystr);
310
bool RIG_FT5000::can_split()
315
void RIG_FT5000::set_split(bool val)
322
showresp(WARN, ASC, "Rx on A", cmd, replystr);
325
showresp(WARN, ASC, "Tx on B", cmd, replystr);
329
showresp(WARN, ASC, "Rx on A", cmd, replystr);
332
showresp(WARN, ASC, "Tx on A", cmd, replystr);
334
Fl::awake(highlight_vfo, (void *)0);
337
int RIG_FT5000::get_split()
343
int RIG_FT5000::get_smeter()
347
waitN(7, 100, "get smeter", ASC);
349
size_t p = replystr.rfind(rsp);
350
if (p == string::npos) return 0;
351
if (p + 6 >= replystr.length()) return 0;
352
int mtr = atoi(&replystr[p+3]);
353
mtr = mtr * 100.0 / 256.0;
357
int RIG_FT5000::get_swr()
361
waitN(7, 100, "get swr", ASC);
363
size_t p = replystr.rfind(rsp);
364
if (p == string::npos) return 0;
365
if (p + 6 >= replystr.length()) return 0;
366
int mtr = atoi(&replystr[p+3]);
370
int RIG_FT5000::get_power_out()
373
sendCommand(cmd.append(";"));
374
waitN(7, 100, "get pout", ASC);
376
size_t p = replystr.rfind(rsp);
377
if (p == string::npos) return 0;
378
if (p + 6 >= replystr.length()) return 0;
379
double mtr = (double)(atoi(&replystr[p+3]));
380
// mtr = -6.6263535 + .11813178 * mtr + .0013607405 * mtr * mtr;
381
mtr = 0.116 * mtr + 0.0011 * mtr * mtr;
385
// Transceiver power level
386
int RIG_FT5000::get_power_control()
390
waitN(6, 100, "get power", ASC);
392
size_t p = replystr.rfind(rsp);
393
if (p == string::npos) return progStatus.power_level;
394
if (p + 5 >= replystr.length()) return progStatus.power_level;
396
int mtr = atoi(&replystr[p+2]);
400
void RIG_FT5000::set_power_control(double val)
404
for (int i = 4; i > 1; i--) {
409
showresp(WARN, ASC, "SET power", cmd, replystr);
412
// Volume control return 0 ... 100
413
int RIG_FT5000::get_volume_control()
417
waitN(7, 100, "get vol", ASC);
419
size_t p = replystr.rfind(rsp);
420
if (p == string::npos) return progStatus.volume;
421
if (p + 6 >= replystr.length()) return progStatus.volume;
422
int val = atoi(&replystr[p+3]) * 100 / 250;
423
if (val > 100) val = 100;
427
void RIG_FT5000::set_volume_control(int val)
429
int ivol = (int)(val * 250 / 100);
431
for (int i = 5; i > 2; i--) {
436
showresp(WARN, ASC, "SET vol", cmd, replystr);
439
// Tranceiver PTT on/off
440
void RIG_FT5000::set_PTT_control(int val)
442
cmd = val ? "TX1;" : "TX0;";
444
showresp(WARN, ASC, "SET PTT", cmd, replystr);
447
void RIG_FT5000::tune_rig()
451
showresp(WARN, ASC, "tune rig", cmd, replystr);
454
void RIG_FT5000::set_attenuator(int val)
456
if (atten_level == 0) {
458
atten_label("6 dB", true);
459
} else if (atten_level == 1) {
461
atten_label("12 dB", true);
462
} else if (atten_level == 2) {
464
atten_label("18 dB", true);
465
} else if (atten_level == 3) {
467
atten_label("Att", false);
470
cmd[3] += atten_level;
472
showresp(WARN, ASC, "SET att", cmd, replystr);
475
int RIG_FT5000::get_attenuator()
479
waitN(5, 100, "get att", ASC);
481
size_t p = replystr.rfind(rsp);
482
if (p == string::npos) return progStatus.attenuator;
483
if (p + 3 >= replystr.length()) return progStatus.attenuator;
484
atten_level = replystr[p+3] - '0';
485
if (atten_level == 1) {
486
atten_label("6 dB", true);
487
} else if (atten_level == 2) {
488
atten_label("12 dB", true);
489
} else if (atten_level == 3) {
490
atten_label("18 dB", true);
493
atten_label("Att", false);
498
void RIG_FT5000::set_preamp(int val)
501
if (preamp_level == 0) {
503
preamp_label("Amp 1", true);
504
} else if (preamp_level == 1) {
506
preamp_label("Amp 2", true);
507
} else if (preamp_level == 2) {
509
preamp_label("IPO2", true);
510
} else if (preamp_level == 3) {
512
preamp_label("IPO1", false);
514
cmd[3] = '0' + preamp_level;
516
showresp(WARN, ASC, "SET preamp", cmd, replystr);
519
int RIG_FT5000::get_preamp()
523
waitN(5, 100, "get pre", ASC);
525
size_t p = replystr.rfind(rsp);
526
if (p != string::npos)
527
preamp_level = replystr[p+3] - '0';
528
if (preamp_level == 1) {
529
preamp_label("Amp 1", true);
530
} else if (preamp_level == 2) {
531
preamp_label("Amp 2", true);
532
} else if (preamp_level == 3) {
533
preamp_label("IPO2", true);
535
preamp_label("IPO1", false);
541
int RIG_FT5000::adjust_bandwidth(int val)
544
if (val == mCW || val == mCW_R) {
545
bandwidths_ = FT5000_widths_CW;
546
bw_vals_ = FT5000_wvals_CW;
547
} else if (val == mFM || val == mAM || val == mFM_N || val == mPKT_FM) {
548
if (val == mFM) bandwidths_ = FT5000_widths_FMwide;
549
else if (val == mAM) bandwidths_ = FT5000_widths_AMwide;
550
else if (val == mFM_N) bandwidths_ = FT5000_widths_FMnar;
551
else if (val == mPKT_FM) bandwidths_ = FT5000_widths_FMpkt;
552
bw_vals_ = FT5000_wvals_AMFM;
553
} else if (val == mRTTY_L || val == mRTTY_U) { // RTTY
554
bandwidths_ = FT5000_widths_RTTY;
555
bw_vals_ = FT5000_wvals_RTTY;
556
} else if (val == mPKT_L || val == mPKT_U) { // PSK
557
bandwidths_ = FT5000_widths_PSK;
558
bw_vals_ = FT5000_wvals_PSK;
560
bandwidths_ = FT5000_widths_SSB;
561
bw_vals_ = FT5000_wvals_SSB;
563
bw = FT5000_def_bw[val];
567
int RIG_FT5000::def_bandwidth(int val)
569
return FT5000_def_bw[val];
572
const char ** RIG_FT5000::bwtable(int n)
575
case mCW: case mCW_R: return FT5000_widths_CW;
576
case mFM: return FT5000_widths_FMwide;
577
case mAM: return FT5000_widths_AMwide;
578
case mRTTY_L: case mRTTY_U: return FT5000_widths_RTTY;
579
case mPKT_L: case mPKT_U: return FT5000_widths_PSK;
580
case mFM_N: return FT5000_widths_FMnar;
581
case mPKT_FM: return FT5000_widths_FMpkt;
584
return FT5000_widths_SSB;
587
void RIG_FT5000::set_modeA(int val)
591
cmd += FT5000_mode_chr[val];
594
showresp(WARN, ASC, "SET mode A", cmd, replystr);
595
adjust_bandwidth(modeA);
596
if (val == mCW || val == mCW_R) return;
597
if (progStatus.spot_onoff) {
598
progStatus.spot_onoff = false;
602
showresp(WARN, ASC, "SET spot off", cmd, replystr);
607
int RIG_FT5000::get_modeA()
611
waitN(5, 100, "get mode A", ASC);
613
size_t p = replystr.rfind(rsp);
614
if (p != string::npos) {
615
if (p + 3 < replystr.length()) {
616
int md = replystr[p+3];
617
if (md <= '9') md = md - '1';
618
else md = 9 + md - 'A';
622
adjust_bandwidth(modeA);
626
void RIG_FT5000::set_modeB(int val)
630
cmd += FT5000_mode_chr[val];
633
showresp(WARN, ASC, "SET mode B", cmd, replystr);
634
adjust_bandwidth(modeA);
635
if (val == mCW || val == mCW_R) return;
636
if (progStatus.spot_onoff) {
637
progStatus.spot_onoff = false;
641
showresp(WARN, ASC, "SET spot off", cmd, replystr);
646
int RIG_FT5000::get_modeB()
650
waitN(5, 100, "get mode B", ASC);
652
size_t p = replystr.rfind(rsp);
653
if (p != string::npos) {
654
if (p + 3 < replystr.length()) {
655
int md = replystr[p+3];
656
if (md <= '9') md = md - '1';
657
else md = 9 + md - 'A';
661
adjust_bandwidth(modeB);
665
void RIG_FT5000::set_bwA(int val)
667
int bw_indx = bw_vals_[val];
670
if (modeA == mFM || modeA == mAM || modeA == mFM_N || modeA == mPKT_FM ) {
673
if ((((modeA == mLSB || modeA == mUSB) && val < 8)) ||
674
((modeA == mCW || modeA == mCW_R) && val < 11) ||
675
((modeA == mRTTY_L || modeA == mRTTY_U) && val < 11) ||
676
((modeA == mPKT_L || modeA == mPKT_U) && val < 11)) cmd = "NA01;";
680
cmd += '0' + bw_indx / 10;
681
cmd += '0' + bw_indx % 10;
684
showresp(WARN, ASC, "SET bw A", cmd, replystr);
687
int RIG_FT5000::get_bwA()
689
if (modeA == mFM || modeA == mAM || modeA == mFM_N || modeA == mPKT_FM) {
695
waitN(6, 100, "get bw A", ASC);
697
size_t p = replystr.rfind(rsp);
698
if (p == string::npos) return bwA;
699
if (p + 5 >= replystr.length()) return bwA;
702
int bw_idx = fm_decimal(&replystr[p+3],2);
703
const int *idx = bw_vals_;
705
while (*idx != WVALS_LIMIT) {
706
if (*idx == bw_idx) break;
710
if (*idx == WVALS_LIMIT) i--;
715
void RIG_FT5000::set_bwB(int val)
717
int bw_indx = bw_vals_[val];
720
if (modeB == mFM || modeB == mAM || modeB == mFM_N || modeB == mPKT_FM) {
723
if ((((modeB == mLSB || modeB == mUSB) && val < 8)) ||
724
((modeB == mCW || modeB == mCW_R) && val < 11) ||
725
((modeB == mRTTY_L || modeB == mRTTY_U) && val < 11) ||
726
((modeB == mPKT_L || modeB == mPKT_U) && val < 11)) cmd = "NA01;";
730
cmd += '0' + bw_indx / 10;
731
cmd += '0' + bw_indx % 10;
734
showresp(WARN, ASC, "SET bw B", cmd, replystr);
737
int RIG_FT5000::get_bwB()
739
if (modeB == mFM || modeB == mAM || modeB == mFM_N || modeB == mPKT_FM) {
745
waitN(6, 100, "get bw B", ASC);
747
size_t p = replystr.rfind(rsp);
748
if (p == string::npos) return bwB;
749
if (p + 5 >= replystr.length()) return bwB;
752
int bw_idx = fm_decimal(&replystr[p+3],2);
753
const int *idx = bw_vals_;
755
while (*idx != WVALS_LIMIT) {
756
if (*idx == bw_idx) break;
760
if (*idx == WVALS_LIMIT) i--;
765
int RIG_FT5000::get_modetype(int n)
767
return FT5000_mode_type[n];
770
void RIG_FT5000::set_if_shift(int val)
773
if (val != 0) progStatus.shift = true;
774
else progStatus.shift = false;
775
if (val < 0) cmd[3] = '-';
777
for (int i = 4; i > 0; i--) {
778
cmd[3+i] += val % 10;
782
showresp(WARN, ASC, "SET if shift", cmd, replystr);
785
bool RIG_FT5000::get_if_shift(int &val)
789
waitN(9, 100, "get if shift", ASC);
791
size_t p = replystr.rfind(rsp);
792
val = progStatus.shift_val;
793
if (p == string::npos) return progStatus.shift;
794
val = atoi(&replystr[p+4]);
795
if (replystr[p+3] == '-') val = -val;
799
void RIG_FT5000::get_if_min_max_step(int &min, int &max, int &step)
801
if_shift_min = min = -1000;
802
if_shift_max = max = 1000;
803
if_shift_step = step = 50;
807
void RIG_FT5000::set_notch(bool on, int val)
809
if (on && !notch_on) {
813
showresp(WARN, ASC, "SET notch on", cmd, replystr);
814
} else if (!on && notch_on) {
818
showresp(WARN, ASC, "SET notch off", cmd, replystr);
824
cmd.append(to_decimal(val,3)).append(";");
826
showresp(WARN, ASC, "SET notch val", cmd, replystr);
829
bool RIG_FT5000::get_notch(int &val)
834
waitN(8, 100, "get notch on/off", ASC);
835
size_t p = replystr.rfind(rsp);
836
if (p == string::npos) return ison;
838
if (replystr[p+6] == '1') // manual notch enabled
841
val = progStatus.notch_val;
844
waitN(8, 100, "get notch val", ASC);
845
p = replystr.rfind(rsp);
846
if (p == string::npos)
849
val = fm_decimal(&replystr[p+4],3) * 10;
851
return (notch_on = ison);
854
void RIG_FT5000::get_notch_min_max_step(int &min, int &max, int &step)
861
void RIG_FT5000::set_auto_notch(int v)
866
showresp(WARN, ASC, "SET auto notch", cmd, replystr);
869
int RIG_FT5000::get_auto_notch()
872
waitN(5, 100, "get auto notch", ASC);
873
size_t p = replystr.rfind("BC0");
874
if (p == string::npos) return 0;
875
if (replystr[p+3] == '1') return 1;
879
int FT5000_blanker_level = 0;
881
void RIG_FT5000::set_noise(bool b)
884
if (FT5000_blanker_level == 0) {
885
FT5000_blanker_level = 1;
886
nb_label("NB 1", true);
887
} else if (FT5000_blanker_level == 1) {
888
FT5000_blanker_level = 2;
889
nb_label("NB 2", true);
890
} else if (FT5000_blanker_level == 2) {
891
FT5000_blanker_level = 0;
892
nb_label("NB", false);
894
cmd[3] = '0' + FT5000_blanker_level;
896
showresp(WARN, ASC, "SET NB", cmd, replystr);
899
int RIG_FT5000::get_noise()
903
waitN(5, 100, "get NB", ASC);
905
size_t p = replystr.rfind(rsp);
906
if (p == string::npos) return FT5000_blanker_level;
908
FT5000_blanker_level = replystr[p+3] - '0';
909
if (FT5000_blanker_level == 1) {
910
nb_label("NB 1", true);
911
} else if (FT5000_blanker_level == 2) {
912
nb_label("NB 2", true);
914
nb_label("NB", false);
915
FT5000_blanker_level = 0;
917
return FT5000_blanker_level;
921
void RIG_FT5000::set_mic_gain(int val)
924
val = (int)(val * 255 / 100); // convert to 0 .. 255
925
for (int i = 3; i > 0; i--) {
926
cmd[1+i] += val % 10;
930
showresp(WARN, ASC, "SET mic", cmd, replystr);
933
int RIG_FT5000::get_mic_gain()
937
waitN(6, 100, "get mic", ASC);
939
size_t p = replystr.rfind(rsp);
940
if (p == string::npos) return progStatus.mic_gain;
941
int val = atoi(&replystr[p+2]);
942
return val * 100 / 255;
945
void RIG_FT5000::get_mic_min_max_step(int &min, int &max, int &step)
952
void RIG_FT5000::set_rf_gain(int val)
955
int rfval = val * 250 / 100;
956
for (int i = 5; i > 2; i--) {
957
cmd[i] = rfval % 10 + '0';
961
showresp(WARN, ASC, "SET rfgain", cmd, replystr);
964
int RIG_FT5000::get_rf_gain()
969
waitN(7, 100, "get rfgain", ASC);
971
size_t p = replystr.rfind(rsp);
972
if (p == string::npos) return progStatus.rfgain;
973
for (int i = 3; i < 6; i++) {
975
rfval += replystr[p+i] - '0';
977
rfval = rfval * 100 / 250;
978
if (rfval > 100) rfval = 100;
982
void RIG_FT5000::get_rf_min_max_step(int &min, int &max, int &step)
989
void RIG_FT5000::set_vox_onoff()
992
if (progStatus.vox_onoff) cmd[2] = '1';
994
showresp(WARN, ASC, "SET vox", cmd, replystr);
997
void RIG_FT5000::set_vox_gain()
1000
cmd.append(to_decimal(progStatus.vox_gain, 3)).append(";");
1002
showresp(WARN, ASC, "SET vox gain", cmd, replystr);
1005
void RIG_FT5000::set_vox_anti()
1008
cmd.append(to_decimal(progStatus.vox_anti, 3)).append(";");
1010
showresp(WARN, ASC, "SET anti-vox", cmd, replystr);
1013
void RIG_FT5000::set_vox_hang()
1016
cmd.append(to_decimal(progStatus.vox_hang, 4)).append(";");
1018
showresp(WARN, ASC, "SET vox delay", cmd, replystr);
1021
void RIG_FT5000::set_vox_on_dataport()
1024
if (progStatus.vox_on_dataport) cmd[5] = '1';
1026
showresp(WARN, ASC, "SET vox on data port", cmd, replystr);
1029
void RIG_FT5000::set_cw_wpm()
1032
if (progStatus.cw_wpm > 60) progStatus.cw_wpm = 60;
1033
if (progStatus.cw_wpm < 4) progStatus.cw_wpm = 4;
1034
cmd.append(to_decimal(progStatus.cw_wpm, 3)).append(";");
1036
showresp(WARN, ASC, "SET cw wpm", cmd, replystr);
1040
void RIG_FT5000::enable_keyer()
1043
if (progStatus.enable_keyer) cmd[2] = '1';
1045
showresp(WARN, ASC, "SET keyer on/off", cmd, replystr);
1048
bool RIG_FT5000::set_cw_spot()
1050
if (vfo.imode == 2 || vfo.imode == 6) {
1052
if (progStatus.spot_onoff) cmd[2] = '1';
1054
showresp(WARN, ASC, "SET spot on/off", cmd, replystr);
1060
void RIG_FT5000::set_cw_weight()
1062
int n = round(progStatus.cw_weight * 10);
1063
cmd.assign("EX065").append(to_decimal(n, 2)).append(";");
1065
showresp(WARN, ASC, "SET cw weight", cmd, replystr);
1068
void RIG_FT5000::set_cw_qsk()
1070
int n = progStatus.cw_qsk / 5 - 3;
1071
cmd.assign("EX068").append(to_decimal(n, 1)).append(";");
1073
showresp(WARN, ASC, "SET cw qsk", cmd, replystr);
1076
void RIG_FT5000::set_cw_spot_tone()
1078
int n = (progStatus.cw_spot_tone - 300) / 50;
1080
cmd.append(to_decimal(n, 2)).append(";");
1082
showresp(WARN, ASC, "SET cw tone", cmd, replystr);
1086
void RIG_FT5000::set_cw_vol()