Change icom behavior for IC-9700 type rig with Main/A/B && Sub A/B setup

If Sub is asked for but neither split nor satmode is on it will get changed
to VFOB instead which should avoid doing a VFO swap
https://github.com/Hamlib/Hamlib/issues/250
pull/281/head
Michael Black W9MDB 2020-05-16 07:55:59 -05:00
rodzic 545081c8d4
commit 906a369e00
2 zmienionych plików z 21 dodań i 6 usunięć

Wyświetl plik

@ -1964,13 +1964,20 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
if (vfo == RIG_VFO_MAIN && VFO_HAS_A_B_ONLY)
{
vfo = RIG_VFO_A;
rig_debug(RIG_DEBUG_TRACE, "%s: Rig does not have MAIN/SUB so Main=%s\n",
rig_debug(RIG_DEBUG_TRACE,
"%s: Rig does not have MAIN/SUB so Main changed to %s\n",
__func__, rig_strvfo(vfo));
}
else if (vfo == RIG_VFO_SUB && VFO_HAS_A_B_ONLY)
else if ((vfo == RIG_VFO_SUB) && (VFO_HAS_A_B_ONLY
|| (VFO_HAS_MAIN_SUB_A_B_ONLY && !priv->split_on && !priv->satmode)))
{
// if rig doesn't have Main/Sub
// or if rig has both Main/Sub and A/B -- e.g. 9700
// and we dont' have split or satmode turned on
// then we dont' use Sub -- instead we use Main/VFOB
vfo = RIG_VFO_B;
rig_debug(RIG_DEBUG_TRACE, "%s: Rig does not have MAIN/SUB so Sub=%s\n",
rig_debug(RIG_DEBUG_TRACE,
"%s: Rig does not have MAIN/SUB so Sub changed to %s\n",
__func__, rig_strvfo(vfo));
}
@ -2016,6 +2023,12 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
// If split is on these rigs can only split on Main/VFOB
if (VFO_HAS_MAIN_SUB_A_B_ONLY && priv->split_on) { icvfo = S_VFOB; }
// If not split or satmode then we must want VFOB
if (VFO_HAS_MAIN_SUB_A_B_ONLY && !priv->split_on && !priv->satmode) { icvfo = S_VFOB; }
rig_debug(RIG_DEBUG_TRACE, "%s: Sub asked for, ended up with vfo=%s\n",
__func__, icvfo == S_SUB ? "Sub" : "VFOB");
break;
case RIG_VFO_TX:
@ -4636,7 +4649,8 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
priv->satmode = 1;
priv->tx_vfo = RIG_VFO_SUB;
}
else if ((tx_vfo == RIG_VFO_B && priv->satmode) || (tx_vfo == RIG_VFO_A && priv->satmode))
else if ((tx_vfo == RIG_VFO_B && priv->satmode) || (tx_vfo == RIG_VFO_A
&& priv->satmode))
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: VFO_B and satmode is on so turning off\n",
__func__);
@ -4712,7 +4726,8 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
}
else if (VFO_HAS_MAIN_SUB_A_B_ONLY && (tx_vfo == RIG_VFO_MAIN
|| tx_vfo == RIG_VFO_SUB))
{ // do we need another case for tx_vfo = A/B ?
{
// do we need another case for tx_vfo = A/B ?
rig_debug(RIG_DEBUG_TRACE, "%s: vfo clause 3\n", __func__);
// if we're asking for split in this case we split Main on A/B
priv->tx_vfo = RIG_VFO_SUB;

Wyświetl plik

@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
#define BACKEND_VER "20200514"
#define BACKEND_VER "20200516"
/*
* defines used by comp_cal_str in rig.c