A slightly better solution to fix the 55 Hz problem with OmniRig v1.19 and later.

This commit is contained in:
Uwe Risse 2022-05-03 15:46:17 +02:00
parent eef441ec87
commit b9b3d1d6f5
1 changed files with 15 additions and 9 deletions

View File

@ -280,24 +280,30 @@ int OmniRigTransceiver::do_start ()
resolution = 2; // 20Hz rounded resolution = 2; // 20Hz rounded
} }
} }
QThread::msleep (200); // For Omnirig v1.19 or later we need a delay here, otherwise rig QRG stays at +55 Hz.
// 200 ms should do job for all modern transceivers. However, with very slow // For OmniRig v1.19 or later we need a delay between GetRxFrequency () and SetFreq (f),
// transceivers or receivers, rig QRG may still stay at +55 Hz. // otherwise rig QRG stays at f+55 Hz. 200 ms should do job for all modern transceivers.
// Because of the asynchronous nature of Omnirig commands, a better solution would be // However, with very slow rigs, QRG may still stay at f+55 Hz. Such rigs should use v1.18.
// to implement an event handler for the OnParamChange event of OmniRig, // Due to the asynchronous nature of Omnirig commands, a better solution would be to implement
// and read the frequency inside that handler. // an event handler for OmniRig's OnParamChange event and read the frequency inside that handler.
if (OmniRig::PM_FREQ & writable_params_) if (OmniRig::PM_FREQ & writable_params_)
{ {
rig_->SetFreq (f); QTimer::singleShot (200, [=] {
rig_->SetFreq (f);
});
} }
else if (reversed_ && (OmniRig::PM_FREQB & writable_params_)) else if (reversed_ && (OmniRig::PM_FREQB & writable_params_))
{ {
rig_->SetFreqB (f); QTimer::singleShot (200, [=] {
rig_->SetFreqB (f);
});
} }
else if (!reversed_ && (OmniRig::PM_FREQA & writable_params_)) else if (!reversed_ && (OmniRig::PM_FREQA & writable_params_))
{ {
rig_->SetFreqA (f); QTimer::singleShot (200, [=] {
rig_->SetFreqA (f);
});
} }
update_rx_frequency (f); update_rx_frequency (f);
CAT_TRACE ("started"); CAT_TRACE ("started");