|
|
| TxLoop (const QString &name) |
|
bool | isActive () const |
| const QDateTime & | nextActivity () const |
| qint64 | period_ms () const |
|
| 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 constexpr qint64 | MAX_TX_DELAY_MS = 1000 |
◆ canceled
| void TxLoop::canceled |
( |
| ) |
const |
|
signal |
Tells whoever wants to know that we have become inactive.
◆ 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.
◆ onDriftChange
| void TxLoop::onDriftChange |
( |
qint64 | new_drift | ) |
|
|
slot |
Tells us that the DriftingDateTime has a new drift value. We'll adjust accordingly. Idempotent.
◆ 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.
◆ 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.
◆ onPlumbingCompleted
| void TxLoop::onPlumbingCompleted |
( |
| ) |
const |
|
slot |
Asks us to emit initial signals, either nextActivityChanged or, more likely, canceled.
◆ 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.
◆ 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.
◆ 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:
The documentation for this class was generated from the following files: