Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pager notifications #2276

Merged
merged 6 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@
"cacheVariables": {
"ENABLE_QT6": "ON"
}
},
{
"name": "default-qt6-windows",
"inherits": "default-windows",
"binaryDir": "${sourceDir}/build-qt6",
"cacheVariables": {
"ENABLE_QT6": "ON",
"CMAKE_PREFIX_PATH": "C:/Qt/6.7.3/msvc2022_64;C:/Applications/boost_1_81_0"
}
}
],
"buildPresets": [
Expand All @@ -94,6 +103,10 @@
{
"name": "default-qt6",
"configurePreset": "default-qt6"
},
{
"name": "default-qt6-windows",
"configurePreset": "default-qt6-windows"
}
]
}
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.
9 changes: 9 additions & 0 deletions plugins/channelrx/demodpager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,25 @@ if(NOT SERVER_MODE)
pagerdemodgui.ui
pagerdemodcharsetdialog.cpp
pagerdemodcharsetdialog.ui
pagerdemodnotificationdialog.cpp
pagerdemodnotificationdialog.ui
pagerdemodfilterdialog.cpp
pagerdemodfilterdialog.ui
pagerdemodicons.qrc
)
set(demodpager_HEADERS
${demodpager_HEADERS}
pagerdemodgui.h
pagerdemodcharsetdialog.h
pagerdemodnotificationdialog.h
)

set(TARGET_NAME ${PLUGINS_PREFIX}demodpager)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
if(Qt${QT_DEFAULT_MAJOR_VERSION}TextToSpeech_FOUND)
list(APPEND TARGET_LIB_GUI Qt::TextToSpeech)
endif()
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME ${PLUGINSSRV_PREFIX}demodpagersrv)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions plugins/channelrx/demodpager/pagerdemod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "dsp/dspcommands.h"
#include "device/deviceapi.h"
#include "util/db.h"
#include "util/csv.h"
#include "maincore.h"

MESSAGE_CLASS_DEFINITION(PagerDemod::MsgConfigurePagerDemod, Message)
Expand Down Expand Up @@ -141,15 +142,15 @@ bool PagerDemod::handleMessage(const Message& cmd)
{
if (MsgConfigurePagerDemod::match(cmd))
{
MsgConfigurePagerDemod& cfg = (MsgConfigurePagerDemod&) cmd;
const MsgConfigurePagerDemod& cfg = (const MsgConfigurePagerDemod&) cmd;
qDebug() << "PagerDemod::handleMessage: MsgConfigurePagerDemod";
applySettings(cfg.getSettings(), cfg.getForce());

return true;
}
else if (DSPSignalNotification::match(cmd))
{
DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
const DSPSignalNotification& notif = (const DSPSignalNotification&) cmd;
m_basebandSampleRate = notif.getSampleRate();
m_centerFrequency = notif.getCenterFrequency();
// Forward to the sink
Expand All @@ -166,7 +167,7 @@ bool PagerDemod::handleMessage(const Message& cmd)
else if (MsgPagerMessage::match(cmd))
{
// Forward to GUI
MsgPagerMessage& report = (MsgPagerMessage&)cmd;
const MsgPagerMessage& report = (const MsgPagerMessage&)cmd;
if (getMessageQueueToGUI())
{
MsgPagerMessage *msg = new MsgPagerMessage(report);
Expand Down Expand Up @@ -200,7 +201,7 @@ bool PagerDemod::handleMessage(const Message& cmd)
<< report.getDateTime().time().toString() << ","
<< QString("%1").arg(report.getAddress(), 7, 10, QChar('0')) << ","
<< QString::number(report.getFunctionBits()) << ","
<< "\"" << report.getAlphaMessage() << "\","
<< CSV::escape(report.getAlphaMessage()) << ","
<< report.getNumericMessage() << ","
<< QString::number(report.getEvenParityErrors()) << ","
<< QString::number(report.getBCHParityErrors()) << "\n";
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demodpager/pagerdemodbaseband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bool PagerDemodBaseband::handleMessage(const Message& cmd)
if (MsgConfigurePagerDemodBaseband::match(cmd))
{
QMutexLocker mutexLocker(&m_mutex);
MsgConfigurePagerDemodBaseband& cfg = (MsgConfigurePagerDemodBaseband&) cmd;
const MsgConfigurePagerDemodBaseband& cfg = (const MsgConfigurePagerDemodBaseband&) cmd;
qDebug() << "PagerDemodBaseband::handleMessage: MsgConfigurePagerDemodBaseband";

applySettings(cfg.getSettings(), cfg.getForce());
Expand All @@ -141,7 +141,7 @@ bool PagerDemodBaseband::handleMessage(const Message& cmd)
else if (DSPSignalNotification::match(cmd))
{
QMutexLocker mutexLocker(&m_mutex);
DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
const DSPSignalNotification& notif = (const DSPSignalNotification&) cmd;
qDebug() << "PagerDemodBaseband::handleMessage: DSPSignalNotification: basebandSampleRate: " << notif.getSampleRate();
setBasebandSampleRate(notif.getSampleRate());
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(notif.getSampleRate()));
Expand Down
46 changes: 46 additions & 0 deletions plugins/channelrx/demodpager/pagerdemodfilterdialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2021 Jon Beniston, M7RCE //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////

#include <QDebug>
#include <QCheckBox>

#include "pagerdemodfilterdialog.h"

PagerDemodFilterDialog::PagerDemodFilterDialog(PagerDemodSettings *settings,
QWidget* parent) :
QDialog(parent),
ui(new Ui::PagerDemodFilterDialog),
m_settings(settings)
{
ui->setupUi(this);

ui->matchLastOnly->setChecked(m_settings->m_duplicateMatchLastOnly);
ui->matchMessageOnly->setChecked(m_settings->m_duplicateMatchMessageOnly);
}

PagerDemodFilterDialog::~PagerDemodFilterDialog()
{
delete ui;
}

void PagerDemodFilterDialog::accept()
{
m_settings->m_duplicateMatchLastOnly = ui->matchLastOnly->isChecked();
m_settings->m_duplicateMatchMessageOnly = ui->matchMessageOnly->isChecked();

QDialog::accept();
}
41 changes: 41 additions & 0 deletions plugins/channelrx/demodpager/pagerdemodfilterdialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2021 Jon Beniston, M7RCE //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////

#ifndef INCLUDE_PAGERDEMODFILTERDIALOG_H
#define INCLUDE_PAGERDEMODFILTERDIALOG_H


#include "ui_pagerdemodfilterdialog.h"
#include "pagerdemodsettings.h"


class PagerDemodFilterDialog : public QDialog {
Q_OBJECT

public:
explicit PagerDemodFilterDialog(PagerDemodSettings* settings, QWidget* parent = nullptr);
~PagerDemodFilterDialog();

private slots:
void accept() override;

private:
Ui::PagerDemodFilterDialog* ui;
PagerDemodSettings *m_settings;
};

#endif // INCLUDE_PAGERDEMODFILTERDIALOG_H
118 changes: 118 additions & 0 deletions plugins/channelrx/demodpager/pagerdemodfilterdialog.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PagerDemodFilterDialog</class>
<widget class="QDialog" name="PagerDemodFilterDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>396</width>
<height>167</height>
</rect>
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::ContextMenuPolicy::PreventContextMenu</enum>
</property>
<property name="windowTitle">
<string>Duplicate Filtering</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Duplicate Filtering</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="matchMessageOnlyLabel">
<property name="text">
<string>Match message only</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="matchMessageOnly">
<property name="toolTip">
<string>Whether both the address and message must match or only the message to be considered a duplicate</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="matchLastOnlyLabel">
<property name="text">
<string>Match last message only</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="matchLastOnly">
<property name="toolTip">
<string>Whether to match with only the last message or any message in the table</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>PagerDemodFilterDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>PagerDemodFilterDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Loading
Loading