Skip to content

Commit 4180ceb

Browse files
noc0lourmarcusmueller
authored andcommitted
Migrate to GNU Radio 3.8
1 parent f51eb4a commit 4180ceb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+578
-1923
lines changed

CMakeLists.txt

+6-58
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
########################################################################
2222
# Project setup
2323
########################################################################
24-
cmake_minimum_required(VERSION 2.6)
24+
cmake_minimum_required(VERSION 3.8)
2525
project(gr-dab CXX C)
2626
enable_testing()
2727

28+
cmake_policy(SET CMP0011 NEW)
29+
2830
#select the release build type by default to get optimization flags
2931
if(NOT CMAKE_BUILD_TYPE)
3032
set(CMAKE_BUILD_TYPE "Release")
@@ -79,32 +81,13 @@ if (NOT LIBTOOLAME-DAB_FOUND )
7981
message(FATAL_ERROR "please make sure the libtoolame-dab source can be found")
8082
else()
8183
message(STATUS "LIBTOOLAME-DAB found: ${LIBTOOLAME-DAB_SOURCE_DIR}")
82-
endif ()
84+
endif ()
85+
86+
find_package(Gnuradio "3.8" REQUIRED COMPONENTS filter fft blocks)
8387

8488
include(GrPython)
8589
# Find PyQt5
8690
find_program(PYUIC5_EXECUTABLE pyuic5)
87-
########################################################################
88-
# Find boost
89-
########################################################################
90-
if(UNIX AND EXISTS "/usr/lib64")
91-
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
92-
endif(UNIX AND EXISTS "/usr/lib64")
93-
set(Boost_ADDITIONAL_VERSIONS
94-
"1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
95-
"1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
96-
"1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49"
97-
"1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
98-
"1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
99-
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
100-
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
101-
)
102-
find_package(Boost "1.35" COMPONENTS filesystem system)
103-
104-
if(NOT Boost_FOUND)
105-
message(FATAL_ERROR "Boost required to compile dab")
106-
endif()
107-
10891
########################################################################
10992
# Install directories
11093
########################################################################
@@ -125,19 +108,8 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
125108
########################################################################
126109
# Find gnuradio build dependencies
127110
########################################################################
128-
find_package(CppUnit)
129111
find_package(Doxygen)
130112

131-
# Search for GNU Radio and its components and versions. Add any
132-
# components required to the list of GR_REQUIRED_COMPONENTS (in all
133-
# caps such as FILTER or FFT) and change the version to the minimum
134-
# API compatible version required.
135-
set(GR_REQUIRED_COMPONENTS RUNTIME FILTER)
136-
find_package(Gnuradio "3.7.1" REQUIRED)
137-
138-
if(NOT CPPUNIT_FOUND)
139-
message(FATAL_ERROR "CppUnit required to compile dab")
140-
endif()
141113

142114
########################################################################
143115
# Setup doxygen option
@@ -148,30 +120,6 @@ else(DOXYGEN_FOUND)
148120
option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF)
149121
endif(DOXYGEN_FOUND)
150122

151-
########################################################################
152-
# Setup the include and linker paths
153-
########################################################################
154-
include_directories(
155-
${CMAKE_SOURCE_DIR}/lib
156-
${CMAKE_SOURCE_DIR}/include
157-
${CMAKE_BINARY_DIR}/lib
158-
${CMAKE_BINARY_DIR}/include
159-
${Boost_INCLUDE_DIRS}
160-
${CPPUNIT_INCLUDE_DIRS}
161-
${GNURADIO_ALL_INCLUDE_DIRS}
162-
)
163-
164-
link_directories(
165-
${Boost_LIBRARY_DIRS}
166-
${CPPUNIT_LIBRARY_DIRS}
167-
${GNURADIO_RUNTIME_LIBRARY_DIRS}
168-
${GNURADIO_FILTER_LIBRARY_DIRS}
169-
)
170-
171-
# Set component parameters
172-
set(GR_DAB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE)
173-
set(GR_DAB_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig CACHE INTERNAL "" FORCE)
174-
175123
########################################################################
176124
# Create uninstall target
177125
########################################################################

apps/DABstep

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from PyQt5 import QtGui
3+
from PyQt5 import QtGui, QtWidgets
44
from PyQt5.QtCore import QTimer
55
import sys
66
import time
@@ -15,7 +15,7 @@ import sip
1515
resolution_width = 0
1616
resolution_height = 0
1717

18-
class DABstep(QtGui.QMainWindow, user_frontend.Ui_MainWindow):
18+
class DABstep(QtWidgets.QMainWindow, user_frontend.Ui_MainWindow):
1919
def __init__(self, parent=None):
2020
super(DABstep, self).__init__(parent)
2121
self.setupUi(self)
@@ -58,13 +58,13 @@ class DABstep(QtGui.QMainWindow, user_frontend.Ui_MainWindow):
5858

5959
# table preparations
6060
header = self.table_mci.horizontalHeader()
61-
header.setResizeMode(0, QtGui.QHeaderView.ResizeToContents)
62-
header.setResizeMode(1, QtGui.QHeaderView.Stretch)
63-
header.setResizeMode(2, QtGui.QHeaderView.ResizeToContents)
64-
header.setResizeMode(3, QtGui.QHeaderView.ResizeToContents)
61+
header.setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents)
62+
header.setSectionResizeMode(1, QtWidgets.QHeaderView.Stretch)
63+
header.setSectionResizeMode(2, QtWidgets.QHeaderView.ResizeToContents)
64+
header.setSectionResizeMode(3, QtWidgets.QHeaderView.ResizeToContents)
6565
header.setStretchLastSection(False)
6666
self.table_mci.verticalHeader().hide()
67-
self.table_mci.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
67+
self.table_mci.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
6868

6969
# timer for update of SNR
7070
self.snr_timer = QTimer()
@@ -213,13 +213,13 @@ class DABstep(QtGui.QMainWindow, user_frontend.Ui_MainWindow):
213213
################################
214214
def change_tab(self):
215215
if self.mode_tabs.currentWidget() is self.tab_transmission:
216-
print "changed to transmission mode"
216+
print("changed to transmission mode")
217217
self.t_update_service_components()
218218

219219
elif self.mode_tabs.currentWidget() is self.tab_reception:
220-
print "changed to reception mode"
220+
print("changed to reception mode")
221221
else:
222-
print "changed to unknown tab"
222+
print("changed to unknown tab")
223223

224224
################################
225225
# Receiver functions
@@ -355,8 +355,8 @@ class DABstep(QtGui.QMainWindow, user_frontend.Ui_MainWindow):
355355

356356
# display ensemble info
357357
ensemble_data = self.get_ensemble_info()
358-
self.label_ensemble.setText(ensemble_data.keys()[0].strip())
359-
self.label_country.setText(str(self.table.country_ID_ECC_E0[int(ensemble_data.values()[0]['country_ID'])]))
358+
self.label_ensemble.setText(list(ensemble_data.keys())[0].strip())
359+
self.label_country.setText(str(self.table.country_ID_ECC_E0[int(list(ensemble_data.values())[0]['country_ID'])]))
360360
self.lcd_number_num_subch.display(self.num_subch)
361361
# status bar
362362
self.statusBar.showMessage("Select a Service Component.")
@@ -508,7 +508,7 @@ class DABstep(QtGui.QMainWindow, user_frontend.Ui_MainWindow):
508508
def get_ensemble_info(self):
509509
self.json = self.my_receiver.get_ensemble_info()
510510
if self.json is "":
511-
return {"unknown":{"country_ID":0}}
511+
return {"unknown":{"country_ID":0},}
512512
else:
513513
# load string (json) with ensemble info and convert it to dictionary
514514
# string structure example: "{\"SWR_BW_N\":{\"country_ID\":1}}"
@@ -571,19 +571,19 @@ class DABstep(QtGui.QMainWindow, user_frontend.Ui_MainWindow):
571571
def dev_mode_init(self):
572572
available_height = self.screen_height-200
573573
# constellation plot
574-
self.constellation = sip.wrapinstance(self.my_receiver.constellation_plot.pyqwidget(), QtGui.QWidget)
574+
self.constellation = sip.wrapinstance(self.my_receiver.constellation_plot.pyqwidget(), QtWidgets.QWidget)
575575
self.vertical_layout_dev_mode_right.addWidget(self.constellation)
576576
self.constellation.setMaximumHeight(available_height/3)
577577
self.constellation.setMaximumWidth(available_height/3*2)
578578
self.constellation.hide()
579579
# FFT plot
580-
self.fft_plot = sip.wrapinstance(self.my_receiver.fft_plot.pyqwidget(), QtGui.QWidget)
580+
self.fft_plot = sip.wrapinstance(self.my_receiver.fft_plot.pyqwidget(), QtWidgets.QWidget)
581581
self.vertical_layout_dev_mode_right.addWidget(self.fft_plot)
582582
self.fft_plot.setMaximumHeight(available_height/3)
583583
self.fft_plot.setMaximumWidth(available_height/3*2)
584584
self.fft_plot.hide()
585585
# Waterfall plot
586-
self.waterfall_plot = sip.wrapinstance(self.my_receiver.waterfall_plot.pyqwidget(), QtGui.QWidget)
586+
self.waterfall_plot = sip.wrapinstance(self.my_receiver.waterfall_plot.pyqwidget(), QtWidgets.QWidget)
587587
self.vertical_layout_dev_mode_right.addWidget(self.waterfall_plot)
588588
self.waterfall_plot.setMaximumHeight(available_height/3)
589589
self.waterfall_plot.setMaximumWidth(available_height/3*2)
@@ -1113,7 +1113,7 @@ class lookup_tables:
11131113
]
11141114

11151115
def main():
1116-
app = QtGui.QApplication(sys.argv)
1116+
app = QtWidgets.QApplication(sys.argv)
11171117
global resolution_width
11181118
resolution_width = app.desktop().screenGeometry().width()
11191119
global resolution_height

cmake/Modules/CMakeParseArgumentsCopy.cmake

-138
This file was deleted.

cmake/Modules/FindCppUnit.cmake

-36
This file was deleted.

0 commit comments

Comments
 (0)