JS8Call-Improved master
Loading...
Searching...
No Matches
TxLoop Class Reference
Inheritance diagram for TxLoop:
Collaboration diagram for TxLoop:

Public Slots

void onPlumbingCompleted () const
void onDriftChange (qint64 new_drift)
void onModeChange (Varicode::SubmodeType new_submode)
void onTxDelayChange (qint64 tx_delay_ms)
void onTxLoopPeriodChangeStart (qint64 loop_period_ms)
void onLoopCancel ()
Public Slots inherited from TwoPhaseSignal
virtual void onPlumbingCompleted () const =0

Signals

void triggerTxNow () const
void nextActivityChanged (const QDateTime &) const
void canceled () const

Public Member Functions

 TxLoop (const QString &name)
bool isActive () const
const QDateTime & nextActivity () const
qint64 period_ms () const
Public Member Functions inherited from TwoPhaseSignal
 TwoPhaseSignal ()
 This is a humble helper class for Qt signals and slots when this mechanism is also used to initialize the data. In that case, we first do the "plumbing" phase, where signals and slots are connected as appropriate. After that has been completed, signals are to be sent in a volley so that an required initial values are being set.

Static Public Attributes

static constexpr qint64 MAX_TX_DELAY_MS = 1000

Member Function Documentation

◆ canceled

void TxLoop::canceled ( ) const
signal

Tells whoever wants to know that we have become inactive.

Here is the caller graph for this function:

◆ nextActivity()

const QDateTime & TxLoop::nextActivity ( ) const
inline

Return the timestamp when the payload signal is supposed to start. This timestamp will always point to a full second. The actual triggering happens tx_delay earlier.

The value this returns is undetermined (arbitrary) when called while isActive() returns false.

◆ nextActivityChanged

void TxLoop::nextActivityChanged ( const QDateTime & ) const
signal

Tells whoever wants to know that our future plans have changed. Only an active loop will emit this.

This signal is emitted in conjunction with triggerTxNow and also each time our onTxLoopPeriodChangeStart receives a signal.

The QDateTime sent is the same that will be returned by nextActivity().

In addition, it gets fired when some other incoming onXXX signal caused our next activity to change.

Here is the caller graph for this function:

◆ onDriftChange

void TxLoop::onDriftChange ( qint64 new_drift)
slot

Tells us that the DriftingDateTime has a new drift value. We'll adjust accordingly. Idempotent.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onLoopCancel

void TxLoop::onLoopCancel ( )
slot

Cancel the loop. After this signal has come in, isActive() will return false and triggerTxNow will not fire any longer. Loop activity will restart when a onTxLoopPeriodChangeStart signal is again received.

This is idempotent, it does no harm to call this on an idle loop.

Here is the call graph for this function:

◆ onModeChange

void TxLoop::onModeChange ( Varicode::SubmodeType new_submode)
slot

Tells us that the next transmission organized by this loop will be in this new submode. Idempotent.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onPlumbingCompleted

void TxLoop::onPlumbingCompleted ( ) const
slot

Asks us to emit initial signals, either nextActivityChanged or, more likely, canceled.

Here is the call graph for this function:

◆ onTxDelayChange

void TxLoop::onTxDelayChange ( qint64 tx_delay_ms)
slot

Tells us that the desired TX delay (switch TX on a bit before the full second that starts the mode period) has changed. Idempotent.

Here is the call graph for this function:

◆ onTxLoopPeriodChangeStart

void TxLoop::onTxLoopPeriodChangeStart ( qint64 loop_period_ms)
slot

This starts or restarts the loop. You need to provide the desired period.

After this signal has come in, isActive() will return true and triggerTxNow will fire every loop_period_ms milliseconds. This continues until the onLoopCancel signal is received.

Calling this on a loop that is active will cause the schedule to be reset; i.e., this restarts the loop.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ period_ms()

qint64 TxLoop::period_ms ( ) const
inline

Return the present period of the loop, in milliseconds, if isActive() returns true.

Not sure this is useful, but: If isActive() returns false, this will hand out the previous period used, or, if this loop object has never been active, some reasonable initial value.

◆ triggerTxNow

void TxLoop::triggerTxNow ( ) const
signal

Tells whoever wants to know that now is the time to push the PTT for TX delay:

Here is the caller graph for this function:

The documentation for this class was generated from the following files: