Allow for rigs with neither get VFO nor toggle VFO CAT commands

Some    rigs    always    receive     on    the    same    VFO,    the
HamlibTransceiver::init_rig()  method was  not allowing  for this.  It
needs  to simply  do  nothing  and assume  VFO  MAIN/A  is current  at
startup.

Merged from wsjtx-1.4 branch.




git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4450 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2014-10-02 14:46:32 +00:00
parent aa6ece2262
commit 4e5c1713f2

View File

@ -290,7 +290,7 @@ void HamlibTransceiver::init_rig ()
rmode_t mb;
pbwidth_t w {rig_passband_wide (rig_.data (), m)};
pbwidth_t wb;
if (!rig_->caps->get_vfo)
if (!rig_->caps->get_vfo && (rig_->caps->set_vfo || rig_has_vfo_op (rig_.data (), RIG_OP_TOGGLE)))
{
// Icom have deficient CAT protocol with no way of reading which
// VFO is selected or if SPLIT is selected so we have to simply
@ -314,9 +314,6 @@ void HamlibTransceiver::init_rig ()
if (!rig_->caps->set_vfo)
{
if (rig_has_vfo_op (rig_.data (), RIG_OP_TOGGLE))
{
#if WSJT_TRACE_CAT
qDebug () << "HamlibTransceiver::init_rig rig_vfo_op TOGGLE";
#endif
@ -324,11 +321,6 @@ void HamlibTransceiver::init_rig ()
}
else
{
throw error {tr ("Hamlib: unable to initialise rig")};
}
}
else
{
#if WSJT_TRACE_CAT
qDebug () << "HamlibTransceiver::init_rig rig_set_vfo to other VFO";
#endif
@ -401,7 +393,10 @@ void HamlibTransceiver::init_rig ()
}
else
{
vfo_t v;
vfo_t v {RIG_VFO_A}; // assume RX always on VFO A/MAIN
if (rig_->caps->get_vfo)
{
#if WSJT_TRACE_CAT
qDebug ().nospace () << "HamlibTransceiver::init_rig rig_get_vfo current VFO";
#endif
@ -409,6 +404,7 @@ void HamlibTransceiver::init_rig ()
#if WSJT_TRACE_CAT
qDebug ().nospace () << "HamlibTransceiver::init_rig rig_get_vfo current VFO = 0x" << hex << v;
#endif
}
reversed_ = RIG_VFO_B == v;