Fix double ;; in newcat_set_cmd_validate

Only ask for freq from other vfo that may have been changed by band select
pull/518/head
Michael Black W9MDB 2021-01-18 22:30:49 -06:00
rodzic 2eda4bf1a7
commit 00cc6e848f
1 zmienionych plików z 16 dodań i 6 usunięć

Wyświetl plik

@ -866,12 +866,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (rig->state.current_vfo != vfo)
{
// then we need to change vfos, BS, and change back
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS1;BS%02d%c;VS0;",
newcat_band_index(freq), cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS1;BS%02d;VS0;",
newcat_band_index(freq));
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS0;BS%02d%c;VS1;",
newcat_band_index(freq), cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS0;BS%02d;VS1;",
newcat_band_index(freq));
}
else
{
@ -951,6 +951,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
freq_t tmp_freqA, tmp_freqB;
rmode_t tmp_mode;
pbwidth_t tmp_width;
rig_get_freq(rig, RIG_VFO_MAIN, &tmp_freqA);
rig_get_freq(rig, RIG_VFO_SUB, &tmp_freqB);
rig_get_mode(rig, RIG_VFO_MAIN, &tmp_mode, &tmp_width);
@ -972,8 +973,17 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
freq_t tmp_freqA, tmp_freqB;
rmode_t tmp_mode;
pbwidth_t tmp_width;
rig_get_freq(rig, RIG_VFO_MAIN, &tmp_freqA);
rig_get_freq(rig, RIG_VFO_SUB, &tmp_freqB);
// we need to update some info that BS may have caused
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
{
rig_get_freq(rig, RIG_VFO_SUB, &tmp_freqA);
}
else
{
rig_get_freq(rig, RIG_VFO_MAIN, &tmp_freqB);
}
rig_get_mode(rig, RIG_VFO_MAIN, &tmp_mode, &tmp_width);
rig_get_mode(rig, RIG_VFO_SUB, &tmp_mode, &tmp_width);