diff --git a/.appveyor.yml b/.appveyor.yml index ed3fd8934..103342f18 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -9,36 +9,42 @@ matrix: fast_finish: false environment: -# my_variable: -# secure: kyU5TaXRoily6q/QLRLqal2xCFGWEdnb8AJIu7FknsUQyj1wjRGmqC2My+Wfszod matrix: - - TARGET: vs2017gui - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - # RelWithDebInfo + - TARGET: vs2019gui + APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2019' configuration: Release - # CMAKE_CUSTOM_OPTIONS: "-DENABLE_EXTERNAL_LIBRARIES=OFF" - CMAKE_CUSTOM_OPTIONS: "-DFORCE_SSE41=ON -DQT_MISSING=OFF -DDEBUG_OUTPUT=ON -DENABLE_MIRISDR=OFF -DBUILD_SERVER=OFF" - CMAKE_GENERATOR: "Visual Studio 15 2017 Win64" + CMAKE_CUSTOM_OPTIONS: "-DCMAKE_BUILD_TYPE=Release \ + -DFORCE_SSE41=ON \ + -DDEBUG_OUTPUT=ON \ + -DENABLE_MIRISDR=OFF \ + -DBUILD_SERVER=OFF \ + -DCMAKE_PREFIX_PATH=C:\\Qt\\5.15.1\\msvc2019_64;C:\\Libraries\\boost_1_73_0" + CMAKE_GENERATOR: Ninja - TARGET: ubuntu2004prod APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004 - CMAKE_CUSTOM_OPTIONS: "-DFORCE_SSE41=ON -DDEBUG_OUTPUT=ON -DENABLE_EXTERNAL_LIBRARIES=ON" + CC: "gcc-9" + CXX: "g++-9" + CMAKE_CUSTOM_OPTIONS: "-DCMAKE_BUILD_TYPE=Release \ + -DFORCE_SSE41=ON \ + -DDEBUG_OUTPUT=ON \ + -DENABLE_EXTERNAL_LIBRARIES=ON \ + -DBUILD_SERVER=OFF" -# image: -# - &linux Ubuntu1804 -# - matrix: { only: [ image: *linux ] } for: - matrix: only: - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2019' cache: - C:\ProgramData\chocolatey\bin - C:\ProgramData\chocolatey\lib - #- C:\Tools\vcpkg\installed build_script: + - call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" + # Install GNU patch as applying patches with git fails in BladeRF tree + - choco install patch - git submodule update --init --recursive - mkdir build && cd build - - cmake ..\ -G "%CMAKE_GENERATOR%" %CMAKE_CUSTOM_OPTIONS% - - cmake --build . --config Release --target PACKAGE + - cmake .. -G "%CMAKE_GENERATOR%" %CMAKE_CUSTOM_OPTIONS% + - cmake --build . --config Release --target package artifacts: # push installer executable path: build\*.exe name: installer @@ -76,7 +82,7 @@ for: libopus-dev libcodec2-dev libairspy-dev libhackrf-dev \ libbladerf-dev libsoapysdr-dev libiio-dev libuhd-dev \ python3-mako python3-cheetah python3-numpy \ - autoconf automake libtool + autoconf automake libtool ninja-build - sh: if [[ ! "${CMAKE_CUSTOM_OPTIONS}" =~ "ENABLE_EXTERNAL_LIBRARIES=ON" ]]; then bash cmake/ci/build_cm256cc.sh; fi - sh: if [[ ! "${CMAKE_CUSTOM_OPTIONS}" =~ "ENABLE_EXTERNAL_LIBRARIES=ON" ]]; then bash cmake/ci/build_mbelib.sh; fi - sh: if [[ ! "${CMAKE_CUSTOM_OPTIONS}" =~ "ENABLE_EXTERNAL_LIBRARIES=ON" ]]; then bash cmake/ci/build_serialdv.sh; fi @@ -90,7 +96,7 @@ for: - sh: bash -c export - sh: bash -c pwd build_script: - - sh: bash cmake/ci/build_sdrangel.sh + - sh: ./cmake/ci/build_sdrangel.sh test_script: # debian build path - sh: ./obj-x86_64-linux-gnu/sdrangelbench diff --git a/CHANGELOG b/CHANGELOG index a044c7895..e1a8e560b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,15 @@ +sdrangel (4.21.2-1) unstable; urgency=medium + + * Windows package: upgrade to VS 2019 and Qt 5.15.1. PR #683 + * Package builds: migrate to Ninja. PR #683 + * Define _USE_MATH_DEFINES and clean M_PI redefinitions. PR #682 + * NFM Demod: Refactored audio scaling. PR #682 + fix + * NFM Demod: Fix CTCSS check logic: PR #682 + * NFM: review frequency deviation + * KiwiSDR: fixed issue in local network. Fixes #435 + + -- Edouard Griffiths, F4EXB Fri, 06 Nov 2020 05:21:24 +0100 + sdrangel (4.21.1-1) unstable; urgency=medium * ADS-B demod: optimization of sync word correlation. Implements #675 diff --git a/CMakeLists.txt b/CMakeLists.txt index f64c31ac0..2a42928f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,6 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.10.0) -# force 64bit on windows because we have only that library -# TODO discuss because, at this days, a dsp software should be 64bit -# if(WIN32 AND NOT CMAKE_GENERATOR_PLATFORM AND NOT CMAKE_C_COMPILER AND NOT CMAKE_CXX_COMPILER) -# set(CMAKE_GENERATOR_PLATFORM "x64" CACHE INTERNAL "") -# endif() +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") project(sdrangel) @@ -18,7 +14,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) # configure version set(sdrangel_VERSION_MAJOR "4") set(sdrangel_VERSION_MINOR "21") -set(sdrangel_VERSION_PATCH "1") +set(sdrangel_VERSION_PATCH "2") set(sdrangel_VERSION_SUFFIX "") # SDRAngel cmake options @@ -62,6 +58,11 @@ add_definitions("-DCOPYRIGHT=\"${COPYRIGHT}\"") set(IDENTIFIER "com.${COMPANY}.${APPLICATION_NAME}") add_definitions("-DIDENTIFIER=\"${IDENTIFIER}\"") +add_compile_definitions(_USE_MATH_DEFINES) +if(WIN32) + add_compile_definitions(NOMINMAX) +endif() + find_package(Git) if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git/") execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags @@ -192,39 +193,35 @@ elseif(APPLE) "${CMAKE_BINARY_DIR}/Info.plist" @ONLY) elseif (WIN32) # check compiler version - if(MSVC_VERSION GREATER 1910 AND MSVC_VERSION LESS 1919) + if(MSVC_VERSION GREATER 1920 AND MSVC_VERSION LESS 1929) + set(VS2019 ON) + elseif(MSVC_VERSION GREATER 1910 AND MSVC_VERSION LESS 1919) set(VS2017 ON) elseif(MSVC_VERSION GREATER 1899 AND MSVC_VERSION LESS 1910) set(VS2015 ON) endif() - if(NOT VS2015 AND NOT VS2017) - message(FATAL_ERROR "You must use Microsoft Visual Studio 2015 or 2017 as compiler") + if(NOT VS2015 AND NOT VS2017 AND NOT VS2019) + message(FATAL_ERROR "You must use Microsoft Visual Studio 2015, 2017 or 2019 as compiler") endif() - # used on code but not defined on VS2017 - add_definitions(-D__WINDOWS__) - # compile with full multicore - set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /MP /w") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /w") - - # find Qt folder - if(DEFINED QT_PATH) - set (QT_MISSING False) + if(MSVC) + add_compile_definitions(/MP) endif() - include(QtLocator) # in alternative we can use ExternalProject set(EXTERNAL_LIBRARY_FOLDER "${CMAKE_SOURCE_DIR}/external/windows") - set(BOOST_ROOT "${EXTERNAL_LIBRARY_FOLDER}/boost" CACHE INTERNAL "") - set(BOOST_LIBRARYDIR "${EXTERNAL_LIBRARY_FOLDER}/boost/lib64-msvc-14.1" CACHE INTERNAL "") set(FFTW3F_FOUND ON CACHE INTERNAL "") set(FFTW3F_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/include" CACHE INTERNAL "") set(FFTW3F_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/libfftw3f-3.lib" CACHE INTERNAL "") set(LIBUSB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/libusb/include" CACHE INTERNAL "") set(LIBUSB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll/libusb-1.0.lib" CACHE INTERNAL "") - set(OpenCV_DIR "${EXTERNAL_LIBRARY_FOLDER}/opencv" CACHE INTERNAL "") + if(VS2019) + set(OpenCV_DIR "${EXTERNAL_LIBRARY_FOLDER}/opencv4" CACHE INTERNAL "") + else() + set(OpenCV_DIR "${EXTERNAL_LIBRARY_FOLDER}/opencv" CACHE INTERNAL "") + endif() set(PKG_CONFIG_EXECUTABLE "${EXTERNAL_LIBRARY_FOLDER}/pkg-config-lite/bin/pkg-config.exe" CACHE INTERNAL "") set(SOAPYSUPPORT_DIR "${EXTERNAL_LIBRARY_FOLDER}/soapysdr-support" CACHE INTERNAL "") @@ -260,7 +257,6 @@ elseif (WIN32) # used on fixup_bundle phase set(WINDOWS_FIXUP_BUNDLE_LIB_DIRS - "${Qt5_DIR}../../../bin" "${EXTERNAL_LIBRARY_FOLDER}/fftw-3" "${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll" "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/bin" @@ -371,11 +367,7 @@ if(WIN32) set(OpenCV_ARCH "86") endif() - if(VS2015) - set(OpenCV_LIBS_BIN_DIR "${OpenCV_DIR}/x${OpenCV_ARCH}/vc14/bin" CACHE INTERNAL "") - elseif(VS2017) - set(OpenCV_LIBS_BIN_DIR "${OpenCV_DIR}/x${OpenCV_ARCH}/vc15/bin" CACHE INTERNAL "") - endif() + set(OpenCV_LIBS_BIN_DIR "${OpenCV_DIR}/x${OpenCV_ARCH}/${OpenCV_RUNTIME}/bin" CACHE INTERNAL "") set(WINDOWS_FIXUP_BUNDLE_LIB_DIRS "${WINDOWS_FIXUP_BUNDLE_LIB_DIRS}" diff --git a/app/main.cpp b/app/main.cpp index deb75b6d5..32e1a2f70 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -37,7 +37,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo QCoreApplication::setApplicationName(APPLICATION_NAME); QCoreApplication::setApplicationVersion(SDRANGEL_VERSION); -#if QT_VERSION >= 0x050600 +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps #endif @@ -102,7 +102,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo MainParser parser; parser.parse(*qApp); -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld", qPrintable(qApp->applicationName()), qPrintable(qApp->applicationVersion()), diff --git a/appbench/main.cpp b/appbench/main.cpp index 743ccc49e..0c91a875c 100644 --- a/appbench/main.cpp +++ b/appbench/main.cpp @@ -71,7 +71,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo ParserBench parser; parser.parse(a); -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld", qPrintable(QCoreApplication::applicationName()), qPrintable(QCoreApplication::applicationVersion()), diff --git a/appsrv/main.cpp b/appsrv/main.cpp index d74735362..78f4c3a7b 100644 --- a/appsrv/main.cpp +++ b/appsrv/main.cpp @@ -70,7 +70,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo MainParser parser; parser.parse(a); -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld", qPrintable(QCoreApplication::applicationName()), qPrintable(QCoreApplication::applicationVersion()), diff --git a/cmake/Modules/DeployQt.cmake b/cmake/Modules/DeployQt.cmake index d8a1d2d79..d302cf203 100644 --- a/cmake/Modules/DeployQt.cmake +++ b/cmake/Modules/DeployQt.cmake @@ -25,6 +25,8 @@ function(windeployqt target bindir qmldir) --dir "${bindir}" --qmldir "${qmldir}" --multimedia + --websockets + --opengl \"$\" COMMENT "Deploying Qt..." ) @@ -38,6 +40,8 @@ function(windeployqt target bindir qmldir) --dir "${bindir}/winqt" --qmldir "${qmldir}" --multimedia + --websockets + --opengl \"$\" COMMENT "Deploying Qt..." ) diff --git a/cmake/Modules/QtLocator.cmake b/cmake/Modules/QtLocator.cmake deleted file mode 100644 index 72f759ebe..000000000 --- a/cmake/Modules/QtLocator.cmake +++ /dev/null @@ -1,48 +0,0 @@ -SET(QT_MISSING True) -# msvc only; mingw will need different logic -IF(MSVC) - # look for user-registry pointing to qtcreator - GET_FILENAME_COMPONENT(QT_BIN [HKEY_CURRENT_USER\\Software\\Classes\\Applications\\QtProject.QtCreator.pro\\shell\\Open\\Command] PATH) - - # get root path so we can search for 5.3, 5.4, 5.5, etc - STRING(REPLACE "/Tools" ";" QT_BIN "${QT_BIN}") - LIST(GET QT_BIN 0 QT_BIN) - FILE(GLOB QT_VERSIONS "${QT_BIN}/5.*") - LIST(SORT QT_VERSIONS) - - # assume the latest version will be last alphabetically - LIST(REVERSE QT_VERSIONS) - - LIST(GET QT_VERSIONS 0 QT_VERSION) - - # fix any double slashes which seem to be common - STRING(REPLACE "//" "/" QT_VERSION "${QT_VERSION}") - - # do some math trickery to guess folder - # - qt uses (e.g.) "msvc2012" - # - cmake uses (e.g.) "1800" - # - see also https://cmake.org/cmake/help/v3.0/variable/MSVC_VERSION.html - # checkcompiler version - if(MSVC_VERSION GREATER 1910 AND MSVC_VERSION LESS 1919) - set(QT_MSVC 2017) - elseif(MSVC_VERSION GREATER 1899 AND MSVC_VERSION LESS 1910) - set(QT_MSVC 2015) - else() - MATH(EXPR QT_MSVC "2000 + (${MSVC_VERSION} - 600) / 100") - endif() - - # check for 64-bit os - # may need to be removed for older compilers as it wasn't always offered - IF(CMAKE_SYSTEM_PROCESSOR MATCHES 64) - SET(QT_MSVC "${QT_MSVC}_64") - ENDIF() - SET(QT_PATH "${QT_VERSION}/msvc${QT_MSVC}") - SET(QT_MISSING False) -ENDIF() - -# use Qt_DIR approach so you can find Qt after cmake has been invoked -IF(NOT QT_MISSING) - MESSAGE("-- Qt found: ${QT_PATH}") - SET(Qt5_DIR "${QT_PATH}/lib/cmake/Qt5/") - SET(Qt5Test_DIR "${QT_PATH}/lib/cmake/Qt5Test") -ENDIF() diff --git a/cmake/ci/build_sdrangel.sh b/cmake/ci/build_sdrangel.sh old mode 100644 new mode 100755 index d42142561..8ea5358b3 --- a/cmake/ci/build_sdrangel.sh +++ b/cmake/ci/build_sdrangel.sh @@ -1,26 +1,17 @@ -#!/bin/sh - -if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - JOBS=$(sysctl -n hw.ncpu) -elif [ "${TRAVIS_OS_NAME}" == "linux" ] || [ ${CI_LINUX} = true ]; then - JOBS=$(nproc --all) -else - JOBS=1 -fi - +#!/bin/sh -e if [ "${TRAVIS_OS_NAME}" == "linux" ] || [ ${CI_LINUX} = true ]; then debuild -i -us -uc -b else - mkdir build && cd build - cmake .. "${CMAKE_CUSTOM_OPTIONS}" + mkdir -p build; cd build + cmake .. -GNinja ${CMAKE_CUSTOM_OPTIONS} case "${CMAKE_CUSTOM_OPTIONS}" in *BUNDLE=ON*) - make -j${JOBS} package + cmake --build . --target package ;; *) - make -j${JOBS} + cmake --build . ;; - esac + esac fi diff --git a/debian/changelog b/debian/changelog index c7eda0ca0..3f3c03b01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +sdrangel (4.21.2-1) unstable; urgency=medium + + * Windows package: upgrade to VS 2019 and Qt 5.15.1. PR #683 + * Package builds: migrate to Ninja. PR #683 + * Define _USE_MATH_DEFINES and clean M_PI redefinitions. PR #682 + * NFM Demod: Refactored audio scaling. PR #682 + fix + * NFM Demod: Fix CTCSS check logic: PR #682 + * NFM: review frequency deviation + * KiwiSDR: fixed issue in local network. Fixes #435 + + -- Edouard Griffiths, F4EXB Fri, 06 Nov 2020 05:21:24 +0100 + sdrangel (4.21.1-1) unstable; urgency=medium * ADS-B demod: optimization of sync word correlation. Implements #675 diff --git a/debian/rules b/debian/rules index b73828347..3d4bf9ddb 100755 --- a/debian/rules +++ b/debian/rules @@ -1,10 +1,13 @@ #!/usr/bin/make -f %: - dh $@ --parallel + dh $@ --parallel --buildsystem=cmake+ninja # FORCE_SSE41 will be not accepted upstream override_dh_auto_configure: - dh_auto_configure -- -DFORCE_SSE41=ON -DENABLE_EXTERNAL_LIBRARIES=ON -DDEBUG_OUTPUT=ON + dh_auto_configure -- -DFORCE_SSE41=ON -DENABLE_EXTERNAL_LIBRARIES=ON -DDEBUG_OUTPUT=ON -DBUILD_SERVER=OFF + +override_dh_auto_test: + echo "Skipping test step" # permit the packaging with /usr/local/lib libraries (from `make install`) # you can also use `export DEB_DH_SHLIBDEPS_ARGS_ALL=--dpkg-shlibdeps-params=--ignore-missing-info` diff --git a/devices/usrp/CMakeLists.txt b/devices/usrp/CMakeLists.txt index 31803536f..ec26fc273 100644 --- a/devices/usrp/CMakeLists.txt +++ b/devices/usrp/CMakeLists.txt @@ -1,8 +1,3 @@ -if(WIN32) - # ${Boost_LIBRARY_DIRS} is empty on windows - link_directories(${BOOST_LIBRARYDIR}) -endif() - project(usrpdevice) @@ -30,10 +25,13 @@ add_library(usrpdevice SHARED set_target_properties(usrpdevice PROPERTIES DEFINE_SYMBOL "devices_EXPORTS") -link_directories(${Boost_LIBRARY_DIRS}) +if (NOT WIN32) + link_directories(${Boost_LIBRARY_DIRS}) +endif() target_link_libraries(usrpdevice ${UHD_LIBRARIES} + Boost::disable_autolinking sdrbase ) diff --git a/doc/img/NFMdemod_plugin.png b/doc/img/NFMdemod_plugin.png index 56aeab458..5c3147e44 100644 Binary files a/doc/img/NFMdemod_plugin.png and b/doc/img/NFMdemod_plugin.png differ diff --git a/doc/img/NFMdemod_plugin.xcf b/doc/img/NFMdemod_plugin.xcf index 56ba60fd9..b7fa63b72 100644 Binary files a/doc/img/NFMdemod_plugin.xcf and b/doc/img/NFMdemod_plugin.xcf differ diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 275b5d88b..63d515b57 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -10,7 +10,7 @@ # which version/tag/checkout to use set(CODEC2_TAG "v0.9.2") set(CM256CC_TAG c0e92b92aca3d1d36c990b642b937c64d363c559) -set(MBELIB_TAG 9a04ed5c78176a9965f3d43f7aa1b1f5330e771f) +set(MBELIB_TAG fe83b32c6a60cdd7bce8cecf3c7a0b9ec87a7667) set(SERIALDV_TAG "v1.1.4") set(DSDCC_TAG "v1.9.0") set(LIMESUITE_TAG "v20.01.0") @@ -37,7 +37,7 @@ include(ExternalProject) # default build destination in windows to avoid Release/Debug folder if (WIN32) # the build will be output on the same folder of sdrangel - set(DEFAULT_OUTPUT_DIRECTORIES + set(COMMON_CMAKE_ARGS -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${SDRANGEL_BINARY_BIN_DIR} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${SDRANGEL_BINARY_BIN_DIR} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=${SDRANGEL_BINARY_BIN_DIR} @@ -52,7 +52,7 @@ if (WIN32) -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO=${SDRANGEL_BINARY_LIB_DIR} ) elseif (LINUX) - set(DEFAULT_OUTPUT_DIRECTORIES + set(COMMON_CMAKE_ARGS -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${EXTERNAL_BUILD_LIBRARIES}/bin -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/bin -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/bin @@ -68,6 +68,19 @@ elseif (LINUX) ) endif () +if(CMAKE_MSVC_RUNTIME_LIBRARY) + list(APPEND COMMON_CMAKE_ARGS -DCMAKE_POLICY_DEFAULT_CMP0091:STRING=NEW) + list(APPEND COMMON_CMAKE_ARGS -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}) +endif() + +if(CMAKE_BUILD_TYPE) + list(APPEND COMMON_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) +endif() + +list(APPEND COMMON_CMAKE_ARGS -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}) +list(APPEND COMMON_CMAKE_ARGS -DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}) +list(APPEND COMMON_CMAKE_ARGS -DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}) + if (LINUX) # macro that create symbolic links macro(makeLink src dest target) @@ -159,11 +172,17 @@ endif (AUTO_EXTERNAL_LIBRARIES) if (NOT WIN32 AND (NOT CODEC2_FOUND OR CODEC2_EXTERNAL)) # needs speexdsp + if (WIN32) + set(CODEC2_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/codec2.lib" CACHE INTERNAL "") + elseif (LINUX) + set(CODEC2_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + endif () ExternalProject_Add(codec2 GIT_REPOSITORY https://github.com/drowe67/codec2.git GIT_TAG ${CODEC2_TAG} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/codec2" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS "${CODEC2_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -186,16 +205,22 @@ endif (NOT WIN32 AND (NOT CODEC2_FOUND OR CODEC2_EXTERNAL)) if (NOT APPLE AND (NOT CM256CC_FOUND OR CM256CC_EXTERNAL)) # needs boost + if (WIN32) + set(CM256CC_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/cm256cc.lib" CACHE INTERNAL "") + elseif (LINUX) + set(CM256CC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libcm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + endif () + string(REPLACE ";" "|" CMAKE_PREFIX_PATH_SEP "${CMAKE_PREFIX_PATH}") ExternalProject_Add(cm256cc GIT_REPOSITORY https://github.com/f4exb/cm256cc.git GIT_TAG ${CM256CC_TAG} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/cm256cc" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + LIST_SEPARATOR | + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DBUILD_TOOLS=OFF - -DBOOST_ROOT="${BOOST_ROOT}" - -DBoost_INCLUDE_DIR=${Boost_INCLUDE_DIRS} - -DBoost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS} + -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH_SEP} -DENABLE_DISTRIBUTION=ON + BUILD_BYPRODUCTS "${CM256CC_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -205,10 +230,7 @@ if (NOT APPLE AND (NOT CM256CC_FOUND OR CM256CC_EXTERNAL)) # we need cm256cc/library.h set(CM256CC_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/cm256cc/src" CACHE INTERNAL "") if (WIN32) - set(CM256CC_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/cm256cc.lib" CACHE INTERNAL "") install(FILES "${SDRANGEL_BINARY_BIN_DIR}/cm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") - elseif (LINUX) - set(CM256CC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libcm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") elseif (APPLE) # kept in case of relaxation of APPLE exclusion set(CM256CC_LIBRARIES "${binary_dir}/libcm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}" @@ -219,11 +241,17 @@ endif (NOT APPLE AND (NOT CM256CC_FOUND OR CM256CC_EXTERNAL)) if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND (NOT LIBMBE_FOUND OR LIBMBE_EXTERNAL)) set(USE_MBELIB OFF) + if (WIN32) + set(LIBMBE_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libmbe.lib" CACHE INTERNAL "") + elseif (LINUX) + set(LIBMBE_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + endif () ExternalProject_Add(mbelib - GIT_REPOSITORY https://github.com/szechyjs/mbelib.git + GIT_REPOSITORY https://github.com/kasper93/mbelib.git GIT_TAG ${MBELIB_TAG} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/mbelib" - CMAKE_ARGS -DDISABLE_TEST=ON ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS -DDISABLE_TEST=ON ${COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS "${LIBMBE_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -234,10 +262,7 @@ if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND (NOT LIBMBE_FOUND OR LIBMBE_EX set(LIBMBE_EXTERNAL ON CACHE INTERNAL "") set(LIBMBE_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "") if (WIN32) - set(LIBMBE_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/mbe.lib" CACHE INTERNAL "") - install(FILES "${SDRANGEL_BINARY_BIN_DIR}/mbe${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") - elseif (LINUX) - set(LIBMBE_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + install(FILES "${SDRANGEL_BINARY_BIN_DIR}/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (APPLE) set(LIBMBE_LIBRARIES "${binary_dir}/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}" @@ -248,12 +273,17 @@ endif ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND (NOT LIBMBE_FOUND OR LIBMBE if (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL) # Works on MacOS with a dummy serialDV + if (WIN32) + set(LIBSERIALDV_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/serialdv.lib" CACHE INTERNAL "") + elseif (LINUX) + set(LIBSERIALDV_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib/libserialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + endif () ExternalProject_Add(serialdv GIT_REPOSITORY https://github.com/f4exb/serialDV.git GIT_TAG ${SERIALDV_TAG} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/serialdv" - CMAKE_ARGS -DBUILD_TOOL=OFF ${DEFAULT_OUTPUT_DIRECTORIES} - INSTALL_COMMAND "" + CMAKE_ARGS -DBUILD_TOOL=OFF ${COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS "${LIBSERIALDV_LIBRARY}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -263,11 +293,9 @@ if (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL) set(LIBSERIALDV_EXTERNAL ON CACHE INTERNAL "") set(LIBSERIALDV_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "") if (WIN32) - set(LIBSERIALDV_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/serialdv.lib" CACHE INTERNAL "") makeCopyDir("${source_dir}" "${source_dir}/dsp" serialdv) install(FILES "${SDRANGEL_BINARY_BIN_DIR}/serialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (LINUX) - set(LIBSERIALDV_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib/libserialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") # because sdrbase/dsp/dvserialworker.h use dsp/dvcontroller.h # so we need a link makeLink("${source_dir}" "${source_dir}/dsp" serialdv) @@ -283,17 +311,23 @@ if (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL) endif (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL) if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND LIBMBE_FOUND) + if (WIN32) + set(LIBDSDCC_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/dsdcc.lib" CACHE INTERNAL "") + elseif (LINUX) + set(LIBDSDCC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libdsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + endif () ExternalProject_Add(dsdcc GIT_REPOSITORY https://github.com/f4exb/dsdcc.git GIT_TAG ${DSDCC_TAG} DEPENDS ${DSDCC_DEPENDS} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/dsdcc" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DBUILD_TOOL=OFF -DUSE_MBELIB=${USE_MBELIB} -DLIBMBE_INCLUDE_DIR=${LIBMBE_INCLUDE_DIR} -DLIBMBE_LIBRARY=${LIBMBE_LIBRARIES} -DLIBSERIALDV_INCLUDE_DIR=${LIBSERIALDV_INCLUDE_DIR} -DLIBSERIALDV_LIBRARY=${LIBSERIALDV_LIBRARY} + BUILD_BYPRODUCTS "${LIBDSDCC_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -302,10 +336,7 @@ if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND LIBMBE_FOUND) set(LIBDSDCC_EXTERNAL ON CACHE INTERNAL "") set(LIBDSDCC_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/dsdcc/src" CACHE INTERNAL "") if (WIN32) - set(LIBDSDCC_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/dsdcc.lib" CACHE INTERNAL "") install(FILES "${SDRANGEL_BINARY_BIN_DIR}/dsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") - elseif (LINUX) - set(LIBDSDCC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libdsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") elseif (APPLE) set(LIBDSDCC_LIBRARIES "${binary_dir}/libdsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}" @@ -344,134 +375,142 @@ if (LINUX) # apt install liblimesuite-dev (only on ubuntu 18.04). Can be picky on version though so let's build it. # needs pkgconfig and libusb if (NOT LIMESUITE_FOUND OR LIMESUITE_EXTERNAL) - ExternalProject_Add(limesuite - GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git - GIT_TAG ${LIMESUITE_TAG} - PREFIX "${EXTERNAL_BUILD_LIBRARIES}/limesuite" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} -DLIME_SUITE_EXTVER=release -DENABLE_GUI=OFF -DENABLE_NOVENARF7=OFF -DENABLE_SOAPY_LMS7=OFF -DENABLE_OCTAVE=OFF -DENABLE_SIMD_FLAGS=SSE3 - INSTALL_COMMAND "" - TEST_COMMAND "" - ) - ExternalProject_Get_Property(limesuite source_dir) set(LIMESUITE_FOUND ON CACHE INTERNAL "") set(LIMESUITE_EXTERNAL ON CACHE INTERNAL "") set(LIMESUITE_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/limesuite/src/limesuite/src" CACHE INTERNAL "") set(LIMESUITE_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib/libLimeSuite.so" CACHE INTERNAL "") + ExternalProject_Add(limesuite + GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git + GIT_TAG ${LIMESUITE_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/limesuite" + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DLIME_SUITE_EXTVER=release -DENABLE_GUI=OFF -DENABLE_NOVENARF7=OFF -DENABLE_SOAPY_LMS7=OFF -DENABLE_OCTAVE=OFF -DENABLE_SIMD_FLAGS=SSE3 + BUILD_BYPRODUCTS "${LIMESUITE_LIBRARY}" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + ExternalProject_Get_Property(limesuite source_dir) makeCopyFile("${source_dir}/src/limeRFE/limeRFE.h" "${source_dir}/src/lime/limeRFE.h" limesuite) endif (NOT LIMESUITE_FOUND OR LIMESUITE_EXTERNAL) # apt install libbladerf-dev # needs pkgconfig and libusb if (NOT LIBBLADERF_FOUND OR LIBBLADERF_EXTERNAL) + set(LIBBLADERF_FOUND ON CACHE INTERNAL "") + set(LIBBLADERF_EXTERNAL ON CACHE INTERNAL "") + set(LIBBLADERF_INCLUDE_DIRS "${EXTERNAL_BUILD_LIBRARIES}/bladerf/src/bladerf/host/libraries/libbladeRF/include" CACHE INTERNAL "") + set(LIBBLADERF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/bladerf/src/bladerf-build/output/libbladeRF.so.2" CACHE INTERNAL "") ExternalProject_Add(bladerf GIT_REPOSITORY https://github.com/Nuand/bladeRF.git GIT_TAG ${BLADERF_TAG} GIT_SUBMODULES PREFIX "${EXTERNAL_BUILD_LIBRARIES}/bladerf" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} SOURCE_SUBDIR host/ + BUILD_BYPRODUCTS "${LIBBLADERF_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) - set(LIBBLADERF_FOUND ON CACHE INTERNAL "") - set(LIBBLADERF_EXTERNAL ON CACHE INTERNAL "") - set(LIBBLADERF_INCLUDE_DIRS "${EXTERNAL_BUILD_LIBRARIES}/bladerf/src/bladerf/host/libraries/libbladeRF/include" CACHE INTERNAL "") - set(LIBBLADERF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libbladeRF.so" CACHE INTERNAL "") + install(FILES "${LIBBLADERF_LIBRARIES}" DESTINATION "${INSTALL_LIB_DIR}") endif (NOT LIBBLADERF_FOUND OR LIBBLADERF_EXTERNAL) # apt install libiio-dev # needs pkgconfig, libusb, libxml2, lzma, xz, libiconv if (NOT LIBIIO_FOUND OR LIBIIO_EXTERNAL) - ExternalProject_Add(libiio - GIT_REPOSITORY https://github.com/analogdevicesinc/libiio.git - GIT_TAG ${LIBIIO_TAG} - PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libiio" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} -DOSX_PACKAGE=OFF -DWITH_DOC=OFF - INSTALL_COMMAND "" - TEST_COMMAND "" - ) set(LIBIIO_FOUND ON CACHE INTERNAL "") set(LIBIIO_EXTERNAL ON CACHE INTERNAL "") set(LIBIIO_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/libiio/src/libiio" CACHE INTERNAL "") set(LIBIIO_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libiio.so" CACHE INTERNAL "") + ExternalProject_Add(libiio + GIT_REPOSITORY https://github.com/analogdevicesinc/libiio.git + GIT_TAG ${LIBIIO_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libiio" + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DOSX_PACKAGE=OFF -DWITH_DOC=OFF + BUILD_BYPRODUCTS "${LIBIIO_LIBRARIES}" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) endif (NOT LIBIIO_FOUND OR LIBIIO_EXTERNAL) # apt install libairspyhf-dev (only on ubuntu 18.04) # needs libusb and pkgconfig if (NOT LIBAIRSPYHF_FOUND OR LIBAIRSPYHF_EXTERNAL) + set(LIBAIRSPYHF_FOUND ON CACHE INTERNAL "") + set(LIBAIRSPYHF_EXTERNAL ON CACHE INTERNAL "") + set(LIBAIRSPYHF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libairspyhf.so" CACHE INTERNAL "") ExternalProject_Add(airspyhf GIT_REPOSITORY https://github.com/airspy/airspyhf.git GIT_TAG ${AIRSPYHF_TAG} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspyhf" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS "${LIBAIRSPYHF_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) ExternalProject_Get_Property(airspyhf source_dir) - set(LIBAIRSPYHF_FOUND ON CACHE INTERNAL "") - set(LIBAIRSPYHF_EXTERNAL ON CACHE INTERNAL "") set(LIBAIRSPYHF_INCLUDE_DIR "${source_dir}/.." CACHE INTERNAL "") - set(LIBAIRSPYHF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libairspyhf.so" CACHE INTERNAL "") makeLink("${source_dir}/libairspyhf/src" "${source_dir}/../libairspyhf" airspyhf) endif (NOT LIBAIRSPYHF_FOUND OR LIBAIRSPYHF_EXTERNAL) # needs pkgconfig, libusb, autoconf, automake and libtool if (NOT LIBPERSEUS_FOUND OR LIBPERSEUS_EXTERNAL) - ExternalProject_Add(perseus - GIT_REPOSITORY https://github.com/f4exb/libperseus-sdr.git - GIT_TAG ${PERSEUS_TAG} - PREFIX "${EXTERNAL_BUILD_LIBRARIES}/perseus" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} - INSTALL_COMMAND "" - TEST_COMMAND "" - ) set(LIBPERSEUS_FOUND ON CACHE INTERNAL "") set(LIBPERSEUS_EXTERNAL ON CACHE INTERNAL "") set(LIBPERSEUS_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/perseus/src/perseus" CACHE INTERNAL "") set(LIBPERSEUS_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libperseus-sdr.so" CACHE INTERNAL "") + ExternalProject_Add(perseus + GIT_REPOSITORY https://github.com/f4exb/libperseus-sdr.git + GIT_TAG ${PERSEUS_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/perseus" + CMAKE_ARGS ${COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS "${LIBPERSEUS_LIBRARIES}" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) endif (NOT LIBPERSEUS_FOUND OR LIBPERSEUS_EXTERNAL) # apt install librtlsdr-dev # needs pkgconfig and libusb if (NOT LIBRTLSDR_FOUND OR LIBRTLSDR_EXTERNAL) - ExternalProject_Add(rtlsdr - GIT_REPOSITORY https://github.com/osmocom/rtl-sdr.git - GIT_TAG ${RTLSDR_TAG} - PREFIX "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} -DDETACH_KERNEL_DRIVER=ON -DINSTALL_UDEV_RULES=${RTLSDR_UDEV} - INSTALL_COMMAND "" - TEST_COMMAND "" - ) set(LIBRTLSDR_FOUND ON CACHE INTERNAL "") set(LIBRTLSDR_EXTERNAL ON CACHE INTERNAL "") set(LIBRTLSDR_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr/src/rtlsdr/include" CACHE INTERNAL "") set(LIBRTLSDR_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/librtlsdr.so" CACHE INTERNAL "") + ExternalProject_Add(rtlsdr + GIT_REPOSITORY https://github.com/osmocom/rtl-sdr.git + GIT_TAG ${RTLSDR_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr" + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DDETACH_KERNEL_DRIVER=ON -DINSTALL_UDEV_RULES=${RTLSDR_UDEV} + BUILD_BYPRODUCTS "${LIBRTLSDR_LIBRARIES}" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) endif (NOT LIBRTLSDR_FOUND OR LIBRTLSDR_EXTERNAL) # needs pkgconfig and libusb if (NOT LIBMIRISDR_FOUND OR LIBMIRISDR_EXTERNAL) - ExternalProject_Add(libmirisdr - GIT_REPOSITORY https://github.com/f4exb/libmirisdr-4.git - GIT_TAG ${MIRISDR_TAG} - PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libmirisdr" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} - INSTALL_COMMAND "" - TEST_COMMAND "" - ) set(LIBMIRISDR_FOUND ON CACHE INTERNAL "") set(LIBMIRISDR_EXTERNAL ON CACHE INTERNAL "") set(LIBMIRISDR_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/libmirisdr/src/libmirisdr/include" CACHE INTERNAL "") set(LIBMIRISDR_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libmirisdr.so" CACHE INTERNAL "") + ExternalProject_Add(libmirisdr + GIT_REPOSITORY https://github.com/f4exb/libmirisdr-4.git + GIT_TAG ${MIRISDR_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libmirisdr" + CMAKE_ARGS ${COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS "${LIBMIRISDR_LIBRARIES}" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) endif (NOT LIBMIRISDR_FOUND OR LIBMIRISDR_EXTERNAL) endif (LINUX) if (WIN32 OR APPLE) if (ENABLE_RTLSDR) + set(RTLSDR_LIBUSB_INCLUDE "${LIBUSB_INCLUDE_DIR}") if (WIN32) + set(LIBRTLSDR_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/rtlsdr.lib" CACHE INTERNAL "") set(RTLSDR_LIBUSB_INCLUDE "${LIBUSB_INCLUDE_DIR}/libusb-1.0") - else () - set(RTLSDR_LIBUSB_INCLUDE "${LIBUSB_INCLUDE_DIR}") endif () # needs pkgconfig and libusb ExternalProject_Add(rtlsdr @@ -479,12 +518,13 @@ if (WIN32 OR APPLE) GIT_TAG ${RTLSDR_TAG} DEPENDS ${PTHREADS4W_DEPENDS} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DINSTALL_UDEV_RULES=${RTLSDR_UDEV} -DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES} -DLIBUSB_INCLUDE_DIR=${RTLSDR_LIBUSB_INCLUDE} -DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR} -DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES} + BUILD_BYPRODUCTS "${LIBRTLSDR_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -493,7 +533,6 @@ if (WIN32 OR APPLE) set(LIBRTLSDR_EXTERNAL ON CACHE INTERNAL "") set(LIBRTLSDR_INCLUDE_DIR "${source_dir}/include" CACHE INTERNAL "") if (WIN32) - set(LIBRTLSDR_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/rtlsdr.lib" CACHE INTERNAL "") install(FILES "${SDRANGEL_BINARY_BIN_DIR}/rtlsdr${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (APPLE) set(LIBRTLSDR_LIBRARIES "${binary_dir}/src/librtlsdr${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") @@ -505,11 +544,14 @@ if (WIN32 OR APPLE) if (ENABLE_LIMESUITE) # needs pkgconfig, libusb + if (WIN32) + set(LIMESUITE_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/LimeSuite.lib" CACHE INTERNAL "") + endif () ExternalProject_Add(limesuite GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git GIT_TAG ${LIMESUITE_TAG} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/limesuite" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DLIME_SUITE_EXTVER=release -DENABLE_GUI=OFF -DENABLE_NOVENARF7=OFF @@ -519,6 +561,7 @@ if (WIN32 OR APPLE) -DENABLE_EXAMPLES=OFF -DENABLE_SIMD_FLAGS=SSE3 -DFX3_SDK_PATH=${FX3SDK_DIR} + BUILD_BYPRODUCTS "${LIMESUITE_LIBRARY}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -527,7 +570,6 @@ if (WIN32 OR APPLE) set(LIMESUITE_EXTERNAL ON CACHE INTERNAL "") set(LIMESUITE_INCLUDE_DIR "${source_dir}/src" CACHE INTERNAL "") if (WIN32) - set(LIMESUITE_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/LimeSuite.lib" CACHE INTERNAL "") install(FILES "${SDRANGEL_BINARY_BIN_DIR}/LimeSuite${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") makeCopy("${source_dir}/src/limeRFE/limeRFE.h" "${source_dir}/src/lime/limeRFE.h" limesuite) elseif (APPLE) @@ -539,14 +581,18 @@ if (WIN32 OR APPLE) endif (ENABLE_LIMESUITE) if (ENABLE_SOAPYSDR) + if (WIN32) + set(SOAPYSDR_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/SoapySDR.lib" CACHE INTERNAL "") + endif () ExternalProject_Add(soapysdr GIT_REPOSITORY https://github.com/pothosware/SoapySDR.git GIT_TAG ${SOAPYSDR_TAG} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/soapysdr" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DENABLE_PYTHON=OFF -DENABLE_PYTHON3=OFF -DENABLE_TESTS=OFF + BUILD_BYPRODUCTS "${SOAPYSDR_LIBRARY}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -555,7 +601,6 @@ if (WIN32 OR APPLE) set(SOAPYSDR_EXTERNAL ON CACHE INTERNAL "") set(SOAPYSDR_INCLUDE_DIR "${source_dir}/include" CACHE INTERNAL "") if (WIN32) - set(SOAPYSDR_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/SoapySDR.lib" CACHE INTERNAL "") install(FILES "${SDRANGEL_BINARY_BIN_DIR}/SoapySDR${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (APPLE) set(SOAPYSDR_LIBRARY "${binary_dir}/lib/libSoapySDR${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") @@ -566,10 +611,10 @@ if (WIN32 OR APPLE) endif (ENABLE_SOAPYSDR) if (ENABLE_AIRSPY) + set(AIRSPY_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}) if (WIN32) + set(LIBAIRSPY_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/airspy.lib" CACHE INTERNAL "") set(AIRSPY_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}/libusb-1.0) - else () - set(AIRSPY_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}) endif () # needs libusb, pthreads ExternalProject_Add(airspy @@ -577,11 +622,13 @@ if (WIN32 OR APPLE) GIT_TAG ${AIRSPY_TAG} DEPENDS ${PTHREADS4W_DEPENDS} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspy" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + SOURCE_SUBDIR "libairspy" + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES} -DLIBUSB_INCLUDE_DIR=${AIRSPY_LIBUSB_INCLUDE_DIR} -DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR} -DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES} + BUILD_BYPRODUCTS "${LIBAIRSPY_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -591,9 +638,8 @@ if (WIN32 OR APPLE) set(LIBAIRSPY_EXTERNAL ON CACHE INTERNAL "") set(LIBAIRSPY_INCLUDE_DIR "${source_dir}/libairspy/src" CACHE INTERNAL "") if (WIN32) - set(LIBAIRSPY_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/airspy.lib" CACHE INTERNAL "") makeCopyDir("${source_dir}/libairspy/src" "${source_dir}/libairspy/src/libairspy" airspy) - makeCopy("${binary_dir}/airspy-tools/src/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" "${SDRANGEL_BINARY_BIN_DIR}/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" airspy) + makeCopy("${binary_dir}/../airspy-tools/src/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" "${SDRANGEL_BINARY_BIN_DIR}/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" airspy) install(FILES "${SDRANGEL_BINARY_BIN_DIR}/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (APPLE) set(LIBAIRSPY_LIBRARIES "${binary_dir}/libairspy/src/libairspy${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") @@ -605,10 +651,10 @@ if (WIN32 OR APPLE) endif (ENABLE_AIRSPY) if (ENABLE_AIRSPYHF) + set(AIRSPYHF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}) if (WIN32) + set(LIBAIRSPYHF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/airspyhf.lib" CACHE INTERNAL "") set(AIRSPYHF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}/libusb-1.0) - else () - set(AIRSPYHF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}) endif () # needs pkgconfig, libusb, pthreads ExternalProject_Add(airspyhf @@ -616,11 +662,12 @@ if (WIN32 OR APPLE) GIT_TAG ${AIRSPYHF_TAG} DEPENDS ${PTHREADS4W_DEPENDS} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspyhf" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES} -DLIBUSB_INCLUDE_DIR=${AIRSPYHF_LIBUSB_INCLUDE_DIR} -DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR} -DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES} + BUILD_BYPRODUCTS "${LIBAIRSPYHF_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -630,7 +677,6 @@ if (WIN32 OR APPLE) set(LIBAIRSPYHF_EXTERNAL ON CACHE INTERNAL "") set(LIBAIRSPYHF_INCLUDE_DIR "${source_dir}/libairspyhf/src" CACHE INTERNAL "") if (WIN32) - set(LIBAIRSPYHF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/airspyhf.lib" CACHE INTERNAL "") makeCopyDir("${source_dir}/libairspyhf/src" "${source_dir}/libairspyhf/src/libairspyhf" airspyhf) install(FILES "${SDRANGEL_BINARY_BIN_DIR}/airspyhf${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (APPLE) @@ -649,6 +695,7 @@ if (WIN32 OR APPLE) # needs pkgconfig, libusb, fftw, pthreads if (WIN32) set(HACKRF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}/libusb-1.0) + set(LIBHACKRF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/hackrf.lib" CACHE INTERNAL "") else () set(HACKRF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}) endif () @@ -659,13 +706,14 @@ if (WIN32 OR APPLE) DEPENDS ${PTHREADS4W_DEPENDS} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/hackrf" SOURCE_SUBDIR "host/libhackrf" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES} -DLIBUSB_INCLUDE_DIR=${HACKRF_LIBUSB_INCLUDE_DIR} -DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR} -DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES} -DFFTW_INCLUDES=${FFTW3F_INCLUDE_DIRS} -DFFTW_LIBRARIES=${FFTW3F_LIBRARIES} + BUILD_BYPRODUCTS "${LIBHACKRF_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -675,7 +723,6 @@ if (WIN32 OR APPLE) set(LIBHACKRF_EXTERNAL ON CACHE INTERNAL "") set(LIBHACKRF_INCLUDE_DIR "${source_dir}/host/libhackrf" CACHE INTERNAL "") if (WIN32) - set(LIBHACKRF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/hackrf.lib" CACHE INTERNAL "") # include "libhackrf/hackrf.h" makeCopyDir("${source_dir}/host/libhackrf/src" "${source_dir}/host/libhackrf/libhackrf" hackrf) install(FILES "${SDRANGEL_BINARY_BIN_DIR}/hackrf${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") @@ -722,6 +769,7 @@ if (WIN32 OR APPLE) set(LIBXML2_INCLUDE_DIR "${source_dir}/include" CACHE INTERNAL "") if (WIN32) set(LIBXML2_LIBRARIES "${source_dir}/win32/bin.msvc/libxml2.lib" CACHE INTERNAL "") + set(LIBIIO_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libiio.lib" CACHE INTERNAL "") makeCopy("${source_dir}/win32/bin.msvc/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}" "${SDRANGEL_BINARY_BIN_DIR}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}" libxml2) install(FILES "${source_dir}/win32/bin.msvc/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (APPLE) @@ -736,7 +784,7 @@ if (WIN32 OR APPLE) GIT_TAG ${LIBIIO_TAG} DEPENDS ${PTHREADS4W_DEPENDS} ${LIBXML2_DEPENDS} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libiio" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES} -DLIBUSB_INCLUDE_DIR=${LIBUSB_INCLUDE_DIR} -DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR} @@ -747,6 +795,7 @@ if (WIN32 OR APPLE) -DPYTHON_BINDINGS=OFF -DWITH_MATLAB_BINDINGS_API=OFF -DOSX_PACKAGE=OFF + BUILD_BYPRODUCTS "${LIBIIO_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -756,7 +805,6 @@ if (WIN32 OR APPLE) set(LIBIIO_EXTERNAL ON CACHE INTERNAL "") set(LIBIIO_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "") if (WIN32) - set(LIBIIO_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libiio.lib" CACHE INTERNAL "") install(FILES "${SDRANGEL_BINARY_BIN_DIR}/libiio${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (APPLE) set(LIBIIO_LIBRARIES "${binary_dir}/libiio${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") @@ -771,12 +819,16 @@ if (WIN32 OR APPLE) if (ENABLE_BLADERF) # needs pkgconfig, libusb, pthreads + if (WIN32) + set(LIBBLADERF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/bladeRF.lib" CACHE INTERNAL "") + endif () ExternalProject_Add(bladerf GIT_REPOSITORY https://github.com/Nuand/bladeRF.git GIT_TAG ${BLADERF_TAG} DEPENDS ${PTHREADS4W_DEPENDS} PREFIX "${EXTERNAL_BUILD_LIBRARIES}/bladerf" - CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + SOURCE_SUBDIR "host" + CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DPKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE} -DENABLE_BACKEND_USB=ON -DENABLE_BACKEND_LIBUSB=ON @@ -790,6 +842,7 @@ if (WIN32 OR APPLE) -DENABLE_HOST_BUILD=ON -DENABLE_BACKEND_CYAPI=OFF -DTREAT_WARNINGS_AS_ERRORS=OFF + BUILD_BYPRODUCTS "${LIBBLADERF_LIBRARIES}" INSTALL_COMMAND "" TEST_COMMAND "" ) @@ -799,7 +852,6 @@ if (WIN32 OR APPLE) set(LIBBLADERF_EXTERNAL ON CACHE INTERNAL "") set(LIBBLADERF_INCLUDE_DIRS "${source_dir}/host/libraries/libbladeRF/include" CACHE INTERNAL "") if (WIN32) - set(LIBBLADERF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/bladeRF.lib" CACHE INTERNAL "") install(FILES "${SDRANGEL_BINARY_BIN_DIR}/bladeRF${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") elseif (APPLE) set(LIBBLADERF_LIBRARIES "${binary_dir}/host/output/libbladeRF${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") diff --git a/external/windows b/external/windows index f781c2fa4..a47e94ace 160000 --- a/external/windows +++ b/external/windows @@ -1 +1 @@ -Subproject commit f781c2fa49717ff509fdb82eb50c1c55bd64b41d +Subproject commit a47e94ace126e9562fdc58d27fce95412e10d932 diff --git a/flatpak/org.sdrangel.SDRangel.json b/flatpak/org.sdrangel.SDRangel.json index 523b7c3bb..a7f6bbc1f 100644 --- a/flatpak/org.sdrangel.SDRangel.json +++ b/flatpak/org.sdrangel.SDRangel.json @@ -14,7 +14,8 @@ "--share=ipc", "--socket=pulseaudio", "--socket=x11", - "--socket=wayland" + "--socket=wayland", + "--env=QT_QPA_PLATFORM=xcb" ], "modules": [ { diff --git a/httpserver/httpconnectionhandler.h b/httpserver/httpconnectionhandler.h index 00cdd943d..5ced8ca76 100644 --- a/httpserver/httpconnectionhandler.h +++ b/httpserver/httpconnectionhandler.h @@ -23,7 +23,7 @@ namespace qtwebapp { /** Alias type definition, for compatibility to different Qt versions */ -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) typedef qintptr tSocketDescriptor; #else typedef int tSocketDescriptor; diff --git a/logging/logger.cpp b/logging/logger.cpp index fca4a307f..a608fad54 100644 --- a/logging/logger.cpp +++ b/logging/logger.cpp @@ -73,7 +73,7 @@ void Logger::msgHandler(const QtMsgType type, const QString &message, const QStr } -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) void Logger::msgHandler5(const QtMsgType type, const QMessageLogContext &context, const QString &message) { (void)(context); // suppress "unused parameter" warning @@ -91,7 +91,7 @@ Logger::~Logger() { if (defaultLogger==this) { -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) qInstallMessageHandler(0); #else qInstallMsgHandler(0); @@ -111,7 +111,7 @@ void Logger::write(const LogMessage* logMessage) void Logger::installMsgHandler() { defaultLogger=this; -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) qInstallMessageHandler(msgHandler5); #else qInstallMsgHandler(msgHandler4); diff --git a/plugins/channelrx/chanalyzer/CMakeLists.txt b/plugins/channelrx/chanalyzer/CMakeLists.txt index 942f94311..ea6f44267 100644 --- a/plugins/channelrx/chanalyzer/CMakeLists.txt +++ b/plugins/channelrx/chanalyzer/CMakeLists.txt @@ -22,10 +22,7 @@ set(chanalyzer_HEADERS ) include_directories( - ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client -) - -include_directories( + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client ${Boost_INCLUDE_DIRS} ) diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.cpp b/plugins/channelrx/demodadsb/adsbdemodgui.cpp index 9d9fffd87..d069f1adc 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodgui.cpp @@ -16,7 +16,6 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES #include #include "device/deviceuiset.h" diff --git a/plugins/channelrx/demodatv/CMakeLists.txt b/plugins/channelrx/demodatv/CMakeLists.txt index 52bb83c9c..570c6180a 100644 --- a/plugins/channelrx/demodatv/CMakeLists.txt +++ b/plugins/channelrx/demodatv/CMakeLists.txt @@ -22,8 +22,8 @@ set(atv_HEADERS ) include_directories( - ${Boost_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${Boost_INCLUDE_DIRS} ) add_library(demodatv SHARED diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index aa317de4e..d699f6389 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -523,8 +523,7 @@ void BFMDemodGUI::tick() ui->channelPower->setText(QString::number(powDbAvg, 'f', 1)); Real pilotPowDb = CalcDb::dbPower(m_bfmDemod->getPilotLevel()); - QString pilotPowDbStr; - pilotPowDbStr.sprintf("%+02.1f", pilotPowDb); + QString pilotPowDbStr = QString("%1%2").arg(pilotPowDb < 0 ? '-' : '+').arg(pilotPowDb, 3, 'f', 1, QLatin1Char('0')); ui->pilotPower->setText(pilotPowDbStr); if (m_bfmDemod->getAudioSampleRate() < 0) diff --git a/plugins/channelrx/demodbfm/rdsdemod.cpp b/plugins/channelrx/demodbfm/rdsdemod.cpp index 14d989c86..c14a3ed09 100644 --- a/plugins/channelrx/demodbfm/rdsdemod.cpp +++ b/plugins/channelrx/demodbfm/rdsdemod.cpp @@ -19,15 +19,10 @@ #include "../../channelrx/demodbfm/rdsdemod.h" #include -#include +#include #include #include -#undef M_PI -#define M_PI 3.14159265358979323846 -#undef M_PI_2 -#define M_PI_2 1.57079632679489661923 - const Real RDSDemod::m_pllBeta = 50; const Real RDSDemod::m_fsc = 1187.5; diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index 7e0ca3c11..e8170bbd1 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -670,19 +670,20 @@ void DATVDemodGUI::on_udpTS_clicked(bool checked) void DATVDemodGUI::on_StreamMetaDataChanged(DataTSMetaData2 *objMetaData) { - QString strMetaData=""; if (objMetaData != nullptr) { + QString strMetaData = ""; + if (objMetaData->OK_TransportStream == true) { - strMetaData.sprintf("PID: %d - Width: %d - Height: %d\r\n%s%s\r\nCodec: %s\r\n", - objMetaData->PID, - objMetaData->Width, - objMetaData->Height, - objMetaData->Program.toStdString().c_str(), - objMetaData->Stream.toStdString().c_str(), - objMetaData->CodecDescription.toStdString().c_str()); + strMetaData = tr("PID: %1 - Width: %2 - Height: %3\r\n%4%5\r\nCodec: %6\r\n") + .arg(objMetaData->PID) + .arg(objMetaData->Width) + .arg(objMetaData->Height) + .arg(objMetaData->Program) + .arg(objMetaData->Stream) + .arg(objMetaData->CodecDescription); } ui->streamInfo->setText(strMetaData); diff --git a/plugins/channelrx/demoddatv/leansdr/dvb.h b/plugins/channelrx/demoddatv/leansdr/dvb.h index 66676f536..cedb8463c 100644 --- a/plugins/channelrx/demoddatv/leansdr/dvb.h +++ b/plugins/channelrx/demoddatv/leansdr/dvb.h @@ -17,17 +17,14 @@ #ifndef LEANSDR_DVB_H #define LEANSDR_DVB_H -#include +#include +#include #include "leansdr/convolutional.h" #include "leansdr/rs.h" #include "leansdr/sdr.h" #include "leansdr/viterbi.h" -#ifndef M_PI -# define M_PI 3.14159265358979323846 -#endif - namespace leansdr { diff --git a/plugins/channelrx/demoddatv/leansdr/math.h b/plugins/channelrx/demoddatv/leansdr/math.h index 24fba2406..64bcbaaca 100644 --- a/plugins/channelrx/demoddatv/leansdr/math.h +++ b/plugins/channelrx/demoddatv/leansdr/math.h @@ -17,13 +17,9 @@ #ifndef LEANSDR_MATH_H #define LEANSDR_MATH_H -#include +#include #include -#ifndef M_PI -# define M_PI 3.14159265358979323846 -#endif - namespace leansdr { diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index a7e9dc72f..ec1cfa69c 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -126,8 +126,8 @@ void NFMDemodGUI::on_afBW_valueChanged(int value) void NFMDemodGUI::on_volume_valueChanged(int value) { - ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1)); - m_settings.m_volume = value / 10.0; + ui->volumeText->setText(QString("%1").arg(value)); + m_settings.m_volume = value / 100.0; applySettings(); } @@ -368,8 +368,8 @@ void NFMDemodGUI::displaySettings() ui->afBWText->setText(QString("%1 k").arg(m_settings.m_afBandwidth / 1000.0)); ui->afBW->setValue(m_settings.m_afBandwidth / 1000.0); - ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1)); - ui->volume->setValue(m_settings.m_volume * 10.0); + ui->volumeText->setText(QString("%1").arg(m_settings.m_volume*100.0, 0, 'f', 0)); + ui->volume->setValue(m_settings.m_volume * 100.0); ui->squelchGateText->setText(QString("%1").arg(m_settings.m_squelchGate * 10.0f, 0, 'f', 0)); ui->squelchGate->setValue(m_settings.m_squelchGate); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.ui b/plugins/channelrx/demodnfm/nfmdemodgui.ui index d7cb4820c..8d3eb29f8 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.ui +++ b/plugins/channelrx/demodnfm/nfmdemodgui.ui @@ -336,16 +336,19 @@ - Sound volume + Sound volume (%) - 40 + 200 + + + 1 1 - 10 + 100 @@ -364,10 +367,10 @@ - Sound volume + Sound volume (%) - 1.0 + 100 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/plugins/channelrx/demodnfm/nfmdemodsettings.cpp b/plugins/channelrx/demodnfm/nfmdemodsettings.cpp index 55fb412c2..de5c3479a 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsettings.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodsettings.cpp @@ -23,13 +23,15 @@ #include "nfmdemodsettings.h" +// fixed |Carson (3k) |Carson (6k) +// | 11F3 16F3 | const int NFMDemodSettings::m_rfBW[] = { - 5000, 6250, 8330, 10000, 12500, 15000, 20000, 25000, 40000 + 5000, 6250, 8330, 11000, 16000, 20000, 25000, 40000 }; -const int NFMDemodSettings::m_fmDev[] = { // corresponding single side FM deviations at 0.4 * BW - 2000, 2500, 3330, 4000, 5000, 6000, 8000, 10000, 16000 +const int NFMDemodSettings::m_fmDev[] = { + 2500, 2500, 3330, 5000, 10000, 14000, 19000, 28000 }; -const int NFMDemodSettings::m_nbRfBW = 9; +const int NFMDemodSettings::m_nbRfBW = 8; NFMDemodSettings::NFMDemodSettings() : m_channelMarker(0) diff --git a/plugins/channelrx/demodnfm/nfmdemodsink.cpp b/plugins/channelrx/demodnfm/nfmdemodsink.cpp index d51f02f0f..8b39e1d7a 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsink.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodsink.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include +#include #include #include @@ -27,6 +27,7 @@ #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "dsp/devicesamplemimo.h" +#include "dsp/misc.h" #include "device/deviceapi.h" #include "nfmdemodreport.h" @@ -58,6 +59,7 @@ NFMDemodSink::NFMDemodSink() : { m_agcLevel = 1.0; m_audioBuffer.resize(1<<16); + m_phaseDiscri.setFMScaling(0.5f); applySettings(m_settings, true); applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true); @@ -171,12 +173,13 @@ void NFMDemodSink::processOneSample(Complex &ci) } } - if (!m_settings.m_audioMute && (m_settings.m_ctcssOn && m_ctcssIndexSelected == ctcssIndex || m_ctcssIndexSelected == 0)) + if (!m_settings.m_audioMute && (!m_settings.m_ctcssOn || m_ctcssIndexSelected == ctcssIndex || m_ctcssIndexSelected == 0)) { Real audioSample = m_squelchDelayLine.readBack(m_squelchGate); audioSample = m_settings.m_highPass ? m_bandpass.filter(audioSample) : m_lowpass.filter(audioSample); - audioSample *= m_settings.m_volume * m_filterTaps; - sample = std::lrint(audioSample); + + audioSample *= m_settings.m_volume * std::numeric_limits::max(); + sample = clamp(std::rint(audioSample), std::numeric_limits::lowest(), std::numeric_limits::max()); } } @@ -260,7 +263,7 @@ void NFMDemodSink::applySettings(const NFMDemodSettings& settings, bool force) if ((settings.m_fmDeviation != m_settings.m_fmDeviation) || force) { - m_phaseDiscri.setFMScaling((8.0f*m_audioSampleRate) / static_cast(settings.m_fmDeviation)); // integrate 4x factor + m_phaseDiscri.setFMScaling((0.5f *m_audioSampleRate) / static_cast(settings.m_fmDeviation)); // integrate 4x factor } if ((settings.m_afBandwidth != m_settings.m_afBandwidth) || force) @@ -324,7 +327,7 @@ void NFMDemodSink::applyAudioSampleRate(unsigned int sampleRate) m_afSquelch.setCoefficients(sampleRate/2000, 600, sampleRate, 200, 0, afSqTones); // 0.5ms test period, 300ms average span, audio SR, 100ms attack, no decay } - m_phaseDiscri.setFMScaling((8.0f*sampleRate) / static_cast(m_settings.m_fmDeviation)); // integrate 4x factor + m_phaseDiscri.setFMScaling((0.5f * sampleRate) / static_cast(m_settings.m_fmDeviation)); m_audioFifo.setSize(sampleRate); m_squelchDelayLine.resize(sampleRate/2); m_interpolatorDistanceRemain = 0; diff --git a/plugins/channelrx/demodnfm/nfmdemodsink.h b/plugins/channelrx/demodnfm/nfmdemodsink.h index 74c8dc469..bca38c93c 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsink.h +++ b/plugins/channelrx/demodnfm/nfmdemodsink.h @@ -139,39 +139,6 @@ private: void processOneSample(Complex &ci); MessageQueue *getMessageQueueToGUI() { return m_messageQueueToGUI; } - - inline float arctan2(Real y, Real x) - { - Real coeff_1 = M_PI / 4; - Real coeff_2 = 3 * coeff_1; - Real abs_y = fabs(y) + 1e-10; // kludge to prevent 0/0 condition - Real angle; - if( x>= 0) { - Real r = (x - abs_y) / (x + abs_y); - angle = coeff_1 - coeff_1 * r; - } else { - Real r = (x + abs_y) / (abs_y - x); - angle = coeff_2 - coeff_1 * r; - } - if(y < 0) { - return(-angle); - } else { - return(angle); - } - } - - inline Real angleDist(Real a, Real b) - { - Real dist = b - a; - - while(dist <= M_PI) - dist += 2 * M_PI; - while(dist >= M_PI) - dist -= 2 * M_PI; - - return dist; - } - }; #endif // INCLUDE_NFMDEMODSINK_H diff --git a/plugins/channelrx/demodnfm/nfmplugin.cpp b/plugins/channelrx/demodnfm/nfmplugin.cpp index d0827fb11..c130c1b0a 100644 --- a/plugins/channelrx/demodnfm/nfmplugin.cpp +++ b/plugins/channelrx/demodnfm/nfmplugin.cpp @@ -12,7 +12,7 @@ const PluginDescriptor NFMPlugin::m_pluginDescriptor = { NFMDemod::m_channelId, QString("NFM Demodulator"), - QString("4.21.1"), + QString("4.21.2"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channelrx/demodnfm/readme.md b/plugins/channelrx/demodnfm/readme.md index 92f0b8021..f16fa47c8 100644 --- a/plugins/channelrx/demodnfm/readme.md +++ b/plugins/channelrx/demodnfm/readme.md @@ -24,7 +24,16 @@ Average total power in dB relative to a +/- 1.0 amplitude signal received in the

4: RF bandwidth

-This is the bandwidth in kHz of the channel signal before demodulation. It can be set in steps as 5, 6.25, 8.33, 10, 12.5, 15, 20, 25 and 40 kHz. The expected one side frequency deviation is 0.4 times the bandwidth. +This is the bandwidth in kHz of the channel signal before demodulation. It can take these values with the corresponding nominal frequency deviation: + + - **5** kHz: ± 1.25 kHz + - **6.25** kHz: ± 1.25 kHz + - **8.33** kHz: ± 1.67 kHz + - **11** kHz: ± 2.5 kHz (11F3) + - **16** kHz: ± 5 kHz (16F3) + - **20** kHz: ± 7 kHz + - **25** kHz: ± 9.5 kHz + - **40** kHz: ± 14 kHz ☞ The demodulation is done at the channel sample rate which is guaranteed not to be lower than the requested audio sample rate but can possibly be equal to it. This means that for correct operation in any case you must ensure that the sample rate of the audio device is not lower than the Nyquist rate required to process this channel bandwidth. @@ -36,7 +45,7 @@ This is the bandwidth of the audio signal in kHz (i.e. after demodulation). It c

6: Volume

-This is the volume of the audio signal from 0.0 (mute) to 4.0 (maximum). It can be varied continuously in 0.1 steps using the dial button. +This is the volume of the audio signal from 0% (mute) to 200% (maximum) of volume at nominal frequency deviation. It can be varied continuously 1% steps using the dial button.

7: Delta/Level squelch

diff --git a/plugins/channelrx/filesink/CMakeLists.txt b/plugins/channelrx/filesink/CMakeLists.txt index 867275a07..6f230ca76 100644 --- a/plugins/channelrx/filesink/CMakeLists.txt +++ b/plugins/channelrx/filesink/CMakeLists.txt @@ -22,7 +22,7 @@ set(filesink_HEADERS include_directories( ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client - ${Boost_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} ) if(NOT SERVER_MODE) diff --git a/plugins/channelrx/localsink/CMakeLists.txt b/plugins/channelrx/localsink/CMakeLists.txt index b5632ae4c..f03b740aa 100644 --- a/plugins/channelrx/localsink/CMakeLists.txt +++ b/plugins/channelrx/localsink/CMakeLists.txt @@ -22,7 +22,7 @@ set(localsink_HEADERS include_directories( ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client - ${Boost_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} ) if(NOT SERVER_MODE) diff --git a/plugins/channelrx/remotesink/CMakeLists.txt b/plugins/channelrx/remotesink/CMakeLists.txt index 64713e86d..fe6c61b3f 100644 --- a/plugins/channelrx/remotesink/CMakeLists.txt +++ b/plugins/channelrx/remotesink/CMakeLists.txt @@ -33,9 +33,9 @@ set(remotesink_HEADERS include_directories( ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client - ${Boost_INCLUDE_DIRS} ${CM256CC_INCLUDE_DIR} ${CUSTOM_WINDOWS_INCLUDE} + ${Boost_INCLUDE_DIRS} ) if(NOT SERVER_MODE) diff --git a/plugins/channeltx/mod802.15.4/CMakeLists.txt b/plugins/channeltx/mod802.15.4/CMakeLists.txt index 11dd722f6..072a6adb2 100644 --- a/plugins/channeltx/mod802.15.4/CMakeLists.txt +++ b/plugins/channeltx/mod802.15.4/CMakeLists.txt @@ -20,8 +20,8 @@ set(mod_ieee_802_15_4_HEADERS ) include_directories( - ${Boost_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${Boost_INCLUDE_DIRS} ) if(NOT SERVER_MODE) diff --git a/plugins/channeltx/modnfm/nfmmodgui.ui b/plugins/channeltx/modnfm/nfmmodgui.ui index e154043a8..ea064368f 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.ui +++ b/plugins/channeltx/modnfm/nfmmodgui.ui @@ -299,7 +299,7 @@ Modulation percentage
- 250 + 300 1 @@ -827,29 +827,29 @@
gui/rollupwidget.h
1 + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
+ + ValueDialZ + QWidget +
gui/valuedialz.h
+ 1 +
LevelMeterVU QWidget
gui/levelmeter.h
1
- - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
CWKeyerGUI QWidget
gui/cwkeyergui.h
1
- - ValueDialZ - QWidget -
gui/valuedialz.h
- 1 -
diff --git a/plugins/channeltx/modnfm/nfmmodplugin.cpp b/plugins/channeltx/modnfm/nfmmodplugin.cpp index 2a5065c4b..96e9f824f 100644 --- a/plugins/channeltx/modnfm/nfmmodplugin.cpp +++ b/plugins/channeltx/modnfm/nfmmodplugin.cpp @@ -28,7 +28,7 @@ const PluginDescriptor NFMModPlugin::m_pluginDescriptor = { NFMMod::m_channelId, QString("NFM Modulator"), - QString("4.21.1"), + QString("4.21.2"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/modnfm/nfmmodsource.cpp b/plugins/channeltx/modnfm/nfmmodsource.cpp index bc0d5e0c1..6ed08b9dd 100644 --- a/plugins/channeltx/modnfm/nfmmodsource.cpp +++ b/plugins/channeltx/modnfm/nfmmodsource.cpp @@ -134,11 +134,10 @@ void NFMModSource::modulateSample() calculateLevel(t); m_audioBufferFill++; - // 0.625 = 1/1.25 (heuristic) if (m_settings.m_ctcssOn) { - m_modPhasor += (m_settings.m_fmDeviation / (float) m_audioSampleRate) * (0.85f * m_bandpass.filter(t) + 0.15f * 0.625f * m_ctcssNco.next()) * (M_PI / 0.625f); + m_modPhasor += (m_settings.m_fmDeviation / (float) m_audioSampleRate) * (0.85f * m_bandpass.filter(t) + 0.15f * 0.625f * m_ctcssNco.next()) * 1.33f; } else { - m_modPhasor += (m_settings.m_fmDeviation / (float) m_audioSampleRate) * m_bandpass.filter(t) * (M_PI / 0.625f); + m_modPhasor += (m_settings.m_fmDeviation / (float) m_audioSampleRate) * m_bandpass.filter(t) * 1.33f; } // limit phasor range to ]-pi,pi] diff --git a/plugins/channeltx/modnfm/readme.md b/plugins/channeltx/modnfm/readme.md index 22139d828..f03bacb39 100644 --- a/plugins/channeltx/modnfm/readme.md +++ b/plugins/channeltx/modnfm/readme.md @@ -30,7 +30,7 @@ This is the bandwidth in khz of the modulating signal filtered before modulation

7: Frequency deviation

-Adjusts the frequency deviation in 0.1 kHz steps from 0 to 25 kHz +Adjusts the frequency deviation in 0.1 kHz steps from 0 to 30 kHz. This is the full deviation.

8: Volume

diff --git a/plugins/channeltx/modpacket/packetmodbpfdialog.cpp b/plugins/channeltx/modpacket/packetmodbpfdialog.cpp index c318d0658..0f7032f9c 100644 --- a/plugins/channeltx/modpacket/packetmodbpfdialog.cpp +++ b/plugins/channeltx/modpacket/packetmodbpfdialog.cpp @@ -15,7 +15,6 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES #include #include "packetmodbpfdialog.h" #include "ui_packetmodbpfdialog.h" diff --git a/plugins/channeltx/remotesource/CMakeLists.txt b/plugins/channeltx/remotesource/CMakeLists.txt index 3bf447dc2..ec483a4e7 100644 --- a/plugins/channeltx/remotesource/CMakeLists.txt +++ b/plugins/channeltx/remotesource/CMakeLists.txt @@ -31,9 +31,9 @@ set(remotesource_HEADERS include_directories( ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client - ${Boost_INCLUDE_DIRS} ${CM256CC_INCLUDE_DIR} ${CUSTOM_WINDOWS_INCLUDE} + ${Boost_INCLUDE_DIRS} ) if(NOT SERVER_MODE) diff --git a/plugins/channeltx/remotesource/remotesourcegui.cpp b/plugins/channeltx/remotesource/remotesourcegui.cpp index df8e8af74..b2d23c49e 100644 --- a/plugins/channeltx/remotesource/remotesourcegui.cpp +++ b/plugins/channeltx/remotesource/remotesourcegui.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include "remotesourcegui.h" +#include #include "device/deviceapi.h" #include "device/deviceuiset.h" @@ -26,6 +26,8 @@ #include "remotesource.h" #include "ui_remotesourcegui.h" +#include "remotesourcegui.h" + RemoteSourceGUI* RemoteSourceGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx) { RemoteSourceGUI* gui = new RemoteSourceGUI(pluginAPI, deviceUISet, channelTx); diff --git a/plugins/channeltx/remotesource/remotesourcegui.h b/plugins/channeltx/remotesource/remotesourcegui.h index 1a4faf9b1..bcd66a805 100644 --- a/plugins/channeltx/remotesource/remotesourcegui.h +++ b/plugins/channeltx/remotesource/remotesourcegui.h @@ -18,7 +18,7 @@ #ifndef PLUGINS_CHANNELTX_REMOTESRC_REMOTESRCGUI_H_ #define PLUGINS_CHANNELTX_REMOTESRC_REMOTESRCGUI_H_ -#include +#include #include "dsp/channelmarker.h" #include "channel/channelgui.h" @@ -69,7 +69,7 @@ private: uint32_t m_lastSampleCount; uint64_t m_lastTimestampUs; bool m_resetCounts; - QTime m_time; + QElapsedTimer m_time; uint32_t m_tickCount; explicit RemoteSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget* parent = 0); diff --git a/plugins/samplesink/fileoutput/fileoutputworker.cpp b/plugins/samplesink/fileoutput/fileoutputworker.cpp index d31e6589a..99644b0db 100644 --- a/plugins/samplesink/fileoutput/fileoutputworker.cpp +++ b/plugins/samplesink/fileoutput/fileoutputworker.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -39,7 +38,6 @@ FileOutputWorker::FileOutputWorker(std::ofstream *samplesStream, SampleSourceFif m_throttleToggle(false), m_buf(nullptr) { - assert(m_ofstream != nullptr); } FileOutputWorker::~FileOutputWorker() diff --git a/plugins/samplesink/localoutput/localoutputgui.cpp b/plugins/samplesink/localoutput/localoutputgui.cpp index 3b9cd6490..6e9f91234 100644 --- a/plugins/samplesink/localoutput/localoutputgui.cpp +++ b/plugins/samplesink/localoutput/localoutputgui.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/plugins/samplesink/remoteoutput/CMakeLists.txt b/plugins/samplesink/remoteoutput/CMakeLists.txt index 3bf7c60a9..e731370f2 100644 --- a/plugins/samplesink/remoteoutput/CMakeLists.txt +++ b/plugins/samplesink/remoteoutput/CMakeLists.txt @@ -34,8 +34,8 @@ set(remoteoutput_HEADERS include_directories( ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client ${CMAKE_SOURCE_DIR}/devices - ${Boost_INCLUDE_DIRS} ${CM256CC_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} ) if(NOT SERVER_MODE) diff --git a/plugins/samplesink/remoteoutput/remoteoutputworker.cpp b/plugins/samplesink/remoteoutput/remoteoutputworker.cpp index a1a88c31b..e295bf7d4 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputworker.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputworker.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include diff --git a/plugins/samplesink/testsink/testsinkworker.cpp b/plugins/samplesink/testsink/testsinkworker.cpp index 4d59aa0a2..6eb9c11ab 100644 --- a/plugins/samplesink/testsink/testsinkworker.cpp +++ b/plugins/samplesink/testsink/testsinkworker.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -225,4 +224,4 @@ void TestSinkWorker::feedSpectrum(int16_t *buf, unsigned int bufSize) ); m_spectrumSink->feed(m_samplesVector.m_vector.begin(), m_samplesVector.m_vector.begin() + (bufSize/2), false); -} \ No newline at end of file +} diff --git a/plugins/samplesink/usrpoutput/CMakeLists.txt b/plugins/samplesink/usrpoutput/CMakeLists.txt index 7e05dbb9a..3fc09108f 100644 --- a/plugins/samplesink/usrpoutput/CMakeLists.txt +++ b/plugins/samplesink/usrpoutput/CMakeLists.txt @@ -1,7 +1,3 @@ -if(WIN32) - link_directories(${BOOST_LIBRARYDIR}) -endif() - project(usrpoutput) set(usrpoutput_SOURCES diff --git a/plugins/samplesource/fileinput/fileinputworker.cpp b/plugins/samplesource/fileinput/fileinputworker.cpp index 4c2e67523..f1b61f75d 100644 --- a/plugins/samplesource/fileinput/fileinputworker.cpp +++ b/plugins/samplesource/fileinput/fileinputworker.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include "dsp/filerecord.h" @@ -49,7 +48,6 @@ FileInputWorker::FileInputWorker(std::ifstream *samplesStream, m_throttlems(FILESOURCE_THROTTLE_MS), m_throttleToggle(false) { - assert(m_ifstream != nullptr); } FileInputWorker::~FileInputWorker() diff --git a/plugins/samplesource/kiwisdr/CMakeLists.txt b/plugins/samplesource/kiwisdr/CMakeLists.txt index 8ffdb9fa9..272344470 100644 --- a/plugins/samplesource/kiwisdr/CMakeLists.txt +++ b/plugins/samplesource/kiwisdr/CMakeLists.txt @@ -18,7 +18,7 @@ set(kiwisdr_HEADERS include_directories( ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client - ${Boost_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} ) if(NOT SERVER_MODE) @@ -55,4 +55,4 @@ target_link_libraries(${TARGET_NAME} ${TARGET_LIB_GUI} ) -install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) \ No newline at end of file +install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) diff --git a/plugins/samplesource/kiwisdr/kiwisdrplugin.cpp b/plugins/samplesource/kiwisdr/kiwisdrplugin.cpp index 6da771d85..fb93b2b78 100644 --- a/plugins/samplesource/kiwisdr/kiwisdrplugin.cpp +++ b/plugins/samplesource/kiwisdr/kiwisdrplugin.cpp @@ -32,7 +32,7 @@ const PluginDescriptor KiwiSDRPlugin::m_pluginDescriptor = { QString("KiwiSDR"), QString("KiwiSDR input"), - QString("4.19.0"), + QString("4.21.2"), QString("(c) Vort (c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/samplesource/kiwisdr/kiwisdrworker.cpp b/plugins/samplesource/kiwisdr/kiwisdrworker.cpp index 614454d94..ad93db7dd 100644 --- a/plugins/samplesource/kiwisdr/kiwisdrworker.cpp +++ b/plugins/samplesource/kiwisdr/kiwisdrworker.cpp @@ -86,8 +86,7 @@ void KiwiSDRWorker::onBinaryMessageReceived(const QByteArray &message) if (message[0] == 'M' && message[1] == 'S' && message[2] == 'G') { QStringList al = QString::fromUtf8(message).split(' '); - if (al[1] == "audio_init=0" && - al[2] == "audio_rate=12000") + if (al.size() > 2 && al[2] == "audio_rate=12000") { m_webSocket.sendTextMessage("SET AR OK in=12000 out=48000"); m_webSocket.sendTextMessage("SERVER DE CLIENT KiwiAngel SND"); @@ -157,4 +156,4 @@ void KiwiSDRWorker::onServerAddressChanged(QString serverAddress) void KiwiSDRWorker::tick() { m_webSocket.sendTextMessage("SET keepalive"); -} \ No newline at end of file +} diff --git a/plugins/samplesource/localinput/localinputgui.cpp b/plugins/samplesource/localinput/localinputgui.cpp index a1f4d1e17..59ebb35b1 100644 --- a/plugins/samplesource/localinput/localinputgui.cpp +++ b/plugins/samplesource/localinput/localinputgui.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/plugins/samplesource/remoteinput/CMakeLists.txt b/plugins/samplesource/remoteinput/CMakeLists.txt index eb1b83715..3041e77b5 100644 --- a/plugins/samplesource/remoteinput/CMakeLists.txt +++ b/plugins/samplesource/remoteinput/CMakeLists.txt @@ -29,8 +29,8 @@ set(remoteinput_HEADERS include_directories( ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client - ${Boost_INCLUDE_DIRS} ${CM256CC_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} ) if(NOT SERVER_MODE) diff --git a/plugins/samplesource/remoteinput/remoteinputbuffer.cpp b/plugins/samplesource/remoteinput/remoteinputbuffer.cpp index 948733fec..6f070e09e 100644 --- a/plugins/samplesource/remoteinput/remoteinputbuffer.cpp +++ b/plugins/samplesource/remoteinput/remoteinputbuffer.cpp @@ -16,7 +16,6 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include #include #include diff --git a/plugins/samplesource/remoteinput/remoteinputgui.cpp b/plugins/samplesource/remoteinput/remoteinputgui.cpp index df1b10cae..dc73951fc 100644 --- a/plugins/samplesource/remoteinput/remoteinputgui.cpp +++ b/plugins/samplesource/remoteinput/remoteinputgui.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/plugins/samplesource/sdrplay/sdrplaygui.cpp b/plugins/samplesource/sdrplay/sdrplaygui.cpp index 1cab3c0c1..a214a0b54 100644 --- a/plugins/samplesource/sdrplay/sdrplaygui.cpp +++ b/plugins/samplesource/sdrplay/sdrplaygui.cpp @@ -144,16 +144,14 @@ bool SDRPlayGui::handleMessage(const Message& message) ui->gainMixer->setChecked(msg.getMixerGain() != 0); ui->gainBaseband->setValue(msg.getBasebandGain()); - QString gainText; - gainText.sprintf("%02d", msg.getBasebandGain()); + QString gainText = QStringLiteral("%1").arg(msg.getBasebandGain(), 2, 10, QLatin1Char('0')); ui->gainBasebandText->setText(gainText); } else { ui->gainTuner->setValue(msg.getTunerGain()); - QString gainText; - gainText.sprintf("%03d", msg.getTunerGain()); + QString gainText = QStringLiteral("%1").arg(msg.getTunerGain(), 3, 10, QLatin1Char('0')); ui->gainTunerText->setText(gainText); } @@ -241,8 +239,7 @@ void SDRPlayGui::displaySettings() int gain = m_settings.m_tunerGain; ui->gainTuner->setValue(gain); - QString gainText; - gainText.sprintf("%03d", gain); + QString gainText = QStringLiteral("%1").arg(gain, 3, 10, QLatin1Char('0')); ui->gainTunerText->setText(gainText); m_settings.m_tunerGain = gain; } @@ -258,8 +255,7 @@ void SDRPlayGui::displaySettings() int gain = m_settings.m_basebandGain; ui->gainBaseband->setValue(gain); - QString gainText; - gainText.sprintf("%02d", gain); + QString gainText = QStringLiteral("%1").arg(gain, 2, 10, QLatin1Char('0')); ui->gainBasebandText->setText(gainText); } } @@ -393,9 +389,7 @@ void SDRPlayGui::on_gainTunerOn_toggled(bool checked) void SDRPlayGui::on_gainTuner_valueChanged(int value) { int gain = value; - QString gainText; - gainText.sprintf("%03d", gain); - ui->gainTunerText->setText(gainText); + QString gainText = QStringLiteral("%1").arg(gain, 3, 10, QLatin1Char('0')); m_settings.m_tunerGain = gain; sendSettings(); @@ -429,8 +423,7 @@ void SDRPlayGui::on_gainBaseband_valueChanged(int value) { m_settings.m_basebandGain = value; - QString gainText; - gainText.sprintf("%02d", value); + QString gainText = QStringLiteral("%1").arg(value, 2, 10, QLatin1Char('0')); ui->gainBasebandText->setText(gainText); sendSettings(); diff --git a/plugins/samplesource/testsource/testsourceworker.cpp b/plugins/samplesource/testsource/testsourceworker.cpp index 188f7f704..4da7a74e0 100644 --- a/plugins/samplesource/testsource/testsourceworker.cpp +++ b/plugins/samplesource/testsource/testsourceworker.cpp @@ -15,9 +15,8 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES -#include -#include +#include +#include #include #include "testsourceworker.h" diff --git a/plugins/samplesource/usrpinput/CMakeLists.txt b/plugins/samplesource/usrpinput/CMakeLists.txt index a3f495bf1..948232fb8 100644 --- a/plugins/samplesource/usrpinput/CMakeLists.txt +++ b/plugins/samplesource/usrpinput/CMakeLists.txt @@ -1,7 +1,3 @@ -if(WIN32) - link_directories(${BOOST_LIBRARYDIR}) -endif() - project(usrpinput) set(usrpinput_SOURCES diff --git a/sdrbase/ambe/ambeengine.cpp b/sdrbase/ambe/ambeengine.cpp index 03e4eec63..8c56c4ec3 100644 --- a/sdrbase/ambe/ambeengine.cpp +++ b/sdrbase/ambe/ambeengine.cpp @@ -27,7 +27,7 @@ #include #endif -#if !defined(__WINDOWS__) && !defined(__APPLE__) +#if !defined(_WIN32) && !defined(__APPLE__) #include #include #include @@ -51,7 +51,7 @@ AMBEEngine::~AMBEEngine() qDebug("AMBEEngine::~AMBEEngine: %lu controllers", m_controllers.size()); } -#if defined(__WINDOWS__) +#if defined(_WIN32) void AMBEEngine::getComList() { m_comList.clear(); @@ -119,7 +119,7 @@ void AMBEEngine::getComList() } #endif // not Windows nor Apple -#if !defined(__WINDOWS__) && !defined(__APPLE__) +#if !defined(_WIN32) && !defined(__APPLE__) void AMBEEngine::register_comport( std::vector& comList, std::vector& comList8250, diff --git a/sdrbase/ambe/ambeengine.h b/sdrbase/ambe/ambeengine.h index 59c16291f..f083d17b7 100644 --- a/sdrbase/ambe/ambeengine.h +++ b/sdrbase/ambe/ambeengine.h @@ -73,7 +73,7 @@ private: std::string device; }; -#ifndef __WINDOWS__ +#ifndef _WIN32 static std::string get_driver(const std::string& tty); static void register_comport(std::vector& comList, std::vector& comList8250, const std::string& dir); static void probe_serial8250_comports(std::vector& comList, std::vector comList8250); diff --git a/sdrbase/audio/audiocompressorsnd.h b/sdrbase/audio/audiocompressorsnd.h index 712152db2..41d6f80fc 100644 --- a/sdrbase/audio/audiocompressorsnd.h +++ b/sdrbase/audio/audiocompressorsnd.h @@ -25,8 +25,7 @@ #ifndef SDRBASE_AUDIO_AUDIOCOMPRESSORSND_H_ #define SDRBASE_AUDIO_AUDIOCOMPRESSORSND_H_ -#define _USE_MATH_DEFINES -#include +#include // maximum number of samples in the delay buffer #define AUDIOCOMPRESSORSND_SF_COMPRESSOR_MAXDELAY 1024 @@ -161,7 +160,7 @@ private: static inline float fixf(float v, float def){ // fix NaN and infinity values that sneak in... not sure why this is needed, but it is - if (isnan(v) || isinf(v)) + if (std::isnan(v) || std::isinf(v)) return def; return v; } diff --git a/sdrbase/audio/audiofilter.cpp b/sdrbase/audio/audiofilter.cpp index d6f01f5bd..9957b0f68 100644 --- a/sdrbase/audio/audiofilter.cpp +++ b/sdrbase/audio/audiofilter.cpp @@ -15,8 +15,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES -#include +#include #include #include diff --git a/sdrbase/commands/command.cpp b/sdrbase/commands/command.cpp index 9f558267c..a6b83dff8 100644 --- a/sdrbase/commands/command.cpp +++ b/sdrbase/commands/command.cpp @@ -67,7 +67,7 @@ Command::~Command() { if (m_currentProcess) { -#if QT_VERSION < 0x051000 +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) disconnect(m_currentProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); #else disconnect(m_currentProcess, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); @@ -193,7 +193,7 @@ void Command::run(const QString& apiAddress, int apiPort, int deviceSetIndex) m_isInError = false; m_hasExited = false; -#if QT_VERSION < 0x051000 +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) connect(m_currentProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); #else connect(m_currentProcess, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); @@ -266,7 +266,7 @@ void Command::processError(QProcess::ProcessError error) { m_log = m_currentProcess->readAllStandardOutput(); -#if QT_VERSION < 0x051000 +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) disconnect(m_currentProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); #else disconnect(m_currentProcess, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); @@ -288,7 +288,7 @@ void Command::processFinished(int exitCode, QProcess::ExitStatus exitStatus) m_hasExited = true; m_log = m_currentProcess->readAllStandardOutput(); -#if QT_VERSION < 0x051000 +#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) disconnect(m_currentProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); #else disconnect(m_currentProcess, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); diff --git a/sdrbase/dsp/afsquelch.cpp b/sdrbase/dsp/afsquelch.cpp index faadf3074..1ebaa75a6 100644 --- a/sdrbase/dsp/afsquelch.cpp +++ b/sdrbase/dsp/afsquelch.cpp @@ -15,11 +15,9 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include +#include #include "dsp/afsquelch.h" -#undef M_PI -#define M_PI 3.14159265358979323846 AFSquelch::AFSquelch() : m_nbAvg(128), diff --git a/sdrbase/dsp/ctcssdetector.cpp b/sdrbase/dsp/ctcssdetector.cpp index df073562f..019c5a418 100644 --- a/sdrbase/dsp/ctcssdetector.cpp +++ b/sdrbase/dsp/ctcssdetector.cpp @@ -17,7 +17,6 @@ // along with this program. If not, see . // ////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES #include #include "dsp/ctcssdetector.h" diff --git a/sdrbase/dsp/fftfilt.h b/sdrbase/dsp/fftfilt.h index 5c3e0222c..fa02d5432 100644 --- a/sdrbase/dsp/fftfilt.h +++ b/sdrbase/dsp/fftfilt.h @@ -6,12 +6,11 @@ #define _FFTFILT_H #include +#include + #include "gfft.h" #include "export.h" -#undef M_PI -#define M_PI 3.14159265358979323846 - //---------------------------------------------------------------------- class SDRBASE_API fftfilt { diff --git a/sdrbase/dsp/fftwindow.h b/sdrbase/dsp/fftwindow.h index 1bcbb6bc1..32fbd7ca7 100644 --- a/sdrbase/dsp/fftwindow.h +++ b/sdrbase/dsp/fftwindow.h @@ -20,14 +20,10 @@ #define INCLUDE_FFTWINDOW_H #include -#define _USE_MATH_DEFINES -#include +#include #include "dsp/dsptypes.h" #include "export.h" -#undef M_PI -#define M_PI 3.14159265358979323846 - class SDRBASE_API FFTWindow { public: enum Function { diff --git a/sdrbase/dsp/firfilter.cpp b/sdrbase/dsp/firfilter.cpp index ef3092583..dd287c348 100644 --- a/sdrbase/dsp/firfilter.cpp +++ b/sdrbase/dsp/firfilter.cpp @@ -52,6 +52,19 @@ void generateLowPassFilter(int nTaps, double sampleRate, double cutoff, std::vec int n = i - (nTaps - 1) / 2; taps[i] *= 0.42 + 0.5 * cos((2.0 * M_PI * n) / nTaps) + 0.08 * cos((4.0 * M_PI * n) / nTaps); } + + Real sum = 0; + size_t i; + + for (i = 0; i < taps.size() - 1; ++i) { + sum += taps[i] * 2.0; + } + + sum += taps[i]; + + for (i = 0; i < taps.size(); ++i) { + taps[i] /= sum; + } } } diff --git a/sdrbase/dsp/firfilter.h b/sdrbase/dsp/firfilter.h index 0ba6334a5..282e52505 100644 --- a/sdrbase/dsp/firfilter.h +++ b/sdrbase/dsp/firfilter.h @@ -18,9 +18,9 @@ #pragma once -#define _USE_MATH_DEFINES -#include +#include #include "dsp/dsptypes.h" +#include "dsp/misc.h" #include "export.h" namespace FirFilterGenerators @@ -75,22 +75,6 @@ protected: } } - void normalize(Real sum_fix = 0.0) - { - Real sum = 0; - size_t i; - - for (i = 0; i < m_taps.size() - 1; ++i) { - sum += m_taps[i] * 2.0; - } - - sum += m_taps[i] + sum_fix; - - for (i = 0; i < m_taps.size(); ++i) { - m_taps[i] /= sum; - } - } - protected: std::vector m_taps; std::vector m_samples; @@ -105,7 +89,6 @@ public: { this->init(nTaps); FirFilterGenerators::generateLowPassFilter(nTaps, sampleRate, cutoff, this->m_taps); - this->normalize(); } }; @@ -130,7 +113,6 @@ struct Bandpass : public FirFilter } this->m_taps[this->m_taps.size() - 1] += 1; - this->normalize(-1.0); } }; @@ -147,6 +129,5 @@ struct Highpass : public FirFilter } this->m_taps[this->m_taps.size() - 1] += 1; - this->normalize(-1.0); } }; diff --git a/sdrbase/dsp/fmpreemphasis.cpp b/sdrbase/dsp/fmpreemphasis.cpp index 6e33ef431..0df31d38e 100644 --- a/sdrbase/dsp/fmpreemphasis.cpp +++ b/sdrbase/dsp/fmpreemphasis.cpp @@ -16,7 +16,6 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES #include #include #include "dsp/fmpreemphasis.h" diff --git a/sdrbase/dsp/freqlockcomplex.cpp b/sdrbase/dsp/freqlockcomplex.cpp index 59ce97e09..79a4e4018 100644 --- a/sdrbase/dsp/freqlockcomplex.cpp +++ b/sdrbase/dsp/freqlockcomplex.cpp @@ -22,8 +22,7 @@ /////////////////////////////////////////////////////////////////////////////////// #include "freqlockcomplex.h" -#define _USE_MATH_DEFINES -#include +#include FreqLockComplex::FreqLockComplex() : m_a0(0.998), diff --git a/sdrbase/dsp/iirfilter.h b/sdrbase/dsp/iirfilter.h index be05ffefe..c575796d0 100644 --- a/sdrbase/dsp/iirfilter.h +++ b/sdrbase/dsp/iirfilter.h @@ -26,7 +26,6 @@ #include #include -#include template class IIRFilter { @@ -61,8 +60,6 @@ private: template IIRFilter::IIRFilter(const Type *a, const Type *b) { - assert(Order > 1); - m_a = new Type[Order+1]; m_b = new Type[Order+1]; m_x = new Type[Order]; diff --git a/sdrbase/dsp/interpolator.cpp b/sdrbase/dsp/interpolator.cpp index 467ed0a48..9ab79d84d 100644 --- a/sdrbase/dsp/interpolator.cpp +++ b/sdrbase/dsp/interpolator.cpp @@ -1,5 +1,4 @@ -#define _USE_MATH_DEFINES -#include +#include #include #include "dsp/interpolator.h" diff --git a/sdrbase/dsp/misc.h b/sdrbase/dsp/misc.h index eb0e411cf..a4b41b65b 100644 --- a/sdrbase/dsp/misc.h +++ b/sdrbase/dsp/misc.h @@ -24,10 +24,7 @@ #ifndef _MISC_H #define _MISC_H -#include - -#undef M_PI -#define M_PI 3.14159265358979323846 +#include inline float sinc(float x) { @@ -39,7 +36,8 @@ inline float cosc(float x) return (fabs(x) < 1e-10) ? 0.0 : ((1.0 - cos(M_PI * x)) / (M_PI * x)); } -inline float clamp(float x, float min, float max) +template +inline T clamp(T x, T min, T max) { return (x < min) ? min : ((x > max) ? max : x); } diff --git a/sdrbase/dsp/nco.cpp b/sdrbase/dsp/nco.cpp index 57d072327..6eda52fdb 100644 --- a/sdrbase/dsp/nco.cpp +++ b/sdrbase/dsp/nco.cpp @@ -17,13 +17,10 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include -#define _USE_MATH_DEFINES -#include +#include +#include #include "dsp/nco.h" -#undef M_PI -#define M_PI 3.14159265358979323846 Real NCO::m_table[NCO::TableSize]; bool NCO::m_tableInitialized = false; diff --git a/sdrbase/dsp/ncof.cpp b/sdrbase/dsp/ncof.cpp index 48011671c..4becab475 100644 --- a/sdrbase/dsp/ncof.cpp +++ b/sdrbase/dsp/ncof.cpp @@ -17,13 +17,9 @@ #include #include -#define _USE_MATH_DEFINES -#include +#include #include "dsp/ncof.h" -#undef M_PI -#define M_PI 3.14159265358979323846 - Real NCOF::m_table[NCOF::TableSize+1]; bool NCOF::m_tableInitialized = false; float NCOF::m_tableSizeLimit = (float) NCOF::TableSize; diff --git a/sdrbase/dsp/phasediscri.h b/sdrbase/dsp/phasediscri.h index e479c40e4..cb3059936 100644 --- a/sdrbase/dsp/phasediscri.h +++ b/sdrbase/dsp/phasediscri.h @@ -19,11 +19,9 @@ #ifndef INCLUDE_DSP_PHASEDISCRI_H_ #define INCLUDE_DSP_PHASEDISCRI_H_ +#include #include "dsp/dsptypes.h" -#undef M_PI -#define M_PI 3.14159265358979323846 - class PhaseDiscriminators { public: @@ -167,8 +165,8 @@ private: } - #define PI_FLOAT 3.14159265f - #define PIBY2_FLOAT 1.5707963f + #define PI_FLOAT float(M_PI) + #define PIBY2_FLOAT float(M_PI_2) // |error| < 0.005 float atan2_approximation2( float y, float x ) { diff --git a/sdrbase/dsp/phaselock.cpp b/sdrbase/dsp/phaselock.cpp index 503f85bca..035a2de17 100644 --- a/sdrbase/dsp/phaselock.cpp +++ b/sdrbase/dsp/phaselock.cpp @@ -16,11 +16,9 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include +#include #include "dsp/phaselock.h" -#undef M_PI -#define M_PI 3.14159265358979323846 // Construct phase-locked loop. PhaseLock::PhaseLock(Real freq, Real bandwidth, Real minsignal) diff --git a/sdrbase/dsp/phaselockcomplex.cpp b/sdrbase/dsp/phaselockcomplex.cpp index a5fdfe8ab..523469059 100644 --- a/sdrbase/dsp/phaselockcomplex.cpp +++ b/sdrbase/dsp/phaselockcomplex.cpp @@ -22,8 +22,7 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#define _USE_MATH_DEFINES -#include +#include #include "phaselockcomplex.h" PhaseLockComplex::PhaseLockComplex() : diff --git a/sdrbase/dsp/projector.cpp b/sdrbase/dsp/projector.cpp index afe98ad5a..1add3dcf0 100644 --- a/sdrbase/dsp/projector.cpp +++ b/sdrbase/dsp/projector.cpp @@ -16,8 +16,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES -#include +#include #include "projector.h" Projector::Projector(ProjectionType projectionType) : diff --git a/sdrbase/dsp/raisedcosine.h b/sdrbase/dsp/raisedcosine.h index 98a82bee2..5e9e51c18 100644 --- a/sdrbase/dsp/raisedcosine.h +++ b/sdrbase/dsp/raisedcosine.h @@ -19,8 +19,7 @@ #ifndef INCLUDE_RAISEDCOSINE_H #define INCLUDE_RAISEDCOSINE_H -#define _USE_MATH_DEFINES -#include +#include #include "dsp/dsptypes.h" // Raised-cosine low-pass filter for pulse shaping, without intersymbol interference (ISI) diff --git a/sdrbase/dsp/recursivefilters.cpp b/sdrbase/dsp/recursivefilters.cpp index f246e3ed2..d5f468943 100644 --- a/sdrbase/dsp/recursivefilters.cpp +++ b/sdrbase/dsp/recursivefilters.cpp @@ -15,12 +15,9 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include +#include #include "recursivefilters.h" -#undef M_PI -#define M_PI 3.14159265358979323846 - SecondOrderRecursiveFilter::SecondOrderRecursiveFilter(float samplingFrequency, float centerFrequency, float r) : m_r(r), m_frequencyRatio(centerFrequency/samplingFrequency), diff --git a/sdrbase/dsp/samplesourcefifodb.cpp b/sdrbase/dsp/samplesourcefifodb.cpp index f702cc7fd..d39e5be63 100644 --- a/sdrbase/dsp/samplesourcefifodb.cpp +++ b/sdrbase/dsp/samplesourcefifodb.cpp @@ -16,7 +16,6 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include "samplesourcefifodb.h" SampleSourceFifoDB::SampleSourceFifoDB(uint32_t size, QObject* parent) : @@ -60,7 +59,7 @@ void SampleSourceFifoDB::init() void SampleSourceFifoDB::readAdvance(SampleVector::iterator& readUntil, unsigned int nbSamples) { // QMutexLocker mutexLocker(&m_mutex); - assert(nbSamples <= m_size/2); + nbSamples = nbSamples > m_size/2 ? m_size/2 : nbSamples; emit dataWrite(nbSamples); m_ir = (m_ir + nbSamples) % m_size; @@ -71,7 +70,7 @@ void SampleSourceFifoDB::readAdvance(SampleVector::iterator& readUntil, unsigned void SampleSourceFifoDB::readAdvance(SampleVector::const_iterator& readUntil, unsigned int nbSamples) { // QMutexLocker mutexLocker(&m_mutex); - assert(nbSamples <= m_size/2); + nbSamples = nbSamples > m_size/2 ? m_size/2 : nbSamples; emit dataWrite(nbSamples); m_ir = (m_ir + nbSamples) % m_size; diff --git a/sdrbase/dsp/samplesourcefifodb.h b/sdrbase/dsp/samplesourcefifodb.h index 7062ae87f..a9b7bbbe2 100644 --- a/sdrbase/dsp/samplesourcefifodb.h +++ b/sdrbase/dsp/samplesourcefifodb.h @@ -21,7 +21,6 @@ #include #include #include -#include #include "export.h" #include "dsp/dsptypes.h" diff --git a/sdrbase/dsp/wfir.cpp b/sdrbase/dsp/wfir.cpp index e6df32cd2..642bbe989 100644 --- a/sdrbase/dsp/wfir.cpp +++ b/sdrbase/dsp/wfir.cpp @@ -4,15 +4,13 @@ http://www.iowahills.com */ -#include +#include #include #include #include "wfir.h" -#undef M_PI -#define M_PI 3.14159265358979323846 -#define M_2PI 6.28318530717958647692 +#define M_2PI (2*M_PI) // This first calculates the impulse response for a rectangular window. // It then applies the windowing function of choice to the impulse response. diff --git a/sdrbase/maincore.cpp b/sdrbase/maincore.cpp index be6186d79..fed2c4f9a 100644 --- a/sdrbase/maincore.cpp +++ b/sdrbase/maincore.cpp @@ -85,7 +85,7 @@ void MainCore::setLoggingOptions() if (m_settings.getUseLogFile()) { -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) QString appInfoStr(QString("%1 %2 Qt %3 %4b %5 %6 DSP Rx:%7b Tx:%8b PID %9") .arg(QCoreApplication::applicationName()) .arg(QCoreApplication::applicationVersion()) diff --git a/sdrbase/util/azel.cpp b/sdrbase/util/azel.cpp index 4bb7494bb..7a9aeeb8b 100644 --- a/sdrbase/util/azel.cpp +++ b/sdrbase/util/azel.cpp @@ -17,7 +17,6 @@ #include "azel.h" -#define _USE_MATH_DEFINES #include // Calculate cartesian distance between two points diff --git a/sdrbase/util/db.cpp b/sdrbase/util/db.cpp index 872d4e015..6b18d89ae 100644 --- a/sdrbase/util/db.cpp +++ b/sdrbase/util/db.cpp @@ -17,18 +17,16 @@ #include "util/db.h" #include -#include double CalcDb::dbPower(double magsq, double floor) { - assert(floor > 0.0); - - if (magsq > floor) - { - return 10.0 * log10(magsq); + if (floor <= 0.0) { + return -100.0; } - else - { + + if (magsq > floor) { + return 10.0 * log10(magsq); + } else { return 10.0 * log10(floor); } } diff --git a/sdrbase/util/serialutil.cpp b/sdrbase/util/serialutil.cpp index c84fddb4c..9a74bd2ba 100644 --- a/sdrbase/util/serialutil.cpp +++ b/sdrbase/util/serialutil.cpp @@ -18,7 +18,7 @@ #include #include -#if defined(__WINDOWS__) +#if defined(_WIN32) #include #include #include @@ -31,7 +31,7 @@ #include "serialutil.h" -#if defined(__WINDOWS__) +#if defined(_WIN32) void SerialUtil::getComPorts(std::vector& comPorts, const std::string& regexStr) { (void) regexStr; diff --git a/sdrbase/util/syncmessenger.cpp b/sdrbase/util/syncmessenger.cpp index 9233bbb3c..53459a672 100644 --- a/sdrbase/util/syncmessenger.cpp +++ b/sdrbase/util/syncmessenger.cpp @@ -16,6 +16,8 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include + #include "util/syncmessenger.h" #include "util/message.h" @@ -34,14 +36,23 @@ int SyncMessenger::sendWait(Message& message, unsigned long msPollTime) { m_message = &message; m_mutex.lock(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + m_complete.storeRelaxed(0); +#else m_complete.store(0); +#endif emit messageSent(); - while (!m_complete.load()) - { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + while (!m_complete.loadRelaxed()) { m_waitCondition.wait(&m_mutex, msPollTime); } +#else + while (!m_complete.load()) { + m_waitCondition.wait(&m_mutex, msPollTime); + } +#endif int result = m_result; m_mutex.unlock(); @@ -52,7 +63,11 @@ int SyncMessenger::sendWait(Message& message, unsigned long msPollTime) void SyncMessenger::done(int result) { m_result = result; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + m_complete.storeRelaxed(1); +#else m_complete.store(1); +#endif m_waitCondition.wakeAll(); } diff --git a/sdrbase/util/udpsinkutil.h b/sdrbase/util/udpsinkutil.h index 7abb63995..467b09480 100644 --- a/sdrbase/util/udpsinkutil.h +++ b/sdrbase/util/udpsinkutil.h @@ -24,8 +24,6 @@ #include #include -#include - template class UDPSinkUtil { @@ -37,7 +35,6 @@ public: m_port(9999), m_sampleBufferIndex(0) { - assert(m_udpSamples > 0); m_sampleBuffer = new T[m_udpSamples]; m_socket = new QUdpSocket(parent); } @@ -49,7 +46,6 @@ public: m_port(port), m_sampleBufferIndex(0) { - assert(m_udpSamples > 0); m_sampleBuffer = new T[m_udpSamples]; m_socket = new QUdpSocket(parent); } @@ -61,7 +57,6 @@ public: m_port(port), m_sampleBufferIndex(0) { - assert(m_udpSamples > 0); m_sampleBuffer = new T[m_udpSamples]; m_socket = new QUdpSocket(parent); } diff --git a/sdrbase/webapi/webapiadapter.cpp b/sdrbase/webapi/webapiadapter.cpp index 4a7cbc9bb..04f1be848 100644 --- a/sdrbase/webapi/webapiadapter.cpp +++ b/sdrbase/webapi/webapiadapter.cpp @@ -102,7 +102,7 @@ int WebAPIAdapter::instanceSummary( response.setDspRxBits(SDR_RX_SAMP_SZ); response.setDspTxBits(SDR_TX_SAMP_SZ); response.setPid(qApp->applicationPid()); -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) *response.getArchitecture() = QString(QSysInfo::currentCpuArchitecture()); *response.getOs() = QString(QSysInfo::prettyProductName()); #endif diff --git a/sdrgui/CMakeLists.txt b/sdrgui/CMakeLists.txt index 093ac3a91..0284b7008 100644 --- a/sdrgui/CMakeLists.txt +++ b/sdrgui/CMakeLists.txt @@ -232,7 +232,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client ${OPENGL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} - ) +) add_library(sdrgui SHARED ${sdrgui_SOURCES} diff --git a/sdrgui/dsp/scopevis.cpp b/sdrgui/dsp/scopevis.cpp index a2ffa1856..a39e2f66c 100644 --- a/sdrgui/dsp/scopevis.cpp +++ b/sdrgui/dsp/scopevis.cpp @@ -16,6 +16,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include #include #include @@ -619,15 +620,27 @@ int ScopeVis::processTraces(const SampleVector::const_iterator& cbegin, const Sa // display only at trace end if trace time is less than 1 second if (traceTime < 1.0f) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + if (m_glScope->getProcessingTraceIndex().loadRelaxed() < 0) { + m_glScope->newTraces(m_traces.m_traces, m_traces.currentBufferIndex(), &m_traces.m_projectionTypes); + } +#else if (m_glScope->getProcessingTraceIndex().load() < 0) { m_glScope->newTraces(m_traces.m_traces, m_traces.currentBufferIndex(), &m_traces.m_projectionTypes); } +#endif } // switch to next buffer only if it is not being processed by the scope +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + if (m_glScope->getProcessingTraceIndex().loadRelaxed() != (((int) m_traces.currentBufferIndex() + 1) % 2)) { + m_traces.switchBuffer(); + } +#else if (m_glScope->getProcessingTraceIndex().load() != (((int) m_traces.currentBufferIndex() + 1) % 2)) { m_traces.switchBuffer(); } +#endif return end - begin; // return remainder count } diff --git a/sdrgui/dsp/scopevis.h b/sdrgui/dsp/scopevis.h index 3e01a3bf3..b8b5df5f6 100644 --- a/sdrgui/dsp/scopevis.h +++ b/sdrgui/dsp/scopevis.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -37,8 +37,6 @@ #include "util/message.h" #include "util/doublebuffer.h" -#undef M_PI -#define M_PI 3.14159265358979323846 class GLScope; diff --git a/sdrgui/gui/fmpreemphasisdialog.cpp b/sdrgui/gui/fmpreemphasisdialog.cpp index 54ddd80b6..37d1ef7a0 100644 --- a/sdrgui/gui/fmpreemphasisdialog.cpp +++ b/sdrgui/gui/fmpreemphasisdialog.cpp @@ -15,7 +15,6 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES #include #include "fmpreemphasisdialog.h" #include "ui_fmpreemphasisdialog.h" diff --git a/sdrgui/gui/glscope.cpp b/sdrgui/gui/glscope.cpp index 3050b1d16..9d1aa27e9 100644 --- a/sdrgui/gui/glscope.cpp +++ b/sdrgui/gui/glscope.cpp @@ -16,6 +16,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -135,7 +136,11 @@ void GLScope::newTraces(std::vector *traces, int traceIndex, std::vecto if (m_dataChanged.testAndSetOrdered(0, 1)) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + m_processingTraceIndex.storeRelaxed(traceIndex); +#else m_processingTraceIndex.store(traceIndex); +#endif m_traces = &traces[traceIndex]; m_projectionTypes = projectionTypes; } @@ -834,8 +839,13 @@ void GLScope::paintGL() drawMarkers(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + m_dataChanged.storeRelaxed(0); + m_processingTraceIndex.storeRelaxed(-1); +#else m_dataChanged.store(0); m_processingTraceIndex.store(-1); +#endif m_mutex.unlock(); } @@ -1113,7 +1123,7 @@ void GLScope::applyConfig() void GLScope::setUniqueDisplays() { QFontMetrics fm(font()); - int M = fm.width("-"); + int M = fm.horizontalAdvance("-"); int scopeHeight = height() - m_topMargin - m_botMargin; int scopeWidth = width() - m_leftMargin - m_rightMargin; @@ -1297,7 +1307,7 @@ void GLScope::setUniqueDisplays() void GLScope::setVerticalDisplays() { QFontMetrics fm(font()); - int M = fm.width("-"); + int M = fm.horizontalAdvance("-"); int scopeHeight = (height() - m_topMargin) / 2 - m_botMargin; int scopeWidth = width() - m_leftMargin - m_rightMargin; @@ -1480,7 +1490,7 @@ void GLScope::setVerticalDisplays() void GLScope::setHorizontalDisplays() { QFontMetrics fm(font()); - int M = fm.width("-"); + int M = fm.horizontalAdvance("-"); int scopeHeight = height() - m_topMargin - m_botMargin; int scopeWidth = (width() - m_rightMargin) / 2 - m_leftMargin; @@ -1662,7 +1672,7 @@ void GLScope::setHorizontalDisplays() void GLScope::setPolarDisplays() { QFontMetrics fm(font()); - int M = fm.width("-"); + int M = fm.horizontalAdvance("-"); int scopeHeight = height() - m_topMargin - m_botMargin; int scopeWidth = (width() - m_rightMargin) / 2 - m_leftMargin; int scopeDim = std::min(scopeWidth, scopeHeight); @@ -2012,9 +2022,15 @@ void GLScope::drawTextOverlay( void GLScope::tick() { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + if (m_dataChanged.loadRelaxed()) { + update(); + } +#else if (m_dataChanged.load()) { update(); } +#endif } void GLScope::connectTimer(const QTimer &timer) diff --git a/sdrgui/gui/glscopegui.cpp b/sdrgui/gui/glscopegui.cpp index 3e5d491da..df52e760a 100644 --- a/sdrgui/gui/glscopegui.cpp +++ b/sdrgui/gui/glscopegui.cpp @@ -872,8 +872,7 @@ void GLScopeGUI::on_memoryLoad_clicked(bool checked) void GLScopeGUI::on_mem_valueChanged(int value) { - QString text; - text.sprintf("%02d", value); + QString text = QStringLiteral("%1").arg(value, 2, 10, QLatin1Char('0')); ui->memText->setText(text); disableLiveMode(value > 0); // live / memory mode toggle m_scopeVis->setMemoryIndex(value); @@ -1013,8 +1012,7 @@ void GLScopeGUI::setTraceIndexDisplay() void GLScopeGUI::setTrigCountDisplay() { - QString text; - text.sprintf("%02d", ui->trigCount->value()); + QString text = QStringLiteral("%1").arg(ui->trigCount->value(), 2, 10, QLatin1Char('0')); ui->trigCountText->setText(text); } diff --git a/sdrgui/gui/glspectrum.cpp b/sdrgui/gui/glspectrum.cpp index d539265d0..bb36aabe5 100644 --- a/sdrgui/gui/glspectrum.cpp +++ b/sdrgui/gui/glspectrum.cpp @@ -1251,7 +1251,7 @@ void GLSpectrum::applyChanges() } QFontMetrics fm(font()); - int M = fm.width("-"); + int M = fm.horizontalAdvance("-"); m_topMargin = fm.ascent() * 1.5; m_bottomMargin = fm.ascent() * 1.5; @@ -1261,7 +1261,7 @@ void GLSpectrum::applyChanges() int frequencyScaleTop = 0; int histogramTop = 0; //int m_leftMargin; - m_rightMargin = fm.width("000"); + m_rightMargin = fm.horizontalAdvance("000"); // displays both histogram and waterfall if (m_displayWaterfall && (m_displayHistogram | m_displayMaxHold | m_displayCurrent)) @@ -1800,7 +1800,7 @@ void GLSpectrum::applyChanges() shift = 0; } else { // right half of scale ftext = ftext + " "; - shift = - fm.width(ftext); + shift = - fm.horizontalAdvance(ftext); } painter.drawText(QPointF(m_leftMargin + m_frequencyScale.getPosFromValue(xc) + shift, 2*fm.height() + fm.ascent() / 2 - 1), ftext); } diff --git a/sdrgui/gui/valuedial.cpp b/sdrgui/gui/valuedial.cpp index e5037df0e..3af067f13 100644 --- a/sdrgui/gui/valuedial.cpp +++ b/sdrgui/gui/valuedial.cpp @@ -77,7 +77,7 @@ void ValueDial::setFont(const QFont &font) QWidget::setFont(font); QFontMetrics fm(font); - m_digitWidth = fm.width('0'); + m_digitWidth = fm.horizontalAdvance('0'); m_digitHeight = fm.ascent(); if (m_digitWidth < m_digitHeight) { m_digitWidth = m_digitHeight; diff --git a/sdrgui/gui/valuedialz.cpp b/sdrgui/gui/valuedialz.cpp index 5d9ed8be8..2cc419bf1 100644 --- a/sdrgui/gui/valuedialz.cpp +++ b/sdrgui/gui/valuedialz.cpp @@ -79,7 +79,7 @@ void ValueDialZ::setFont(const QFont& font) QWidget::setFont(font); QFontMetrics fm(font); - m_digitWidth = fm.width('0'); + m_digitWidth = fm.horizontalAdvance('0'); m_digitHeight = fm.ascent(); if(m_digitWidth < m_digitHeight) m_digitWidth = m_digitHeight; diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 6828c8906..ed0462fc2 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -743,7 +743,7 @@ void MainWindow::saveCommandSettings() void MainWindow::createStatusBar() { QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR); -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) m_showSystemWidget = new QLabel("SDRangel " + qApp->applicationVersion() + " " + qtVersionStr + QSysInfo::currentCpuArchitecture() + " " + QSysInfo::prettyProductName(), this); #else