mirror of
https://git.code.sf.net/p/fldigi/flrig
synced 2026-08-13 17:28:24 -04:00
Yaesu tuner
* change get/set tuner methods for these xcvrs
- FT991, FT991A
This commit is contained in:
parent
fe973dd83d
commit
e7e7e2d976
4 changed files with 40 additions and 26 deletions
|
|
@ -83,7 +83,8 @@ public:
|
|||
int get_volume_control();
|
||||
void set_PTT_control(int val);
|
||||
int get_PTT();
|
||||
void tune_rig();
|
||||
void tune_rig(int);
|
||||
int get_tune();
|
||||
int next_attenuator();
|
||||
void set_attenuator(int val);
|
||||
int get_attenuator();
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ public:
|
|||
int get_volume_control();
|
||||
void set_PTT_control(int val);
|
||||
int get_PTT();
|
||||
void tune_rig();
|
||||
void tune_rig(int);
|
||||
int get_tune();
|
||||
int next_attenuator();
|
||||
void set_attenuator(int val);
|
||||
int get_attenuator();
|
||||
|
|
|
|||
|
|
@ -542,24 +542,29 @@ int RIG_FT991::get_PTT()
|
|||
return ptt_;
|
||||
}
|
||||
|
||||
|
||||
// internal or external tune mode
|
||||
void RIG_FT991::tune_rig()
|
||||
void RIG_FT991::tune_rig(int how)
|
||||
{
|
||||
cmd = "AC;";
|
||||
wait_char(';',6, FL991_WAIT_TIME, "is Int. Tuner Enabled", ASC);
|
||||
size_t p = replystr.rfind(rsp);
|
||||
if (p == string::npos) return;
|
||||
if ((p + 5) >= replystr.length()) return;
|
||||
if (replystr[p+4] == '0') {
|
||||
return;
|
||||
}
|
||||
|
||||
cmd = "AC002;";
|
||||
cmd = "AC000;";
|
||||
if (how == 1) cmd[4] = '1';
|
||||
else if (how == 2) cmd[4] = '2';
|
||||
sendCommand(cmd);
|
||||
showresp(WARN, ASC, "tune rig", cmd, replystr);
|
||||
}
|
||||
|
||||
int RIG_FT991::get_tune()
|
||||
{
|
||||
cmd = "AC;";
|
||||
wait_char(';',6, 100, "Tuner Enabled?", ASC);
|
||||
size_t p = replystr.rfind("AC");
|
||||
if (p == string::npos) return 0;
|
||||
if ((p + 5) >= replystr.length()) return 0;
|
||||
if (replystr[p+4] == '0') {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int RIG_FT991::next_attenuator()
|
||||
{
|
||||
switch (atten_level) {
|
||||
|
|
|
|||
|
|
@ -17,12 +17,13 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ----------------------------------------------------------------------------
|
||||
#include <iostream>
|
||||
|
||||
#include "FT991A.h"
|
||||
#include "debug.h"
|
||||
#include "support.h"
|
||||
|
||||
#define FL991A_WAIT_TIME 200
|
||||
#define FL991A_WAIT_TIME 100
|
||||
|
||||
enum mFT991 {
|
||||
mLSB, mUSB, mCW, mFM, mAM, mRTTY_L, mCW_R, mPKT_L, mRTTY_U, mPKT_FM, mFM_N, mPKT_U, mAM_N, mC4FM };
|
||||
|
|
@ -544,22 +545,28 @@ int RIG_FT991A::get_PTT()
|
|||
|
||||
|
||||
// internal or external tune mode
|
||||
void RIG_FT991A::tune_rig()
|
||||
void RIG_FT991A::tune_rig(int how)
|
||||
{
|
||||
cmd = "AC;";
|
||||
wait_char(';',6, FL991A_WAIT_TIME, "is Int. Tuner Enabled", ASC);
|
||||
size_t p = replystr.rfind(rsp);
|
||||
if (p == string::npos) return;
|
||||
if ((p + 5) >= replystr.length()) return;
|
||||
if (replystr[p+4] == '0') {
|
||||
return;
|
||||
}
|
||||
|
||||
cmd = "AC002;";
|
||||
cmd = "AC000;";
|
||||
if (how == 1) cmd[4] = '1';
|
||||
else if (how == 2) cmd[4] = '2';
|
||||
sendCommand(cmd);
|
||||
showresp(WARN, ASC, "tune rig", cmd, replystr);
|
||||
}
|
||||
|
||||
int RIG_FT991A::get_tune()
|
||||
{
|
||||
cmd = "AC;";
|
||||
wait_char(';',6, FL991A_WAIT_TIME, "Tuner Enabled?", ASC);
|
||||
size_t p = replystr.rfind("AC");
|
||||
if (p == string::npos) return 0;
|
||||
if ((p + 5) >= replystr.length()) return 0;
|
||||
if (replystr[p+4] == '0') {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int RIG_FT991A::next_attenuator()
|
||||
{
|
||||
switch (atten_level) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue