Skip to content

Commit

Permalink
Fix server compilation. Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
srcejon committed Oct 11, 2024
1 parent 4455ac0 commit 944803a
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 43 deletions.
Binary file modified doc/img/PagerDemod_plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/img/PagerDemod_plugin_notifications.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 28 additions & 28 deletions plugins/channelrx/demodpager/pagerdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)))
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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())
Expand All @@ -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);
}
Expand Down
11 changes: 0 additions & 11 deletions plugins/channelrx/demodpager/pagerdemodgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demodpager/pagerdemodnotificationdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

// Map main table column numbers to combo box indices
std::vector<int> PagerDemodNotificationDialog::m_columnMap = {
PagerDemodGUI::MESSAGE_COL_ADDRESS, PagerDemodGUI::MESSAGE_COL_MESSAGE
PagerDemodSettings::MESSAGE_COL_ADDRESS, PagerDemodSettings::MESSAGE_COL_MESSAGE
};

PagerDemodNotificationDialog::PagerDemodNotificationDialog(PagerDemodSettings *settings,
Expand Down Expand Up @@ -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:[email protected] \"-subject: Paging ${address}\" \"-body: ${message}\"";
Expand Down
3 changes: 1 addition & 2 deletions plugins/channelrx/demodpager/pagerdemodsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "util/simpleserializer.h"
#include "settings/serializable.h"
#include "pagerdemodsettings.h"
#include "pagerdemodgui.h"

PagerDemodSettings::PagerDemodSettings() :
m_channelMarker(nullptr),
Expand Down Expand Up @@ -255,7 +254,7 @@ void PagerDemodSettings::deserializeIntList(const QByteArray& data, QList<qint32
}

PagerDemodSettings::NotificationSettings::NotificationSettings() :
m_matchColumn(PagerDemodGUI::MESSAGE_COL_ADDRESS),
m_matchColumn(PagerDemodSettings::MESSAGE_COL_ADDRESS),
m_highlight(false),
m_highlightColor(Qt::red),
m_plotOnMap(false)
Expand Down
12 changes: 12 additions & 0 deletions plugins/channelrx/demodpager/pagerdemodsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ class Serializable;

struct PagerDemodSettings
{
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
};

struct NotificationSettings {
int m_matchColumn;
QString m_regExp;
Expand Down

0 comments on commit 944803a

Please sign in to comment.