kopia lustrzana https://github.com/Hamlib/Hamlib
rodzic
b380ed5dbf
commit
4ff31d008f
38
src/rig.c
38
src/rig.c
|
@ -1459,10 +1459,10 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
// If we're in vfo_mode then rigctld will do any VFO swapping we need
|
// If we're in vfo_mode then rigctld will do any VFO swapping we need
|
||||||
if ((caps->targetable_vfo & RIG_TARGETABLE_FREQ)
|
if ((caps->targetable_vfo & RIG_TARGETABLE_FREQ)
|
||||||
|| vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo
|
|| vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo
|
||||||
|| rig->state.vfo_opt == 1)
|
|| (rig->state.vfo_opt == 1 && rig->caps->rig_model == RIG_MODEL_NETRIGCTL))
|
||||||
{
|
{
|
||||||
// If rig does not have set_vfo we need to change vfo
|
// If rig does not have set_vfo we need to change vfo
|
||||||
if (vfo == RIG_VFO_CURR && caps->set_vfo == NULL)
|
if (vfo == RIG_VFO_CURR && caps->set_vfo == NULL)
|
||||||
{
|
{
|
||||||
vfo = vfo_fixup(rig, RIG_VFO_A);
|
vfo = vfo_fixup(rig, RIG_VFO_A);
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: no set_vfo so vfo=%s\n", __func__,
|
rig_debug(RIG_DEBUG_TRACE, "%s: no set_vfo so vfo=%s\n", __func__,
|
||||||
|
@ -1540,29 +1540,29 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
|
|
||||||
/* VFO compensation */
|
/* VFO compensation */
|
||||||
if (rig->state.vfo_comp != 0.0)
|
if (rig->state.vfo_comp != 0.0)
|
||||||
{
|
{
|
||||||
*freq = (freq_t)(*freq / (1.0 + (double)rig->state.vfo_comp));
|
*freq = (freq_t)(*freq / (1.0 + (double)rig->state.vfo_comp));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retcode == RIG_OK
|
if (retcode == RIG_OK
|
||||||
&& (vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo))
|
&& (vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo))
|
||||||
{
|
{
|
||||||
rig->state.current_freq = *freq;
|
rig->state.current_freq = *freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rig->state.lo_freq != 0.0)
|
if (rig->state.lo_freq != 0.0)
|
||||||
{
|
{
|
||||||
*freq += rig->state.lo_freq;
|
*freq += rig->state.lo_freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cache_ms = elapsed_ms(&(rig->state.cache.time_freq), ELAPSED_SET);
|
cache_ms = elapsed_ms(&(rig->state.cache.time_freq), ELAPSED_SET);
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: cache reset age=%dms, vfo=%s, freq=%.0f\n",
|
rig_debug(RIG_DEBUG_TRACE, "%s: cache reset age=%dms, vfo=%s, freq=%.0f\n",
|
||||||
__func__, cache_ms, rig_strvfo(vfo), *freq);
|
__func__, cache_ms, rig_strvfo(vfo), *freq);
|
||||||
rig->state.cache.freq = *freq;
|
rig->state.cache.freq = *freq;
|
||||||
rig->state.cache.vfo_freq = vfo;
|
rig->state.cache.vfo_freq = vfo;
|
||||||
|
|
||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue