mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 07:41:46 -05:00
Fix server compilation. Update docs.
This commit is contained in:
parent
4455ac0c55
commit
944803a276
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 15 KiB |
BIN
doc/img/PagerDemod_plugin_notifications.png
Normal file
BIN
doc/img/PagerDemod_plugin_notifications.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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,
|
||||
@ -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}\"";
|
||||
|
@ -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<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)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user