Avoid newcat BS command when VFO freq is not changing

pull/518/head
Michael Black W9MDB 2021-01-17 08:54:40 -06:00
rodzic a8d841182b
commit ebeb23e49d
2 zmienionych plików z 38 dodań i 16 usunięć

Wyświetl plik

@ -816,12 +816,24 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
{
if (rig->state.cache.freqMainA == 0)
{
freq_t freqtmp;
err = rig_get_freq(rig,RIG_VFO_CURR,&freqtmp);
if (err != RIG_OK) RETURNFUNC(err);
}
changing = newcat_band_index(freq) != newcat_band_index(
rig->state.cache.freqMainA);
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A freq changing=%d\n", __func__, changing);
}
else
{
if (rig->state.cache.freqMainB == 0)
{
freq_t freqtmp;
err = rig_get_freq(rig,RIG_VFO_CURR,&freqtmp);
if (err != RIG_OK) RETURNFUNC(err);
}
changing = newcat_band_index(freq) != newcat_band_index(
rig->state.cache.freqMainB);
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B freq changing=%d\n", __func__, changing);
@ -861,6 +873,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// Also need to do this for the other VFO on some Yaesu rigs
// is redundant for rigs where band stack includes both vfos
vfo_t vfotmp;
freq_t freqtmp;
err = rig_get_vfo(rig, &vfotmp);
if (err != RIG_OK) { return err; }
@ -874,9 +887,16 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_B : RIG_VFO_A);
}
if (err != RIG_OK) { return err; }
rig_get_freq(rig, RIG_VFO_CURR, &freqtmp);
if (err != RIG_OK) { return err; }
// we'll ignore UHF/VHF frequencies -- need to see the behavior
if (newcat_band_index(freqtmp) != newcat_band_index(freq) && freq < 100e6)
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c",
newcat_band_index(freq), cat_term);
@ -886,6 +906,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
__func__,
rigerror(err));
}
}
// switch back to the starting vfo
if (rig->state.vfo_list & RIG_VFO_MAIN)
@ -9289,6 +9310,7 @@ int newcat_get_cmd(RIG *rig)
int is_read_cmd = 0;
ENTERFUNC;
// try to cache rapid repeats of the IF command
// this is for WSJT-X/JTDX sequence of v/f/m/t
// should allow rapid repeat of any call using the IF; cmd

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
#define NEWCAT_VER "20210116"
#define NEWCAT_VER "20210117"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129