From 83268fbdaf0b708b070f523bcabf651a245fecea Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Mon, 15 Oct 2018 12:01:28 -0400 Subject: [PATCH] Added groupcall and allcall callsign counts --- mainwindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 695c432..6cce395 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5073,13 +5073,21 @@ void MainWindow::createAllcallTableRow(QTableWidget *table, bool selected){ table->insertRow(table->rowCount()); if(ui->selcalButton->isChecked()){ - auto item = new QTableWidgetItem("GROUPCALL"); + int freq = currentFreqOffset(); + int count = 0; + foreach(auto cd, m_callActivity.values()){ + if(abs(freq - cd.freq) < 125){ + count++; + } + } + auto item = new QTableWidgetItem(count == 0 ? QString("GROUPCALL") : QString("GROUPCALL (%1)").arg(count)); item->setData(Qt::UserRole, QVariant("GROUPCALL")); table->setItem(table->rowCount() - 1, 0, item); table->setSpan(table->rowCount() - 1, 0, 1, table->columnCount()); } else { - auto item = new QTableWidgetItem("ALLCALL"); + int count = m_callActivity.count(); + auto item = new QTableWidgetItem(count == 0 ? QString("ALLCALL") : QString("ALLCALL (%1)").arg(count)); item->setData(Qt::UserRole, QVariant("ALLCALL")); table->setItem(table->rowCount() - 1, 0, item); table->setSpan(table->rowCount() - 1, 0, 1, table->columnCount());