summaryrefslogtreecommitdiff
path: root/Transceiver/PollingTransceiver.hpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2025-01-09 22:12:06 +0100
committerChristoph Berg <myon@debian.org>2025-01-09 22:12:06 +0100
commit992d4b4b8d3f3a630a2cf00d593ee4ce4dfa7ce8 (patch)
treefbfdfe6bcb0a8a114be2480dac53d88c977e4869 /Transceiver/PollingTransceiver.hpp
parent4320ce238aae1fe87fc9f379cdd816e9317885fa (diff)
New upstream version 2.7.0~rc8+repackupstream/2.7.0_rc8+repack
Diffstat (limited to 'Transceiver/PollingTransceiver.hpp')
-rwxr-xr-xTransceiver/PollingTransceiver.hpp148
1 files changed, 74 insertions, 74 deletions
diff --git a/Transceiver/PollingTransceiver.hpp b/Transceiver/PollingTransceiver.hpp
index 6ffa1747..2569e166 100755
--- a/Transceiver/PollingTransceiver.hpp
+++ b/Transceiver/PollingTransceiver.hpp
@@ -1,74 +1,74 @@
-#ifndef POLLING_TRANSCEIVER_HPP__
-#define POLLING_TRANSCEIVER_HPP__
-
-#include <QObject>
-
-#include "Transceiver/TransceiverBase.hpp"
-
-class QTimer;
-
-//
-// Polling Transceiver
-//
-// Helper base class that encapsulates the emulation of continuous
-// update and caching of a transceiver state.
-//
-// Collaborations
-//
-// Implements the TransceiverBase post action interface and provides
-// the abstract poll() operation for sub-classes to implement. The
-// poll operation is invoked every poll_interval seconds.
-//
-// Responsibilities
-//
-// Because some rig interfaces don't immediately update after a state
-// change request; this class allows a rig a few polls to stabilise
-// to the requested state before signalling the change. This means
-// that clients don't see intermediate states that are sometimes
-// inaccurate, e.g. changing the split TX frequency on Icom rigs
-// requires a VFO switch and polls while switched will return the
-// wrong current frequency.
-//
-class PollingTransceiver
- : public TransceiverBase
-{
- Q_OBJECT; // for translation context
-
-protected:
- explicit PollingTransceiver (logger_type *, int poll_interval, // in seconds
- QObject * parent);
-
-protected:
- // Sub-classes implement this and fetch what they can from the rig
- // in a non-intrusive manner.
- virtual void do_poll () = 0;
-
- void do_post_start () override final;
- void do_post_stop () override final;
- void do_post_frequency (Frequency, MODE) override final;
- void do_post_tx_frequency (Frequency, MODE) override final;
- void do_post_mode (MODE) override final;
- void do_post_ptt (bool = true) override final;
- bool do_pre_update () override final;
-
-private:
- void start_timer ();
- void stop_timer ();
-
- Q_SLOT void handle_timeout ();
-
- int interval_; // polling interval in milliseconds
- QTimer * poll_timer_;
-
- // keep a record of the last state signalled so we can elide
- // duplicate updates
- Transceiver::TransceiverState last_signalled_state_;
-
- // keep a record of expected state so we can compare with actual
- // updates to determine when state changes have bubbled through
- Transceiver::TransceiverState next_state_;
-
- unsigned retries_; // number of incorrect polls left
-};
-
-#endif
+#ifndef POLLING_TRANSCEIVER_HPP__
+#define POLLING_TRANSCEIVER_HPP__
+
+#include <QObject>
+
+#include "Transceiver/TransceiverBase.hpp"
+
+class QTimer;
+
+//
+// Polling Transceiver
+//
+// Helper base class that encapsulates the emulation of continuous
+// update and caching of a transceiver state.
+//
+// Collaborations
+//
+// Implements the TransceiverBase post action interface and provides
+// the abstract poll() operation for sub-classes to implement. The
+// poll operation is invoked every poll_interval seconds.
+//
+// Responsibilities
+//
+// Because some rig interfaces don't immediately update after a state
+// change request; this class allows a rig a few polls to stabilise
+// to the requested state before signalling the change. This means
+// that clients don't see intermediate states that are sometimes
+// inaccurate, e.g. changing the split TX frequency on Icom rigs
+// requires a VFO switch and polls while switched will return the
+// wrong current frequency.
+//
+class PollingTransceiver
+ : public TransceiverBase
+{
+ Q_OBJECT; // for translation context
+
+protected:
+ explicit PollingTransceiver (logger_type *, int poll_interval, // in seconds
+ QObject * parent);
+
+protected:
+ // Sub-classes implement this and fetch what they can from the rig
+ // in a non-intrusive manner.
+ virtual void do_poll () = 0;
+
+ void do_post_start () override final;
+ void do_post_stop () override final;
+ void do_post_frequency (Frequency, MODE) override final;
+ void do_post_tx_frequency (Frequency, MODE) override final;
+ void do_post_mode (MODE) override final;
+ void do_post_ptt (bool = true) override final;
+ bool do_pre_update () override final;
+
+private:
+ void start_timer ();
+ void stop_timer ();
+
+ Q_SLOT void handle_timeout ();
+
+ int interval_; // polling interval in milliseconds
+ QTimer * poll_timer_;
+
+ // keep a record of the last state signalled so we can elide
+ // duplicate updates
+ Transceiver::TransceiverState last_signalled_state_;
+
+ // keep a record of expected state so we can compare with actual
+ // updates to determine when state changes have bubbled through
+ Transceiver::TransceiverState next_state_;
+
+ unsigned retries_; // number of incorrect polls left
+};
+
+#endif