mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-08 08:54:41 -04:00
Rig polling not detecting changes against cached values correctly
The PollingTransceiver class was not dealing with frequency change commands correctly when the mode was not specified. Improved some diagnostic messages. Only leave transmit mode when PTT is seen to drop. Merged from wsjtx-1.4 branch. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4886 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+23
-6
@@ -21,9 +21,6 @@ class PollingTransceiver::impl final
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY (impl);
|
||||
|
||||
public:
|
||||
impl (PollingTransceiver * self, int poll_interval)
|
||||
: QObject {self}
|
||||
@@ -35,6 +32,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
impl (impl const&) = delete;
|
||||
impl& operator = (impl const&) = delete;
|
||||
|
||||
void start_timer ()
|
||||
{
|
||||
if (interval_)
|
||||
@@ -108,11 +108,17 @@ void PollingTransceiver::do_post_stop ()
|
||||
|
||||
void PollingTransceiver::do_post_frequency (Frequency f, MODE m)
|
||||
{
|
||||
if (m_->next_state_.frequency () != f || m_->next_state_.mode () != m)
|
||||
// take care not to set the expected next mode to unknown since some
|
||||
// callers use mode == unknown to signify that they do not know the
|
||||
// mode and don't care
|
||||
if (m_->next_state_.frequency () != f || (m != UNK && m_->next_state_.mode () != m))
|
||||
{
|
||||
// update expected state with new frequency and set poll count
|
||||
m_->next_state_.frequency (f);
|
||||
m_->next_state_.mode (m);
|
||||
if (m != UNK)
|
||||
{
|
||||
m_->next_state_.mode (m);
|
||||
}
|
||||
m_->retries_ = polls_to_stabilize;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +137,8 @@ void PollingTransceiver::do_post_tx_frequency (Frequency f, bool /* rationalize
|
||||
|
||||
void PollingTransceiver::do_post_mode (MODE m, bool /*rationalize_mode*/)
|
||||
{
|
||||
if (m_->next_state_.mode () != m)
|
||||
// we don't ever expect mode to goto to unknown
|
||||
if (m != UNK && m_->next_state_.mode () != m)
|
||||
{
|
||||
// update expected state with new mode and set poll count
|
||||
m_->next_state_.mode (m);
|
||||
@@ -139,6 +146,16 @@ void PollingTransceiver::do_post_mode (MODE m, bool /*rationalize_mode*/)
|
||||
}
|
||||
}
|
||||
|
||||
void PollingTransceiver::do_post_ptt (bool p)
|
||||
{
|
||||
if (m_->next_state_.ptt () != p)
|
||||
{
|
||||
// update expected state with new PTT and set poll count
|
||||
m_->next_state_.ptt (p);
|
||||
m_->retries_ = polls_to_stabilize;
|
||||
}
|
||||
}
|
||||
|
||||
bool PollingTransceiver::do_pre_update ()
|
||||
{
|
||||
// if we are holding off a change then withhold the signal
|
||||
|
||||
Reference in New Issue
Block a user