Skip to content

Commit

Permalink
improved DX support
Browse files Browse the repository at this point in the history
  • Loading branch information
JvanKatwijk committed Apr 4, 2024
1 parent 2148a69 commit 542eab5
Show file tree
Hide file tree
Showing 10 changed files with 197 additions and 46 deletions.
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,36 @@
Recent changes
------------------------------------------------------------------------

The development version, Qt-DAB-6.X, contains a few goodies that will
In the development version, Qt-DAB-6.X, a few errors that still could
occur in Version 6.5. were corrected.
Furthermore, Qt-DAB-6.X contains a few goodies that will
be incorporated in the "stable" version to come.
First of all, - 6.X - has two (sub)systems for the sound handling are
included. Next to the portaudio interface that was the default
for a long time, the sound interface provided by Qt itself is interfaces.
The Qt based version is now the default, A selection will be applied in the
next program invocation.
If the Qt-audio interface is selected, a volume slider is shown on

First of, one of the problems with the implemented sound handler was
that sound did not always work after restarting the program with a
saved - and therefore selected - audiostream.
6.X - has now two (sub)systems for the sound handling.
Next to the portaudio interface that was the default
for a long time, the sound interface is provided by Qt itself.
If the katter audio interface is selected, a **volume slider** is shown on
the main widget.

Second, as known, most DAN ensembles are transmitted by more than a single
transmitter. All transmitters in a so-called Single Frequency Network
As known, most DAB ensembles are transmitted by more than a single
transmitter. All transmitters in a so-called **Single Frequency Network**
transmit the same ensemble. However, each transmitter adds a little
data with which the transmitter can be identified. In my
neighbourhoodm there are - for a few ensembles - four transmitters
within 20 Km.
The Qt0DAB-6.X version now attempts to identify all transmitetrs that are
transmitting the same signal. For that purpose, the notion of "dx mode"
is introduced in Qt-DAB. Selecting the "dx mode" (with a checkbox on the
data with which the transmitter can be identified.
Other than with e.g. FM or AM, where receiving signal at the same time
from different transmitters, transmitting the same audio is hardly enjoyable,
with digital modes, the software is able to select data from
the strongest signal. In my neighbourhoodm there are - for a few ensembles
- four transmitters within 20 Km.

New is that while Qt-DAB decodes data from the strongest signal,
Qt-DAB-6.X has a special **mode**, dxMode, in which it
tries to identify **all ** transmitetrs that are
transmitting the same signal. The TII decoding was adapted for this purpose.

Selecting the "dx mode" (with a checkbox on the
configuration widget) causes the software to display all transmitters
the identification of which could be extracted from the signal

Expand Down
Binary file modified front-picture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions qt-dab-RC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ add_definitions (-D__THREADED_BACKEND__) # uncomment for use for an RPI
./support/ensemble-handler.h
./support/config-handler.h
./support/audiosystem-selector.h
./support/dxDisplay.h
./forms-v7/new-display/display-widget.h
./forms-v7/new-display/scopes/correlation-scope.h
./forms-67/new-display/scopes/spectrum-scope.h
Expand Down Expand Up @@ -361,6 +362,7 @@ add_definitions (-D__THREADED_BACKEND__) # uncomment for use for an RPI
./support/ensemble-handler.cpp
./support/config-handler.cpp
./support/audiosystem-selector.cpp
./support/dxDisplay.cpp
./forms-v7/new-display/display-widget.cpp
./forms-v7/new-display/scopes/spectrum-scope.cpp
./forms-v7/new-display/scopes/correlation-scope.cpp
Expand Down Expand Up @@ -481,6 +483,7 @@ add_definitions (-D__THREADED_BACKEND__) # uncomment for use for an RPI
./support/ensemble-handler.h
./support/config-handler.h
./support/audiosystem-selector.h
./support/dxDisplay.h
./forms-v7/new-display/display-widget.h
./forms-v7/new-display/scopes/correlation-scope.h
./forms-v7/new-display/scopes/spectrum-scope.h
Expand Down
2 changes: 2 additions & 0 deletions qt-dab-RC/qt-dab-RC.pro
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ HEADERS += ./radio.h \
./support/ensemble-handler.h \
./support/config-handler.h \
./support/audiosystem-selector.h \
./support/dxDisplay.h \
./forms-v7/qwt-2.h \
./forms-v7/new-display/display-widget.h \
./forms-v7/new-display/scopes/spectrum-scope.h \
Expand Down Expand Up @@ -269,6 +270,7 @@ SOURCES += ./main.cpp \
./support/ensemble-handler.cpp \
./support/config-handler.cpp \
./support/audiosystem-selector.cpp \
./support/dxDisplay.cpp \
./forms-v7/new-display/display-widget.cpp \
./forms-v7/new-display/scopes/correlation-scope.cpp \
./forms-v7/new-display/scopes/spectrum-scope.cpp \
Expand Down
47 changes: 18 additions & 29 deletions qt-dab-RC/radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ char LABEL_STYLE [] = "color:lightgreen";
my_scanListHandler (this,
scanListFile),
chooseDevice (Si),
dxDisplay (nullptr),
my_dxDisplay (this, Si),
scanMonitor (this, Si, freqExtension) {
int16_t k;
QString h;
Expand All @@ -178,12 +178,7 @@ QString h;
contentTable_p = nullptr;
scanTable_p = nullptr;
mapHandler = nullptr;
dxDisplay. setWindowTitle ("Transmitters received");
dxDisplayText = new QLabel ();
QVBoxLayout *LV = new QVBoxLayout ();
LV -> addWidget (dxDisplayText);
dxDisplay. setLayout (LV);
dxDisplay. hide ();
my_dxDisplay. hide ();
// "globals" is introduced to reduce the number of parameters
// for the ofdmHandler
globals. spectrumBuffer = &spectrumBuffer;
Expand Down Expand Up @@ -1179,7 +1174,7 @@ void RadioInterface::TerminateProcess () {
usleep (1000);
hideButtons ();

dxDisplay. hide ();
my_dxDisplay. hide ();
store_widget_position (dabSettings_p, this, "mainWidget");
newDisplay. hide ();
//
Expand Down Expand Up @@ -2202,7 +2197,7 @@ void RadioInterface::cleanScreen () {
techWindow_p -> cleanUp ();
setStereo (false);
distanceLabel -> setText ("");
dxDisplayText -> setText ("");
my_dxDisplay. cleanUp ();
transmitter_country -> setText ("");
newDisplay. ficError_display -> setValue (0);
}
Expand Down Expand Up @@ -2278,7 +2273,7 @@ int tunedFrequency =
if (channel. realChannel)
dabSettings_p -> setValue (CHANNEL_NAME, theChannel);
distanceLabel -> setText ("");
dxDisplayText -> setText ("");
my_dxDisplay. cleanUp ();
newDisplay. show_transmitters (channel. transmitters);
bool localTransmitters =
configHandler_p -> localTransmitterSelector_active ();
Expand Down Expand Up @@ -3590,10 +3585,11 @@ cacheElement theTransmitter;
distanceLabel -> setFont (f);
}
else {
QFont f ("Arial", 12);
dxDisplayText -> setFont (f);
my_dxDisplay. cleanUp ();
my_dxDisplay. show ();
}
QString labelText;
int teller = 0;
for (auto &theTr : channel. transmitters) {
position thePosition;
thePosition. latitude = theTr. theTransmitter. latitude;
Expand Down Expand Up @@ -3621,18 +3617,19 @@ cacheElement theTransmitter;
channel. corner = theCorner;
channel. height = height;
}
int tiiValue_local = theTr. tiiValue;
if (labelText != "")
labelText += "\n";
labelText += "(" + QString::number (tiiValue_local >> 8) + ","
int tiiValue_local = theTr. tiiValue;
labelText = "(" + QString::number (tiiValue_local >> 8) + ","
+ QString::number (tiiValue_local & 0xFF) + ") "
+ theName + " "
+ theName + " ";
QString text2 = " "
+ QString::number (theDistance, 'f', 1) + " km "
+ QString::number (theCorner, 'f', 1)
+ QString::fromLatin1 (" \xb0 ")
+ " (" + QString::number (height, 'f', 1) + "m)";
if (dxMode && theTr. isStrongest)
labelText += " <<<<<<";
if (dxMode)
my_dxDisplay. addRow (labelText, text2, theTr. isStrongest);
else
distanceLabel -> setText (labelText + text2);

// see if we have a map
if (mapHandler == nullptr)
Expand Down Expand Up @@ -3660,16 +3657,6 @@ cacheElement theTransmitter;
theDistance,
theCorner, power, height);
}
if (dxMode) {
dxDisplayText -> setText (labelText);
dxDisplay. show ();
distanceLabel -> setText ("");
}
else {
dxDisplay. hide ();
dxDisplayText -> setText ("");
distanceLabel -> setText (labelText);
}
}

void RadioInterface::showIQ (int amount) {
Expand Down Expand Up @@ -3930,6 +3917,8 @@ void RadioInterface::handle_dxSelector (int d) {
(void)d;
bool b = configHandler_p -> get_dxSelector ();
dabSettings_p -> setValue ("dxMode", b ? 1 : 0);
if (!b)
my_dxDisplay. hide ();
if (my_ofdmHandler != nullptr)
my_ofdmHandler -> set_dxMode (b);
if (b)
Expand Down
3 changes: 2 additions & 1 deletion qt-dab-RC/radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "scanlist-handler.h"
#include "dl-cache.h"
#include "content-table.h"
#include "dxDisplay.h"
#include <memory>
#include <mutex>
#ifdef DATA_STREAMER
Expand Down Expand Up @@ -231,7 +232,7 @@ Q_OBJECT

scanListHandler my_scanListHandler;
deviceChooser chooseDevice;
QFrame dxDisplay;
dxDisplay my_dxDisplay;
scanHandler scanMonitor;
configHandler *configHandler_p;
ensembleHandler *the_ensembleHandler;
Expand Down
2 changes: 1 addition & 1 deletion qt-dab-RC/support/config-handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void configHandler::set_connections () {
//
// Now the checkboxes
// top line
int upload = dabSettings -> value ("UPLOAD_ENABLRD", 0). toInt ();
int upload = dabSettings -> value ("UPLOAD_ENABLED", 0). toInt ();
if (upload != 0)
connect (upload_selector, SIGNAL (stateChanged (int)),
this, SLOT (handle_upload_selector (int)));
Expand Down
95 changes: 95 additions & 0 deletions qt-dab-RC/support/dxDisplay.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#
/*
* Copyright (C) 2024
* Jan van Katwijk ([email protected])
* Lazy Chair Computing
*
* This file is part of Qt-DAB
*
* Qt-DAB 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; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB 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 for more details.
*
* You should have received a copy of the GNU General Public License
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "dxDisplay.h"
#include "radio.h"
#include "position-handler.h"
#include <QHeaderView>

dxDisplay::dxDisplay (RadioInterface *mr, QSettings *s){
dxSettings = s;
myWidget = new QScrollArea (nullptr);
myWidget -> resize (220, 400);
myWidget -> setWidgetResizable(true);

tableWidget = new QTableWidget (0, 3);
tableWidget -> setColumnWidth (0, 60);
tableWidget -> setColumnWidth (1, 200);
tableWidget -> setColumnWidth (2, 200);
QHeaderView *headerView = tableWidget -> horizontalHeader ();
headerView -> setSectionResizeMode (1, QHeaderView::Stretch);
headerView -> resizeSection (0, 50);
myWidget -> setWidget(tableWidget);
tableWidget -> setHorizontalHeaderLabels (
QStringList () << tr ("r") << tr ("transmitter"));
set_position_and_size (s, myWidget, "DX_DISPLAY");
myWidget -> setWindowTitle ("dx display");
}

dxDisplay::~dxDisplay () {
store_widget_position (dxSettings, myWidget, "DX_DISPLAY");
int16_t rows = tableWidget -> rowCount ();
for (int row = rows; row > 0; row --)
tableWidget -> removeRow (row);
delete tableWidget;
delete myWidget;
}

void dxDisplay::cleanUp () {
int16_t rows = tableWidget -> rowCount ();
for (int row = rows; row >= 0; row --)
tableWidget -> removeRow (row);
}

int dxDisplay::nrRows () {
return tableWidget -> rowCount ();
}

void dxDisplay::show () {
myWidget -> show ();
}

void dxDisplay::hide () {
myWidget -> hide ();
}

void dxDisplay::addRow (const QString &tr, const QString &ds, bool b) {
int16_t row = tableWidget -> rowCount ();

tableWidget -> insertRow (row);
QTableWidgetItem *item0 = new QTableWidgetItem;
item0 -> setTextAlignment (Qt::AlignRight |Qt::AlignVCenter);
tableWidget -> setItem (row, 0, item0);

QTableWidgetItem *item1 = new QTableWidgetItem;
item1 -> setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
tableWidget -> setItem (row, 1, item1);

QTableWidgetItem *item2 = new QTableWidgetItem;
item2 -> setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
tableWidget -> setItem (row, 2, item2);

tableWidget -> setCurrentItem (item0);
tableWidget -> item (row, 1) -> setText (tr);
tableWidget -> item (row, 2) -> setText (ds);
tableWidget -> item (row, 0) -> setText (b ? "***" : "");
}

50 changes: 50 additions & 0 deletions qt-dab-RC/support/dxDisplay.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
/*
* Copyright (C) 2024
* Jan van Katwijk ([email protected])
* Lazy Chair Computing
*
* This file is part of Qt-DAB
*
* Qt-DAB 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; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB 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 for more details.
*
* You should have received a copy of the GNU General Public License
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#pragma once

#include <QWidget>
#include <QScrollArea>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QObject>
#include <QSettings>

class RadioInterface;

class dxDisplay:public QFrame {
Q_OBJECT
public:
dxDisplay (RadioInterface *, QSettings *);
~dxDisplay ();
void addRow (const QString &, const QString &, bool);
void cleanUp ();
void show ();
void hide ();
int nrRows ();
private:
QScrollArea *myWidget;
QTableWidget *tableWidget;
QSettings *dxSettings;
};



Binary file modified transmitters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 542eab5

Please sign in to comment.