MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / beginTransmitWhenReady

Method beginTransmitWhenReady

src/gui/Ax25HfPacketDecodeDialog.cpp:1626–1700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624
1625
1626void Ax25HfPacketDecodeDialog::beginTransmitWhenReady()
1627{
1628 if (m_txPcm.isEmpty())
1629 return;
1630 if (!m_audio || !m_radio) {
1631 finishTransmit(true, QStringLiteral("audio engine or radio model disappeared before TX"));
1632 return;
1633 }
1634 if (m_audio->txStreamId() == 0) {
1635 m_txPendingStream = true;
1636 refreshTransmitControls();
1637 return;
1638 }
1639
1640 auto& txModel = m_radio->transmitModel();
1641 if (m_attachedSlice && !m_attachedSlice->isTxSlice()) {
1642 appendSystemLine(QStringLiteral("Selecting attached slice %1 for AX.25 TX.")
1643 .arg(m_attachedSlice->sliceId()));
1644 m_attachedSlice->setTxSlice(true);
1645 }
1646 m_txPendingStream = false;
1647 m_txActive = true;
1648 m_txPreviousAudioDaxMode = m_audio->isDaxTxMode();
1649 m_txPreviousTransmitDax = txModel.daxOn();
1650 m_txRestoreAudioDaxMode = true;
1651 m_txRestoreTransmitDax = true;
1652
1653 m_audio->setDaxTxMode(true);
1654 txModel.setDax(true);
1655 appendSystemLine(QStringLiteral("Keying transmitter for AX.25 TX on %1; DAX TX stream 0x%2.")
1656 .arg(transmitSliceSummary())
1657 .arg(m_audio->txStreamId(), 0, 16));
1658 qCInfo(lcAx25).noquote()
1659 << QStringLiteral("AX.25 TX start stream=0x%1 %2 chunks=%3 daxSettleMs=%4 leadMs=%5 tailMs=%6")
1660 .arg(m_audio->txStreamId(), 0, 16)
1661 .arg(transmitSliceSummary())
1662 .arg(m_txChunkCount)
1663 .arg(kTxDaxSettleMs)
1664 .arg(kTxLeadMs)
1665 .arg(m_txTailMs);
1666
1667 refreshTransmitControls();
1668 QTimer::singleShot(kTxDaxSettleMs, this, [this] {
1669 if (!m_txActive)
1670 return;
1671 if (!m_radio) {
1672 finishTransmit(true, QStringLiteral("radio model disappeared before PTT"));
1673 return;
1674 }
1675 auto& txModel = m_radio->transmitModel();
1676 txModel.requestPttOn(TransmitModel::PttSource::Dax);
1677 if (!m_txActive)
1678 return;
1679 if (!txModel.isTransmitting()) {
1680 finishTransmit(true, QStringLiteral("PTT did not engage"));
1681 return;
1682 }
1683

Callers

nothing calls this directly

Calls 12

txStreamIdMethod · 0.80
isTxSliceMethod · 0.80
sliceIdMethod · 0.80
setTxSliceMethod · 0.80
isDaxTxModeMethod · 0.80
daxOnMethod · 0.80
setDaxTxModeMethod · 0.80
setDaxMethod · 0.80
requestPttOnMethod · 0.80
isTransmittingMethod · 0.80
isEmptyMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected