1
0
mirror of https://github.com/JvanKatwijk/dabradio synced 2025-10-06 00:02:49 +02:00

setscan/nextchannel

This commit is contained in:
JvanKatwijk
2018-04-12 18:36:02 +02:00
parent c4d63c3006
commit 038efcc5a6
6 changed files with 65 additions and 6862 deletions

View File

@@ -63,7 +63,7 @@ if(DEFINED RTLSDR)
endif () endif ()
#add_definitions (-DTHREADED_DECODING) # uncomment for use for an RPI #add_definitions (-DTHREADED_DECODING -DTHREADED_BACKEND) # uncomment for use for an RPI
# #
######################################################################## ########################################################################

6792
Makefile

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,7 @@ Table of Contents
* [Features](#features) * [Features](#features)
* [Installation](#features) * [Installation](#features)
* [Windows](#windows) * [Windows](#windows)
* [Ubuntu Linux](#ubuntu-linux) * [Linux: Ubuntu/x64 and Stretch RPI2/3](#ubuntu-linux)
- [Configuring using the dabradio.pro file](#configuring-using-the-dabradio-file) - [Configuring using the dabradio.pro file](#configuring-using-the-dabradio-file)
- [Configuring using CMake](#configuring-using-cmake) - [Configuring using CMake](#configuring-using-cmake)
- [Qt](#qt) - [Qt](#qt)
@@ -92,7 +92,8 @@ If you are not familar with compiling then please continue reading by jumping to
Ubuntu 16.04 (and on) as well as Debian/Stretch on the RPI2 and 3 have good support for Qt5 (note that contrary to Qt-DAB Ubuntu 16.04 (and on) as well as Debian/Stretch on the RPI2 and 3 have good support for Qt5 (note that contrary to Qt-DAB
no use is made of the qwt library). no use is made of the qwt library).
For generating an executable under Ubuntu (16.04 or newer) or on the RPI 2/3 running under Stretch, you can put the following commands into a script. For generating an executable under Ubuntu (16.04 or newer) or on
the RPI 2/3 running under Stretch, THE FOLLOWING COMMANDS ARE IN A SCRIPT: build-script. It was tested on RPI2/3 running stretch.
(For Ubuntu 14.04 look into the package manager for Qt4 packages). (For Ubuntu 14.04 look into the package manager for Qt4 packages).
1. Fetch the required components 1. Fetch the required components

30
build-script Normal file
View File

@@ -0,0 +1,30 @@
sudo apt-get update
sudo apt-get install qt5-qmake build-essential g++ git cmake
sudo apt-get install libsndfile1-dev qt5-default libfftw3-dev portaudio19-dev
sudo apt-get install libfaad-dev zlib1g-dev rtl-sdr libusb-1.0-0-dev mesa-common-dev
sudo apt-get install libgl1-mesa-dev libqt5opengl5-dev libsamplerate0-dev
sudo apt-get install qtbase5-dev
sudo apt-get install librtlsdr-dev
sudo apt-get install build-essential cmake libusb-1.0-0-dev pkg-config
wget https://github.com/airspy/host/archive/master.zip
unzip master.zip
cd airspyone_host-master
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
cd ../
rm -rf build
cd ..
git clone https://github.com/JvanKatwijk/dabradio.git
cd dabradio
mkdir build
cd build
cmake .. -DRTLSDR=ON -DAIRSPY=ON
make

View File

@@ -1,37 +0,0 @@
#include <windows.h>
IDI_ICON1 ICON DISCARDABLE "/usr/shared/sdr-j-development/systems/newradio/dabradio.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 0,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "\0"
VALUE "FileVersion", "0.0.0.0\0"
VALUE "LegalCopyright", "\0"
VALUE "OriginalFilename", "dabradio-1.0.exe\0"
VALUE "ProductName", "dabradio-1.0\0"
VALUE "ProductVersion", "0.0.0.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1200
END
END
/* End of Version info */

View File

@@ -189,7 +189,11 @@ int gain;
RadioInterface::~RadioInterface (void) { RadioInterface::~RadioInterface (void) {
fprintf (stderr, "radioInterface is deleted\n"); fprintf (stderr, "radioInterface is deleted\n");
} }
//
// A little tricky, there are two signals that may trigger nextChannel
// The "no dab is here" signal, which should arrive within
// a second or so after starting the decoding,
// or a timeout
void RadioInterface:: startScanning (void) { void RadioInterface:: startScanning (void) {
connect (&signalTimer, SIGNAL (timeout (void)), connect (&signalTimer, SIGNAL (timeout (void)),
this, SLOT (nextChannel (void))); this, SLOT (nextChannel (void)));
@@ -210,8 +214,6 @@ void RadioInterface:: startScanning (void) {
channelNumber ++; channelNumber ++;
} }
if (channelNumber >= theBand -> channels ())
return;
QString text = "scanning ch "; QString text = "scanning ch ";
text. append (theBand -> channel (channelNumber. load ())); text. append (theBand -> channel (channelNumber. load ()));
set_ensembleName (text); set_ensembleName (text);
@@ -230,6 +232,10 @@ void RadioInterface:: startScanning (void) {
} }
void RadioInterface::nextChannel (void) { void RadioInterface::nextChannel (void) {
disconnect (&signalTimer, SIGNAL (timeout (void)),
this, SLOT (nextChannel (void)));
disconnect (my_dabProcessor, SIGNAL (No_Signal_Found (void)),
this, SLOT (nextChannel (void)));
signalTimer. stop (); signalTimer. stop ();
my_dabProcessor -> stop (); my_dabProcessor -> stop ();
channelNumber++; channelNumber++;
@@ -237,36 +243,31 @@ void RadioInterface::nextChannel (void) {
QString channel = theBand -> channel (channelNumber); QString channel = theBand -> channel (channelNumber);
if (dabSettings -> value (channel, 1). toInt () > 0) { if (dabSettings -> value (channel, 1). toInt () > 0) {
dabSettings -> setValue (channel, -1); dabSettings -> setValue (channel, -1);
break; int tunedFrequency =
theBand -> Frequency (channelNumber);
QString text = "scanning ch ";
text. append (theBand -> channel (channelNumber));
set_ensembleName (text);
connect (&signalTimer, SIGNAL (timeout (void)),
this, SLOT (nextChannel (void)));
connect (my_dabProcessor, SIGNAL (No_Signal_Found (void)),
this, SLOT (nextChannel (void)));
my_dabProcessor -> start (tunedFrequency, true);
signalTimer. start (5000);
return;
} }
channelNumber ++; channelNumber ++;
} }
if (channelNumber < theBand -> channels ()) {
if (channelNumber >= theBand -> channels ()) scanning = false;
return; set_ensembleName ("end of scan");
int tunedFrequency = serviceLabel -> setText ("select a services");
theBand -> Frequency (channelNumber); serviceLabel -> setStyleSheet ("QLabel {background-color : green}");
QString text = "scanning ch "; connect (ensembleDisplay,
text. append (theBand -> channel (channelNumber)); SIGNAL (newService (const QString &, const QString &)),
set_ensembleName (text); this, SLOT (selectService (const QString &, const QString &)));
my_dabProcessor -> start (tunedFrequency, true); connect (resetButton, SIGNAL (clicked (void)),
signalTimer. start (5000); this, SLOT (reset (void)));
}
else {
scanning = false;
set_ensembleName ("end of scan");
serviceLabel -> setText ("select a services");
serviceLabel -> setStyleSheet ("QLabel {background-color : green}");
disconnect (&signalTimer, SIGNAL (timeout (void)),
this, SLOT (nextChannel (void)));
disconnect (my_dabProcessor, SIGNAL (No_Signal_Found (void)),
this, SLOT (nextChannel (void)));
connect (ensembleDisplay,
SIGNAL (newService (const QString &, const QString &)),
this, SLOT (selectService (const QString &, const QString &)));
connect (resetButton, SIGNAL (clicked (void)),
this, SLOT (reset (void)));
}
} }
void RadioInterface::reset (void) { void RadioInterface::reset (void) {