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

Method appendTciMessage

src/gui/NetworkDiagnosticsDialog.cpp:1643–1686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1641}
1642
1643void NetworkDiagnosticsDialog::appendTciMessage(const QString& direction,
1644 const QString& text)
1645{
1646 if (!m_tciLogTable || m_tciMonitorPaused)
1647 return;
1648
1649 const QString stamp =
1650 QTime::currentTime().toString(QStringLiteral("HH:mm:ss.zzz"));
1651 const bool rx = (direction == QLatin1String("rx"));
1652 const QString dirTag = rx ? QStringLiteral("▶ ") // ▶
1653 : QStringLiteral("◀ "); // ◀
1654
1655 // One row per semicolon-delimited command so colour + suppression work
1656 // per command, exactly like the standalone monitor.
1657 const QStringList cmds = text.split(QLatin1Char(';'), Qt::SkipEmptyParts);
1658 for (const QString& raw : cmds) {
1659 const QString cmd = raw.trimmed();
1660 if (cmd.isEmpty())
1661 continue;
1662 const QString prefix = tciCmdOf(cmd);
1663 if (m_tciSuppressed.contains(prefix))
1664 continue;
1665
1666 constexpr int kMaxRows = 20000; // rolling window, bound memory
1667 if (m_tciLogTable->rowCount() >= kMaxRows)
1668 m_tciLogTable->removeRow(0);
1669
1670 const int row = m_tciLogTable->rowCount();
1671 m_tciLogTable->insertRow(row);
1672 const QColor colour(tciLineColor(cmd));
1673
1674 auto* tItem = new QTableWidgetItem(stamp);
1675 tItem->setForeground(QColor(QStringLiteral("#6b8099")));
1676 auto* cItem = new QTableWidgetItem(dirTag + prefix);
1677 cItem->setForeground(rx ? QColor(QStringLiteral("#9cff00"))
1678 : QColor(QStringLiteral("#7c9cff")));
1679 auto* mItem = new QTableWidgetItem(cmd);
1680 mItem->setForeground(colour);
1681 m_tciLogTable->setItem(row, 0, tItem);
1682 m_tciLogTable->setItem(row, 1, cItem);
1683 m_tciLogTable->setItem(row, 2, mItem);
1684 }
1685 m_tciLogTable->scrollToBottom();
1686}
1687
1688void NetworkDiagnosticsDialog::onTciLogContextMenu(const QPoint& pos)
1689{

Callers

nothing calls this directly

Calls 6

tciCmdOfFunction · 0.85
tciLineColorFunction · 0.85
containsMethod · 0.80
toStringMethod · 0.45
isEmptyMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected