diff --git a/doc/img/PagerDemod_plugin.png b/doc/img/PagerDemod_plugin.png index 0f6bae41d..e5af00739 100644 Binary files a/doc/img/PagerDemod_plugin.png and b/doc/img/PagerDemod_plugin.png differ diff --git a/doc/img/PagerDemod_plugin_notifications.png b/doc/img/PagerDemod_plugin_notifications.png new file mode 100644 index 000000000..23247a4d9 Binary files /dev/null and b/doc/img/PagerDemod_plugin_notifications.png differ diff --git a/plugins/channelrx/demodpager/pagerdemodgui.cpp b/plugins/channelrx/demodpager/pagerdemodgui.cpp index 19ccfa4d1..8d44cd2e6 100644 --- a/plugins/channelrx/demodpager/pagerdemodgui.cpp +++ b/plugins/channelrx/demodpager/pagerdemodgui.cpp @@ -55,15 +55,15 @@ void PagerDemodGUI::resizeTable() // Trailing spaces are for sort arrow int row = ui->messages->rowCount(); ui->messages->setRowCount(row + 1); - ui->messages->setItem(row, MESSAGE_COL_DATE, new QTableWidgetItem("Fri Apr 15 2016--")); - ui->messages->setItem(row, MESSAGE_COL_TIME, new QTableWidgetItem("10:17:00")); - ui->messages->setItem(row, MESSAGE_COL_ADDRESS, new QTableWidgetItem("1000000")); - ui->messages->setItem(row, MESSAGE_COL_MESSAGE, new QTableWidgetItem("ABCEDGHIJKLMNOPQRSTUVWXYZABCEDGHIJKLMNOPQRSTUVWXYZ")); - ui->messages->setItem(row, MESSAGE_COL_FUNCTION, new QTableWidgetItem("0")); - ui->messages->setItem(row, MESSAGE_COL_ALPHA, new QTableWidgetItem("ABCEDGHIJKLMNOPQRSTUVWXYZABCEDGHIJKLMNOPQRSTUVWXYZ")); - ui->messages->setItem(row, MESSAGE_COL_NUMERIC, new QTableWidgetItem("123456789123456789123456789123456789123456789123456789")); - ui->messages->setItem(row, MESSAGE_COL_EVEN_PE, new QTableWidgetItem("0")); - ui->messages->setItem(row, MESSAGE_COL_BCH_PE, new QTableWidgetItem("0")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_DATE, new QTableWidgetItem("Fri Apr 15 2016--")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_TIME, new QTableWidgetItem("10:17:00")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_ADDRESS, new QTableWidgetItem("1000000")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_MESSAGE, new QTableWidgetItem("ABCEDGHIJKLMNOPQRSTUVWXYZABCEDGHIJKLMNOPQRSTUVWXYZ")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_FUNCTION, new QTableWidgetItem("0")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_ALPHA, new QTableWidgetItem("ABCEDGHIJKLMNOPQRSTUVWXYZABCEDGHIJKLMNOPQRSTUVWXYZ")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_NUMERIC, new QTableWidgetItem("123456789123456789123456789123456789123456789123456789")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_EVEN_PE, new QTableWidgetItem("0")); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_BCH_PE, new QTableWidgetItem("0")); ui->messages->resizeColumnsToContents(); ui->messages->removeRow(row); } @@ -233,8 +233,8 @@ void PagerDemodGUI::messageReceived(const QDateTime dateTime, int address, int f int startRow = m_settings.m_duplicateMatchLastOnly ? ui->messages->rowCount() - 1 : 0; for (int row = startRow; row < ui->messages->rowCount(); row++) { - QString prevAddress = ui->messages->item(row, MESSAGE_COL_ADDRESS)->text(); - QString prevMessage = ui->messages->item(row, MESSAGE_COL_MESSAGE)->text(); + QString prevAddress = ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_ADDRESS)->text(); + QString prevMessage = ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_MESSAGE)->text(); if ((message == prevMessage) && (m_settings.m_duplicateMatchMessageOnly || (addressString == prevAddress))) { @@ -262,15 +262,15 @@ void PagerDemodGUI::messageReceived(const QDateTime dateTime, int address, int f QTableWidgetItem *numericItem = new QTableWidgetItem(); QTableWidgetItem *evenPEItem = new QTableWidgetItem(); QTableWidgetItem *bchPEItem = new QTableWidgetItem(); - ui->messages->setItem(row, MESSAGE_COL_DATE, dateItem); - ui->messages->setItem(row, MESSAGE_COL_TIME, timeItem); - ui->messages->setItem(row, MESSAGE_COL_ADDRESS, addressItem); - ui->messages->setItem(row, MESSAGE_COL_MESSAGE, messageItem); - ui->messages->setItem(row, MESSAGE_COL_FUNCTION, functionItem); - ui->messages->setItem(row, MESSAGE_COL_ALPHA, alphaItem); - ui->messages->setItem(row, MESSAGE_COL_NUMERIC, numericItem); - ui->messages->setItem(row, MESSAGE_COL_EVEN_PE, evenPEItem); - ui->messages->setItem(row, MESSAGE_COL_BCH_PE, bchPEItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_DATE, dateItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_TIME, timeItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_ADDRESS, addressItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_MESSAGE, messageItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_FUNCTION, functionItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_ALPHA, alphaItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_NUMERIC, numericItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_EVEN_PE, evenPEItem); + ui->messages->setItem(row, PagerDemodSettings::MESSAGE_COL_BCH_PE, bchPEItem); dateItem->setText(dateTime.date().toString()); timeItem->setText(dateTime.time().toString()); addressItem->setText(addressString); @@ -434,7 +434,7 @@ void PagerDemodGUI::filterRow(int row) if (m_settings.m_filterAddress != "") { QRegExp re(m_settings.m_filterAddress); - QTableWidgetItem *fromItem = ui->messages->item(row, MESSAGE_COL_ADDRESS); + QTableWidgetItem *fromItem = ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_ADDRESS); if (!re.exactMatch(fromItem->text())) { hidden = true; } @@ -921,18 +921,18 @@ void PagerDemodGUI::enableSpeechIfNeeded() void PagerDemodGUI::checkNotification(int row) { - QString address = ui->messages->item(row, MESSAGE_COL_ADDRESS)->text(); - QString message = ui->messages->item(row, MESSAGE_COL_MESSAGE)->text(); + QString address = ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_ADDRESS)->text(); + QString message = ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_MESSAGE)->text(); for (int i = 0; i < m_settings.m_notificationSettings.size(); i++) { QString match; switch (m_settings.m_notificationSettings[i]->m_matchColumn) { - case MESSAGE_COL_ADDRESS: + case PagerDemodSettings::MESSAGE_COL_ADDRESS: match = address; break; - case MESSAGE_COL_MESSAGE: + case PagerDemodSettings::MESSAGE_COL_MESSAGE: match = message; break; } @@ -944,7 +944,7 @@ void PagerDemodGUI::checkNotification(int row) if (matchResult.hasMatch()) { if (m_settings.m_notificationSettings[i]->m_highlight) { - ui->messages->item(row, MESSAGE_COL_MESSAGE)->setTextColor(m_settings.m_notificationSettings[i]->m_highlightColor); + ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_MESSAGE)->setTextColor(m_settings.m_notificationSettings[i]->m_highlightColor); } if (!m_settings.m_notificationSettings[i]->m_speech.isEmpty()) @@ -968,8 +968,8 @@ void PagerDemodGUI::checkNotification(int row) { QDateTime dateTime; - dateTime.setDate(QDate::fromString(ui->messages->item(row, MESSAGE_COL_DATE)->text())); - dateTime.setTime(QTime::fromString(ui->messages->item(row, MESSAGE_COL_TIME)->text())); + dateTime.setDate(QDate::fromString(ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_DATE)->text())); + dateTime.setTime(QTime::fromString(ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_TIME)->text())); sendToMap(address, message, latitude, longitude, dateTime); } diff --git a/plugins/channelrx/demodpager/pagerdemodgui.h b/plugins/channelrx/demodpager/pagerdemodgui.h index 4531c8c60..346f9fcae 100644 --- a/plugins/channelrx/demodpager/pagerdemodgui.h +++ b/plugins/channelrx/demodpager/pagerdemodgui.h @@ -46,17 +46,6 @@ class PagerDemodGUI : public ChannelGUI { Q_OBJECT public: - enum MessageCol { - MESSAGE_COL_DATE, - MESSAGE_COL_TIME, - MESSAGE_COL_ADDRESS, - MESSAGE_COL_MESSAGE, - MESSAGE_COL_FUNCTION, - MESSAGE_COL_ALPHA, - MESSAGE_COL_NUMERIC, - MESSAGE_COL_EVEN_PE, - MESSAGE_COL_BCH_PE - }; static PagerDemodGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual void destroy(); diff --git a/plugins/channelrx/demodpager/pagerdemodnotificationdialog.cpp b/plugins/channelrx/demodpager/pagerdemodnotificationdialog.cpp index b7979ac2c..5c26f4a75 100644 --- a/plugins/channelrx/demodpager/pagerdemodnotificationdialog.cpp +++ b/plugins/channelrx/demodpager/pagerdemodnotificationdialog.cpp @@ -28,7 +28,7 @@ // Map main table column numbers to combo box indices std::vector PagerDemodNotificationDialog::m_columnMap = { - PagerDemodGUI::MESSAGE_COL_ADDRESS, PagerDemodGUI::MESSAGE_COL_MESSAGE + PagerDemodSettings::MESSAGE_COL_ADDRESS, PagerDemodSettings::MESSAGE_COL_MESSAGE }; PagerDemodNotificationDialog::PagerDemodNotificationDialog(PagerDemodSettings *settings, @@ -76,7 +76,7 @@ void PagerDemodNotificationDialog::accept() void PagerDemodNotificationDialog::resizeTable() { PagerDemodSettings::NotificationSettings dummy; - dummy.m_matchColumn = PagerDemodGUI::MESSAGE_COL_ADDRESS; + dummy.m_matchColumn = PagerDemodSettings::MESSAGE_COL_ADDRESS; dummy.m_regExp = "1234567"; dummy.m_speech = "${message}"; dummy.m_command = "cmail.exe -to:user@host.com \"-subject: Paging ${address}\" \"-body: ${message}\""; diff --git a/plugins/channelrx/demodpager/pagerdemodsettings.cpp b/plugins/channelrx/demodpager/pagerdemodsettings.cpp index ab4cdb93d..e329a56b8 100644 --- a/plugins/channelrx/demodpager/pagerdemodsettings.cpp +++ b/plugins/channelrx/demodpager/pagerdemodsettings.cpp @@ -25,7 +25,6 @@ #include "util/simpleserializer.h" #include "settings/serializable.h" #include "pagerdemodsettings.h" -#include "pagerdemodgui.h" PagerDemodSettings::PagerDemodSettings() : m_channelMarker(nullptr), @@ -255,7 +254,7 @@ void PagerDemodSettings::deserializeIntList(const QByteArray& data, QList