| 796 | }; |
| 797 | |
| 798 | Ax25HfPacketDecodeDialog::Ax25HfPacketDecodeDialog(AudioEngine* audio, |
| 799 | RadioModel* radio, |
| 800 | SliceModel* initialSlice, |
| 801 | QWidget* parent) |
| 802 | : PersistentDialog(QStringLiteral("AetherModem"), |
| 803 | QStringLiteral("Ax25HfPacketDecodeDialogGeometry"), |
| 804 | parent) |
| 805 | , m_audio(audio) |
| 806 | , m_radio(radio) |
| 807 | { |
| 808 | theme::setContainer(this, QStringLiteral("dialog/ax25Decode")); |
| 809 | setMinimumSize(1080, 680); |
| 810 | |
| 811 | m_shim = new AetherAx25LibmodemShim(); |
| 812 | m_shim->moveToThread(&m_shimThread); |
| 813 | connect(&m_shimThread, &QThread::finished, m_shim, &QObject::deleteLater); |
| 814 | m_shimThread.start(); |
| 815 | m_kissServer = new KissTncServer(this); |
| 816 | m_heard = new HeardList(this); |
| 817 | m_terminal = new TncTerminal(this); |
| 818 | m_pms = new PmsMailbox(this); |
| 819 | m_aprsStations = new AprsStationList(this); |
| 820 | m_aprsMessenger = new AprsMessenger(this); |
| 821 | m_aprsBeacon = new AprsBeacon(this); |
| 822 | |
| 823 | // The TNC store lives next to the app settings (heard log + session logs). |
| 824 | const QString tncDir = |
| 825 | QFileInfo(AppSettings::instance().filePath()).absolutePath() |
| 826 | + QStringLiteral("/tnc"); |
| 827 | m_heard->setPersistencePath(tncDir + QStringLiteral("/heard.json")); |
| 828 | m_aprsStations->setPersistencePath(tncDir + QStringLiteral("/aprs-stations.json")); |
| 829 | m_aprsMessenger->setPersistencePath(tncDir + QStringLiteral("/aprs-messages.json")); |
| 830 | m_terminal->setHeardList(m_heard); |
| 831 | m_terminal->setLogDirectory(tncDir + QStringLiteral("/logs")); |
| 832 | m_heartbeatTimer = new QTimer(this); |
| 833 | m_heartbeatTimer->setInterval(1000); |
| 834 | // Free-running (not gated on the modem): updateHeartbeat() also ticks the |
| 835 | // APRS station-table ages, which must stay honest while the modem is off. |
| 836 | // The modem-health portion of the heartbeat early-outs when disabled. |
| 837 | m_heartbeatTimer->start(); |
| 838 | m_txPaceTimer = new QTimer(this); |
| 839 | m_txPaceTimer->setInterval(kTxChunkMs); |
| 840 | bodyWidget()->setStyleSheet(QString::fromLatin1(kAetherModemStyle)); |
| 841 | |
| 842 | auto* root = new QVBoxLayout(bodyWidget()); |
| 843 | root->setSpacing(10); |
| 844 | |
| 845 | auto* tabsFrame = panel(QStringLiteral("TabsFrame"), bodyWidget()); |
| 846 | auto* tabs = new QHBoxLayout(tabsFrame); |
| 847 | tabs->setContentsMargins(0, 0, 0, 0); |
| 848 | tabs->setSpacing(0); |
| 849 | m_ax25Tab = tabButton(QStringLiteral("APRS"), true, tabsFrame); |
| 850 | m_kissTab = tabButton(QStringLiteral("KISS TNC"), false, tabsFrame); |
| 851 | m_terminalTab = tabButton(QStringLiteral("Terminal"), false, tabsFrame); |
| 852 | m_mailboxTab = tabButton(QStringLiteral("Mailbox"), false, tabsFrame); |
| 853 | m_ax25Tab->setEnabled(true); |
| 854 | m_kissTab->setEnabled(true); |
| 855 | m_terminalTab->setEnabled(true); |
nothing calls this directly
no test coverage detected