Browse Source

Merge branch 'master' into rgetz-resolve-uninitMemberVar-sdrbase

chirpmodem-v8.0.0
Edouard Griffiths 2 months ago committed by GitHub
parent
commit
1516a2eb2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      CMakeLists.txt
  2. 3
      CMakePresets.json
  3. 19
      cmake/cpack/CMakeLists.txt
  4. 41
      cmake/cpack/claude_extension.nsh.in
  5. BIN
      doc/img/MCPServer_plugin.png
  6. 21
      external/CMakeLists.txt
  7. 16
      external/copy_headers.cmake
  8. 14
      plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp
  9. 18
      plugins/channelmimo/doa2/doa2.cpp
  10. 12
      plugins/channelmimo/doa2/doa2webapiadapter.cpp
  11. 12
      plugins/channelmimo/interferometer/interferometer.cpp
  12. 12
      plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp
  13. 44
      plugins/channelrx/chanalyzer/chanalyzer.cpp
  14. 6
      plugins/channelrx/chanalyzer/chanalyzerbaseband.cpp
  15. 12
      plugins/channelrx/channelpower/channelpower.cpp
  16. 97
      plugins/channelrx/demodadsb/adsbdemod.cpp
  17. 5
      plugins/channelrx/demodadsb/adsbdemod.h
  18. 12
      plugins/channelrx/demodadsb/adsbdemodgui.cpp
  19. 65
      plugins/channelrx/demodais/aisdemod.cpp
  20. 5
      plugins/channelrx/demodais/aisdemod.h
  21. 5
      plugins/channelrx/demodais/aisdemodbaseband.cpp
  22. 1
      plugins/channelrx/demodais/aisdemodbaseband.h
  23. 5
      plugins/channelrx/demodais/aisdemodgui.cpp
  24. 18
      plugins/channelrx/demodam/amdemod.cpp
  25. 42
      plugins/channelrx/demodapt/aptdemod.cpp
  26. 5
      plugins/channelrx/demodapt/aptdemodgui.cpp
  27. 6
      plugins/channelrx/demodatv/atvdemodbaseband.cpp
  28. 12
      plugins/channelrx/demodatv/atvdemodwebapiadapter.cpp
  29. 24
      plugins/channelrx/demodbfm/bfmdemod.cpp
  30. 6
      plugins/channelrx/demodbfm/bfmdemodsink.cpp
  31. 6
      plugins/channelrx/demodbfm/rdsparser.cpp
  32. 1
      plugins/channelrx/demodbfm/rdsparser.h
  33. 2
      plugins/channelrx/demodbfm/readme.md
  34. 30
      plugins/channelrx/demodchirpchat/chirpchatdemod.cpp
  35. 239
      plugins/channelrx/demoddab/dabdemod.cpp
  36. 28
      plugins/channelrx/demoddab/dabdemod.h
  37. 1
      plugins/channelrx/demoddab/dabdemodbaseband.h
  38. 6
      plugins/channelrx/demoddab/dabdemodsink.cpp
  39. 1
      plugins/channelrx/demoddab/dabdemodsink.h
  40. 30
      plugins/channelrx/demoddatv/datvdemod.cpp
  41. 18
      plugins/channelrx/demoddatv/datvdemodwebapiadapter.cpp
  42. 48
      plugins/channelrx/demoddsc/dscdemod.cpp
  43. 5
      plugins/channelrx/demoddsc/dscdemodgui.cpp
  44. 36
      plugins/channelrx/demoddsd/dsddemod.cpp
  45. 4
      plugins/channelrx/demoddsd/dsdstatustextdialog.cpp
  46. 36
      plugins/channelrx/demodendoftrain/endoftraindemod.cpp
  47. 5
      plugins/channelrx/demodendoftrain/endoftraindemodgui.cpp
  48. 18
      plugins/channelrx/demodfreedv/freedvdemod.cpp
  49. 67
      plugins/channelrx/demodft8/ft8demod.cpp
  50. 90
      plugins/channelrx/demodils/ilsdemod.cpp
  51. 36
      plugins/channelrx/demodinmarsat/inmarsatdemod.cpp
  52. 5
      plugins/channelrx/demodinmarsat/inmarsatdemodgui.cpp
  53. 18
      plugins/channelrx/demodm17/m17demod.cpp
  54. 4
      plugins/channelrx/demodm17/m17statustextdialog.cpp
  55. 42
      plugins/channelrx/demodmeshcore/meshcoredemod.cpp
  56. 4
      plugins/channelrx/demodmeshcore/meshcorekeysdialog.cpp
  57. 42
      plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp
  58. 35
      plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp
  59. 3
      plugins/channelrx/demodmeshtastic/meshtasticdemodsink.h
  60. 4
      plugins/channelrx/demodmeshtastic/meshtastickeysdialog.cpp
  61. 60
      plugins/channelrx/demodnavtex/navtexdemod.cpp
  62. 5
      plugins/channelrx/demodnavtex/navtexdemodgui.cpp
  63. 18
      plugins/channelrx/demodnfm/nfmdemod.cpp
  64. 36
      plugins/channelrx/demodpacket/packetdemod.cpp
  65. 5
      plugins/channelrx/demodpacket/packetdemodgui.cpp
  66. 36
      plugins/channelrx/demodpager/pagerdemod.cpp
  67. 5
      plugins/channelrx/demodpager/pagerdemodgui.cpp
  68. 59
      plugins/channelrx/demodradiosonde/radiosondedemod.cpp
  69. 5
      plugins/channelrx/demodradiosonde/radiosondedemod.h
  70. 5
      plugins/channelrx/demodradiosonde/radiosondedemodbaseband.cpp
  71. 1
      plugins/channelrx/demodradiosonde/radiosondedemodbaseband.h
  72. 5
      plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp
  73. 42
      plugins/channelrx/demodrtty/rttydemod.cpp
  74. 40
      plugins/channelrx/demodssb/ssbdemod.cpp
  75. 24
      plugins/channelrx/demodvor/vordemod.cpp
  76. 18
      plugins/channelrx/demodvormc/vordemodmc.cpp
  77. 3
      plugins/channelrx/demodvormc/vordemodmcgui.cpp
  78. 18
      plugins/channelrx/demodwfm/wfmdemod.cpp
  79. 18
      plugins/channelrx/filesink/filesink.cpp
  80. 7
      plugins/channelrx/filesink/filesinkgui.cpp
  81. 23
      plugins/channelrx/filesink/filesinksink.cpp
  82. 84
      plugins/channelrx/freqscanner/freqscanner.cpp
  83. 35
      plugins/channelrx/freqscanner/freqscannergui.cpp
  84. 2
      plugins/channelrx/freqscanner/freqscannergui.h
  85. 12
      plugins/channelrx/freqtracker/freqtracker.cpp
  86. 47
      plugins/channelrx/heatmap/heatmap.cpp
  87. 5
      plugins/channelrx/heatmap/heatmap.h
  88. 5
      plugins/channelrx/heatmap/heatmapbaseband.cpp
  89. 1
      plugins/channelrx/heatmap/heatmapbaseband.h
  90. 17
      plugins/channelrx/heatmap/heatmapgui.cpp
  91. 18
      plugins/channelrx/localsink/localsink.cpp
  92. 83
      plugins/channelrx/noisefigure/noisefigure.cpp
  93. 5
      plugins/channelrx/noisefigure/noisefigure.h
  94. 5
      plugins/channelrx/noisefigure/noisefigurebaseband.cpp
  95. 1
      plugins/channelrx/noisefigure/noisefigurebaseband.h
  96. 9
      plugins/channelrx/noisefigure/noisefiguregui.cpp
  97. 87
      plugins/channelrx/radioastronomy/radioastronomy.cpp
  98. 5
      plugins/channelrx/radioastronomy/radioastronomy.h
  99. 5
      plugins/channelrx/radioastronomy/radioastronomybaseband.cpp
  100. 1
      plugins/channelrx/radioastronomy/radioastronomybaseband.h
  101. Some files were not shown because too many files have changed in this diff Show More

9
CMakeLists.txt

@ -32,6 +32,8 @@ option(RX_SAMPLE_24BIT "Internal 24 bit Rx DSP" ON) @@ -32,6 +32,8 @@ option(RX_SAMPLE_24BIT "Internal 24 bit Rx DSP" ON)
option(BUILD_SERVER "Build Server" ON)
option(BUILD_GUI "Build GUI" ON)
option(BUILD_BENCH "Build benchmark" ON)
option(BUILD_MCP_BRIDGE "Build the Claude Desktop stdio bridge for the MCP server feature" ON)
option(BUILD_MCP_BUNDLE "Package the MCP bridge as a Claude Desktop extension bundle" ON)
option(HIDE_CONSOLE "Hide console when running GUI on Windows" ON)
option(BUNDLE "Enable distribution bundle" OFF)
set(ARCH_OPT "native" CACHE STRING "Specify instruction set to use. Will be passed directly as `-march` or `/arch:` argument on supported compilers. \
@ -227,6 +229,7 @@ option(ENABLE_FEATURE_SID "Enable feature sid plugin" ON) @@ -227,6 +229,7 @@ option(ENABLE_FEATURE_SID "Enable feature sid plugin" ON)
option(ENABLE_FEATURE_MORSEDECODER "Enable feature morsedecoder plugin" ON)
option(ENABLE_FEATURE_DENOISER "Enable feature denoiser plugin" ON)
option(ENABLE_FEATURE_FREQDISPLAY "Enable feature freqdisplay plugin" ON)
option(ENABLE_FEATURE_MCPSERVER "Enable feature mcpserver plugin" ON)
# on windows always build external libraries
if(WIN32)
@ -1102,6 +1105,12 @@ if (BUILD_BENCH) @@ -1102,6 +1105,12 @@ if (BUILD_BENCH)
add_subdirectory(sdrbench)
endif()
# Standalone, and not built by default: only a release that ships a Claude Desktop
# extension bundle needs it
if (BUILD_MCP_BRIDGE OR BUILD_MCP_BUNDLE)
add_subdirectory(plugins/feature/mcpserver/bridge)
endif()
if (BUILD_GUI)
add_subdirectory(sdrgui)
add_subdirectory(plugins plugins)

3
CMakePresets.json

@ -66,6 +66,7 @@ @@ -66,6 +66,7 @@
"ENABLE_XTRX": "ON",
"ENABLE_USRP": "ON",
"BUILD_SERVER": "OFF",
"BUILD_MCP_BUNDLE": "ON",
"CMAKE_PREFIX_PATH": "C:/Qt/5.15.2/msvc2019_64;C:/Applications/boost_1_81_0"
},
"warnings": {
@ -91,7 +92,7 @@ @@ -91,7 +92,7 @@
"binaryDir": "${sourceDir}/build-qt6",
"cacheVariables": {
"ENABLE_QT6": "ON",
"CMAKE_PREFIX_PATH": "C:/Qt/6.7.3/msvc2022_64;C:/Applications/boost_1_81_0"
"CMAKE_PREFIX_PATH": "C:/Qt/6.11.2/msvc2022_64;C:/Applications/boost_1_81_0"
}
}
],

19
cmake/cpack/CMakeLists.txt

@ -354,6 +354,25 @@ elseif(WIN32 OR MINGW) @@ -354,6 +354,25 @@ elseif(WIN32 OR MINGW)
ExecWait '$INSTDIR\\\\${VCREDIST_FILE} /passive /norestart'
Delete '$INSTDIR\\\\${VCREDIST_FILE}'
")
# The Claude Desktop extension, in a file of its own: CPack writes
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS into CPackConfig.cmake without escaping it, so the
# commands themselves cannot contain a quote
if(MCPBRIDGE_BUNDLE_NAME)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/claude_extension.nsh.in"
"${CMAKE_BINARY_DIR}/claude_extension.nsh"
@ONLY
)
# NSIS !include does not take forward slashes, and CPack writes this string into
# CPackConfig.cmake raw, so each separator has to survive being read back as CMake
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/claude_extension.nsh" MCPBRIDGE_NSH)
string(REPLACE "\\" "\\\\" MCPBRIDGE_NSH "${MCPBRIDGE_NSH}")
list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
!include '${MCPBRIDGE_NSH}'
")
endif()
set(CPACK_NSIS_CREATE_ICONS_EXTRA
"CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\SDRangel.lnk' '$INSTDIR\\\\sdrangel.exe'")
set(CPACK_NSIS_DELETE_ICONS_EXTRA

41
cmake/cpack/claude_extension.nsh.in

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
; Offers the Claude Desktop extension, when Claude Desktop is installed.
;
; Claude registers no .mcpb file association, and the packaged (MSIX) build has no execution
; alias, so the only way to hand it a bundle is to run its executable with the bundle as an
; argument. Both the .exe and the MSIX build write the claude:// protocol handler to HKCU
; with a real path to that executable, which is where it is found here.
;
; Claude shows its own install dialog, with its own warning about what an extension can do,
; so this only asks whether to open it.
;
; Included from CPACK_NSIS_EXTRA_INSTALL_COMMANDS. Kept in a file of its own because CPack
; writes that variable into CPackConfig.cmake unescaped, so it cannot contain a quote.
IfFileExists "$INSTDIR\@MCPBRIDGE_BUNDLE_NAME@" 0 mcpbDone
ReadRegStr $R0 HKCU "Software\Classes\claude\shell\open\command" ""
StrCmp $R0 "" mcpbDone
; The value is "<path to the executable>" "%1". Take what the first pair of quotes holds
StrCpy $R5 $R0 1 ; the opening quote, to compare against and to quote with later
StrCpy $R1 $R0 "" 1
StrCpy $R2 0
mcpbScan:
StrCpy $R3 $R1 1 $R2
StrCmp $R3 $R5 mcpbFound
StrCmp $R3 "" mcpbDone ; no closing quote: not a shape we understand, leave it alone
IntOp $R2 $R2 + 1
Goto mcpbScan
mcpbFound:
StrCpy $R4 $R1 $R2
; The path carries the version of the Claude that wrote it, so an update that has not been
; launched since can leave it pointing at a directory that is gone
IfFileExists "$R4" 0 mcpbDone
MessageBox MB_YESNO|MB_ICONQUESTION "Install the SDRangel extension for Claude Desktop?$\r$\n$\r$\nThis lets Claude control SDRangel. Claude will ask you to confirm." IDNO mcpbDone
Exec '"$R4" "$INSTDIR\@MCPBRIDGE_BUNDLE_NAME@"'
mcpbDone:

BIN
doc/img/MCPServer_plugin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

21
external/CMakeLists.txt vendored

@ -153,6 +153,19 @@ else () @@ -153,6 +153,19 @@ else ()
endmacro()
endif (LINUX)
set(COPY_HEADERS_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/copy_headers.cmake")
# macro that mirrors the headers of a directory into another one, for the libraries whose sources
# include them by a subdirectory name that is not in the library's own tree. Unlike makeCopyDir this
# is safe when the destination is inside the source, and it runs on every build rather than only
# when the destination is missing at configure time: an external project that re-clones wipes the
# copy, and a configure time check would leave it gone until the next configure
macro(makeCopyHeaders src dest target)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -DSRC=${src} -DDEST=${dest} -P ${COPY_HEADERS_SCRIPT}
COMMENT "copy headers ${src} -> ${dest}")
endmacro()
if (WIN32)
if (VS2015)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
@ -731,7 +744,7 @@ if (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL) @@ -731,7 +744,7 @@ if (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL)
set(LIBSERIALDV_EXTERNAL ON CACHE INTERNAL "")
set(LIBSERIALDV_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "")
if (WIN32)
makeCopyDir("${source_dir}" "${source_dir}/dsp" serialdv)
makeCopyHeaders("${source_dir}" "${source_dir}/dsp" serialdv)
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/serialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
elseif (LINUX)
# because sdrbase/dsp/dvserialworker.h use dsp/dvcontroller.h
@ -1478,7 +1491,7 @@ if (WIN32 OR APPLE) @@ -1478,7 +1491,7 @@ if (WIN32 OR APPLE)
set(LIBAIRSPY_EXTERNAL ON CACHE INTERNAL "")
set(LIBAIRSPY_INCLUDE_DIR "${source_dir}/libairspy/src" CACHE INTERNAL "")
if (WIN32)
makeCopyDir("${source_dir}/libairspy/src" "${source_dir}/libairspy/src/libairspy" airspy)
makeCopyHeaders("${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)
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
elseif (APPLE)
@ -1520,7 +1533,7 @@ if (WIN32 OR APPLE) @@ -1520,7 +1533,7 @@ if (WIN32 OR APPLE)
set(LIBAIRSPYHF_EXTERNAL ON CACHE INTERNAL "")
set(LIBAIRSPYHF_INCLUDE_DIR "${source_dir}/libairspyhf/src" CACHE INTERNAL "")
if (WIN32)
makeCopyDir("${source_dir}/libairspyhf/src" "${source_dir}/libairspyhf/src/libairspyhf" airspyhf)
makeCopyHeaders("${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)
set(LIBAIRSPYHF_LIBRARIES "${binary_dir}/libairspyhf/src/libairspyhf${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
@ -1566,7 +1579,7 @@ if (WIN32 OR APPLE) @@ -1566,7 +1579,7 @@ if (WIN32 OR APPLE)
set(LIBHACKRF_INCLUDE_DIR "${source_dir}/host/libhackrf" CACHE INTERNAL "")
if (WIN32)
# include "libhackrf/hackrf.h"
makeCopyDir("${source_dir}/host/libhackrf/src" "${source_dir}/host/libhackrf/libhackrf" hackrf)
makeCopyHeaders("${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}")
elseif (APPLE)
set(LIBHACKRF_LIBRARIES "${binary_dir}/src/libhackrf${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")

16
external/copy_headers.cmake vendored

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
# Mirrors the headers of one directory into another, so that sources including a library by a
# subdirectory name it does not have in its own tree - <libairspy/airspy.h>, <dsp/dvcontroller.h> -
# resolve. Only the files directly in SRC are copied and no subdirectory is descended into, so a
# destination inside SRC does not end up copying itself.
#
# Run as: cmake -DSRC=<dir> -DDEST=<dir> -P copy_headers.cmake
file(GLOB headers "${SRC}/*.h" "${SRC}/*.hpp")
file(MAKE_DIRECTORY "${DEST}")
if (headers)
# file(COPY) skips a file that is already there with the same timestamp, so repeating this on
# every build costs no rebuilds
file(COPY ${headers} DESTINATION "${DEST}")
endif ()

14
plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp

@ -329,7 +329,7 @@ void BeamSteeringCWMod::webapiUpdateChannelSettings( @@ -329,7 +329,7 @@ void BeamSteeringCWMod::webapiUpdateChannelSettings(
SWGSDRangel::SWGChannelSettings& response)
{
if (channelSettingsKeys.contains("steerDegrees")) {
settings.m_rgbColor = response.getBeamSteeringCwModSettings()->getSteerDegrees();
settings.m_steerDegrees = response.getBeamSteeringCwModSettings()->getSteerDegrees();
}
if (channelSettingsKeys.contains("rgbColor")) {
@ -485,7 +485,11 @@ void BeamSteeringCWMod::webapiFormatChannelSettings( @@ -485,7 +485,11 @@ void BeamSteeringCWMod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(2); // MIMO sink
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("BeamSteeringCWSource"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "BeamSteeringCWSource";
} else {
swgChannelSettings->setChannelType(new QString("BeamSteeringCWSource"));
}
swgChannelSettings->setBeamSteeringCwModSettings(new SWGSDRangel::SWGBeamSteeringCWModSettings());
SWGSDRangel::SWGBeamSteeringCWModSettings *swgBeamSteeringCWSettings = swgChannelSettings->getBeamSteeringCwModSettings();
@ -498,7 +502,11 @@ void BeamSteeringCWMod::webapiFormatChannelSettings( @@ -498,7 +502,11 @@ void BeamSteeringCWMod::webapiFormatChannelSettings(
swgBeamSteeringCWSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgBeamSteeringCWSettings->setTitle(new QString(settings.m_title));
if (swgBeamSteeringCWSettings->getTitle()) {
*swgBeamSteeringCWSettings->getTitle() = settings.m_title;
} else {
swgBeamSteeringCWSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("log2Decim") || force) {
swgBeamSteeringCWSettings->setLog2Interp(settings.m_log2Interp);

18
plugins/channelmimo/doa2/doa2.cpp

@ -201,7 +201,11 @@ void DOA2::applySettings(const QStringList& settingsKeys, const DOA2Settings& se @@ -201,7 +201,11 @@ void DOA2::applySettings(const QStringList& settingsKeys, const DOA2Settings& se
sendChannelSettings(pipes, settingsKeys, settings, force);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
void DOA2::handleInputMessages()
@ -602,7 +606,11 @@ void DOA2::webapiFormatChannelSettings( @@ -602,7 +606,11 @@ void DOA2::webapiFormatChannelSettings(
swgChannelSettings->setDirection(2); // MIMO sink
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("DOA2"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "DOA2";
} else {
swgChannelSettings->setChannelType(new QString("DOA2"));
}
swgChannelSettings->setDoa2Settings(new SWGSDRangel::SWGDOA2Settings());
SWGSDRangel::SWGDOA2Settings *swgDOA2Settings = swgChannelSettings->getDoa2Settings();
@ -612,7 +620,11 @@ void DOA2::webapiFormatChannelSettings( @@ -612,7 +620,11 @@ void DOA2::webapiFormatChannelSettings(
swgDOA2Settings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgDOA2Settings->setTitle(new QString(settings.m_title));
if (swgDOA2Settings->getTitle()) {
*swgDOA2Settings->getTitle() = settings.m_title;
} else {
swgDOA2Settings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("log2Decim") || force) {
swgDOA2Settings->setLog2Decim(settings.m_log2Decim);

12
plugins/channelmimo/doa2/doa2webapiadapter.cpp

@ -46,7 +46,11 @@ void DOA2WebAPIAdapter::webapiFormatChannelSettings( @@ -46,7 +46,11 @@ void DOA2WebAPIAdapter::webapiFormatChannelSettings(
{
response.getDoa2Settings()->setCorrelationType((int) settings.m_correlationType);
response.getDoa2Settings()->setRgbColor(settings.m_rgbColor);
response.getDoa2Settings()->setTitle(new QString(settings.m_title));
if (response.getDoa2Settings()->getTitle()) {
*response.getDoa2Settings()->getTitle() = settings.m_title;
} else {
response.getDoa2Settings()->setTitle(new QString(settings.m_title));
}
// scope
SWGSDRangel::SWGGLScope *swgScope = new SWGSDRangel::SWGGLScope();
@ -72,7 +76,11 @@ void DOA2WebAPIAdapter::webapiFormatChannelSettings( @@ -72,7 +76,11 @@ void DOA2WebAPIAdapter::webapiFormatChannelSettings(
swgScope->getTracesData()->back()->setStreamIndex(traceIt->m_streamIndex);
swgScope->getTracesData()->back()->setOfs(traceIt->m_ofs);
swgScope->getTracesData()->back()->setProjectionType((int) traceIt->m_projectionType);
swgScope->getTracesData()->back()->setTextOverlay(new QString(traceIt->m_textOverlay));
if (swgScope->getTracesData()->back()->getTextOverlay()) {
*swgScope->getTracesData()->back()->getTextOverlay() = traceIt->m_textOverlay;
} else {
swgScope->getTracesData()->back()->setTextOverlay(new QString(traceIt->m_textOverlay));
}
swgScope->getTracesData()->back()->setTraceColor(qColorToInt(traceIt->m_traceColor));
swgScope->getTracesData()->back()->setTraceColorB(traceIt->m_traceColorB);
swgScope->getTracesData()->back()->setTraceColorG(traceIt->m_traceColorG);

12
plugins/channelmimo/interferometer/interferometer.cpp

@ -742,7 +742,11 @@ void Interferometer::webapiFormatChannelSettings( @@ -742,7 +742,11 @@ void Interferometer::webapiFormatChannelSettings(
swgChannelSettings->setDirection(2); // MIMO sink
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("Interferometer"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "Interferometer";
} else {
swgChannelSettings->setChannelType(new QString("Interferometer"));
}
swgChannelSettings->setInterferometerSettings(new SWGSDRangel::SWGInterferometerSettings());
SWGSDRangel::SWGInterferometerSettings *swgInterferometerSettings = swgChannelSettings->getInterferometerSettings();
@ -752,7 +756,11 @@ void Interferometer::webapiFormatChannelSettings( @@ -752,7 +756,11 @@ void Interferometer::webapiFormatChannelSettings(
swgInterferometerSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgInterferometerSettings->setTitle(new QString(settings.m_title));
if (swgInterferometerSettings->getTitle()) {
*swgInterferometerSettings->getTitle() = settings.m_title;
} else {
swgInterferometerSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("log2Decim") || force) {
swgInterferometerSettings->setLog2Decim(settings.m_log2Decim);

12
plugins/channelmimo/interferometer/interferometerwebapiadapter.cpp

@ -48,7 +48,11 @@ void InterferometerWebAPIAdapter::webapiFormatChannelSettings( @@ -48,7 +48,11 @@ void InterferometerWebAPIAdapter::webapiFormatChannelSettings(
{
response.getInterferometerSettings()->setCorrelationType((int) settings.m_correlationType);
response.getInterferometerSettings()->setRgbColor(settings.m_rgbColor);
response.getInterferometerSettings()->setTitle(new QString(settings.m_title));
if (response.getInterferometerSettings()->getTitle()) {
*response.getInterferometerSettings()->getTitle() = settings.m_title;
} else {
response.getInterferometerSettings()->setTitle(new QString(settings.m_title));
}
// scope
SWGSDRangel::SWGGLScope *swgScope = new SWGSDRangel::SWGGLScope();
@ -74,7 +78,11 @@ void InterferometerWebAPIAdapter::webapiFormatChannelSettings( @@ -74,7 +78,11 @@ void InterferometerWebAPIAdapter::webapiFormatChannelSettings(
swgScope->getTracesData()->back()->setStreamIndex(traceIt->m_streamIndex);
swgScope->getTracesData()->back()->setOfs(traceIt->m_ofs);
swgScope->getTracesData()->back()->setProjectionType((int) traceIt->m_projectionType);
swgScope->getTracesData()->back()->setTextOverlay(new QString(traceIt->m_textOverlay));
if (swgScope->getTracesData()->back()->getTextOverlay()) {
*swgScope->getTracesData()->back()->getTextOverlay() = traceIt->m_textOverlay;
} else {
swgScope->getTracesData()->back()->setTextOverlay(new QString(traceIt->m_textOverlay));
}
swgScope->getTracesData()->back()->setTraceColor(qColorToInt(traceIt->m_traceColor));
swgScope->getTracesData()->back()->setTraceColorB(traceIt->m_traceColorB);
swgScope->getTracesData()->back()->setTraceColorG(traceIt->m_traceColorG);

44
plugins/channelrx/chanalyzer/chanalyzer.cpp

@ -279,13 +279,29 @@ int ChannelAnalyzer::webapiSettingsPutPatch( @@ -279,13 +279,29 @@ int ChannelAnalyzer::webapiSettingsPutPatch(
ChannelAnalyzerSettings settings = m_settings;
webapiUpdateChannelSettings(settings, channelSettingsKeys, response);
MsgConfigureChannelAnalyzer *msg = MsgConfigureChannelAnalyzer::create(settings, channelSettingsKeys, force);
// Map API names to setting names
QStringList settingsKeys = channelSettingsKeys;
static const QList<QPair<QString, QString>> renamed = {
{"frequency", "inputFrequencyOffset"},
{"spanLog2", "log2Decim"},
{"downSample", "rationalDownSample"},
{"downSamplerRate", "rationalDownSamplerRate"}
};
for (const auto& pair : renamed)
{
if (settingsKeys.contains(pair.first) && !settingsKeys.contains(pair.second)) {
settingsKeys.append(pair.second);
}
}
MsgConfigureChannelAnalyzer *msg = MsgConfigureChannelAnalyzer::create(settings, settingsKeys, force);
m_inputMessageQueue.push(msg);
qDebug("ChannelAnalyzer::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureChannelAnalyzer *msgToGUI = MsgConfigureChannelAnalyzer::create(settings, channelSettingsKeys, force);
MsgConfigureChannelAnalyzer *msgToGUI = MsgConfigureChannelAnalyzer::create(settings, settingsKeys, force);
m_guiMessageQueue->push(msgToGUI);
}
@ -299,13 +315,13 @@ void ChannelAnalyzer::webapiUpdateChannelSettings( @@ -299,13 +315,13 @@ void ChannelAnalyzer::webapiUpdateChannelSettings(
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response)
{
if (channelSettingsKeys.contains("inputFrequencyOffset")) {
if (channelSettingsKeys.contains("inputFrequencyOffset") || channelSettingsKeys.contains("frequency")) {
settings.m_inputFrequencyOffset = response.getChannelAnalyzerSettings()->getFrequency();
}
if (channelSettingsKeys.contains("rationalDownSample ")) {
if (channelSettingsKeys.contains("rationalDownSample") || channelSettingsKeys.contains("downSample")) {
settings.m_rationalDownSample = response.getChannelAnalyzerSettings()->getDownSample() != 0;
}
if (channelSettingsKeys.contains("rationalDownSamplerRate")) {
if (channelSettingsKeys.contains("rationalDownSamplerRate") || channelSettingsKeys.contains("downSamplerRate")) {
settings.m_rationalDownSamplerRate = response.getChannelAnalyzerSettings()->getDownSampleRate();
}
if (channelSettingsKeys.contains("bandwidth")) {
@ -552,7 +568,11 @@ void ChannelAnalyzer::webapiFormatChannelSettings( @@ -552,7 +568,11 @@ void ChannelAnalyzer::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setChannelAnalyzerSettings(new SWGSDRangel::SWGChannelAnalyzerSettings());
SWGSDRangel::SWGChannelAnalyzerSettings *swgChannelAnalyzerSettings = swgChannelSettings->getChannelAnalyzerSettings();
@ -613,7 +633,11 @@ void ChannelAnalyzer::webapiFormatChannelSettings( @@ -613,7 +633,11 @@ void ChannelAnalyzer::webapiFormatChannelSettings(
swgChannelAnalyzerSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgChannelAnalyzerSettings->setTitle(new QString(settings.m_title));
if (swgChannelAnalyzerSettings->getTitle()) {
*swgChannelAnalyzerSettings->getTitle() = settings.m_title;
} else {
swgChannelAnalyzerSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex")) {
swgChannelAnalyzerSettings->setStreamIndex(settings.m_streamIndex);
@ -622,7 +646,11 @@ void ChannelAnalyzer::webapiFormatChannelSettings( @@ -622,7 +646,11 @@ void ChannelAnalyzer::webapiFormatChannelSettings(
swgChannelAnalyzerSettings->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
swgChannelAnalyzerSettings->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
if (swgChannelAnalyzerSettings->getReverseApiAddress()) {
*swgChannelAnalyzerSettings->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
swgChannelAnalyzerSettings->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
swgChannelAnalyzerSettings->setReverseApiPort(settings.m_reverseAPIPort);

6
plugins/channelrx/chanalyzer/chanalyzerbaseband.cpp

@ -161,7 +161,11 @@ void ChannelAnalyzerBaseband::applySettings(const ChannelAnalyzerSettings& setti @@ -161,7 +161,11 @@ void ChannelAnalyzerBaseband::applySettings(const ChannelAnalyzerSettings& setti
}
m_sink.applySettings(settings, settingsKeys, force);
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
int ChannelAnalyzerBaseband::getChannelSampleRate() const

12
plugins/channelrx/channelpower/channelpower.cpp

@ -479,7 +479,11 @@ void ChannelPower::webapiFormatChannelSettings( @@ -479,7 +479,11 @@ void ChannelPower::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("ChannelPower"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "ChannelPower";
} else {
swgChannelSettings->setChannelType(new QString("ChannelPower"));
}
swgChannelSettings->setChannelPowerSettings(new SWGSDRangel::SWGChannelPowerSettings());
SWGSDRangel::SWGChannelPowerSettings *swgChannelPowerSettings = swgChannelSettings->getChannelPowerSettings();
@ -507,7 +511,11 @@ void ChannelPower::webapiFormatChannelSettings( @@ -507,7 +511,11 @@ void ChannelPower::webapiFormatChannelSettings(
swgChannelPowerSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgChannelPowerSettings->setTitle(new QString(settings.m_title));
if (swgChannelPowerSettings->getTitle()) {
*swgChannelPowerSettings->getTitle() = settings.m_title;
} else {
swgChannelPowerSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgChannelPowerSettings->setStreamIndex(settings.m_streamIndex);

97
plugins/channelrx/demodadsb/adsbdemod.cpp

@ -467,23 +467,63 @@ void ADSBDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res @@ -467,23 +467,63 @@ void ADSBDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getAdsbDemodSettings()->setRemoveTimeout(settings.m_removeTimeout);
response.getAdsbDemodSettings()->setFeedEnabled(settings.m_feedEnabled ? 1 : 0);
response.getAdsbDemodSettings()->setExportClientEnabled(settings.m_exportClientEnabled ? 1 : 0);
response.getAdsbDemodSettings()->setExportClientHost(new QString(settings.m_exportClientHost));
if (response.getAdsbDemodSettings()->getExportClientHost()) {
*response.getAdsbDemodSettings()->getExportClientHost() = settings.m_exportClientHost;
} else {
response.getAdsbDemodSettings()->setExportClientHost(new QString(settings.m_exportClientHost));
}
response.getAdsbDemodSettings()->setExportClientPort(settings.m_exportClientPort);
response.getAdsbDemodSettings()->setExportClientFormat((int) settings.m_exportClientFormat);
response.getAdsbDemodSettings()->setExportServerEnabled(settings.m_exportServerEnabled ? 1 : 0);
response.getAdsbDemodSettings()->setExportServerPort(settings.m_exportServerPort);
response.getAdsbDemodSettings()->setImportEnabled(settings.m_importEnabled ? 1 : 0);
response.getAdsbDemodSettings()->setImportHost(new QString(settings.m_importHost));
response.getAdsbDemodSettings()->setImportUsername(new QString(settings.m_importClientId));
response.getAdsbDemodSettings()->setImportPassword(new QString(settings.m_importClientSecret));
response.getAdsbDemodSettings()->setImportParameters(new QString(settings.m_importParameters));
if (response.getAdsbDemodSettings()->getImportHost()) {
*response.getAdsbDemodSettings()->getImportHost() = settings.m_importHost;
} else {
response.getAdsbDemodSettings()->setImportHost(new QString(settings.m_importHost));
}
if (response.getAdsbDemodSettings()->getImportUsername()) {
*response.getAdsbDemodSettings()->getImportUsername() = settings.m_importClientId;
} else {
response.getAdsbDemodSettings()->setImportUsername(new QString(settings.m_importClientId));
}
if (response.getAdsbDemodSettings()->getImportPassword()) {
*response.getAdsbDemodSettings()->getImportPassword() = settings.m_importClientSecret;
} else {
response.getAdsbDemodSettings()->setImportPassword(new QString(settings.m_importClientSecret));
}
if (response.getAdsbDemodSettings()->getImportParameters()) {
*response.getAdsbDemodSettings()->getImportParameters() = settings.m_importParameters;
} else {
response.getAdsbDemodSettings()->setImportParameters(new QString(settings.m_importParameters));
}
response.getAdsbDemodSettings()->setImportPeriod(settings.m_importPeriod);
response.getAdsbDemodSettings()->setImportMinLatitude(new QString(settings.m_importMinLatitude));
response.getAdsbDemodSettings()->setImportMaxLatitude(new QString(settings.m_importMaxLatitude));
response.getAdsbDemodSettings()->setImportMinLongitude(new QString(settings.m_importMinLongitude));
response.getAdsbDemodSettings()->setImportMaxLongitude(new QString(settings.m_importMaxLongitude));
if (response.getAdsbDemodSettings()->getImportMinLatitude()) {
*response.getAdsbDemodSettings()->getImportMinLatitude() = settings.m_importMinLatitude;
} else {
response.getAdsbDemodSettings()->setImportMinLatitude(new QString(settings.m_importMinLatitude));
}
if (response.getAdsbDemodSettings()->getImportMaxLatitude()) {
*response.getAdsbDemodSettings()->getImportMaxLatitude() = settings.m_importMaxLatitude;
} else {
response.getAdsbDemodSettings()->setImportMaxLatitude(new QString(settings.m_importMaxLatitude));
}
if (response.getAdsbDemodSettings()->getImportMinLongitude()) {
*response.getAdsbDemodSettings()->getImportMinLongitude() = settings.m_importMinLongitude;
} else {
response.getAdsbDemodSettings()->setImportMinLongitude(new QString(settings.m_importMinLongitude));
}
if (response.getAdsbDemodSettings()->getImportMaxLongitude()) {
*response.getAdsbDemodSettings()->getImportMaxLongitude() = settings.m_importMaxLongitude;
} else {
response.getAdsbDemodSettings()->setImportMaxLongitude(new QString(settings.m_importMaxLongitude));
}
response.getAdsbDemodSettings()->setRgbColor(settings.m_rgbColor);
response.getAdsbDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getAdsbDemodSettings()->getLogFilename()) {
*response.getAdsbDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getAdsbDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getAdsbDemodSettings()->setLogEnabled(settings.m_logEnabled);
if (response.getAdsbDemodSettings()->getTitle()) {
@ -545,7 +585,11 @@ void ADSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respons @@ -545,7 +585,11 @@ void ADSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respons
if (m_targetAzElValid)
{
response.getAdsbDemodReport()->setTargetName(new QString(m_targetName));
if (response.getAdsbDemodReport()->getTargetName()) {
*response.getAdsbDemodReport()->getTargetName() = m_targetName;
} else {
response.getAdsbDemodReport()->setTargetName(new QString(m_targetName));
}
response.getAdsbDemodReport()->setTargetAzimuth(m_targetAzimuth);
response.getAdsbDemodReport()->setTargetElevation(m_targetElevation);
response.getAdsbDemodReport()->setTargetRange(m_targetRange);
@ -555,12 +599,31 @@ void ADSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respons @@ -555,12 +599,31 @@ void ADSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respons
for (const auto& report : m_aircraftReport)
{
SWGSDRangel::SWGADSBDemodAircraftState *aircraftState = new SWGSDRangel::SWGADSBDemodAircraftState();
aircraftState->setIcao(new QString(report.m_icao));
aircraftState->setCallsign(new QString(report.m_callsign));
aircraftState->setLatitude(report.m_latitude);
aircraftState->setLongitude(report.m_longitude);
aircraftState->setAltitude(report.m_altitude);
aircraftState->setGroundSpeed(report.m_groundSpeed);
if (aircraftState->getIcao()) {
*aircraftState->getIcao() = report.m_icao;
} else {
aircraftState->setIcao(new QString(report.m_icao));
}
if (aircraftState->getCallsign()) {
*aircraftState->getCallsign() = report.m_callsign;
} else {
aircraftState->setCallsign(new QString(report.m_callsign));
}
// Only fields that have been received are set, so that unknown ones are left out of the
// JSON rather than reported as zero, which is a real position, altitude and speed
if (report.m_positionValid)
{
aircraftState->setLatitude(report.m_latitude);
aircraftState->setLongitude(report.m_longitude);
}
if (report.m_altitudeValid) {
aircraftState->setAltitude(report.m_altitude);
}
if (report.m_groundSpeedValid) {
aircraftState->setGroundSpeed(report.m_groundSpeed);
}
list->append(aircraftState);
}
}

5
plugins/channelrx/demodadsb/adsbdemod.h

@ -75,6 +75,11 @@ public: @@ -75,6 +75,11 @@ public:
float m_longitude;
int m_altitude;
int m_groundSpeed;
// Which of the above have been received. Zero is a valid position, altitude and
// speed, so a reader cannot otherwise tell a value apart from one not yet known
bool m_positionValid;
bool m_altitudeValid;
bool m_groundSpeedValid;
};
QList<AircraftReport>& getReport() { return m_report; }

12
plugins/channelrx/demodadsb/adsbdemodgui.cpp

@ -50,6 +50,7 @@ @@ -50,6 +50,7 @@
#include "util/units.h"
#include "util/morse.h"
#include "util/profiler.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/crightclickenabler.h"
#include "gui/clickablelabel.h"
@ -7771,7 +7772,10 @@ void ADSBDemodGUI::sendAircraftReport() @@ -7771,7 +7772,10 @@ void ADSBDemodGUI::sendAircraftReport()
aircraft->m_latitude,
aircraft->m_longitude,
aircraft->m_altitude,
aircraft->m_groundspeed
aircraft->m_groundspeed,
aircraft->m_positionValid,
aircraft->m_altitudeValid,
aircraft->m_groundspeedValid
};
report.append(aircraftReport);
@ -8086,7 +8090,7 @@ void ADSBDemodGUI::on_logOpen_clicked() @@ -8086,7 +8090,7 @@ void ADSBDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "ADS-B", error);
MessageDialog::critical(this, "ADS-B", error);
}
ui->adsbData->blockSignals(false);
m_loadingData = false;
@ -8098,7 +8102,7 @@ void ADSBDemodGUI::on_logOpen_clicked() @@ -8098,7 +8102,7 @@ void ADSBDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "ADS-B", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "ADS-B", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}
@ -8124,7 +8128,7 @@ void ADSBDemodGUI::downloadProgress(qint64 bytesRead, qint64 totalBytes) @@ -8124,7 +8128,7 @@ void ADSBDemodGUI::downloadProgress(qint64 bytesRead, qint64 totalBytes)
void ADSBDemodGUI::downloadError(const QString& error)
{
QMessageBox::critical(this, "ADS-B", error);
MessageDialog::critical(this, "ADS-B", error);
if (m_progressDialog)
{
m_progressDialog->close();

65
plugins/channelrx/demodais/aisdemod.cpp

@ -29,9 +29,11 @@ @@ -29,9 +29,11 @@
#include <complex.h>
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGWorkspaceInfo.h"
#include "dsp/dspcommands.h"
#include "util/db.h"
#include "device/deviceapi.h"
#include "util/ais.h"
#include "maincore.h"
@ -322,7 +324,11 @@ void AISDemod::applySettings(const AISDemodSettings& settings, const QStringList @@ -322,7 +324,11 @@ void AISDemod::applySettings(const AISDemodSettings& settings, const QStringList
}
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
QByteArray AISDemod::serialize() const
@ -386,6 +392,27 @@ int AISDemod::webapiWorkspaceGet( @@ -386,6 +392,27 @@ int AISDemod::webapiWorkspaceGet(
return 200;
}
int AISDemod::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
(void) errorMessage;
response.setAisDemodReport(new SWGSDRangel::SWGAISDemodReport());
response.getAisDemodReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void AISDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
double magsqAvg, magsqPeak;
int nbMagsqSamples;
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
response.getAisDemodReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getAisDemodReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
}
int AISDemod::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
@ -495,10 +522,18 @@ void AISDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp @@ -495,10 +522,18 @@ void AISDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getAisDemodSettings()->setFmDeviation(settings.m_fmDeviation);
response.getAisDemodSettings()->setCorrelationThreshold(settings.m_correlationThreshold);
response.getAisDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getAisDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getAisDemodSettings()->getUdpAddress()) {
*response.getAisDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getAisDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getAisDemodSettings()->setUdpPort(settings.m_udpPort);
response.getAisDemodSettings()->setUdpFormat((int)settings.m_udpFormat);
response.getAisDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getAisDemodSettings()->getLogFilename()) {
*response.getAisDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getAisDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getAisDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getAisDemodSettings()->setUseFileTime(settings.m_useFileTime);
@ -600,7 +635,11 @@ void AISDemod::webapiFormatChannelSettings( @@ -600,7 +635,11 @@ void AISDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("AISDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "AISDemod";
} else {
swgChannelSettings->setChannelType(new QString("AISDemod"));
}
swgChannelSettings->setAisDemodSettings(new SWGSDRangel::SWGAISDemodSettings());
SWGSDRangel::SWGAISDemodSettings *swgAISDemodSettings = swgChannelSettings->getAisDemodSettings();
@ -625,7 +664,11 @@ void AISDemod::webapiFormatChannelSettings( @@ -625,7 +664,11 @@ void AISDemod::webapiFormatChannelSettings(
swgAISDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgAISDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgAISDemodSettings->getUdpAddress()) {
*swgAISDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgAISDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgAISDemodSettings->setUdpPort(settings.m_udpPort);
@ -634,7 +677,11 @@ void AISDemod::webapiFormatChannelSettings( @@ -634,7 +677,11 @@ void AISDemod::webapiFormatChannelSettings(
swgAISDemodSettings->setUdpFormat((int)settings.m_udpFormat);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgAISDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgAISDemodSettings->getLogFilename()) {
*swgAISDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgAISDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgAISDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -646,7 +693,11 @@ void AISDemod::webapiFormatChannelSettings( @@ -646,7 +693,11 @@ void AISDemod::webapiFormatChannelSettings(
swgAISDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgAISDemodSettings->setTitle(new QString(settings.m_title));
if (swgAISDemodSettings->getTitle()) {
*swgAISDemodSettings->getTitle() = settings.m_title;
} else {
swgAISDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgAISDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demodais/aisdemod.h

@ -151,6 +151,10 @@ public: @@ -151,6 +151,10 @@ public:
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response,
const AISDemodSettings& settings);
@ -189,6 +193,7 @@ private: @@ -189,6 +193,7 @@ private:
virtual bool handleMessage(const Message& cmd);
void applySettings(const AISDemodSettings& settings, const QStringList& settingsKeys, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const AISDemodSettings& settings, bool force);
void webapiFormatChannelSettings(
const QList<QString>& channelSettingsKeys,

5
plugins/channelrx/demodais/aisdemodbaseband.cpp

@ -173,6 +173,11 @@ void AISDemodBaseband::applySettings(const AISDemodSettings& settings, const QSt @@ -173,6 +173,11 @@ void AISDemodBaseband::applySettings(const AISDemodSettings& settings, const QSt
}
}
int AISDemodBaseband::getChannelSampleRate() const
{
return m_channelizer->getChannelSampleRate();
}
void AISDemodBaseband::setBasebandSampleRate(int sampleRate)
{
m_channelizer->setBasebandSampleRate(sampleRate);

1
plugins/channelrx/demodais/aisdemodbaseband.h

@ -75,6 +75,7 @@ public: @@ -75,6 +75,7 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
m_sink.getMagSqLevels(avg, peak, nbSamples);
}
int getChannelSampleRate() const;
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_sink.setMessageQueueToChannel(messageQueue); }
void setBasebandSampleRate(int sampleRate);
ScopeVis *getScopeSink() { return &m_scopeSink; }

5
plugins/channelrx/demodais/aisdemodgui.cpp

@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
#include "util/csv.h"
#include "util/db.h"
#include "util/mmsi.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -1076,7 +1077,7 @@ void AISDemodGUI::on_logOpen_clicked() @@ -1076,7 +1077,7 @@ void AISDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "AIS Demod", error);
MessageDialog::critical(this, "AIS Demod", error);
}
m_loadingData = false;
ui->messages->setSortingEnabled(true);
@ -1086,7 +1087,7 @@ void AISDemodGUI::on_logOpen_clicked() @@ -1086,7 +1087,7 @@ void AISDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "AIS Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "AIS Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

18
plugins/channelrx/demodam/amdemod.cpp

@ -589,7 +589,11 @@ void AMDemod::webapiFormatChannelSettings( @@ -589,7 +589,11 @@ void AMDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("AMDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "AMDemod";
} else {
swgChannelSettings->setChannelType(new QString("AMDemod"));
}
swgChannelSettings->setAmDemodSettings(new SWGSDRangel::SWGAMDemodSettings());
SWGSDRangel::SWGAMDemodSettings *swgAMDemodSettings = swgChannelSettings->getAmDemodSettings();
@ -614,7 +618,11 @@ void AMDemod::webapiFormatChannelSettings( @@ -614,7 +618,11 @@ void AMDemod::webapiFormatChannelSettings(
swgAMDemodSettings->setSquelch(settings.m_squelch);
}
if (channelSettingsKeys.contains("title") || force) {
swgAMDemodSettings->setTitle(new QString(settings.m_title));
if (swgAMDemodSettings->getTitle()) {
*swgAMDemodSettings->getTitle() = settings.m_title;
} else {
swgAMDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("volume") || force) {
swgAMDemodSettings->setVolume(settings.m_volume);
@ -623,7 +631,11 @@ void AMDemod::webapiFormatChannelSettings( @@ -623,7 +631,11 @@ void AMDemod::webapiFormatChannelSettings(
swgAMDemodSettings->setBandpassEnable(settings.m_bandpassEnable ? 1 : 0);
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgAMDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgAMDemodSettings->getAudioDeviceName()) {
*swgAMDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgAMDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("pll") || force) {
swgAMDemodSettings->setPll(settings.m_pll);

42
plugins/channelrx/demodapt/aptdemod.cpp

@ -283,7 +283,11 @@ void APTDemod::applySettings(const QStringList& settingsKeys, const APTDemodSett @@ -283,7 +283,11 @@ void APTDemod::applySettings(const QStringList& settingsKeys, const APTDemodSett
webapiReverseSendSettings(settingsKeys, settings, fullUpdate || force);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
QByteArray APTDemod::serialize() const
@ -482,7 +486,11 @@ void APTDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp @@ -482,7 +486,11 @@ void APTDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getAptDemodSettings()->setChannels((int)settings.m_channels);
response.getAptDemodSettings()->setDecodeEnabled(settings.m_decodeEnabled);
response.getAptDemodSettings()->setAutoSave(settings.m_autoSave);
response.getAptDemodSettings()->setAutoSavePath(new QString(settings.m_autoSavePath));
if (response.getAptDemodSettings()->getAutoSavePath()) {
*response.getAptDemodSettings()->getAutoSavePath() = settings.m_autoSavePath;
} else {
response.getAptDemodSettings()->setAutoSavePath(new QString(settings.m_autoSavePath));
}
response.getAptDemodSettings()->setAutoSaveMinScanLines(settings.m_autoSaveMinScanLines);
response.getAptDemodSettings()->setSaveCombined(settings.m_saveCombined);
response.getAptDemodSettings()->setSaveSeparate(settings.m_saveSeparate);
@ -490,7 +498,11 @@ void APTDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp @@ -490,7 +498,11 @@ void APTDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getAptDemodSettings()->setScanlinesPerImageUpdate(settings.m_scanlinesPerImageUpdate);
response.getAptDemodSettings()->setTransparencyThreshold(settings.m_transparencyThreshold);
response.getAptDemodSettings()->setOpacityThreshold(settings.m_opacityThreshold);
response.getAptDemodSettings()->setPalettes(new QString(settings.m_palettes.join(";")));
if (response.getAptDemodSettings()->getPalettes()) {
*response.getAptDemodSettings()->getPalettes() = settings.m_palettes.join(";");
} else {
response.getAptDemodSettings()->setPalettes(new QString(settings.m_palettes.join(";")));
}
response.getAptDemodSettings()->setPalette(settings.m_palette);
response.getAptDemodSettings()->setHorizontalPixelsPerDegree(settings.m_horizontalPixelsPerDegree);
response.getAptDemodSettings()->setVerticalPixelsPerDegree(settings.m_verticalPixelsPerDegree);
@ -582,7 +594,11 @@ void APTDemod::webapiFormatChannelSettings( @@ -582,7 +594,11 @@ void APTDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("APTDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "APTDemod";
} else {
swgChannelSettings->setChannelType(new QString("APTDemod"));
}
swgChannelSettings->setAptDemodSettings(new SWGSDRangel::SWGAPTDemodSettings());
SWGSDRangel::SWGAPTDemodSettings *swgAPTDemodSettings = swgChannelSettings->getAptDemodSettings();
@ -625,7 +641,11 @@ void APTDemod::webapiFormatChannelSettings( @@ -625,7 +641,11 @@ void APTDemod::webapiFormatChannelSettings(
swgAPTDemodSettings->setAutoSave(settings.m_autoSave);
}
if (channelSettingsKeys.contains("autoSavePath") || force) {
swgAPTDemodSettings->setAutoSavePath(new QString(settings.m_autoSavePath));
if (swgAPTDemodSettings->getAutoSavePath()) {
*swgAPTDemodSettings->getAutoSavePath() = settings.m_autoSavePath;
} else {
swgAPTDemodSettings->setAutoSavePath(new QString(settings.m_autoSavePath));
}
}
if (channelSettingsKeys.contains("autoSaveMinScanLines") || force) {
swgAPTDemodSettings->setAutoSaveMinScanLines(settings.m_autoSaveMinScanLines);
@ -649,7 +669,11 @@ void APTDemod::webapiFormatChannelSettings( @@ -649,7 +669,11 @@ void APTDemod::webapiFormatChannelSettings(
swgAPTDemodSettings->setOpacityThreshold(settings.m_opacityThreshold);
}
if (channelSettingsKeys.contains("palettes") || force) {
swgAPTDemodSettings->setPalettes(new QString(settings.m_palettes.join(";")));
if (swgAPTDemodSettings->getPalettes()) {
*swgAPTDemodSettings->getPalettes() = settings.m_palettes.join(";");
} else {
swgAPTDemodSettings->setPalettes(new QString(settings.m_palettes.join(";")));
}
}
if (channelSettingsKeys.contains("palette") || force) {
swgAPTDemodSettings->setPalette(settings.m_palette);
@ -670,7 +694,11 @@ void APTDemod::webapiFormatChannelSettings( @@ -670,7 +694,11 @@ void APTDemod::webapiFormatChannelSettings(
swgAPTDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgAPTDemodSettings->setTitle(new QString(settings.m_title));
if (swgAPTDemodSettings->getTitle()) {
*swgAPTDemodSettings->getTitle() = settings.m_title;
} else {
swgAPTDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgAPTDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demodapt/aptdemodgui.cpp

@ -37,6 +37,7 @@ @@ -37,6 +37,7 @@
#include "ui_aptdemodgui.h"
#include "plugin/pluginapi.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -526,12 +527,12 @@ void APTDemodGUI::on_saveImage_clicked() @@ -526,12 +527,12 @@ void APTDemodGUI::on_saveImage_clicked()
{
qDebug() << "APT: Saving image to " << fileNames;
if (!m_image.save(fileNames[0])) {
QMessageBox::critical(this, "APT Demodulator", QString("Failed to save image to %1").arg(fileNames[0]));
MessageDialog::critical(this, "APT Demodulator", QString("Failed to save image to %1").arg(fileNames[0]));
}
}
else
{
QMessageBox::critical(this, "APT Demodulator", QString("Please specify a filename with an extension such as .png or .jpg"));
MessageDialog::critical(this, "APT Demodulator", QString("Please specify a filename with an extension such as .png or .jpg"));
}
}
}

6
plugins/channelrx/demodatv/atvdemodbaseband.cpp

@ -159,7 +159,11 @@ void ATVDemodBaseband::applySettings(const QStringList& settingsKeys, const ATVD @@ -159,7 +159,11 @@ void ATVDemodBaseband::applySettings(const QStringList& settingsKeys, const ATVD
}
m_sink.applySettings(settingsKeys, settings, force);
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
int ATVDemodBaseband::getChannelSampleRate() const

12
plugins/channelrx/demodatv/atvdemodwebapiadapter.cpp

@ -72,8 +72,16 @@ void ATVDemodWebAPIAdapter::webapiFormatChannelSettings( @@ -72,8 +72,16 @@ void ATVDemodWebAPIAdapter::webapiFormatChannelSettings(
response.getAtvDemodSettings()->setIntNumberOfLines(settings.m_nbLines);
response.getAtvDemodSettings()->setNbLinesIndex(ATVDemodSettings::getNumberOfLinesIndex(settings.m_nbLines));
response.getAtvDemodSettings()->setRgbColor(settings.m_rgbColor);
response.getAtvDemodSettings()->setTitle(new QString(settings.m_title));
response.getAtvDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getAtvDemodSettings()->getTitle()) {
*response.getAtvDemodSettings()->getTitle() = settings.m_title;
} else {
response.getAtvDemodSettings()->setTitle(new QString(settings.m_title));
}
if (response.getAtvDemodSettings()->getUdpAddress()) {
*response.getAtvDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getAtvDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getAtvDemodSettings()->setUdpPort(settings.m_udpPort);
}

24
plugins/channelrx/demodbfm/bfmdemod.cpp

@ -540,10 +540,12 @@ void BFMDemod::webapiFormatRDSReport(SWGSDRangel::SWGRDSReport *report) @@ -540,10 +540,12 @@ void BFMDemod::webapiFormatRDSReport(SWGSDRangel::SWGRDSReport *report)
report->setPid(new QString(str(boost::format("%04X") % getRDSParser()->m_pi_program_identification).c_str()));
report->setPiType(new QString(getRDSParser()->pty_table[getRDSParser()->m_pi_program_type].c_str()));
report->setPiCoverage(new QString(getRDSParser()->coverage_area_codes[getRDSParser()->m_pi_area_coverage_index].c_str()));
report->setProgServiceName(new QString(getRDSParser()->m_g0_program_service_name));
// RDS pads these to a fixed width, which is a transport detail rather than part of the
// name, and the radio text ends with a carriage return
report->setProgServiceName(new QString(QString(getRDSParser()->m_g0_program_service_name_complete).trimmed()));
report->setMusicSpeech(new QString((getRDSParser()->m_g0_music_speech ? "Music" : "Speech")));
report->setMonoStereo(new QString((getRDSParser()->m_g0_mono_stereo ? "Mono" : "Stereo")));
report->setRadioText(new QString(getRDSParser()->m_g2_radiotext));
report->setRadioText(new QString(QString(getRDSParser()->m_g2_radiotext).trimmed()));
std::string time = str(boost::format("%4i-%02i-%02i %02i:%02i (%+.1fh)")\
% (1900 + getRDSParser()->m_g4_year) % getRDSParser()->m_g4_month % getRDSParser()->m_g4_day % getRDSParser()->m_g4_hours % getRDSParser()->m_g4_minutes % getRDSParser()->m_g4_local_time_offset);
report->setTime(new QString(time.c_str()));
@ -620,7 +622,11 @@ void BFMDemod::webapiFormatChannelSettings( @@ -620,7 +622,11 @@ void BFMDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setBfmDemodSettings(new SWGSDRangel::SWGBFMDemodSettings());
SWGSDRangel::SWGBFMDemodSettings *swgBFMDemodSettings = swgChannelSettings->getBfmDemodSettings();
@ -663,10 +669,18 @@ void BFMDemod::webapiFormatChannelSettings( @@ -663,10 +669,18 @@ void BFMDemod::webapiFormatChannelSettings(
swgBFMDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgBFMDemodSettings->setTitle(new QString(settings.m_title));
if (swgBFMDemodSettings->getTitle()) {
*swgBFMDemodSettings->getTitle() = settings.m_title;
} else {
swgBFMDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgBFMDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgBFMDemodSettings->getAudioDeviceName()) {
*swgBFMDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgBFMDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgBFMDemodSettings->setStreamIndex(settings.m_streamIndex);

6
plugins/channelrx/demodbfm/bfmdemodsink.cpp

@ -376,5 +376,9 @@ void BFMDemodSink::applySettings(const QStringList& settingsKeys, const BFMDemod @@ -376,5 +376,9 @@ void BFMDemodSink::applySettings(const QStringList& settingsKeys, const BFMDemod
m_squelchLevel = std::pow(10.0, settings.m_squelch / 10.0);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}

6
plugins/channelrx/demodbfm/rdsparser.cpp

@ -283,6 +283,8 @@ void RDSParser::clearAllFields() @@ -283,6 +283,8 @@ void RDSParser::clearAllFields()
m_g0_count = 0;
std::memset(m_g0_program_service_name, ' ', sizeof(m_g0_program_service_name));
m_g0_program_service_name[sizeof(m_g0_program_service_name) - 1] = '\0';
std::memset(m_g0_program_service_name_complete, ' ', sizeof(m_g0_program_service_name_complete));
m_g0_program_service_name_complete[sizeof(m_g0_program_service_name_complete) - 1] = '\0';
m_g0_psn_bitmap = 0;
m_g0_traffic_announcement = false;
m_g0_music_speech = false;
@ -492,6 +494,10 @@ void RDSParser::decode_type0(unsigned int *group, bool B) @@ -492,6 +494,10 @@ void RDSParser::decode_type0(unsigned int *group, bool B)
m_g0_program_service_name[segment_address * 2 + 1] = group[3] & 0xff;
m_g0_psn_bitmap |= 1<<segment_address;
if (m_g0_psn_bitmap == 0b1111) {
std::memcpy(m_g0_program_service_name_complete, m_g0_program_service_name, sizeof(m_g0_program_service_name_complete));
}
/* see page 41, table 9 of the standard */
switch (segment_address)
{

1
plugins/channelrx/demodbfm/rdsparser.h

@ -56,6 +56,7 @@ public: @@ -56,6 +56,7 @@ public:
bool m_g0_af_updated;
unsigned int m_g0_count;
char m_g0_program_service_name[8+1];
char m_g0_program_service_name_complete[8+1]; //!< Last name for which all four segments were received
unsigned char m_g0_psn_bitmap;
bool m_g0_traffic_announcement;
bool m_g0_music_speech;

2
plugins/channelrx/demodbfm/readme.md

@ -62,6 +62,8 @@ Use this button to mute or unmute audio @@ -62,6 +62,8 @@ Use this button to mute or unmute audio
This is the bandwidth in kHz of the channel signal before demodulation. It can be set in steps: 80, 100, 120, 140, 160, 180, 200, 220 and 250 kHz. Inspect the baseband spectrum (B) to adjust for best quality.
The BFM demodulator requires a complex baseband sample rate greater than its RF bandwidth. For a 180 kHz broadcast-FM channel, use at least 240 kS/s; 256 kS/s is recommended.
<h3>A.11: AF bandwidth</h3>
This is the AF bandwidth in kHz. It can be varied continuously between 1 and 20 kHz in steps of 1 kHz.

30
plugins/channelrx/demodchirpchat/chirpchatdemod.cpp

@ -863,8 +863,16 @@ void ChirpChatDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& re @@ -863,8 +863,16 @@ void ChirpChatDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& re
response.getChirpChatDemodReport()->setHeaderCrcStatus(m_lastMsgHeaderCRC);
response.getChirpChatDemodReport()->setPayloadParityStatus(m_lastMsgPayloadParityStatus);
response.getChirpChatDemodReport()->setPayloadCrcStatus(m_lastMsgPayloadCRC);
response.getChirpChatDemodReport()->setMessageTimestamp(new QString(m_lastMsgTimestamp));
response.getChirpChatDemodReport()->setMessageString(new QString(m_lastMsgString));
if (response.getChirpChatDemodReport()->getMessageTimestamp()) {
*response.getChirpChatDemodReport()->getMessageTimestamp() = m_lastMsgTimestamp;
} else {
response.getChirpChatDemodReport()->setMessageTimestamp(new QString(m_lastMsgTimestamp));
}
if (response.getChirpChatDemodReport()->getMessageString()) {
*response.getChirpChatDemodReport()->getMessageString() = m_lastMsgString;
} else {
response.getChirpChatDemodReport()->setMessageString(new QString(m_lastMsgString));
}
response.getChirpChatDemodReport()->setDecoding(getDemodActive() ? 1 : 0);
response.getChirpChatDemodReport()->setMessageBytes(new QList<QString *>);
@ -937,7 +945,11 @@ void ChirpChatDemod::webapiFormatChannelSettings( @@ -937,7 +945,11 @@ void ChirpChatDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setChirpChatDemodSettings(new SWGSDRangel::SWGChirpChatDemodSettings());
SWGSDRangel::SWGChirpChatDemodSettings *swgChirpChatDemodSettings = swgChannelSettings->getChirpChatDemodSettings();
@ -989,7 +1001,11 @@ void ChirpChatDemod::webapiFormatChannelSettings( @@ -989,7 +1001,11 @@ void ChirpChatDemod::webapiFormatChannelSettings(
swgChirpChatDemodSettings->setSendViaUdp(settings.m_sendViaUDP ? 1 : 0);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgChirpChatDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgChirpChatDemodSettings->getUdpAddress()) {
*swgChirpChatDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgChirpChatDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("updPort") || force) {
swgChirpChatDemodSettings->setUdpPort(settings.m_udpPort);
@ -1001,7 +1017,11 @@ void ChirpChatDemod::webapiFormatChannelSettings( @@ -1001,7 +1017,11 @@ void ChirpChatDemod::webapiFormatChannelSettings(
swgChirpChatDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgChirpChatDemodSettings->setTitle(new QString(settings.m_title));
if (swgChirpChatDemodSettings->getTitle()) {
*swgChirpChatDemodSettings->getTitle() = settings.m_title;
} else {
swgChirpChatDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrunConfig") || force))

239
plugins/channelrx/demoddab/dabdemod.cpp

@ -32,12 +32,16 @@ @@ -32,12 +32,16 @@
#include <complex.h>
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGWorkspaceInfo.h"
#include "SWGDABDemodReport.h"
#include "SWGDABDemodSettings.h"
#include "SWGDABProgram.h"
#include "dsp/dspcommands.h"
#include "device/deviceapi.h"
#include "settings/serializable.h"
#include "util/db.h"
#include "maincore.h"
MESSAGE_CLASS_DEFINITION(DABDemod::MsgConfigureDABDemod, Message)
@ -60,7 +64,19 @@ const char * const DABDemod::m_channelId = "DABDemod"; @@ -60,7 +64,19 @@ const char * const DABDemod::m_channelId = "DABDemod";
DABDemod::DABDemod(DeviceAPI *deviceAPI) :
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI),
m_basebandSampleRate(0)
m_basebandSampleRate(0),
m_centerFrequency(0),
m_reportSync(false),
m_reportSNR(0),
m_reportFrequencyOffset(0),
m_reportEnsembleId(0),
m_reportAudioActive(false),
m_reportBitrate(0),
m_reportFrameQuality(0),
m_reportReedSolomonQuality(0),
m_reportAACQuality(0),
m_reportFIBQuality(0),
m_reportTII(0)
{
setObjectName(m_channelId);
@ -136,6 +152,8 @@ void DABDemod::start() @@ -136,6 +152,8 @@ void DABDemod::start()
{
qDebug("DABDemod::start");
clearReport();
m_basebandSink->reset();
m_basebandSink->startWork();
m_thread.start();
@ -153,6 +171,7 @@ void DABDemod::stop() @@ -153,6 +171,7 @@ void DABDemod::stop()
m_basebandSink->stopWork();
m_thread.quit();
m_thread.wait();
clearReport();
}
bool DABDemod::handleMessage(const Message& cmd)
@ -168,6 +187,9 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -168,6 +187,9 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (DSPSignalNotification::match(cmd))
{
DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
if ((m_basebandSampleRate != notif.getSampleRate()) || (m_centerFrequency != notif.getCenterFrequency())) {
clearReport();
}
m_basebandSampleRate = notif.getSampleRate();
m_centerFrequency = notif.getCenterFrequency();
// Forward to the sink
@ -184,6 +206,15 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -184,6 +206,15 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABSystemData::match(cmd))
{
MsgDABSystemData& report = (MsgDABSystemData&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportSync = report.getSync();
m_reportSNR = report.getSNR();
m_reportFrequencyOffset = report.getFrequencyOffset();
if (!m_reportSync) {
m_reportAudioActive = false;
}
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABSystemData(report));
@ -194,6 +225,12 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -194,6 +225,12 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABProgramQuality::match(cmd))
{
MsgDABProgramQuality& report = (MsgDABProgramQuality&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportFrameQuality = report.getFrames();
m_reportReedSolomonQuality = report.getRS();
m_reportAACQuality = report.getAAC();
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABProgramQuality(report));
@ -204,6 +241,10 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -204,6 +241,10 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABFIBQuality::match(cmd))
{
MsgDABFIBQuality& report = (MsgDABFIBQuality&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportFIBQuality = report.getPercent();
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABFIBQuality(report));
@ -214,6 +255,10 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -214,6 +255,10 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABSampleRate::match(cmd))
{
MsgDABSampleRate& report = (MsgDABSampleRate&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportAudioActive = report.getSampleRate() > 0;
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABSampleRate(report));
@ -224,6 +269,11 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -224,6 +269,11 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABEnsembleName::match(cmd))
{
MsgDABEnsembleName& report = (MsgDABEnsembleName&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportEnsembleName = report.getName();
m_reportEnsembleId = report.getId();
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABEnsembleName(report));
@ -234,6 +284,10 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -234,6 +284,10 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABProgramName::match(cmd))
{
MsgDABProgramName& report = (MsgDABProgramName&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportPrograms.insert(report.getId(), report.getName());
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABProgramName(report));
@ -245,6 +299,14 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -245,6 +299,14 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABProgramData::match(cmd))
{
MsgDABProgramData& report = (MsgDABProgramData&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportAudioActive = true;
m_reportBitrate = report.getBitrate();
m_reportAudio = report.getAudio();
m_reportLanguage = report.getLanguage();
m_reportProgramType = report.getProgramType();
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABProgramData(report));
@ -255,6 +317,10 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -255,6 +317,10 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABData::match(cmd))
{
MsgDABData& report = (MsgDABData&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportData = report.getData();
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABData(report));
@ -275,6 +341,10 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -275,6 +341,10 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABTII::match(cmd))
{
MsgDABTII& report = (MsgDABTII&)cmd;
{
QMutexLocker locker(&m_reportMutex);
m_reportTII = report.getTII();
}
if (getMessageQueueToGUI())
{
getMessageQueueToGUI()->push(new MsgDABTII(report));
@ -285,6 +355,7 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -285,6 +355,7 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABReset::match(cmd))
{
MsgDABReset& report = (MsgDABReset&)cmd;
clearReport();
m_basebandSink->getInputMessageQueue()->push(new MsgDABReset(report));
return true;
@ -292,6 +363,7 @@ bool DABDemod::handleMessage(const Message& cmd) @@ -292,6 +363,7 @@ bool DABDemod::handleMessage(const Message& cmd)
else if (MsgDABResetService::match(cmd))
{
MsgDABResetService& report = (MsgDABResetService&)cmd;
clearProgramReport();
m_basebandSink->getInputMessageQueue()->push(new MsgDABResetService(report));
return true;
@ -326,6 +398,12 @@ void DABDemod::applySettings(const QStringList& settingsKeys, const DABDemodSett @@ -326,6 +398,12 @@ void DABDemod::applySettings(const QStringList& settingsKeys, const DABDemodSett
{
qDebug() << "DABDemod::applySettings:" << settings.getDebugString(settingsKeys, force);
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) {
clearReport();
} else if (settings.m_program != m_settings.m_program) {
clearProgramReport();
}
QList<QString> reverseAPIKeys;
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) {
@ -374,7 +452,11 @@ void DABDemod::applySettings(const QStringList& settingsKeys, const DABDemodSett @@ -374,7 +452,11 @@ void DABDemod::applySettings(const QStringList& settingsKeys, const DABDemodSett
webapiReverseSendSettings(settingsKeys, settings, fullUpdate || force);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
QByteArray DABDemod::serialize() const
@ -429,6 +511,123 @@ int DABDemod::webapiSettingsGet( @@ -429,6 +511,123 @@ int DABDemod::webapiSettingsGet(
return 200;
}
int DABDemod::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
(void) errorMessage;
response.setDabDemodReport(new SWGSDRangel::SWGDABDemodReport());
response.getDabDemodReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void DABDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
SWGSDRangel::SWGDABDemodReport *report = response.getDabDemodReport();
double magsqAvg;
double magsqPeak;
int nbMagsqSamples;
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
report->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
report->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
report->setAudioSampleRate(m_basebandSink->getAudioSampleRate());
if (report->getSelectedProgram()) {
*report->getSelectedProgram() = m_settings.m_program.trimmed();
} else {
report->setSelectedProgram(new QString(m_settings.m_program.trimmed()));
}
QMutexLocker locker(&m_reportMutex);
report->setSync(m_reportSync ? 1 : 0);
report->setSnr(m_reportSNR);
report->setFrequencyOffset(m_reportFrequencyOffset);
// DAB labels are a fixed 16 characters, space padded
if (report->getEnsembleName()) {
*report->getEnsembleName() = m_reportEnsembleName.trimmed();
} else {
report->setEnsembleName(new QString(m_reportEnsembleName.trimmed()));
}
report->setEnsembleId(m_reportEnsembleId);
for (auto it = m_reportPrograms.cbegin(); it != m_reportPrograms.cend(); ++it)
{
SWGSDRangel::SWGDABProgram *program = new SWGSDRangel::SWGDABProgram();
program->init();
if (program->getName()) {
*program->getName() = it.value().trimmed();
} else {
program->setName(new QString(it.value().trimmed()));
}
program->setId(it.key());
report->getPrograms()->append(program);
}
report->setAudioActive(m_reportAudioActive ? 1 : 0);
report->setBitrate(m_reportBitrate);
if (report->getAudio()) {
*report->getAudio() = m_reportAudio.trimmed();
} else {
report->setAudio(new QString(m_reportAudio.trimmed()));
}
if (report->getLanguage()) {
*report->getLanguage() = m_reportLanguage.trimmed();
} else {
report->setLanguage(new QString(m_reportLanguage.trimmed()));
}
if (report->getProgramType()) {
*report->getProgramType() = m_reportProgramType.trimmed();
} else {
report->setProgramType(new QString(m_reportProgramType.trimmed()));
}
report->setFrameQuality(m_reportFrameQuality);
report->setReedSolomonQuality(m_reportReedSolomonQuality);
report->setAacQuality(m_reportAACQuality);
report->setFibQuality(m_reportFIBQuality);
report->setTii(m_reportTII);
if (report->getData()) {
*report->getData() = m_reportData.trimmed();
} else {
report->setData(new QString(m_reportData.trimmed()));
}
}
void DABDemod::clearProgramReport()
{
QMutexLocker locker(&m_reportMutex);
m_reportAudioActive = false;
m_reportBitrate = 0;
m_reportAudio.clear();
m_reportLanguage.clear();
m_reportProgramType.clear();
m_reportFrameQuality = 0;
m_reportReedSolomonQuality = 0;
m_reportAACQuality = 0;
m_reportData.clear();
}
void DABDemod::clearReport()
{
QMutexLocker locker(&m_reportMutex);
m_reportSync = false;
m_reportSNR = 0;
m_reportFrequencyOffset = 0;
m_reportEnsembleName.clear();
m_reportEnsembleId = 0;
m_reportPrograms.clear();
m_reportAudioActive = false;
m_reportBitrate = 0;
m_reportAudio.clear();
m_reportLanguage.clear();
m_reportProgramType.clear();
m_reportFrameQuality = 0;
m_reportReedSolomonQuality = 0;
m_reportAACQuality = 0;
m_reportFIBQuality = 0;
m_reportTII = 0;
m_reportData.clear();
}
int DABDemod::webapiWorkspaceGet(
SWGSDRangel::SWGWorkspaceInfo& response,
QString& errorMessage)
@ -522,10 +721,18 @@ void DABDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp @@ -522,10 +721,18 @@ void DABDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
{
response.getDabDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getDabDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getDabDemodSettings()->setProgram(new QString(settings.m_program));
if (response.getDabDemodSettings()->getProgram()) {
*response.getDabDemodSettings()->getProgram() = settings.m_program;
} else {
response.getDabDemodSettings()->setProgram(new QString(settings.m_program));
}
response.getDabDemodSettings()->setVolume(settings.m_volume);
response.getDabDemodSettings()->setAudioMute(settings.m_audioMute);
response.getDabDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (response.getDabDemodSettings()->getAudioDeviceName()) {
*response.getDabDemodSettings()->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
response.getDabDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getDabDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getDabDemodSettings()->getTitle()) {
@ -611,7 +818,11 @@ void DABDemod::webapiFormatChannelSettings( @@ -611,7 +818,11 @@ void DABDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("DABDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "DABDemod";
} else {
swgChannelSettings->setChannelType(new QString("DABDemod"));
}
swgChannelSettings->setDabDemodSettings(new SWGSDRangel::SWGDABDemodSettings());
SWGSDRangel::SWGDABDemodSettings *swgDABDemodSettings = swgChannelSettings->getDabDemodSettings();
@ -624,7 +835,11 @@ void DABDemod::webapiFormatChannelSettings( @@ -624,7 +835,11 @@ void DABDemod::webapiFormatChannelSettings(
swgDABDemodSettings->setRfBandwidth(settings.m_rfBandwidth);
}
if (channelSettingsKeys.contains("program") || force) {
swgDABDemodSettings->setProgram(new QString(settings.m_program));
if (swgDABDemodSettings->getProgram()) {
*swgDABDemodSettings->getProgram() = settings.m_program;
} else {
swgDABDemodSettings->setProgram(new QString(settings.m_program));
}
}
if (channelSettingsKeys.contains("volume") || force) {
swgDABDemodSettings->setVolume(settings.m_volume);
@ -633,13 +848,21 @@ void DABDemod::webapiFormatChannelSettings( @@ -633,13 +848,21 @@ void DABDemod::webapiFormatChannelSettings(
swgDABDemodSettings->setAudioMute(settings.m_audioMute);
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgDABDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgDABDemodSettings->getAudioDeviceName()) {
*swgDABDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgDABDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgDABDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgDABDemodSettings->setTitle(new QString(settings.m_title));
if (swgDABDemodSettings->getTitle()) {
*swgDABDemodSettings->getTitle() = settings.m_title;
} else {
swgDABDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgDABDemodSettings->setStreamIndex(settings.m_streamIndex);

28
plugins/channelrx/demoddab/dabdemod.h

@ -22,6 +22,8 @@ @@ -22,6 +22,8 @@
#include <vector>
#include <QNetworkRequest>
#include <QMap>
#include <QMutex>
#include <QThread>
#include "dsp/basebandsamplesink.h"
@ -381,6 +383,10 @@ public: @@ -381,6 +383,10 @@ public:
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response,
const DABDemodSettings& settings);
@ -410,12 +416,34 @@ private: @@ -410,12 +416,34 @@ private:
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
qint64 m_centerFrequency;
mutable QMutex m_reportMutex;
bool m_reportSync;
int m_reportSNR;
int m_reportFrequencyOffset;
QString m_reportEnsembleName;
int m_reportEnsembleId;
QMap<int, QString> m_reportPrograms;
bool m_reportAudioActive;
int m_reportBitrate;
QString m_reportAudio;
QString m_reportLanguage;
QString m_reportProgramType;
int m_reportFrameQuality;
int m_reportReedSolomonQuality;
int m_reportAACQuality;
int m_reportFIBQuality;
int m_reportTII;
QString m_reportData;
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const QStringList& settingsKeys, const DABDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void clearReport();
void clearProgramReport();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const DABDemodSettings& settings, bool force);
void webapiFormatChannelSettings(
const QList<QString>& channelSettingsKeys,

1
plugins/channelrx/demoddab/dabdemodbaseband.h

@ -79,6 +79,7 @@ public: @@ -79,6 +79,7 @@ public:
double getMagSq() const { return m_sink.getMagSq(); }
bool isRunning() const { return m_running; }
int getAudioSampleRate() const { return m_sink.getAudioSampleRate(); }
int getChannelSampleRate() const { return m_sink.getChannelSampleRate(); }
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }

6
plugins/channelrx/demoddab/dabdemodsink.cpp

@ -633,7 +633,11 @@ void DABDemodSink::applySettings(const QStringList& settingsKeys, const DABDemod @@ -633,7 +633,11 @@ void DABDemodSink::applySettings(const QStringList& settingsKeys, const DABDemod
}
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
// Can't call setProgram directly from callback, so we get here via a message

1
plugins/channelrx/demoddab/dabdemodsink.h

@ -53,6 +53,7 @@ public: @@ -53,6 +53,7 @@ public:
void applyAudioSampleRate(int sampleRate);
void applyDABAudioSampleRate(int sampleRate);
int getAudioSampleRate() const { return m_audioSampleRate; }
int getChannelSampleRate() const { return m_channelSampleRate; }
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }

30
plugins/channelrx/demoddatv/datvdemod.cpp

@ -220,7 +220,11 @@ void DATVDemod::applySettings(const QList<QString>& settingsKeys, const DATVDemo @@ -220,7 +220,11 @@ void DATVDemod::applySettings(const QList<QString>& settingsKeys, const DATVDemo
sendChannelSettings(pipes, settingsKeys, settings, force);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
uint32_t DATVDemod::getNumberOfDeviceStreams() const
@ -538,7 +542,11 @@ void DATVDemod::webapiFormatChannelSettings( @@ -538,7 +542,11 @@ void DATVDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("DATVDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "DATVDemod";
} else {
swgChannelSettings->setChannelType(new QString("DATVDemod"));
}
swgChannelSettings->setDatvDemodSettings(new SWGSDRangel::SWGDATVDemodSettings());
SWGSDRangel::SWGDATVDemodSettings *swgDATVDemodSettings = swgChannelSettings->getDatvDemodSettings();
@ -548,7 +556,11 @@ void DATVDemod::webapiFormatChannelSettings( @@ -548,7 +556,11 @@ void DATVDemod::webapiFormatChannelSettings(
swgDATVDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgDATVDemodSettings->setTitle(new QString(settings.m_title));
if (swgDATVDemodSettings->getTitle()) {
*swgDATVDemodSettings->getTitle() = settings.m_title;
} else {
swgDATVDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("rfBandwidth") || force) {
swgDATVDemodSettings->setRfBandwidth(settings.m_rfBandwidth);
@ -578,7 +590,11 @@ void DATVDemod::webapiFormatChannelSettings( @@ -578,7 +590,11 @@ void DATVDemod::webapiFormatChannelSettings(
swgDATVDemodSettings->setAudioMute(settings.m_audioMute ? 1 : 0);
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgDATVDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgDATVDemodSettings->getAudioDeviceName()) {
*swgDATVDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgDATVDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("symbolRate") || force) {
swgDATVDemodSettings->setSymbolRate(settings.m_symbolRate);
@ -614,7 +630,11 @@ void DATVDemod::webapiFormatChannelSettings( @@ -614,7 +630,11 @@ void DATVDemod::webapiFormatChannelSettings(
swgDATVDemodSettings->setVideoMute(settings.m_videoMute ? 1 : 0);
}
if (channelSettingsKeys.contains("udpTSAddress") || force) {
swgDATVDemodSettings->setUdpTsAddress(new QString(settings.m_udpTSAddress));
if (swgDATVDemodSettings->getUdpTsAddress()) {
*swgDATVDemodSettings->getUdpTsAddress() = settings.m_udpTSAddress;
} else {
swgDATVDemodSettings->setUdpTsAddress(new QString(settings.m_udpTSAddress));
}
}
if (channelSettingsKeys.contains("udpTSPort") || force) {
swgDATVDemodSettings->setUdpTsPort(settings.m_udpTSPort);

18
plugins/channelrx/demoddatv/datvdemodwebapiadapter.cpp

@ -52,7 +52,11 @@ void DATVDemodWebAPIAdapter::webapiFormatChannelSettings( @@ -52,7 +52,11 @@ void DATVDemodWebAPIAdapter::webapiFormatChannelSettings(
const DATVDemodSettings& settings)
{
response.getDatvDemodSettings()->setAllowDrift(settings.m_allowDrift ? 1 : 0);
response.getDatvDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (response.getDatvDemodSettings()->getAudioDeviceName()) {
*response.getDatvDemodSettings()->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
response.getDatvDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getDatvDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getDatvDemodSettings()->setAudioVolume(settings.m_audioVolume);
response.getDatvDemodSettings()->setCenterFrequency(settings.m_centerFrequency);
@ -68,9 +72,17 @@ void DATVDemodWebAPIAdapter::webapiFormatChannelSettings( @@ -68,9 +72,17 @@ void DATVDemodWebAPIAdapter::webapiFormatChannelSettings(
response.getDatvDemodSettings()->setRollOff(settings.m_rollOff);
response.getDatvDemodSettings()->setStandard((int) settings.m_standard);
response.getDatvDemodSettings()->setSymbolRate(settings.m_symbolRate);
response.getDatvDemodSettings()->setTitle(new QString(settings.m_title));
if (response.getDatvDemodSettings()->getTitle()) {
*response.getDatvDemodSettings()->getTitle() = settings.m_title;
} else {
response.getDatvDemodSettings()->setTitle(new QString(settings.m_title));
}
response.getDatvDemodSettings()->setUdpTs(settings.m_udpTS ? 1 : 0);
response.getDatvDemodSettings()->setUdpTsAddress(new QString(settings.m_udpTSAddress));
if (response.getDatvDemodSettings()->getUdpTsAddress()) {
*response.getDatvDemodSettings()->getUdpTsAddress() = settings.m_udpTSAddress;
} else {
response.getDatvDemodSettings()->setUdpTsAddress(new QString(settings.m_udpTSAddress));
}
response.getDatvDemodSettings()->setUdpTsPort(settings.m_udpTSPort);
response.getDatvDemodSettings()->setVideoMute(settings.m_videoMute ? 1 : 0);
response.getDatvDemodSettings()->setViterbi(settings.m_viterbi ? 1 : 0);

48
plugins/channelrx/demoddsc/dscdemod.cpp

@ -509,11 +509,23 @@ void DSCDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp @@ -509,11 +509,23 @@ void DSCDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getDscDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getDscDemodSettings()->setFilterInvalid(settings.m_filterInvalid);
response.getDscDemodSettings()->setFilterColumn(settings.m_filterColumn);
response.getDscDemodSettings()->setFilter(new QString(settings.m_filter));
if (response.getDscDemodSettings()->getFilter()) {
*response.getDscDemodSettings()->getFilter() = settings.m_filter;
} else {
response.getDscDemodSettings()->setFilter(new QString(settings.m_filter));
}
response.getDscDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getDscDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getDscDemodSettings()->getUdpAddress()) {
*response.getDscDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getDscDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getDscDemodSettings()->setUdpPort(settings.m_udpPort);
response.getDscDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getDscDemodSettings()->getLogFilename()) {
*response.getDscDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getDscDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getDscDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getDscDemodSettings()->setUseFileTime(settings.m_useFileTime);
@ -624,7 +636,11 @@ void DSCDemod::webapiFormatChannelSettings( @@ -624,7 +636,11 @@ void DSCDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("DSCDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "DSCDemod";
} else {
swgChannelSettings->setChannelType(new QString("DSCDemod"));
}
swgChannelSettings->setDscDemodSettings(new SWGSDRangel::SWGDSCDemodSettings());
SWGSDRangel::SWGDSCDemodSettings *swgDSCDemodSettings = swgChannelSettings->getDscDemodSettings();
@ -643,19 +659,31 @@ void DSCDemod::webapiFormatChannelSettings( @@ -643,19 +659,31 @@ void DSCDemod::webapiFormatChannelSettings(
swgDSCDemodSettings->setFilterColumn(settings.m_filterColumn);
}
if (channelSettingsKeys.contains("filter") || force) {
swgDSCDemodSettings->setFilter(new QString(settings.m_filter));
if (swgDSCDemodSettings->getFilter()) {
*swgDSCDemodSettings->getFilter() = settings.m_filter;
} else {
swgDSCDemodSettings->setFilter(new QString(settings.m_filter));
}
}
if (channelSettingsKeys.contains("udpEnabled") || force) {
swgDSCDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgDSCDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgDSCDemodSettings->getUdpAddress()) {
*swgDSCDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgDSCDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgDSCDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgDSCDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgDSCDemodSettings->getLogFilename()) {
*swgDSCDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgDSCDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgDSCDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -667,7 +695,11 @@ void DSCDemod::webapiFormatChannelSettings( @@ -667,7 +695,11 @@ void DSCDemod::webapiFormatChannelSettings(
swgDSCDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgDSCDemodSettings->setTitle(new QString(settings.m_title));
if (swgDSCDemodSettings->getTitle()) {
*swgDSCDemodSettings->getTitle() = settings.m_title;
} else {
swgDSCDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgDSCDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demoddsc/dscdemodgui.cpp

@ -40,6 +40,7 @@ @@ -40,6 +40,7 @@
#include "util/csv.h"
#include "util/db.h"
#include "util/mmsi.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/decimaldelegate.h"
#include "dsp/dspengine.h"
@ -1174,12 +1175,12 @@ void DSCDemodGUI::on_logOpen_clicked() @@ -1174,12 +1175,12 @@ void DSCDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "DSC Demod", error);
MessageDialog::critical(this, "DSC Demod", error);
}
}
else
{
QMessageBox::critical(this, "DSC Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "DSC Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

36
plugins/channelrx/demoddsd/dsddemod.cpp

@ -333,7 +333,11 @@ void DSDDemod::applySettings(const QStringList& settingsKeys, const DSDDemodSett @@ -333,7 +333,11 @@ void DSDDemod::applySettings(const QStringList& settingsKeys, const DSDDemodSett
sendChannelSettings(pipes, settingsKeys, settings, force);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
QByteArray DSDDemod::serialize() const
@ -657,12 +661,20 @@ void DSDDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response @@ -657,12 +661,20 @@ void DSDDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response
response.getDsdDemodReport()->setPllLocked(getDecoder().getSymbolPLLLocked() ? 1 : 0);
response.getDsdDemodReport()->setSlot1On(getDecoder().getVoice1On() ? 1 : 0);
response.getDsdDemodReport()->setSlot2On(getDecoder().getVoice2On() ? 1 : 0);
response.getDsdDemodReport()->setSyncType(new QString(getDecoder().getFrameTypeText()));
if (response.getDsdDemodReport()->getSyncType()) {
*response.getDsdDemodReport()->getSyncType() = getDecoder().getFrameTypeText();
} else {
response.getDsdDemodReport()->setSyncType(new QString(getDecoder().getFrameTypeText()));
}
response.getDsdDemodReport()->setInLevel(getDecoder().getInLevel());
response.getDsdDemodReport()->setCarierPosition(getDecoder().getCarrierPos());
response.getDsdDemodReport()->setZeroCrossingPosition(getDecoder().getZeroCrossingPos());
response.getDsdDemodReport()->setSyncRate(getDecoder().getSymbolSyncQuality());
response.getDsdDemodReport()->setStatusText(new QString(updateAndGetStatusText()));
if (response.getDsdDemodReport()->getStatusText()) {
*response.getDsdDemodReport()->getStatusText() = updateAndGetStatusText();
} else {
response.getDsdDemodReport()->setStatusText(new QString(updateAndGetStatusText()));
}
}
void DSDDemod::webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const DSDDemodSettings& settings, bool force)
@ -725,7 +737,11 @@ void DSDDemod::webapiFormatChannelSettings( @@ -725,7 +737,11 @@ void DSDDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setDsdDemodSettings(new SWGSDRangel::SWGDSDDemodSettings());
SWGSDRangel::SWGDSDDemodSettings *swgDSDDemodSettings = swgChannelSettings->getDsdDemodSettings();
@ -780,10 +796,18 @@ void DSDDemod::webapiFormatChannelSettings( @@ -780,10 +796,18 @@ void DSDDemod::webapiFormatChannelSettings(
swgDSDDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgDSDDemodSettings->setTitle(new QString(settings.m_title));
if (swgDSDDemodSettings->getTitle()) {
*swgDSDDemodSettings->getTitle() = settings.m_title;
} else {
swgDSDDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgDSDDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgDSDDemodSettings->getAudioDeviceName()) {
*swgDSDDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgDSDDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("highPassFilter") || force) {
swgDSDDemodSettings->setHighPassFilter(settings.m_highPassFilter ? 1 : 0);

4
plugins/channelrx/demoddsd/dsdstatustextdialog.cpp

@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
#include <QMessageBox>
#include <QTextStream>
#include "gui/messagedialog.h"
DSDStatusTextDialog::DSDStatusTextDialog(QWidget* parent) :
QDialog(parent),
ui(new Ui::DSDStatusTextDialog)
@ -84,7 +86,7 @@ void DSDStatusTextDialog::on_saveLog_clicked() @@ -84,7 +86,7 @@ void DSDStatusTextDialog::on_saveLog_clicked()
}
else
{
QMessageBox::information(this, tr("Message"), tr("Cannot open file for writing"));
MessageDialog::information(this, tr("Message"), tr("Cannot open file for writing"));
}
}

36
plugins/channelrx/demodendoftrain/endoftraindemod.cpp

@ -484,9 +484,17 @@ void EndOfTrainDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetting @@ -484,9 +484,17 @@ void EndOfTrainDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetting
response.getEndOfTrainDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getEndOfTrainDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getEndOfTrainDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getEndOfTrainDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getEndOfTrainDemodSettings()->getUdpAddress()) {
*response.getEndOfTrainDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getEndOfTrainDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getEndOfTrainDemodSettings()->setUdpPort(settings.m_udpPort);
response.getEndOfTrainDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getEndOfTrainDemodSettings()->getLogFilename()) {
*response.getEndOfTrainDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getEndOfTrainDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getEndOfTrainDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getEndOfTrainDemodSettings()->setUseFileTime(settings.m_useFileTime);
@ -584,7 +592,11 @@ void EndOfTrainDemod::webapiFormatChannelSettings( @@ -584,7 +592,11 @@ void EndOfTrainDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("EndOfTrainDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "EndOfTrainDemod";
} else {
swgChannelSettings->setChannelType(new QString("EndOfTrainDemod"));
}
swgChannelSettings->setEndOfTrainDemodSettings(new SWGSDRangel::SWGEndOfTrainDemodSettings());
SWGSDRangel::SWGEndOfTrainDemodSettings *swgEndOfTrainDemodSettings = swgChannelSettings->getEndOfTrainDemodSettings();
@ -603,13 +615,21 @@ void EndOfTrainDemod::webapiFormatChannelSettings( @@ -603,13 +615,21 @@ void EndOfTrainDemod::webapiFormatChannelSettings(
swgEndOfTrainDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgEndOfTrainDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgEndOfTrainDemodSettings->getUdpAddress()) {
*swgEndOfTrainDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgEndOfTrainDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgEndOfTrainDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgEndOfTrainDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgEndOfTrainDemodSettings->getLogFilename()) {
*swgEndOfTrainDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgEndOfTrainDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgEndOfTrainDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -621,7 +641,11 @@ void EndOfTrainDemod::webapiFormatChannelSettings( @@ -621,7 +641,11 @@ void EndOfTrainDemod::webapiFormatChannelSettings(
swgEndOfTrainDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgEndOfTrainDemodSettings->setTitle(new QString(settings.m_title));
if (swgEndOfTrainDemodSettings->getTitle()) {
*swgEndOfTrainDemodSettings->getTitle() = settings.m_title;
} else {
swgEndOfTrainDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgEndOfTrainDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demodendoftrain/endoftraindemodgui.cpp

@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
#include "plugin/pluginapi.h"
#include "util/csv.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "dsp/glscopesettings.h"
@ -728,12 +729,12 @@ void EndOfTrainDemodGUI::on_logOpen_clicked() @@ -728,12 +729,12 @@ void EndOfTrainDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "End-Of-Train Demod", error);
MessageDialog::critical(this, "End-Of-Train Demod", error);
}
}
else
{
QMessageBox::critical(this, "End-Of-Train Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "End-Of-Train Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

18
plugins/channelrx/demodfreedv/freedvdemod.cpp

@ -542,7 +542,11 @@ void FreeDVDemod::webapiFormatChannelSettings( @@ -542,7 +542,11 @@ void FreeDVDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setFreeDvDemodSettings(new SWGSDRangel::SWGFreeDVDemodSettings());
SWGSDRangel::SWGFreeDVDemodSettings *swgFreeDVDemodSettings = swgChannelSettings->getFreeDvDemodSettings();
@ -573,10 +577,18 @@ void FreeDVDemod::webapiFormatChannelSettings( @@ -573,10 +577,18 @@ void FreeDVDemod::webapiFormatChannelSettings(
swgFreeDVDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgFreeDVDemodSettings->setTitle(new QString(settings.m_title));
if (swgFreeDVDemodSettings->getTitle()) {
*swgFreeDVDemodSettings->getTitle() = settings.m_title;
} else {
swgFreeDVDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgFreeDVDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgFreeDVDemodSettings->getAudioDeviceName()) {
*swgFreeDVDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgFreeDVDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgFreeDVDemodSettings->setStreamIndex(settings.m_streamIndex);

67
plugins/channelrx/demodft8/ft8demod.cpp

@ -392,13 +392,26 @@ int FT8Demod::webapiSettingsPutPatch( @@ -392,13 +392,26 @@ int FT8Demod::webapiSettingsPutPatch(
FT8DemodSettings settings = m_settings;
webapiUpdateChannelSettings(settings, channelSettingsKeys, response);
MsgConfigureFT8Demod *msg = MsgConfigureFT8Demod::create(channelSettingsKeys, settings, force);
// The filter keys set one entry of the filter bank, and the settings are applied by key
// name with the bank copied as a whole under its own, so that is the key to pass on
QStringList settingsKeys = channelSettingsKeys;
for (const char *key : {"rfBandwidth", "lowCutoff", "spanLog2", "fftWindow"})
{
if (settingsKeys.contains(key) && !settingsKeys.contains("filterBank"))
{
settingsKeys.append("filterBank");
break;
}
}
MsgConfigureFT8Demod *msg = MsgConfigureFT8Demod::create(settingsKeys, settings, force);
m_inputMessageQueue.push(msg);
qDebug("FT8Demod::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureFT8Demod *msgToGUI = MsgConfigureFT8Demod::create(channelSettingsKeys, settings, force);
MsgConfigureFT8Demod *msgToGUI = MsgConfigureFT8Demod::create(settingsKeys, settings, force);
m_guiMessageQueue->push(msgToGUI);
}
@ -429,7 +442,7 @@ void FT8Demod::webapiUpdateChannelSettings( @@ -429,7 +442,7 @@ void FT8Demod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("lowCutoff")) {
settings.m_filterBank[settings.m_filterIndex].m_lowCutoff = response.getFt8DemodSettings()->getLowCutoff();
}
if (channelSettingsKeys.contains("fftWimdow")) {
if (channelSettingsKeys.contains("fftWindow")) {
settings.m_filterBank[settings.m_filterIndex].m_fftWindow = (FFTWindow::Function) response.getFt8DemodSettings()->getFftWindow();
}
if (channelSettingsKeys.contains("volume")) {
@ -539,9 +552,21 @@ void FT8Demod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp @@ -539,9 +552,21 @@ void FT8Demod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getFt8DemodSettings()->setOsdLdpcThreshold(settings.m_osdLDPCThreshold);
response.getFt8DemodSettings()->setUseOsd(settings.m_verifyOSD ? 1 : 0);
response.getFt8DemodSettings()->setEnablePskReporter(settings.m_enablePSKReporter ? 1 : 0);
response.getFt8DemodSettings()->setPskReporterCallsign(new QString(settings.m_pskReporterCallsign));
response.getFt8DemodSettings()->setPskReporterLocator(new QString(settings.m_pskReporterLocator));
response.getFt8DemodSettings()->setPskReporterSoftware(new QString(settings.m_pskReporterSoftware));
if (response.getFt8DemodSettings()->getPskReporterCallsign()) {
*response.getFt8DemodSettings()->getPskReporterCallsign() = settings.m_pskReporterCallsign;
} else {
response.getFt8DemodSettings()->setPskReporterCallsign(new QString(settings.m_pskReporterCallsign));
}
if (response.getFt8DemodSettings()->getPskReporterLocator()) {
*response.getFt8DemodSettings()->getPskReporterLocator() = settings.m_pskReporterLocator;
} else {
response.getFt8DemodSettings()->setPskReporterLocator(new QString(settings.m_pskReporterLocator));
}
if (response.getFt8DemodSettings()->getPskReporterSoftware()) {
*response.getFt8DemodSettings()->getPskReporterSoftware() = settings.m_pskReporterSoftware;
} else {
response.getFt8DemodSettings()->setPskReporterSoftware(new QString(settings.m_pskReporterSoftware));
}
response.getFt8DemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getFt8DemodSettings()->getTitle()) {
@ -683,7 +708,11 @@ void FT8Demod::webapiFormatChannelSettings( @@ -683,7 +708,11 @@ void FT8Demod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setFt8DemodSettings(new SWGSDRangel::SWGFT8DemodSettings());
SWGSDRangel::SWGFT8DemodSettings *swgFT8DemodSettings = swgChannelSettings->getFt8DemodSettings();
@ -741,19 +770,35 @@ void FT8Demod::webapiFormatChannelSettings( @@ -741,19 +770,35 @@ void FT8Demod::webapiFormatChannelSettings(
swgFT8DemodSettings->setEnablePskReporter(settings.m_enablePSKReporter ? 1 : 0);
}
if (channelSettingsKeys.contains("pskReporterCallsign") || force) {
swgFT8DemodSettings->setPskReporterCallsign(new QString(settings.m_pskReporterCallsign));
if (swgFT8DemodSettings->getPskReporterCallsign()) {
*swgFT8DemodSettings->getPskReporterCallsign() = settings.m_pskReporterCallsign;
} else {
swgFT8DemodSettings->setPskReporterCallsign(new QString(settings.m_pskReporterCallsign));
}
}
if (channelSettingsKeys.contains("pskReporterLocator") || force) {
swgFT8DemodSettings->setPskReporterLocator(new QString(settings.m_pskReporterLocator));
if (swgFT8DemodSettings->getPskReporterLocator()) {
*swgFT8DemodSettings->getPskReporterLocator() = settings.m_pskReporterLocator;
} else {
swgFT8DemodSettings->setPskReporterLocator(new QString(settings.m_pskReporterLocator));
}
}
if (channelSettingsKeys.contains("pskReporterSoftware") || force) {
swgFT8DemodSettings->setPskReporterSoftware(new QString(settings.m_pskReporterSoftware));
if (swgFT8DemodSettings->getPskReporterSoftware()) {
*swgFT8DemodSettings->getPskReporterSoftware() = settings.m_pskReporterSoftware;
} else {
swgFT8DemodSettings->setPskReporterSoftware(new QString(settings.m_pskReporterSoftware));
}
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgFT8DemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgFT8DemodSettings->setTitle(new QString(settings.m_title));
if (swgFT8DemodSettings->getTitle()) {
*swgFT8DemodSettings->getTitle() = settings.m_title;
} else {
swgFT8DemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgFT8DemodSettings->setStreamIndex(settings.m_streamIndex);

90
plugins/channelrx/demodils/ilsdemod.cpp

@ -587,19 +587,43 @@ void ILSDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp @@ -587,19 +587,43 @@ void ILSDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getIlsDemodSettings()->setAverage(settings.m_average);
response.getIlsDemodSettings()->setDdmUnits((int) settings.m_ddmUnits);
response.getIlsDemodSettings()->setIdentThreshold(settings.m_identThreshold);
response.getIlsDemodSettings()->setIdent(new QString(settings.m_ident));
response.getIlsDemodSettings()->setRunway(new QString(settings.m_runway));
if (response.getIlsDemodSettings()->getIdent()) {
*response.getIlsDemodSettings()->getIdent() = settings.m_ident;
} else {
response.getIlsDemodSettings()->setIdent(new QString(settings.m_ident));
}
if (response.getIlsDemodSettings()->getRunway()) {
*response.getIlsDemodSettings()->getRunway() = settings.m_runway;
} else {
response.getIlsDemodSettings()->setRunway(new QString(settings.m_runway));
}
response.getIlsDemodSettings()->setTrueBearing(settings.m_trueBearing);
response.getIlsDemodSettings()->setLatitude(new QString(settings.m_latitude));
response.getIlsDemodSettings()->setLatitude(new QString(settings.m_latitude));
if (response.getIlsDemodSettings()->getLatitude()) {
*response.getIlsDemodSettings()->getLatitude() = settings.m_latitude;
} else {
response.getIlsDemodSettings()->setLatitude(new QString(settings.m_latitude));
}
if (response.getIlsDemodSettings()->getLatitude()) {
*response.getIlsDemodSettings()->getLatitude() = settings.m_latitude;
} else {
response.getIlsDemodSettings()->setLatitude(new QString(settings.m_latitude));
}
response.getIlsDemodSettings()->setElevation(settings.m_elevation);
response.getIlsDemodSettings()->setGlidePath(settings.m_glidePath);
response.getIlsDemodSettings()->setRefHeight(settings.m_refHeight);
response.getIlsDemodSettings()->setCourseWidth(settings.m_courseWidth);
response.getIlsDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getIlsDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getIlsDemodSettings()->getUdpAddress()) {
*response.getIlsDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getIlsDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getIlsDemodSettings()->setUdpPort(settings.m_udpPort);
response.getIlsDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getIlsDemodSettings()->getLogFilename()) {
*response.getIlsDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getIlsDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getIlsDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getIlsDemodSettings()->setRgbColor(settings.m_rgbColor);
@ -672,7 +696,11 @@ void ILSDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response @@ -672,7 +696,11 @@ void ILSDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response
response.getIlsDemodReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getIlsDemodReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
response.getIlsDemodReport()->setIdent(new QString(m_ident));
if (response.getIlsDemodReport()->getIdent()) {
*response.getIlsDemodReport()->getIdent() = m_ident;
} else {
response.getIlsDemodReport()->setIdent(new QString(m_ident));
}
response.getIlsDemodReport()->setDeviation(m_angle);
response.getIlsDemodReport()->setSdm(m_sdm);
response.getIlsDemodReport()->setDdm(m_ddm);
@ -715,7 +743,11 @@ void ILSDemod::webapiFormatChannelSettings( @@ -715,7 +743,11 @@ void ILSDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("ILSDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "ILSDemod";
} else {
swgChannelSettings->setChannelType(new QString("ILSDemod"));
}
swgChannelSettings->setIlsDemodSettings(new SWGSDRangel::SWGILSDemodSettings());
SWGSDRangel::SWGILSDemodSettings *swgILSDemodSettings = swgChannelSettings->getIlsDemodSettings();
@ -752,19 +784,35 @@ void ILSDemod::webapiFormatChannelSettings( @@ -752,19 +784,35 @@ void ILSDemod::webapiFormatChannelSettings(
swgILSDemodSettings->setIdentThreshold(settings.m_identThreshold);
}
if (channelSettingsKeys.contains("ident") || force) {
swgILSDemodSettings->setIdent(new QString(settings.m_ident));
if (swgILSDemodSettings->getIdent()) {
*swgILSDemodSettings->getIdent() = settings.m_ident;
} else {
swgILSDemodSettings->setIdent(new QString(settings.m_ident));
}
}
if (channelSettingsKeys.contains("runway") || force) {
swgILSDemodSettings->setRunway(new QString(settings.m_runway));
if (swgILSDemodSettings->getRunway()) {
*swgILSDemodSettings->getRunway() = settings.m_runway;
} else {
swgILSDemodSettings->setRunway(new QString(settings.m_runway));
}
}
if (channelSettingsKeys.contains("trueBearing") || force) {
swgILSDemodSettings->setTrueBearing(settings.m_trueBearing);
}
if (channelSettingsKeys.contains("latitude") || force) {
swgILSDemodSettings->setLatitude(new QString(settings.m_latitude));
if (swgILSDemodSettings->getLatitude()) {
*swgILSDemodSettings->getLatitude() = settings.m_latitude;
} else {
swgILSDemodSettings->setLatitude(new QString(settings.m_latitude));
}
}
if (channelSettingsKeys.contains("longitude") || force) {
swgILSDemodSettings->setLongitude(new QString(settings.m_longitude));
if (swgILSDemodSettings->getLongitude()) {
*swgILSDemodSettings->getLongitude() = settings.m_longitude;
} else {
swgILSDemodSettings->setLongitude(new QString(settings.m_longitude));
}
}
if (channelSettingsKeys.contains("elevation") || force) {
swgILSDemodSettings->setElevation(settings.m_elevation);
@ -782,13 +830,21 @@ void ILSDemod::webapiFormatChannelSettings( @@ -782,13 +830,21 @@ void ILSDemod::webapiFormatChannelSettings(
swgILSDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgILSDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgILSDemodSettings->getUdpAddress()) {
*swgILSDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgILSDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgILSDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgILSDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgILSDemodSettings->getLogFilename()) {
*swgILSDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgILSDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgILSDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -797,7 +853,11 @@ void ILSDemod::webapiFormatChannelSettings( @@ -797,7 +853,11 @@ void ILSDemod::webapiFormatChannelSettings(
swgILSDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgILSDemodSettings->setTitle(new QString(settings.m_title));
if (swgILSDemodSettings->getTitle()) {
*swgILSDemodSettings->getTitle() = settings.m_title;
} else {
swgILSDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgILSDemodSettings->setStreamIndex(settings.m_streamIndex);

36
plugins/channelrx/demodinmarsat/inmarsatdemod.cpp

@ -475,9 +475,17 @@ void InmarsatDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& @@ -475,9 +475,17 @@ void InmarsatDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings&
response.getInmarsatDemodSettings()->setRrcRolloff(settings.m_rrcRolloff);
response.getInmarsatDemodSettings()->setPllBandwidth(settings.m_pllBW);
response.getInmarsatDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getInmarsatDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getInmarsatDemodSettings()->getUdpAddress()) {
*response.getInmarsatDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getInmarsatDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getInmarsatDemodSettings()->setUdpPort(settings.m_udpPort);
response.getInmarsatDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getInmarsatDemodSettings()->getLogFilename()) {
*response.getInmarsatDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getInmarsatDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getInmarsatDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getInmarsatDemodSettings()->setUseFileTime(settings.m_useFileTime);
@ -575,7 +583,11 @@ void InmarsatDemod::webapiFormatChannelSettings( @@ -575,7 +583,11 @@ void InmarsatDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("InmarsatDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "InmarsatDemod";
} else {
swgChannelSettings->setChannelType(new QString("InmarsatDemod"));
}
swgChannelSettings->setInmarsatDemodSettings(new SWGSDRangel::SWGInmarsatDemodSettings());
SWGSDRangel::SWGInmarsatDemodSettings *swgInmarsatDemodSettings = swgChannelSettings->getInmarsatDemodSettings();
@ -597,13 +609,21 @@ void InmarsatDemod::webapiFormatChannelSettings( @@ -597,13 +609,21 @@ void InmarsatDemod::webapiFormatChannelSettings(
swgInmarsatDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgInmarsatDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgInmarsatDemodSettings->getUdpAddress()) {
*swgInmarsatDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgInmarsatDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgInmarsatDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgInmarsatDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgInmarsatDemodSettings->getLogFilename()) {
*swgInmarsatDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgInmarsatDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgInmarsatDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -615,7 +635,11 @@ void InmarsatDemod::webapiFormatChannelSettings( @@ -615,7 +635,11 @@ void InmarsatDemod::webapiFormatChannelSettings(
swgInmarsatDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgInmarsatDemodSettings->setTitle(new QString(settings.m_title));
if (swgInmarsatDemodSettings->getTitle()) {
*swgInmarsatDemodSettings->getTitle() = settings.m_title;
} else {
swgInmarsatDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgInmarsatDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demodinmarsat/inmarsatdemodgui.cpp

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include "util/db.h"
#include "util/units.h"
#include "util/osndb.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialogpositioner.h"
#include "dsp/glscopesettings.h"
@ -1947,12 +1948,12 @@ void InmarsatDemodGUI::on_logOpen_clicked() @@ -1947,12 +1948,12 @@ void InmarsatDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Inmarsat Demod", error);
MessageDialog::critical(this, "Inmarsat Demod", error);
}
}
else
{
QMessageBox::critical(this, "Inmarsat Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Inmarsat Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

18
plugins/channelrx/demodm17/m17demod.cpp

@ -631,7 +631,11 @@ void M17Demod::webapiFormatChannelSettings( @@ -631,7 +631,11 @@ void M17Demod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setM17DemodSettings(new SWGSDRangel::SWGM17DemodSettings());
SWGSDRangel::SWGM17DemodSettings *swgM17DemodSettings = swgChannelSettings->getM17DemodSettings();
@ -671,10 +675,18 @@ void M17Demod::webapiFormatChannelSettings( @@ -671,10 +675,18 @@ void M17Demod::webapiFormatChannelSettings(
swgM17DemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgM17DemodSettings->setTitle(new QString(settings.m_title));
if (swgM17DemodSettings->getTitle()) {
*swgM17DemodSettings->getTitle() = settings.m_title;
} else {
swgM17DemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgM17DemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgM17DemodSettings->getAudioDeviceName()) {
*swgM17DemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgM17DemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("highPassFilter") || force) {
swgM17DemodSettings->setHighPassFilter(settings.m_highPassFilter ? 1 : 0);

4
plugins/channelrx/demodm17/m17statustextdialog.cpp

@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
#include <QMessageBox>
#include <QTextStream>
#include "gui/messagedialog.h"
M17StatusTextDialog::M17StatusTextDialog(QWidget* parent) :
QDialog(parent),
ui(new Ui::M17StatusTextDialog)
@ -84,7 +86,7 @@ void M17StatusTextDialog::on_saveLog_clicked() @@ -84,7 +86,7 @@ void M17StatusTextDialog::on_saveLog_clicked()
}
else
{
QMessageBox::information(this, tr("Message"), tr("Cannot open file for writing"));
MessageDialog::information(this, tr("Message"), tr("Cannot open file for writing"));
}
}

42
plugins/channelrx/demodmeshcore/meshcoredemod.cpp

@ -1476,10 +1476,26 @@ void MeshcoreDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& res @@ -1476,10 +1476,26 @@ void MeshcoreDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& res
response.getMeshcoreDemodReport()->setHeaderCrcStatus(m_lastMsgHeaderCRC);
response.getMeshcoreDemodReport()->setPayloadParityStatus(m_lastMsgPayloadParityStatus);
response.getMeshcoreDemodReport()->setPayloadCrcStatus(m_lastMsgPayloadCRC);
response.getMeshcoreDemodReport()->setMessageTimestamp(new QString(m_lastMsgTimestamp));
response.getMeshcoreDemodReport()->setMessageString(new QString(m_lastMsgString));
response.getMeshcoreDemodReport()->setFrameType(new QString(m_lastFrameType));
response.getMeshcoreDemodReport()->setChannelType(new QString(m_lastMsgPipelineName));
if (response.getMeshcoreDemodReport()->getMessageTimestamp()) {
*response.getMeshcoreDemodReport()->getMessageTimestamp() = m_lastMsgTimestamp;
} else {
response.getMeshcoreDemodReport()->setMessageTimestamp(new QString(m_lastMsgTimestamp));
}
if (response.getMeshcoreDemodReport()->getMessageString()) {
*response.getMeshcoreDemodReport()->getMessageString() = m_lastMsgString;
} else {
response.getMeshcoreDemodReport()->setMessageString(new QString(m_lastMsgString));
}
if (response.getMeshcoreDemodReport()->getFrameType()) {
*response.getMeshcoreDemodReport()->getFrameType() = m_lastFrameType;
} else {
response.getMeshcoreDemodReport()->setFrameType(new QString(m_lastFrameType));
}
if (response.getMeshcoreDemodReport()->getChannelType()) {
*response.getMeshcoreDemodReport()->getChannelType() = m_lastMsgPipelineName;
} else {
response.getMeshcoreDemodReport()->setChannelType(new QString(m_lastMsgPipelineName));
}
response.getMeshcoreDemodReport()->setDecoding(getDemodActive() ? 1 : 0);
response.getMeshcoreDemodReport()->setMessageBytes(new QList<QString *>);
@ -1552,7 +1568,11 @@ void MeshcoreDemod::webapiFormatChannelSettings( @@ -1552,7 +1568,11 @@ void MeshcoreDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setMeshcoreDemodSettings(new SWGSDRangel::SWGMeshcoreDemodSettings());
SWGSDRangel::SWGMeshcoreDemodSettings *swgMeshcoreDemodSettings = swgChannelSettings->getMeshcoreDemodSettings();
@ -1595,7 +1615,11 @@ void MeshcoreDemod::webapiFormatChannelSettings( @@ -1595,7 +1615,11 @@ void MeshcoreDemod::webapiFormatChannelSettings(
swgMeshcoreDemodSettings->setSendJsonViaUdp(settings.m_sendJsonViaUDP ? 1 : 0);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgMeshcoreDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgMeshcoreDemodSettings->getUdpAddress()) {
*swgMeshcoreDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgMeshcoreDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgMeshcoreDemodSettings->setUdpPort(settings.m_udpPort);
@ -1607,7 +1631,11 @@ void MeshcoreDemod::webapiFormatChannelSettings( @@ -1607,7 +1631,11 @@ void MeshcoreDemod::webapiFormatChannelSettings(
swgMeshcoreDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgMeshcoreDemodSettings->setTitle(new QString(settings.m_title));
if (swgMeshcoreDemodSettings->getTitle()) {
*swgMeshcoreDemodSettings->getTitle() = settings.m_title;
} else {
swgMeshcoreDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrumConfig") || force))

4
plugins/channelrx/demodmeshcore/meshcorekeysdialog.cpp

@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
#include "ui_meshcorekeysdialog.h"
#include "meshcorepacket.h"
#include "gui/messagedialog.h"
MeshcoreKeysDialog::MeshcoreKeysDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MeshcoreKeysDialog)
@ -53,7 +55,7 @@ void MeshcoreKeysDialog::accept() @@ -53,7 +55,7 @@ void MeshcoreKeysDialog::accept()
{
if (!validateCurrentInput())
{
QMessageBox::warning(this, tr("Invalid Keys"), tr("Fix the Meshcore key list before saving."));
MessageDialog::warning(this, tr("Invalid Keys"), tr("Fix the Meshcore key list before saving."));
return;
}

42
plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp

@ -1406,10 +1406,26 @@ void MeshtasticDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& r @@ -1406,10 +1406,26 @@ void MeshtasticDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& r
response.getMeshtasticDemodReport()->setHeaderCrcStatus(m_lastMsgHeaderCRC);
response.getMeshtasticDemodReport()->setPayloadParityStatus(m_lastMsgPayloadParityStatus);
response.getMeshtasticDemodReport()->setPayloadCrcStatus(m_lastMsgPayloadCRC);
response.getMeshtasticDemodReport()->setMessageTimestamp(new QString(m_lastMsgTimestamp));
response.getMeshtasticDemodReport()->setMessageString(new QString(m_lastMsgString));
response.getMeshtasticDemodReport()->setFrameType(new QString(m_lastFrameType));
response.getMeshtasticDemodReport()->setChannelType(new QString(m_lastMsgPipelineName));
if (response.getMeshtasticDemodReport()->getMessageTimestamp()) {
*response.getMeshtasticDemodReport()->getMessageTimestamp() = m_lastMsgTimestamp;
} else {
response.getMeshtasticDemodReport()->setMessageTimestamp(new QString(m_lastMsgTimestamp));
}
if (response.getMeshtasticDemodReport()->getMessageString()) {
*response.getMeshtasticDemodReport()->getMessageString() = m_lastMsgString;
} else {
response.getMeshtasticDemodReport()->setMessageString(new QString(m_lastMsgString));
}
if (response.getMeshtasticDemodReport()->getFrameType()) {
*response.getMeshtasticDemodReport()->getFrameType() = m_lastFrameType;
} else {
response.getMeshtasticDemodReport()->setFrameType(new QString(m_lastFrameType));
}
if (response.getMeshtasticDemodReport()->getChannelType()) {
*response.getMeshtasticDemodReport()->getChannelType() = m_lastMsgPipelineName;
} else {
response.getMeshtasticDemodReport()->setChannelType(new QString(m_lastMsgPipelineName));
}
response.getMeshtasticDemodReport()->setDecoding(getDemodActive() ? 1 : 0);
response.getMeshtasticDemodReport()->setMessageBytes(new QList<QString *>);
@ -1482,7 +1498,11 @@ void MeshtasticDemod::webapiFormatChannelSettings( @@ -1482,7 +1498,11 @@ void MeshtasticDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setMeshtasticDemodSettings(new SWGSDRangel::SWGMeshtasticDemodSettings());
SWGSDRangel::SWGMeshtasticDemodSettings *swgMeshtasticDemodSettings = swgChannelSettings->getMeshtasticDemodSettings();
@ -1525,7 +1545,11 @@ void MeshtasticDemod::webapiFormatChannelSettings( @@ -1525,7 +1545,11 @@ void MeshtasticDemod::webapiFormatChannelSettings(
swgMeshtasticDemodSettings->setSendJsonViaUdp(settings.m_sendJsonViaUDP ? 1 : 0);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgMeshtasticDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgMeshtasticDemodSettings->getUdpAddress()) {
*swgMeshtasticDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgMeshtasticDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgMeshtasticDemodSettings->setUdpPort(settings.m_udpPort);
@ -1537,7 +1561,11 @@ void MeshtasticDemod::webapiFormatChannelSettings( @@ -1537,7 +1561,11 @@ void MeshtasticDemod::webapiFormatChannelSettings(
swgMeshtasticDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgMeshtasticDemodSettings->setTitle(new QString(settings.m_title));
if (swgMeshtasticDemodSettings->getTitle()) {
*swgMeshtasticDemodSettings->getTitle() = settings.m_title;
} else {
swgMeshtasticDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (settings.m_spectrumGUI && (channelSettingsKeys.contains("spectrumConfig") || force))

35
plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp

@ -65,6 +65,7 @@ MeshtasticDemodSink::MeshtasticDemodSink() : @@ -65,6 +65,7 @@ MeshtasticDemodSink::MeshtasticDemodSink() :
m_loRaFrameSymbolCount(0),
m_loRaCFOFrac(0.0f),
m_loRaSTOFrac(0.0f),
m_loRaPendingShift(0),
m_loRaSFOHat(0.0f),
m_loRaSFOCum(0.0f),
m_loRaCFOSTOEstimated(false),
@ -535,6 +536,7 @@ void MeshtasticDemodSink::resetLoRaFrameSync() @@ -535,6 +536,7 @@ void MeshtasticDemodSink::resetLoRaFrameSync()
m_loRaAdditionalUpchirps = 0;
m_loRaCFOFrac = 0.0f;
m_loRaSTOFrac = 0.0f;
m_loRaPendingShift = 0;
m_loRaSFOHat = 0.0f;
m_loRaSFOCum = 0.0f;
m_loRaCFOSTOEstimated = false;
@ -685,7 +687,7 @@ float MeshtasticDemodSink::estimateLoRaCFOFracBernier(const Complex *samples) @@ -685,7 +687,7 @@ float MeshtasticDemodSink::estimateLoRaCFOFracBernier(const Complex *samples)
return cfoFrac;
}
float MeshtasticDemodSink::estimateLoRaSTOFrac()
float MeshtasticDemodSink::estimateLoRaSTOFrac(int *upBinResidual)
{
if (m_loRaUpSymbToUse <= 0) {
return 0.0f;
@ -725,9 +727,19 @@ float MeshtasticDemodSink::estimateLoRaSTOFrac() @@ -725,9 +727,19 @@ float MeshtasticDemodSink::estimateLoRaSTOFrac()
const double v = u * 2.4674;
const double wa = (Y1 - Y_1) / (u * (Y1 + Y_1) + v * Y0 + 1e-12);
const double ka = wa * m_nbSymbols / M_PI;
const double kres = std::fmod((k0 + ka) / 2.0, 1.0);
const double peak = (k0 + ka) / 2.0;
const double kres = std::fmod(peak, 1.0);
const double frac = kres - (kres > 0.5 ? 1.0 : 0.0);
return static_cast<float>(kres - (kres > 0.5 ? 1.0 : 0.0));
if (upBinResidual)
{
// Express the N-wrapped peak as an integer bin plus exactly the same
// fractional offset returned to existing callers, including half-bin ties.
const double pos = std::remainder(peak, static_cast<double>(m_nbSymbols));
*upBinResidual = static_cast<int>(std::round(pos - frac));
}
return static_cast<float>(frac);
}
void MeshtasticDemodSink::buildLoRaPayloadDownchirp()
@ -798,6 +810,10 @@ void MeshtasticDemodSink::processSampleLoRa(const Complex& ci) @@ -798,6 +810,10 @@ void MeshtasticDemodSink::processSampleLoRa(const Complex& ci)
int consumed = processLoRaFrameSyncStep();
// Apply a one-shot adjustment requested by the step just processed.
consumed += m_loRaPendingShift;
m_loRaPendingShift = 0;
if (consumed <= 0) {
consumed = 1;
}
@ -929,7 +945,18 @@ int MeshtasticDemodSink::processLoRaFrameSyncStep() @@ -929,7 +945,18 @@ int MeshtasticDemodSink::processLoRaFrameSyncStep()
m_loRaCFOFrac = 0.0f;
}
m_loRaSTOFrac = estimateLoRaSTOFrac();
int upBinResidual = 0;
m_loRaSTOFrac = estimateLoRaSTOFrac(&upBinResidual);
// Detection aligned on the mode of uncorrected preamble bins. After
// fractional CFO correction, an integer upchirp-bin residual can
// remain. The current Sync window was already read on the old grid;
// adjust consumption so later net-ID windows, downchirps and payload
// use the corrected grid. Detection advances osFactor * (N - b) to
// move bin b to zero, hence residual r needs -osFactor * r.
if (std::abs(upBinResidual) == 1) {
m_loRaPendingShift = -upBinResidual * static_cast<int>(m_osFactor);
}
for (unsigned int n = 0; n < m_nbSymbols; n++)
{

3
plugins/channelrx/demodmeshtastic/meshtasticdemodsink.h

@ -147,6 +147,7 @@ private: @@ -147,6 +147,7 @@ private:
unsigned int m_loRaFrameSymbolCount;
float m_loRaCFOFrac;
float m_loRaSTOFrac;
int m_loRaPendingShift; //!< Extra FIFO samples to consume once after the current step
float m_loRaSFOHat;
float m_loRaSFOCum;
bool m_loRaCFOSTOEstimated;
@ -194,7 +195,7 @@ private: @@ -194,7 +195,7 @@ private:
bool publishSpectrum = false
);
float estimateLoRaCFOFracBernier(const Complex *samples);
float estimateLoRaSTOFrac();
float estimateLoRaSTOFrac(int *upBinResidual = nullptr);
void buildLoRaPayloadDownchirp();
void finalizeLoRaFrame();
};

4
plugins/channelrx/demodmeshtastic/meshtastickeysdialog.cpp

@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
#include "ui_meshtastickeysdialog.h"
#include "meshtasticpacket.h"
#include "gui/messagedialog.h"
MeshtasticKeysDialog::MeshtasticKeysDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MeshtasticKeysDialog)
@ -53,7 +55,7 @@ void MeshtasticKeysDialog::accept() @@ -53,7 +55,7 @@ void MeshtasticKeysDialog::accept()
{
if (!validateCurrentInput())
{
QMessageBox::warning(this, tr("Invalid Keys"), tr("Fix the Meshtastic key list before saving."));
MessageDialog::warning(this, tr("Invalid Keys"), tr("Fix the Meshtastic key list before saving."));
return;
}

60
plugins/channelrx/demodnavtex/navtexdemod.cpp

@ -493,12 +493,28 @@ void NavtexDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r @@ -493,12 +493,28 @@ void NavtexDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getNavtexDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getNavtexDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getNavtexDemodSettings()->setNavArea(settings.m_navArea);
response.getNavtexDemodSettings()->setFilterStation(new QString(settings.m_filterStation));
response.getNavtexDemodSettings()->setFilterType(new QString(settings.m_filterType));
if (response.getNavtexDemodSettings()->getFilterStation()) {
*response.getNavtexDemodSettings()->getFilterStation() = settings.m_filterStation;
} else {
response.getNavtexDemodSettings()->setFilterStation(new QString(settings.m_filterStation));
}
if (response.getNavtexDemodSettings()->getFilterType()) {
*response.getNavtexDemodSettings()->getFilterType() = settings.m_filterType;
} else {
response.getNavtexDemodSettings()->setFilterType(new QString(settings.m_filterType));
}
response.getNavtexDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getNavtexDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getNavtexDemodSettings()->getUdpAddress()) {
*response.getNavtexDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getNavtexDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getNavtexDemodSettings()->setUdpPort(settings.m_udpPort);
response.getNavtexDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getNavtexDemodSettings()->getLogFilename()) {
*response.getNavtexDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getNavtexDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getNavtexDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getNavtexDemodSettings()->setRgbColor(settings.m_rgbColor);
@ -608,7 +624,11 @@ void NavtexDemod::webapiFormatChannelSettings( @@ -608,7 +624,11 @@ void NavtexDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("NavtexDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "NavtexDemod";
} else {
swgChannelSettings->setChannelType(new QString("NavtexDemod"));
}
swgChannelSettings->setNavtexDemodSettings(new SWGSDRangel::SWGNavtexDemodSettings());
SWGSDRangel::SWGNavtexDemodSettings *swgNavtexDemodSettings = swgChannelSettings->getNavtexDemodSettings();
@ -624,22 +644,38 @@ void NavtexDemod::webapiFormatChannelSettings( @@ -624,22 +644,38 @@ void NavtexDemod::webapiFormatChannelSettings(
swgNavtexDemodSettings->setNavArea(settings.m_navArea);
}
if (channelSettingsKeys.contains("filterStation") || force) {
swgNavtexDemodSettings->setFilterStation(new QString(settings.m_filterStation));
if (swgNavtexDemodSettings->getFilterStation()) {
*swgNavtexDemodSettings->getFilterStation() = settings.m_filterStation;
} else {
swgNavtexDemodSettings->setFilterStation(new QString(settings.m_filterStation));
}
}
if (channelSettingsKeys.contains("filterType") || force) {
swgNavtexDemodSettings->setFilterType(new QString(settings.m_filterType));
if (swgNavtexDemodSettings->getFilterType()) {
*swgNavtexDemodSettings->getFilterType() = settings.m_filterType;
} else {
swgNavtexDemodSettings->setFilterType(new QString(settings.m_filterType));
}
}
if (channelSettingsKeys.contains("udpEnabled") || force) {
swgNavtexDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgNavtexDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgNavtexDemodSettings->getUdpAddress()) {
*swgNavtexDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgNavtexDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgNavtexDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgNavtexDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgNavtexDemodSettings->getLogFilename()) {
*swgNavtexDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgNavtexDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgNavtexDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -648,7 +684,11 @@ void NavtexDemod::webapiFormatChannelSettings( @@ -648,7 +684,11 @@ void NavtexDemod::webapiFormatChannelSettings(
swgNavtexDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgNavtexDemodSettings->setTitle(new QString(settings.m_title));
if (swgNavtexDemodSettings->getTitle()) {
*swgNavtexDemodSettings->getTitle() = settings.m_title;
} else {
swgNavtexDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgNavtexDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demodnavtex/navtexdemodgui.cpp

@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
#include "plugin/pluginapi.h"
#include "util/csv.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/decimaldelegate.h"
#include "dsp/dspengine.h"
@ -850,12 +851,12 @@ void NavtexDemodGUI::on_logOpen_clicked() @@ -850,12 +851,12 @@ void NavtexDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Navtex Demod", error);
MessageDialog::critical(this, "Navtex Demod", error);
}
}
else
{
QMessageBox::critical(this, "Navtex Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Navtex Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

18
plugins/channelrx/demodnfm/nfmdemod.cpp

@ -605,7 +605,11 @@ void NFMDemod::webapiFormatChannelSettings( @@ -605,7 +605,11 @@ void NFMDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setNfmDemodSettings(new SWGSDRangel::SWGNFMDemodSettings());
SWGSDRangel::SWGNFMDemodSettings *swgNFMDemodSettings = swgChannelSettings->getNfmDemodSettings();
@ -648,13 +652,21 @@ void NFMDemod::webapiFormatChannelSettings( @@ -648,13 +652,21 @@ void NFMDemod::webapiFormatChannelSettings(
swgNFMDemodSettings->setSquelchGate(settings.m_squelchGate);
}
if (channelSettingsKeys.contains("title") || force) {
swgNFMDemodSettings->setTitle(new QString(settings.m_title));
if (swgNFMDemodSettings->getTitle()) {
*swgNFMDemodSettings->getTitle() = settings.m_title;
} else {
swgNFMDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("volume") || force) {
swgNFMDemodSettings->setVolume(settings.m_volume);
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgNFMDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgNFMDemodSettings->getAudioDeviceName()) {
*swgNFMDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgNFMDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgNFMDemodSettings->setStreamIndex(settings.m_streamIndex);

36
plugins/channelrx/demodpacket/packetdemod.cpp

@ -494,9 +494,17 @@ void PacketDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r @@ -494,9 +494,17 @@ void PacketDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getPacketDemodSettings()->setMode((int) settings.m_mode);
response.getPacketDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getPacketDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getPacketDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getPacketDemodSettings()->getUdpAddress()) {
*response.getPacketDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getPacketDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getPacketDemodSettings()->setUdpPort(settings.m_udpPort);
response.getPacketDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getPacketDemodSettings()->getLogFilename()) {
*response.getPacketDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getPacketDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getPacketDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getPacketDemodSettings()->setUseFileTime(settings.m_useFileTime);
@ -594,7 +602,11 @@ void PacketDemod::webapiFormatChannelSettings( @@ -594,7 +602,11 @@ void PacketDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("PacketDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "PacketDemod";
} else {
swgChannelSettings->setChannelType(new QString("PacketDemod"));
}
swgChannelSettings->setPacketDemodSettings(new SWGSDRangel::SWGPacketDemodSettings());
SWGSDRangel::SWGPacketDemodSettings *swgPacketDemodSettings = swgChannelSettings->getPacketDemodSettings();
@ -619,13 +631,21 @@ void PacketDemod::webapiFormatChannelSettings( @@ -619,13 +631,21 @@ void PacketDemod::webapiFormatChannelSettings(
swgPacketDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgPacketDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgPacketDemodSettings->getUdpAddress()) {
*swgPacketDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgPacketDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgPacketDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgPacketDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgPacketDemodSettings->getLogFilename()) {
*swgPacketDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgPacketDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgPacketDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -637,7 +657,11 @@ void PacketDemod::webapiFormatChannelSettings( @@ -637,7 +657,11 @@ void PacketDemod::webapiFormatChannelSettings(
swgPacketDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgPacketDemodSettings->setTitle(new QString(settings.m_title));
if (swgPacketDemodSettings->getTitle()) {
*swgPacketDemodSettings->getTitle() = settings.m_title;
} else {
swgPacketDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgPacketDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demodpacket/packetdemodgui.cpp

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include "plugin/pluginapi.h"
#include "util/csv.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "gui/dialogpositioner.h"
@ -719,12 +720,12 @@ void PacketDemodGUI::on_logOpen_clicked() @@ -719,12 +720,12 @@ void PacketDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Packet Demod", error);
MessageDialog::critical(this, "Packet Demod", error);
}
}
else
{
QMessageBox::critical(this, "Packet Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Packet Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

36
plugins/channelrx/demodpager/pagerdemod.cpp

@ -485,9 +485,17 @@ void PagerDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& re @@ -485,9 +485,17 @@ void PagerDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& re
response.getPagerDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getPagerDemodSettings()->setFmDeviation(settings.m_fmDeviation);
response.getPagerDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getPagerDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getPagerDemodSettings()->getUdpAddress()) {
*response.getPagerDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getPagerDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getPagerDemodSettings()->setUdpPort(settings.m_udpPort);
response.getPagerDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getPagerDemodSettings()->getLogFilename()) {
*response.getPagerDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getPagerDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getPagerDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getPagerDemodSettings()->setRgbColor(settings.m_rgbColor);
@ -598,7 +606,11 @@ void PagerDemod::webapiFormatChannelSettings( @@ -598,7 +606,11 @@ void PagerDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("PagerDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "PagerDemod";
} else {
swgChannelSettings->setChannelType(new QString("PagerDemod"));
}
swgChannelSettings->setPagerDemodSettings(new SWGSDRangel::SWGPagerDemodSettings());
SWGSDRangel::SWGPagerDemodSettings *swgPagerDemodSettings = swgChannelSettings->getPagerDemodSettings();
@ -623,13 +635,21 @@ void PagerDemod::webapiFormatChannelSettings( @@ -623,13 +635,21 @@ void PagerDemod::webapiFormatChannelSettings(
swgPagerDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgPagerDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgPagerDemodSettings->getUdpAddress()) {
*swgPagerDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgPagerDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgPagerDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgPagerDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgPagerDemodSettings->getLogFilename()) {
*swgPagerDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgPagerDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgPagerDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -638,7 +658,11 @@ void PagerDemod::webapiFormatChannelSettings( @@ -638,7 +658,11 @@ void PagerDemod::webapiFormatChannelSettings(
swgPagerDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgPagerDemodSettings->setTitle(new QString(settings.m_title));
if (swgPagerDemodSettings->getTitle()) {
*swgPagerDemodSettings->getTitle() = settings.m_title;
} else {
swgPagerDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgPagerDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demodpager/pagerdemodgui.cpp

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include "util/db.h"
#include "util/csv.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/crightclickenabler.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
@ -897,12 +898,12 @@ void PagerDemodGUI::on_logOpen_clicked() @@ -897,12 +898,12 @@ void PagerDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Pager Demod", error);
MessageDialog::critical(this, "Pager Demod", error);
}
}
else
{
QMessageBox::critical(this, "Pager Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Pager Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

59
plugins/channelrx/demodradiosonde/radiosondedemod.cpp

@ -29,9 +29,11 @@ @@ -29,9 +29,11 @@
#include <complex.h>
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGWorkspaceInfo.h"
#include "dsp/dspcommands.h"
#include "util/db.h"
#include "device/deviceapi.h"
#include "maincore.h"
@ -413,6 +415,27 @@ int RadiosondeDemod::webapiWorkspaceGet( @@ -413,6 +415,27 @@ int RadiosondeDemod::webapiWorkspaceGet(
return 200;
}
int RadiosondeDemod::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
(void) errorMessage;
response.setRadiosondeDemodReport(new SWGSDRangel::SWGRadiosondeDemodReport());
response.getRadiosondeDemodReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void RadiosondeDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
double magsqAvg, magsqPeak;
int nbMagsqSamples;
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
response.getRadiosondeDemodReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getRadiosondeDemodReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
}
int RadiosondeDemod::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
@ -519,9 +542,17 @@ void RadiosondeDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetting @@ -519,9 +542,17 @@ void RadiosondeDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetting
response.getRadiosondeDemodSettings()->setFmDeviation(settings.m_fmDeviation);
response.getRadiosondeDemodSettings()->setCorrelationThreshold(settings.m_correlationThreshold);
response.getRadiosondeDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getRadiosondeDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getRadiosondeDemodSettings()->getUdpAddress()) {
*response.getRadiosondeDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getRadiosondeDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getRadiosondeDemodSettings()->setUdpPort(settings.m_udpPort);
response.getRadiosondeDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getRadiosondeDemodSettings()->getLogFilename()) {
*response.getRadiosondeDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getRadiosondeDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getRadiosondeDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getRadiosondeDemodSettings()->setUseFileTime(settings.m_useFileTime);
@ -623,7 +654,11 @@ void RadiosondeDemod::webapiFormatChannelSettings( @@ -623,7 +654,11 @@ void RadiosondeDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("RadiosondeDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "RadiosondeDemod";
} else {
swgChannelSettings->setChannelType(new QString("RadiosondeDemod"));
}
swgChannelSettings->setRadiosondeDemodSettings(new SWGSDRangel::SWGRadiosondeDemodSettings());
SWGSDRangel::SWGRadiosondeDemodSettings *swgRadiosondeDemodSettings = swgChannelSettings->getRadiosondeDemodSettings();
@ -648,13 +683,21 @@ void RadiosondeDemod::webapiFormatChannelSettings( @@ -648,13 +683,21 @@ void RadiosondeDemod::webapiFormatChannelSettings(
swgRadiosondeDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgRadiosondeDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgRadiosondeDemodSettings->getUdpAddress()) {
*swgRadiosondeDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgRadiosondeDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgRadiosondeDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgRadiosondeDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgRadiosondeDemodSettings->getLogFilename()) {
*swgRadiosondeDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgRadiosondeDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgRadiosondeDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -666,7 +709,11 @@ void RadiosondeDemod::webapiFormatChannelSettings( @@ -666,7 +709,11 @@ void RadiosondeDemod::webapiFormatChannelSettings(
swgRadiosondeDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgRadiosondeDemodSettings->setTitle(new QString(settings.m_title));
if (swgRadiosondeDemodSettings->getTitle()) {
*swgRadiosondeDemodSettings->getTitle() = settings.m_title;
} else {
swgRadiosondeDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgRadiosondeDemodSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/demodradiosonde/radiosondedemod.h

@ -154,6 +154,10 @@ public: @@ -154,6 +154,10 @@ public:
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response,
const RadiosondeDemodSettings& settings);
@ -194,6 +198,7 @@ private: @@ -194,6 +198,7 @@ private:
virtual bool handleMessage(const Message& cmd);
void applySettings(const QStringList& settingsKeys, const RadiosondeDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(const QStringList& channelSettingsKeys, const RadiosondeDemodSettings& settings, bool force);
void webapiFormatChannelSettings(
const QStringList& channelSettingsKeys,

5
plugins/channelrx/demodradiosonde/radiosondedemodbaseband.cpp

@ -172,6 +172,11 @@ void RadiosondeDemodBaseband::applySettings(const QStringList& settingsKeys, con @@ -172,6 +172,11 @@ void RadiosondeDemodBaseband::applySettings(const QStringList& settingsKeys, con
}
}
int RadiosondeDemodBaseband::getChannelSampleRate() const
{
return m_channelizer->getChannelSampleRate();
}
void RadiosondeDemodBaseband::setBasebandSampleRate(int sampleRate)
{
m_channelizer->setBasebandSampleRate(sampleRate);

1
plugins/channelrx/demodradiosonde/radiosondedemodbaseband.h

@ -75,6 +75,7 @@ public: @@ -75,6 +75,7 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples) {
m_sink.getMagSqLevels(avg, peak, nbSamples);
}
int getChannelSampleRate() const;
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_sink.setMessageQueueToChannel(messageQueue); }
void setBasebandSampleRate(int sampleRate);
ScopeVis *getScopeSink() { return &m_scopeSink; }

5
plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp

@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
#include "util/csv.h"
#include "util/db.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/datetimedelegate.h"
#include "gui/decimaldelegate.h"
@ -913,12 +914,12 @@ void RadiosondeDemodGUI::on_logOpen_clicked() @@ -913,12 +914,12 @@ void RadiosondeDemodGUI::on_logOpen_clicked()
}
else
{
QMessageBox::critical(this, "Radiosonde Demod", error);
MessageDialog::critical(this, "Radiosonde Demod", error);
}
}
else
{
QMessageBox::critical(this, "Radiosonde Demod", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Radiosonde Demod", QString("Failed to open file %1").arg(fileNames[0]));
}
}
}

42
plugins/channelrx/demodrtty/rttydemod.cpp

@ -340,7 +340,11 @@ void RttyDemod::applySettings(const QStringList& settingsKeys, const RttyDemodSe @@ -340,7 +340,11 @@ void RttyDemod::applySettings(const QStringList& settingsKeys, const RttyDemodSe
}
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
void RttyDemod::sendSampleRateToDemodAnalyzer()
@ -532,7 +536,11 @@ void RttyDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res @@ -532,7 +536,11 @@ void RttyDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getRttyDemodSettings()->setBaudRate(settings.m_baudRate);
response.getRttyDemodSettings()->setFrequencyShift(settings.m_frequencyShift);
response.getRttyDemodSettings()->setUdpEnabled(settings.m_udpEnabled);
response.getRttyDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
if (response.getRttyDemodSettings()->getUdpAddress()) {
*response.getRttyDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getRttyDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getRttyDemodSettings()->setUdpPort(settings.m_udpPort);
response.getRttyDemodSettings()->setCharacterSet(settings.m_characterSet);
response.getRttyDemodSettings()->setSuppressCrlf(settings.m_suppressCRLF);
@ -540,7 +548,11 @@ void RttyDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res @@ -540,7 +548,11 @@ void RttyDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getRttyDemodSettings()->setMsbFirst(settings.m_msbFirst);
response.getRttyDemodSettings()->setSpaceHigh(settings.m_spaceHigh);
response.getRttyDemodSettings()->setSquelch(settings.m_squelch);
response.getRttyDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
if (response.getRttyDemodSettings()->getLogFilename()) {
*response.getRttyDemodSettings()->getLogFilename() = settings.m_logFilename;
} else {
response.getRttyDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
}
response.getRttyDemodSettings()->setLogEnabled(settings.m_logEnabled);
response.getRttyDemodSettings()->setRgbColor(settings.m_rgbColor);
@ -650,7 +662,11 @@ void RttyDemod::webapiFormatChannelSettings( @@ -650,7 +662,11 @@ void RttyDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("RttyDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "RttyDemod";
} else {
swgChannelSettings->setChannelType(new QString("RttyDemod"));
}
swgChannelSettings->setRttyDemodSettings(new SWGSDRangel::SWGRTTYDemodSettings());
SWGSDRangel::SWGRTTYDemodSettings *swgRttyDemodSettings = swgChannelSettings->getRttyDemodSettings();
@ -672,7 +688,11 @@ void RttyDemod::webapiFormatChannelSettings( @@ -672,7 +688,11 @@ void RttyDemod::webapiFormatChannelSettings(
swgRttyDemodSettings->setUdpEnabled(settings.m_udpEnabled);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgRttyDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
if (swgRttyDemodSettings->getUdpAddress()) {
*swgRttyDemodSettings->getUdpAddress() = settings.m_udpAddress;
} else {
swgRttyDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
}
if (channelSettingsKeys.contains("udpPort") || force) {
swgRttyDemodSettings->setUdpPort(settings.m_udpPort);
@ -696,7 +716,11 @@ void RttyDemod::webapiFormatChannelSettings( @@ -696,7 +716,11 @@ void RttyDemod::webapiFormatChannelSettings(
swgRttyDemodSettings->setSquelch(settings.m_squelch);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgRttyDemodSettings->setLogFilename(new QString(settings.m_logFilename));
if (swgRttyDemodSettings->getLogFilename()) {
*swgRttyDemodSettings->getLogFilename() = settings.m_logFilename;
} else {
swgRttyDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
}
if (channelSettingsKeys.contains("logEnabled") || force) {
swgRttyDemodSettings->setLogEnabled(settings.m_logEnabled);
@ -705,7 +729,11 @@ void RttyDemod::webapiFormatChannelSettings( @@ -705,7 +729,11 @@ void RttyDemod::webapiFormatChannelSettings(
swgRttyDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgRttyDemodSettings->setTitle(new QString(settings.m_title));
if (swgRttyDemodSettings->getTitle()) {
*swgRttyDemodSettings->getTitle() = settings.m_title;
} else {
swgRttyDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgRttyDemodSettings->setStreamIndex(settings.m_streamIndex);

40
plugins/channelrx/demodssb/ssbdemod.cpp

@ -379,13 +379,26 @@ int SSBDemod::webapiSettingsPutPatch( @@ -379,13 +379,26 @@ int SSBDemod::webapiSettingsPutPatch(
SSBDemodSettings settings = m_settings;
webapiUpdateChannelSettings(settings, channelSettingsKeys, response);
MsgConfigureSSBDemod *msg = MsgConfigureSSBDemod::create(channelSettingsKeys, settings, force);
// The filter keys set one entry of the filter bank, and the settings are applied by key
// name with the bank copied as a whole under its own, so that is the key to pass on
QStringList settingsKeys = channelSettingsKeys;
for (const char *key : {"rfBandwidth", "lowCutoff", "spanLog2", "fftWindow"})
{
if (settingsKeys.contains(key) && !settingsKeys.contains("filterBank"))
{
settingsKeys.append("filterBank");
break;
}
}
MsgConfigureSSBDemod *msg = MsgConfigureSSBDemod::create(settingsKeys, settings, force);
m_inputMessageQueue.push(msg);
qDebug("SSBDemod::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureSSBDemod *msgToGUI = MsgConfigureSSBDemod::create(channelSettingsKeys, settings, force);
MsgConfigureSSBDemod *msgToGUI = MsgConfigureSSBDemod::create(settingsKeys, settings, force);
m_guiMessageQueue->push(msgToGUI);
}
@ -414,7 +427,7 @@ void SSBDemod::webapiUpdateChannelSettings( @@ -414,7 +427,7 @@ void SSBDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("lowCutoff")) {
settings.m_filterBank[settings.m_filterIndex].m_lowCutoff = response.getSsbDemodSettings()->getLowCutoff();
}
if (channelSettingsKeys.contains("fftWimdow")) {
if (channelSettingsKeys.contains("fftWindow")) {
settings.m_filterBank[settings.m_filterIndex].m_fftWindow = (FFTWindow::Function) response.getSsbDemodSettings()->getFftWindow();
}
if (channelSettingsKeys.contains("volume")) {
@ -447,6 +460,9 @@ void SSBDemod::webapiUpdateChannelSettings( @@ -447,6 +460,9 @@ void SSBDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("agcThresholdGate")) {
settings.m_agcThresholdGate = response.getSsbDemodSettings()->getAgcThresholdGate();
}
if (channelSettingsKeys.contains("dnrScheme")) {
settings.m_dnrScheme = response.getSsbDemodSettings()->getDnrScheme();
}
if (channelSettingsKeys.contains("dnr")) {
settings.m_dnr = response.getSsbDemodSettings()->getDnr() != 0;
}
@ -684,7 +700,11 @@ void SSBDemod::webapiFormatChannelSettings( @@ -684,7 +700,11 @@ void SSBDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setSsbDemodSettings(new SWGSDRangel::SWGSSBDemodSettings());
SWGSDRangel::SWGSSBDemodSettings *swgSSBDemodSettings = swgChannelSettings->getSsbDemodSettings();
@ -757,10 +777,18 @@ void SSBDemod::webapiFormatChannelSettings( @@ -757,10 +777,18 @@ void SSBDemod::webapiFormatChannelSettings(
swgSSBDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgSSBDemodSettings->setTitle(new QString(settings.m_title));
if (swgSSBDemodSettings->getTitle()) {
*swgSSBDemodSettings->getTitle() = settings.m_title;
} else {
swgSSBDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgSSBDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgSSBDemodSettings->getAudioDeviceName()) {
*swgSSBDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgSSBDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgSSBDemodSettings->setStreamIndex(settings.m_streamIndex);

24
plugins/channelrx/demodvor/vordemod.cpp

@ -300,7 +300,11 @@ void VORDemod::applySettings(const QStringList& settingsKeys, const VORDemodSett @@ -300,7 +300,11 @@ void VORDemod::applySettings(const QStringList& settingsKeys, const VORDemodSett
sendChannelSettings(pipes, settingsKeys, settings, force);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
QByteArray VORDemod::serialize() const
@ -617,7 +621,11 @@ void VORDemod::webapiFormatChannelSettings( @@ -617,7 +621,11 @@ void VORDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("VORDemod"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "VORDemod";
} else {
swgChannelSettings->setChannelType(new QString("VORDemod"));
}
swgChannelSettings->setVorDemodSettings(new SWGSDRangel::SWGVORDemodSettings());
SWGSDRangel::SWGVORDemodSettings *swgVORDemodSettings = swgChannelSettings->getVorDemodSettings();
@ -642,13 +650,21 @@ void VORDemod::webapiFormatChannelSettings( @@ -642,13 +650,21 @@ void VORDemod::webapiFormatChannelSettings(
swgVORDemodSettings->setIdentBandpassEnable(settings.m_identBandpassEnable);
}
if (channelSettingsKeys.contains("title") || force) {
swgVORDemodSettings->setTitle(new QString(settings.m_title));
if (swgVORDemodSettings->getTitle()) {
*swgVORDemodSettings->getTitle() = settings.m_title;
} else {
swgVORDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("volume") || force) {
swgVORDemodSettings->setVolume(settings.m_volume);
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgVORDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgVORDemodSettings->getAudioDeviceName()) {
*swgVORDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgVORDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgVORDemodSettings->setStreamIndex(settings.m_streamIndex);

18
plugins/channelrx/demodvormc/vordemodmc.cpp

@ -508,7 +508,11 @@ void VORDemodMC::webapiFormatChannelSettings( @@ -508,7 +508,11 @@ void VORDemodMC::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("VORDemodMC"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "VORDemodMC";
} else {
swgChannelSettings->setChannelType(new QString("VORDemodMC"));
}
swgChannelSettings->setVorDemodMcSettings(new SWGSDRangel::SWGVORDemodMCSettings());
SWGSDRangel::SWGVORDemodMCSettings *swgVORDemodSettings = swgChannelSettings->getVorDemodMcSettings();
@ -524,13 +528,21 @@ void VORDemodMC::webapiFormatChannelSettings( @@ -524,13 +528,21 @@ void VORDemodMC::webapiFormatChannelSettings(
swgVORDemodSettings->setSquelch(settings.m_squelch);
}
if (channelSettingsKeys.contains("title") || force) {
swgVORDemodSettings->setTitle(new QString(settings.m_title));
if (swgVORDemodSettings->getTitle()) {
*swgVORDemodSettings->getTitle() = settings.m_title;
} else {
swgVORDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("volume") || force) {
swgVORDemodSettings->setVolume(settings.m_volume);
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgVORDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgVORDemodSettings->getAudioDeviceName()) {
*swgVORDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgVORDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgVORDemodSettings->setStreamIndex(settings.m_streamIndex);

3
plugins/channelrx/demodvormc/vordemodmcgui.cpp

@ -37,6 +37,7 @@ @@ -37,6 +37,7 @@
#include "util/db.h"
#include "util/morse.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "gui/crightclickenabler.h"
@ -1026,7 +1027,7 @@ void VORDemodMCGUI::downloadFinished(const QString& filename, bool success) @@ -1026,7 +1027,7 @@ void VORDemodMCGUI::downloadFinished(const QString& filename, bool success)
else
{
qDebug() << "VORDemodMCGUI::downloadFinished: Failed: " << filename;
QMessageBox::warning(this, "Download failed", QString("Failed to download %1").arg(filename));
MessageDialog::warning(this, "Download failed", QString("Failed to download %1").arg(filename));
}
if (closeDialog && m_progressDialog)
{

18
plugins/channelrx/demodwfm/wfmdemod.cpp

@ -564,7 +564,11 @@ void WFMDemod::webapiFormatChannelSettings( @@ -564,7 +564,11 @@ void WFMDemod::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setWfmDemodSettings(new SWGSDRangel::SWGWFMDemodSettings());
SWGSDRangel::SWGWFMDemodSettings *swgWFMDemodSettings = swgChannelSettings->getWfmDemodSettings();
@ -592,10 +596,18 @@ void WFMDemod::webapiFormatChannelSettings( @@ -592,10 +596,18 @@ void WFMDemod::webapiFormatChannelSettings(
swgWFMDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgWFMDemodSettings->setTitle(new QString(settings.m_title));
if (swgWFMDemodSettings->getTitle()) {
*swgWFMDemodSettings->getTitle() = settings.m_title;
} else {
swgWFMDemodSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgWFMDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
if (swgWFMDemodSettings->getAudioDeviceName()) {
*swgWFMDemodSettings->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
swgWFMDemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgWFMDemodSettings->setStreamIndex(settings.m_streamIndex);

18
plugins/channelrx/filesink/filesink.cpp

@ -726,7 +726,11 @@ void FileSink::webapiFormatChannelSettings( @@ -726,7 +726,11 @@ void FileSink::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setFileSinkSettings(new SWGSDRangel::SWGFileSinkSettings());
SWGSDRangel::SWGFileSinkSettings *swgFileSinkSettings = swgChannelSettings->getFileSinkSettings();
@ -736,13 +740,21 @@ void FileSink::webapiFormatChannelSettings( @@ -736,13 +740,21 @@ void FileSink::webapiFormatChannelSettings(
swgFileSinkSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
}
if (channelSettingsKeys.contains("fileRecordName")) {
swgFileSinkSettings->setFileRecordName(new QString(settings.m_fileRecordName));
if (swgFileSinkSettings->getFileRecordName()) {
*swgFileSinkSettings->getFileRecordName() = settings.m_fileRecordName;
} else {
swgFileSinkSettings->setFileRecordName(new QString(settings.m_fileRecordName));
}
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgFileSinkSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgFileSinkSettings->setTitle(new QString(settings.m_title));
if (swgFileSinkSettings->getTitle()) {
*swgFileSinkSettings->getTitle() = settings.m_title;
} else {
swgFileSinkSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("log2Decim") || force) {
swgFileSinkSettings->setLog2Decim(settings.m_log2Decim);

7
plugins/channelrx/filesink/filesinkgui.cpp

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include "device/deviceuiset.h"
#include "device/deviceapi.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -143,7 +144,7 @@ bool FileSinkGUI::handleMessage(const Message& message) @@ -143,7 +144,7 @@ bool FileSinkGUI::handleMessage(const Message& message)
const FileSinkMessages::MsgReportSquelch& report = (FileSinkMessages::MsgReportSquelch&) message;
qDebug("FileSinkGUI::handleMessage: FileSinkMessages::MsgReportRecording: %s", report.getOpen() ? "on" : "off");
blockSignals(true);
ui->record->blockSignals(true);
if (report.getOpen())
{
@ -156,7 +157,7 @@ bool FileSinkGUI::handleMessage(const Message& message) @@ -156,7 +157,7 @@ bool FileSinkGUI::handleMessage(const Message& message)
ui->record->setChecked(false);
}
blockSignals(false);
ui->record->blockSignals(false);
return true;
}
else if (FileSinkMessages::MsgReportRecordFileName::match(message))
@ -168,7 +169,7 @@ bool FileSinkGUI::handleMessage(const Message& message) @@ -168,7 +169,7 @@ bool FileSinkGUI::handleMessage(const Message& message)
else if (FileSinkMessages::MsgReportRecordFileError::match(message))
{
const FileSinkMessages::MsgReportRecordFileError& report = (FileSinkMessages::MsgReportRecordFileError&) message;
QMessageBox::critical(this, tr("File Error"), report.getMessage());
MessageDialog::critical(this, tr("File Error"), report.getMessage());
return true;
}
else

23
plugins/channelrx/filesink/filesinksink.cpp

@ -285,18 +285,17 @@ void FileSinkSink::applySettings(const QStringList& settingsKeys, const FileSink @@ -285,18 +285,17 @@ void FileSinkSink::applySettings(const QStringList& settingsKeys, const FileSink
<< "force: " << force;
QString fileRecordName = settings.m_fileRecordName;
QFileInfo fileInfo(settings.m_fileRecordName);
QString extension = fileInfo.suffix();
if (extension.isEmpty()) {
fileRecordName.append(".sdriq");
} else if ((extension != "sdriq") && (extension != "wav")) {
fileRecordName.chop(extension.size());
fileRecordName.append("sdriq");
}
if ((settingsKeys.contains("fileRecordName") && (settings.m_fileRecordName != m_settings.m_fileRecordName)) || force)
if ((settingsKeys.contains("fileRecordName") || force) && (fileRecordName != m_settings.m_fileRecordName))
{
QFileInfo fileInfo(settings.m_fileRecordName);
QString extension = fileInfo.suffix();
if (extension.isEmpty()) {
fileRecordName.append(".sdriq");
} else if ((extension != "sdriq") && (extension != "wav")) {
fileRecordName.chop(extension.size());
fileRecordName.append("sdriq");
}
QString fileBase;
FileRecordInterface::RecordType recordType = FileRecordInterface::guessTypeFromFileName(fileRecordName, fileBase);
@ -336,7 +335,9 @@ void FileSinkSink::applySettings(const QStringList& settingsKeys, const FileSink @@ -336,7 +335,9 @@ void FileSinkSink::applySettings(const QStringList& settingsKeys, const FileSink
m_settings.applySettings(settingsKeys, settings);
}
m_settings.m_fileRecordName = fileRecordName;
if (settingsKeys.contains("fileRecordName") || force) {
m_settings.m_fileRecordName = fileRecordName;
}
}
void FileSinkSink::squelchRecording(bool squelchOpen)

84
plugins/channelrx/freqscanner/freqscanner.cpp

@ -994,13 +994,21 @@ int FreqScanner::webapiSettingsPutPatch( @@ -994,13 +994,21 @@ int FreqScanner::webapiSettingsPutPatch(
FreqScannerSettings settings = m_settings;
webapiUpdateChannelSettings(settings, channelSettingsKeys, response);
MsgConfigureFreqScanner *msg = MsgConfigureFreqScanner::create(settings, channelSettingsKeys, force);
// The web API calls the frequency list "frequencies", but everything downstream of here
// keys it as "frequencySettings". Without the alias the list is parsed and then dropped
// when the settings are merged, leaving the scanner with nothing to scan.
QStringList settingsKeys = channelSettingsKeys;
if (settingsKeys.contains("frequencies") && !settingsKeys.contains("frequencySettings")) {
settingsKeys.append("frequencySettings");
}
MsgConfigureFreqScanner *msg = MsgConfigureFreqScanner::create(settings, settingsKeys, force);
m_inputMessageQueue.push(msg);
qDebug("FreqScanner::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureFreqScanner *msgToGUI = MsgConfigureFreqScanner::create(settings, channelSettingsKeys, force);
MsgConfigureFreqScanner *msgToGUI = MsgConfigureFreqScanner::create(settings, settingsKeys, force);
m_guiMessageQueue->push(msgToGUI);
}
@ -1078,6 +1086,27 @@ void FreqScanner::webapiUpdateChannelSettings( @@ -1078,6 +1086,27 @@ void FreqScanner::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("threshold")) {
settings.m_threshold = response.getFreqScannerSettings()->getThreshold();
}
if (channelSettingsKeys.contains("channel")) {
settings.m_channel = *response.getFreqScannerSettings()->getChannel();
}
if (channelSettingsKeys.contains("scanTime")) {
settings.m_scanTime = response.getFreqScannerSettings()->getScanTime();
}
if (channelSettingsKeys.contains("retransmitTime")) {
settings.m_retransmitTime = response.getFreqScannerSettings()->getRetransmitTime();
}
if (channelSettingsKeys.contains("tuneTime")) {
settings.m_tuneTime = (int) response.getFreqScannerSettings()->getTuneTime();
}
if (channelSettingsKeys.contains("priority")) {
settings.m_priority = (FreqScannerSettings::Priority) response.getFreqScannerSettings()->getPriority();
}
if (channelSettingsKeys.contains("measurement")) {
settings.m_measurement = (FreqScannerSettings::Measurement) response.getFreqScannerSettings()->getMeasurement();
}
if (channelSettingsKeys.contains("mode")) {
settings.m_mode = (FreqScannerSettings::Mode) response.getFreqScannerSettings()->getMode();
}
if (channelSettingsKeys.contains("frequencies"))
{
settings.m_frequencySettings.clear();
@ -1088,6 +1117,7 @@ void FreqScanner::webapiUpdateChannelSettings( @@ -1088,6 +1117,7 @@ void FreqScanner::webapiUpdateChannelSettings(
{
FreqScannerSettings::FrequencySettings freqSetting;
freqSetting.m_frequency = frequency->getFrequency();
freqSetting.m_enabled = frequency->getEnabled() != 0;
if (frequency->getNotes()) {
freqSetting.m_notes = *frequency->getNotes();
}
@ -1175,6 +1205,19 @@ void FreqScanner::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r @@ -1175,6 +1205,19 @@ void FreqScanner::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getFreqScannerSettings()->setChannelShift(settings.m_channelShift);
response.getFreqScannerSettings()->setThreshold(settings.m_threshold);
if (response.getFreqScannerSettings()->getChannel()) {
*response.getFreqScannerSettings()->getChannel() = settings.m_channel;
} else {
response.getFreqScannerSettings()->setChannel(new QString(settings.m_channel));
}
response.getFreqScannerSettings()->setScanTime(settings.m_scanTime);
response.getFreqScannerSettings()->setRetransmitTime(settings.m_retransmitTime);
response.getFreqScannerSettings()->setTuneTime(settings.m_tuneTime);
response.getFreqScannerSettings()->setPriority((int) settings.m_priority);
response.getFreqScannerSettings()->setMeasurement((int) settings.m_measurement);
response.getFreqScannerSettings()->setMode((int) settings.m_mode);
QList<SWGSDRangel::SWGFreqScannerFrequency *> *frequencies = createFrequencyList(settings);
if (response.getFreqScannerSettings()->getFrequencies()) {
*response.getFreqScannerSettings()->getFrequencies() = *frequencies;
@ -1282,7 +1325,11 @@ void FreqScanner::webapiFormatChannelSettings( @@ -1282,7 +1325,11 @@ void FreqScanner::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("FreqScanner"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "FreqScanner";
} else {
swgChannelSettings->setChannelType(new QString("FreqScanner"));
}
swgChannelSettings->setFreqScannerSettings(new SWGSDRangel::SWGFreqScannerSettings());
SWGSDRangel::SWGFreqScannerSettings *swgFreqScannerSettings = swgChannelSettings->getFreqScannerSettings();
@ -1300,6 +1347,31 @@ void FreqScanner::webapiFormatChannelSettings( @@ -1300,6 +1347,31 @@ void FreqScanner::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("threshold") || force) {
swgFreqScannerSettings->setThreshold(settings.m_threshold);
}
if (channelSettingsKeys.contains("channel") || force) {
if (swgFreqScannerSettings->getChannel()) {
*swgFreqScannerSettings->getChannel() = settings.m_channel;
} else {
swgFreqScannerSettings->setChannel(new QString(settings.m_channel));
}
}
if (channelSettingsKeys.contains("scanTime") || force) {
swgFreqScannerSettings->setScanTime(settings.m_scanTime);
}
if (channelSettingsKeys.contains("retransmitTime") || force) {
swgFreqScannerSettings->setRetransmitTime(settings.m_retransmitTime);
}
if (channelSettingsKeys.contains("tuneTime") || force) {
swgFreqScannerSettings->setTuneTime(settings.m_tuneTime);
}
if (channelSettingsKeys.contains("priority") || force) {
swgFreqScannerSettings->setPriority((int) settings.m_priority);
}
if (channelSettingsKeys.contains("measurement") || force) {
swgFreqScannerSettings->setMeasurement((int) settings.m_measurement);
}
if (channelSettingsKeys.contains("mode") || force) {
swgFreqScannerSettings->setMode((int) settings.m_mode);
}
if (channelSettingsKeys.contains("frequencies") || force) {
QList<SWGSDRangel::SWGFreqScannerFrequency *> *frequencies = createFrequencyList(settings);
swgFreqScannerSettings->setFrequencies(frequencies);
@ -1309,7 +1381,11 @@ void FreqScanner::webapiFormatChannelSettings( @@ -1309,7 +1381,11 @@ void FreqScanner::webapiFormatChannelSettings(
swgFreqScannerSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgFreqScannerSettings->setTitle(new QString(settings.m_title));
if (swgFreqScannerSettings->getTitle()) {
*swgFreqScannerSettings->getTitle() = settings.m_title;
} else {
swgFreqScannerSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgFreqScannerSettings->setStreamIndex(settings.m_streamIndex);

35
plugins/channelrx/freqscanner/freqscannergui.cpp

@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "ui_freqscannergui.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "dsp/dspengine.h"
#include "gui/tabletapandhold.h"
@ -95,10 +96,10 @@ bool FreqScannerGUI::handleMessage(const Message& message) @@ -95,10 +96,10 @@ bool FreqScannerGUI::handleMessage(const Message& message)
} else {
m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings());
}
blockApplySettings(true);
bool blocked = blockApplySettings(true);
m_channelMarker.updateSettings(static_cast<const ChannelMarker*>(m_settings.m_channelMarker));
displaySettings();
blockApplySettings(false);
blockApplySettings(blocked);
return true;
}
else if (DSPSignalNotification::match(message))
@ -377,25 +378,25 @@ void FreqScannerGUI::on_voiceSquelchType_currentIndexChanged(int index) @@ -377,25 +378,25 @@ void FreqScannerGUI::on_voiceSquelchType_currentIndexChanged(int index)
if (m_settings.m_voiceSquelchType == FreqScannerSettings::VoiceSquelchType::VoiceLsb)
{
blockApplySettings(true);
bool blocked = blockApplySettings(true);
m_settings.m_channelBandwidth = 3000;
ui->channelBandwidth->setValue(m_settings.m_channelBandwidth);
m_settings.m_channelShift = 1500;
ui->channelShift->setValue(m_settings.m_channelShift);
settingsKeys.append("channelBandwidth");
settingsKeys.append("channelShift");
blockApplySettings(false);
blockApplySettings(blocked);
}
else if (m_settings.m_voiceSquelchType == FreqScannerSettings::VoiceSquelchType::VoiceUsb)
{
blockApplySettings(true);
bool blocked = blockApplySettings(true);
m_settings.m_channelBandwidth = 3000;
ui->channelBandwidth->setValue(m_settings.m_channelBandwidth);
m_settings.m_channelShift = -1500;
ui->channelShift->setValue(m_settings.m_channelShift);
settingsKeys.append("channelBandwidth");
settingsKeys.append("channelShift");
blockApplySettings(false);
blockApplySettings(blocked);
}
applySettings(settingsKeys);
@ -599,9 +600,11 @@ FreqScannerGUI::~FreqScannerGUI() @@ -599,9 +600,11 @@ FreqScannerGUI::~FreqScannerGUI()
delete ui;
}
void FreqScannerGUI::blockApplySettings(bool block)
bool FreqScannerGUI::blockApplySettings(bool block)
{
bool blocked = !m_doApplySettings;
m_doApplySettings = !block;
return blocked;
}
void FreqScannerGUI::applySetting(const QString& settingsKey)
@ -638,7 +641,7 @@ void FreqScannerGUI::displaySettings() @@ -638,7 +641,7 @@ void FreqScannerGUI::displaySettings()
setWindowTitle(m_channelMarker.getTitle());
setTitle(m_channelMarker.getTitle());
blockApplySettings(true);
bool blocked = blockApplySettings(true);
int channelIndex = ui->channels->findText(m_settings.m_channel);
if (channelIndex >= 0) {
ui->channels->setCurrentIndex(channelIndex);
@ -688,7 +691,7 @@ void FreqScannerGUI::displaySettings() @@ -688,7 +691,7 @@ void FreqScannerGUI::displaySettings()
getRollupContents()->restoreState(m_rollupState);
updateAbsoluteCenterFrequency();
blockApplySettings(false);
blockApplySettings(blocked);
}
void FreqScannerGUI::leaveEvent(QEvent* event)
@ -795,7 +798,7 @@ void FreqScannerGUI::on_addRange_clicked() @@ -795,7 +798,7 @@ void FreqScannerGUI::on_addRange_clicked()
new DialogPositioner(&dialog, false);
if (dialog.exec())
{
blockApplySettings(true);
bool blocked = blockApplySettings(true);
for (const auto f : dialog.m_frequencies)
{
FreqScannerSettings::FrequencySettings frequencySettings;
@ -803,7 +806,7 @@ void FreqScannerGUI::on_addRange_clicked() @@ -803,7 +806,7 @@ void FreqScannerGUI::on_addRange_clicked()
frequencySettings.m_enabled = true;
addRow(frequencySettings);
}
blockApplySettings(false);
blockApplySettings(blocked);
applySetting("frequencySettings");
}
}
@ -920,7 +923,7 @@ void FreqScannerGUI::on_importFreqs_clicked() @@ -920,7 +923,7 @@ void FreqScannerGUI::on_importFreqs_clicked()
if (error.isEmpty())
{
// Clear existing entries
blockApplySettings(true);
bool blocked = blockApplySettings(true);
ui->table->setRowCount(0);
int freqCol = colIndexes.value("Freq (Hz)");
@ -951,20 +954,20 @@ void FreqScannerGUI::on_importFreqs_clicked() @@ -951,20 +954,20 @@ void FreqScannerGUI::on_importFreqs_clicked()
}
updateAnnotations();
blockApplySettings(false);
blockApplySettings(blocked);
applySetting("frequencySettings");
}
else
{
QString actualColNames = colIndexes.keys().join(" ");
QString expectedColNames = colNames.join(" ");
QMessageBox::critical(this, "Frequency Scanner", QString("Failed to read expected header in CSV file. %1 != %2").arg(actualColNames).arg(expectedColNames));
MessageDialog::critical(this, "Frequency Scanner", QString("Failed to read expected header in CSV file. %1 != %2").arg(actualColNames).arg(expectedColNames));
return;
}
}
else
{
QMessageBox::warning(this, "Frequency Scanner", QString("Failed to open file %1").arg(filename));
MessageDialog::warning(this, "Frequency Scanner", QString("Failed to open file %1").arg(filename));
}
}
}
@ -1005,7 +1008,7 @@ void FreqScannerGUI::on_exportFreqs_clicked() @@ -1005,7 +1008,7 @@ void FreqScannerGUI::on_exportFreqs_clicked()
}
else
{
QMessageBox::warning(this, "Frequency Scanner", QString("Failed to open file %1").arg(filename));
MessageDialog::warning(this, "Frequency Scanner", QString("Failed to open file %1").arg(filename));
}
}
}

2
plugins/channelrx/freqscanner/freqscannergui.h

@ -88,7 +88,7 @@ private: @@ -88,7 +88,7 @@ private:
explicit FreqScannerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
virtual ~FreqScannerGUI();
void blockApplySettings(bool block);
bool blockApplySettings(bool block);
void applySetting(const QString& settingsKey);
void applySettings(const QStringList& settingsKeys, bool force = false);
void applyAllSettings();

12
plugins/channelrx/freqtracker/freqtracker.cpp

@ -593,7 +593,11 @@ void FreqTracker::webapiFormatChannelSettings( @@ -593,7 +593,11 @@ void FreqTracker::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("FreqTracker"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "FreqTracker";
} else {
swgChannelSettings->setChannelType(new QString("FreqTracker"));
}
swgChannelSettings->setFreqTrackerSettings(new SWGSDRangel::SWGFreqTrackerSettings());
SWGSDRangel::SWGFreqTrackerSettings *swgFreqTrackerSettings = swgChannelSettings->getFreqTrackerSettings();
@ -615,7 +619,11 @@ void FreqTracker::webapiFormatChannelSettings( @@ -615,7 +619,11 @@ void FreqTracker::webapiFormatChannelSettings(
swgFreqTrackerSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgFreqTrackerSettings->setTitle(new QString(settings.m_title));
if (swgFreqTrackerSettings->getTitle()) {
*swgFreqTrackerSettings->getTitle() = settings.m_title;
} else {
swgFreqTrackerSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("spanLog2") || force) {
swgFreqTrackerSettings->setSpanLog2(settings.m_spanLog2);

47
plugins/channelrx/heatmap/heatmap.cpp

@ -29,9 +29,11 @@ @@ -29,9 +29,11 @@
#include <complex.h>
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGWorkspaceInfo.h"
#include "dsp/dspcommands.h"
#include "util/db.h"
#include "device/deviceapi.h"
MESSAGE_CLASS_DEFINITION(HeatMap::MsgConfigureHeatMap, Message)
@ -267,6 +269,27 @@ int HeatMap::webapiWorkspaceGet( @@ -267,6 +269,27 @@ int HeatMap::webapiWorkspaceGet(
return 200;
}
int HeatMap::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
(void) errorMessage;
response.setHeatMapReport(new SWGSDRangel::SWGHeatMapReport());
response.getHeatMapReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void HeatMap::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
double magsqAvg, magsqPeak;
int nbMagsqSamples;
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
response.getHeatMapReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getHeatMapReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
}
int HeatMap::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
@ -365,7 +388,11 @@ void HeatMap::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo @@ -365,7 +388,11 @@ void HeatMap::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo
response.getHeatMapSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getHeatMapSettings()->setMinPower(settings.m_minPower);
response.getHeatMapSettings()->setMaxPower(settings.m_maxPower);
response.getHeatMapSettings()->setColorMapName(new QString(settings.m_colorMapName));
if (response.getHeatMapSettings()->getColorMapName()) {
*response.getHeatMapSettings()->getColorMapName() = settings.m_colorMapName;
} else {
response.getHeatMapSettings()->setColorMapName(new QString(settings.m_colorMapName));
}
response.getHeatMapSettings()->setMode((int) settings.m_mode);
response.getHeatMapSettings()->setPulseThreshold(settings.m_pulseThreshold);
response.getHeatMapSettings()->setAveragePeriodUs(settings.m_averagePeriodUS);
@ -469,7 +496,11 @@ void HeatMap::webapiFormatChannelSettings( @@ -469,7 +496,11 @@ void HeatMap::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("HeatMap"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "HeatMap";
} else {
swgChannelSettings->setChannelType(new QString("HeatMap"));
}
swgChannelSettings->setHeatMapSettings(new SWGSDRangel::SWGHeatMapSettings());
SWGSDRangel::SWGHeatMapSettings *swgHeatMapSettings = swgChannelSettings->getHeatMapSettings();
@ -488,7 +519,11 @@ void HeatMap::webapiFormatChannelSettings( @@ -488,7 +519,11 @@ void HeatMap::webapiFormatChannelSettings(
swgHeatMapSettings->setMaxPower(settings.m_maxPower);
}
if (channelSettingsKeys.contains("colorMapName") || force) {
swgHeatMapSettings->setColorMapName(new QString(settings.m_colorMapName));
if (swgHeatMapSettings->getColorMapName()) {
*swgHeatMapSettings->getColorMapName() = settings.m_colorMapName;
} else {
swgHeatMapSettings->setColorMapName(new QString(settings.m_colorMapName));
}
}
if (channelSettingsKeys.contains("mode") || force) {
swgHeatMapSettings->setMode((int) settings.m_mode);
@ -506,7 +541,11 @@ void HeatMap::webapiFormatChannelSettings( @@ -506,7 +541,11 @@ void HeatMap::webapiFormatChannelSettings(
swgHeatMapSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgHeatMapSettings->setTitle(new QString(settings.m_title));
if (swgHeatMapSettings->getTitle()) {
*swgHeatMapSettings->getTitle() = settings.m_title;
} else {
swgHeatMapSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgHeatMapSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/heatmap/heatmap.h

@ -121,6 +121,10 @@ public: @@ -121,6 +121,10 @@ public:
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response,
const HeatMapSettings& settings);
@ -164,6 +168,7 @@ private: @@ -164,6 +168,7 @@ private:
virtual bool handleMessage(const Message& cmd);
void applySettings(const QStringList& settingsKeys, const HeatMapSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const HeatMapSettings& settings, bool force);
void webapiFormatChannelSettings(
const QList<QString>& channelSettingsKeys,

5
plugins/channelrx/heatmap/heatmapbaseband.cpp

@ -174,6 +174,11 @@ void HeatMapBaseband::applySettings(const QStringList& settingsKeys, const HeatM @@ -174,6 +174,11 @@ void HeatMapBaseband::applySettings(const QStringList& settingsKeys, const HeatM
}
}
int HeatMapBaseband::getChannelSampleRate() const
{
return m_channelizer->getChannelSampleRate();
}
void HeatMapBaseband::setBasebandSampleRate(int sampleRate)
{
m_channelizer->setBasebandSampleRate(sampleRate);

1
plugins/channelrx/heatmap/heatmapbaseband.h

@ -83,6 +83,7 @@ public: @@ -83,6 +83,7 @@ public:
}
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_sink.setMessageQueueToChannel(messageQueue); }
void setBasebandSampleRate(int sampleRate);
int getChannelSampleRate() const;
ScopeVis *getScopeSink() { return &m_scopeSink; }
void setChannel(ChannelAPI *channel);
double getMagSq() const { return m_sink.getMagSq(); }

17
plugins/channelrx/heatmap/heatmapgui.cpp

@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
#include "util/colormap.h"
#include "util/db.h"
#include "util/units.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/dialpopup.h"
#include "gui/dialogpositioner.h"
@ -314,7 +315,7 @@ void HeatMapGUI::on_writeCSV_clicked() @@ -314,7 +315,7 @@ void HeatMapGUI::on_writeCSV_clicked()
QFile file(fileNames[0]);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QMessageBox::critical(this, "Heat Map", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Heat Map", QString("Failed to open file %1").arg(fileNames[0]));
return;
}
QTextStream out(&file);
@ -351,7 +352,7 @@ void HeatMapGUI::on_readCSV_clicked() @@ -351,7 +352,7 @@ void HeatMapGUI::on_readCSV_clicked()
QFile file(fileNames[0]);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
QMessageBox::critical(this, "Heat Map", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Heat Map", QString("Failed to open file %1").arg(fileNames[0]));
return;
}
QTextStream in(&file);
@ -382,7 +383,7 @@ void HeatMapGUI::on_readCSV_clicked() @@ -382,7 +383,7 @@ void HeatMapGUI::on_readCSV_clicked()
{
QString actualColNames = colIndexes.keys().join(" ");
QString expectedColNames = colNames.join(" ");
QMessageBox::critical(this, "Heat Map", QString("Failed to read expected header in CSV file. %1 != %2").arg(actualColNames).arg(expectedColNames));
MessageDialog::critical(this, "Heat Map", QString("Failed to read expected header in CSV file. %1 != %2").arg(actualColNames).arg(expectedColNames));
return;
}
}
@ -400,7 +401,7 @@ void HeatMapGUI::on_writeImage_clicked() @@ -400,7 +401,7 @@ void HeatMapGUI::on_writeImage_clicked()
{
if (!m_image.save(fileNames[0]))
{
QMessageBox::critical(this, "Heat Map", QString("Failed to save image to %1").arg(fileNames[0]));
MessageDialog::critical(this, "Heat Map", QString("Failed to save image to %1").arg(fileNames[0]));
return;
}
}
@ -977,7 +978,7 @@ void HeatMapGUI::createImage(int width, int height) @@ -977,7 +978,7 @@ void HeatMapGUI::createImage(int width, int height)
catch (std::bad_alloc&)
{
m_image = QImage();
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(m_width).arg(m_height));
MessageDialog::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(m_width).arg(m_height));
}
}
@ -1295,7 +1296,7 @@ void HeatMapGUI::createMap() @@ -1295,7 +1296,7 @@ void HeatMapGUI::createMap()
catch (std::bad_alloc&)
{
deleteMap();
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(m_width).arg(m_height));
MessageDialog::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(m_width).arg(m_height));
}
on_clearHeatMap_clicked();
@ -1442,7 +1443,7 @@ void HeatMapGUI::resizeMap(int x, int y) @@ -1442,7 +1443,7 @@ void HeatMapGUI::resizeMap(int x, int y)
delete[] powerMaxPeak;
delete[] powerMinPeak;
delete[] powerPathLoss;
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(newWidth).arg(newHeight));
MessageDialog::critical(this, "Heat Map", QString("Failed to allocate memory (width=%1 height=%2)").arg(newWidth).arg(newHeight));
}
}
}
@ -1537,7 +1538,7 @@ void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pul @@ -1537,7 +1538,7 @@ void HeatMapGUI::addToPowerSeries(QDateTime dateTime, double average, double pul
}
catch (std::bad_alloc&)
{
QMessageBox::critical(this, "Heat Map", QString("Failed to allocate memory for chart series"));
MessageDialog::critical(this, "Heat Map", QString("Failed to allocate memory for chart series"));
ui->displayChart->setChecked(false);
}
}

18
plugins/channelrx/localsink/localsink.cpp

@ -395,7 +395,11 @@ void LocalSink::applySettings(const LocalSinkSettings& settings, const QList<QSt @@ -395,7 +395,11 @@ void LocalSink::applySettings(const LocalSinkSettings& settings, const QList<QSt
sendChannelSettings(pipes, settingsKeys, settings, force);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
void LocalSink::validateFilterChainHash(LocalSinkSettings& settings)
@ -678,7 +682,11 @@ void LocalSink::webapiFormatChannelSettings( @@ -678,7 +682,11 @@ void LocalSink::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString(m_channelId));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = m_channelId;
} else {
swgChannelSettings->setChannelType(new QString(m_channelId));
}
swgChannelSettings->setLocalSinkSettings(new SWGSDRangel::SWGLocalSinkSettings());
SWGSDRangel::SWGLocalSinkSettings *swgLocalSinkSettings = swgChannelSettings->getLocalSinkSettings();
@ -691,7 +699,11 @@ void LocalSink::webapiFormatChannelSettings( @@ -691,7 +699,11 @@ void LocalSink::webapiFormatChannelSettings(
swgLocalSinkSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgLocalSinkSettings->setTitle(new QString(settings.m_title));
if (swgLocalSinkSettings->getTitle()) {
*swgLocalSinkSettings->getTitle() = settings.m_title;
} else {
swgLocalSinkSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("log2Decim") || force) {
swgLocalSinkSettings->setLog2Decim(settings.m_log2Decim);

83
plugins/channelrx/noisefigure/noisefigure.cpp

@ -31,9 +31,11 @@ @@ -31,9 +31,11 @@
#include <complex.h>
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGWorkspaceInfo.h"
#include "dsp/dspcommands.h"
#include "util/db.h"
#include "device/deviceapi.h"
#include "settings/serializable.h"
#include "util/interpolation.h"
@ -562,7 +564,11 @@ void NoiseFigure::applySettings(const QStringList& settingsKeys, const NoiseFigu @@ -562,7 +564,11 @@ void NoiseFigure::applySettings(const QStringList& settingsKeys, const NoiseFigu
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
}
m_settings = settings;
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
QByteArray NoiseFigure::serialize() const
@ -607,6 +613,27 @@ int NoiseFigure::webapiWorkspaceGet( @@ -607,6 +613,27 @@ int NoiseFigure::webapiWorkspaceGet(
return 200;
}
int NoiseFigure::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
(void) errorMessage;
response.setNoiseFigureReport(new SWGSDRangel::SWGNoiseFigureReport());
response.getNoiseFigureReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void NoiseFigure::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
double magsqAvg, magsqPeak;
int nbMagsqSamples;
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
response.getNoiseFigureReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getNoiseFigureReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
}
int NoiseFigure::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
@ -802,7 +829,11 @@ void NoiseFigure::webapiFormatChannelSettings( @@ -802,7 +829,11 @@ void NoiseFigure::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("NoiseFigure"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "NoiseFigure";
} else {
swgChannelSettings->setChannelType(new QString("NoiseFigure"));
}
swgChannelSettings->setNoiseFigureSettings(new SWGSDRangel::SWGNoiseFigureSettings());
SWGSDRangel::SWGNoiseFigureSettings *swgNoiseFigureSettings = swgChannelSettings->getNoiseFigureSettings();
@ -833,25 +864,53 @@ void NoiseFigure::webapiFormatChannelSettings( @@ -833,25 +864,53 @@ void NoiseFigure::webapiFormatChannelSettings(
swgNoiseFigureSettings->setStep(settings.m_step);
}
if (channelSettingsKeys.contains("list") || force) {
swgNoiseFigureSettings->setList(new QString(settings.m_sweepList));
if (swgNoiseFigureSettings->getList()) {
*swgNoiseFigureSettings->getList() = settings.m_sweepList;
} else {
swgNoiseFigureSettings->setList(new QString(settings.m_sweepList));
}
}
if (channelSettingsKeys.contains("setting") || force) {
swgNoiseFigureSettings->setSetting(new QString(settings.m_setting));
if (swgNoiseFigureSettings->getSetting()) {
*swgNoiseFigureSettings->getSetting() = settings.m_setting;
} else {
swgNoiseFigureSettings->setSetting(new QString(settings.m_setting));
}
}
if (channelSettingsKeys.contains("visaDevice") || force) {
swgNoiseFigureSettings->setVisaDevice(new QString(settings.m_visaDevice));
if (swgNoiseFigureSettings->getVisaDevice()) {
*swgNoiseFigureSettings->getVisaDevice() = settings.m_visaDevice;
} else {
swgNoiseFigureSettings->setVisaDevice(new QString(settings.m_visaDevice));
}
}
if (channelSettingsKeys.contains("powerOnSCPI") || force) {
swgNoiseFigureSettings->setPowerOnScpi(new QString(settings.m_powerOnSCPI));
if (swgNoiseFigureSettings->getPowerOnScpi()) {
*swgNoiseFigureSettings->getPowerOnScpi() = settings.m_powerOnSCPI;
} else {
swgNoiseFigureSettings->setPowerOnScpi(new QString(settings.m_powerOnSCPI));
}
}
if (channelSettingsKeys.contains("powerOffSCPI") || force) {
swgNoiseFigureSettings->setPowerOffScpi(new QString(settings.m_powerOffSCPI));
if (swgNoiseFigureSettings->getPowerOffScpi()) {
*swgNoiseFigureSettings->getPowerOffScpi() = settings.m_powerOffSCPI;
} else {
swgNoiseFigureSettings->setPowerOffScpi(new QString(settings.m_powerOffSCPI));
}
}
if (channelSettingsKeys.contains("powerOnCommand") || force) {
swgNoiseFigureSettings->setPowerOnCommand(new QString(settings.m_powerOnCommand));
if (swgNoiseFigureSettings->getPowerOnCommand()) {
*swgNoiseFigureSettings->getPowerOnCommand() = settings.m_powerOnCommand;
} else {
swgNoiseFigureSettings->setPowerOnCommand(new QString(settings.m_powerOnCommand));
}
}
if (channelSettingsKeys.contains("powerOffCommand") || force) {
swgNoiseFigureSettings->setPowerOffCommand(new QString(settings.m_powerOffCommand));
if (swgNoiseFigureSettings->getPowerOffCommand()) {
*swgNoiseFigureSettings->getPowerOffCommand() = settings.m_powerOffCommand;
} else {
swgNoiseFigureSettings->setPowerOffCommand(new QString(settings.m_powerOffCommand));
}
}
if (channelSettingsKeys.contains("powerDelay") || force) {
swgNoiseFigureSettings->setPowerDelay(settings.m_powerDelay);
@ -860,7 +919,11 @@ void NoiseFigure::webapiFormatChannelSettings( @@ -860,7 +919,11 @@ void NoiseFigure::webapiFormatChannelSettings(
swgNoiseFigureSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgNoiseFigureSettings->setTitle(new QString(settings.m_title));
if (swgNoiseFigureSettings->getTitle()) {
*swgNoiseFigureSettings->getTitle() = settings.m_title;
} else {
swgNoiseFigureSettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgNoiseFigureSettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/noisefigure/noisefigure.h

@ -224,6 +224,10 @@ public: @@ -224,6 +224,10 @@ public:
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response,
const NoiseFigureSettings& settings);
@ -264,6 +268,7 @@ private: @@ -264,6 +268,7 @@ private:
virtual bool handleMessage(const Message& cmd);
void applySettings(const QStringList& settingsKeys, const NoiseFigureSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const NoiseFigureSettings& settings, bool force);
void webapiFormatChannelSettings(
const QList<QString>& channelSettingsKeys,

5
plugins/channelrx/noisefigure/noisefigurebaseband.cpp

@ -165,6 +165,11 @@ void NoiseFigureBaseband::applySettings(const QStringList& settingsKeys, const N @@ -165,6 +165,11 @@ void NoiseFigureBaseband::applySettings(const QStringList& settingsKeys, const N
}
}
int NoiseFigureBaseband::getChannelSampleRate() const
{
return m_channelizer->getChannelSampleRate();
}
void NoiseFigureBaseband::setBasebandSampleRate(int sampleRate)
{
m_channelizer->setBasebandSampleRate(sampleRate);

1
plugins/channelrx/noisefigure/noisefigurebaseband.h

@ -75,6 +75,7 @@ public: @@ -75,6 +75,7 @@ public:
}
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_sink.setMessageQueueToChannel(messageQueue); }
void setBasebandSampleRate(int sampleRate);
int getChannelSampleRate() const;
void setChannel(ChannelAPI *channel);
double getMagSq() const { return m_sink.getMagSq(); }
bool isRunning() const { return m_running; }

9
plugins/channelrx/noisefigure/noisefiguregui.cpp

@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
#include "ui_noisefiguregui.h"
#include "plugin/pluginapi.h"
#include "util/db.h"
#include "gui/messagedialog.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/decimaldelegate.h"
#include "gui/dialogpositioner.h"
@ -287,7 +288,7 @@ bool NoiseFigureGUI::handleMessage(const Message& message) @@ -287,7 +288,7 @@ bool NoiseFigureGUI::handleMessage(const Message& message)
m_runningTest = false;
QString errorMessage = report.getErrorMessage();
if (!errorMessage.isEmpty()) {
QMessageBox::critical(this, "Noise Figure", errorMessage);
MessageDialog::critical(this, "Noise Figure", errorMessage);
}
return true;
}
@ -406,7 +407,7 @@ void NoiseFigureGUI::on_startStop_clicked() @@ -406,7 +407,7 @@ void NoiseFigureGUI::on_startStop_clicked()
// Check we have at least on ENR value
if (m_settings.m_enr.size() < 1)
{
QMessageBox::critical(this, "Noise Figure", "You must enter the ENR of the noise source for at least one frequency");
MessageDialog::critical(this, "Noise Figure", "You must enter the ENR of the noise source for at least one frequency");
return;
}
// Clear current results if starting a test
@ -435,7 +436,7 @@ void NoiseFigureGUI::on_saveResults_clicked() @@ -435,7 +436,7 @@ void NoiseFigureGUI::on_saveResults_clicked()
qDebug() << "NoiseFigureGUI: Saving results to " << fileNames;
QFile file(fileNames[0]);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QMessageBox::critical(this, "Noise Figure", QString("Failed to open file %1").arg(fileNames[0]));
MessageDialog::critical(this, "Noise Figure", QString("Failed to open file %1").arg(fileNames[0]));
return;
}
QTextStream out(&file);
@ -467,7 +468,7 @@ void NoiseFigureGUI::on_openReference_clicked() @@ -467,7 +468,7 @@ void NoiseFigureGUI::on_openReference_clicked()
m_refFilename = fileNames[0];
QFile file(m_refFilename);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QMessageBox::critical(this, "Noise Figure", QString("Failed to open file %1").arg(m_refFilename));
MessageDialog::critical(this, "Noise Figure", QString("Failed to open file %1").arg(m_refFilename));
return;
}
QTextStream in(&file);

87
plugins/channelrx/radioastronomy/radioastronomy.cpp

@ -30,11 +30,13 @@ @@ -30,11 +30,13 @@
#include <complex.h>
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGWorkspaceInfo.h"
#include "SWGChannelActions.h"
#include "SWGRadioAstronomyActions.h"
#include "dsp/dspcommands.h"
#include "util/db.h"
#include "device/deviceapi.h"
#include "channel/channelwebapiutils.h"
#include "settings/serializable.h"
@ -854,6 +856,27 @@ int RadioAstronomy::webapiWorkspaceGet( @@ -854,6 +856,27 @@ int RadioAstronomy::webapiWorkspaceGet(
return 200;
}
int RadioAstronomy::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
(void) errorMessage;
response.setRadioAstronomyReport(new SWGSDRangel::SWGRadioAstronomyReport());
response.getRadioAstronomyReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void RadioAstronomy::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
double magsqAvg, magsqPeak;
int nbMagsqSamples;
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
response.getRadioAstronomyReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getRadioAstronomyReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
}
int RadioAstronomy::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
@ -964,10 +987,10 @@ void RadioAstronomy::webapiUpdateChannelSettings( @@ -964,10 +987,10 @@ void RadioAstronomy::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("sweep1Delay")) {
settings.m_sweep1Delay = response.getRadioAstronomySettings()->getSweep1Delay();
}
if (channelSettingsKeys.contains("sweep12Start")) {
if (channelSettingsKeys.contains("sweep2Start")) {
settings.m_sweep2Start = response.getRadioAstronomySettings()->getSweep2Start();
}
if (channelSettingsKeys.contains("sweep12Stop")) {
if (channelSettingsKeys.contains("sweep2Stop")) {
settings.m_sweep2Stop = response.getRadioAstronomySettings()->getSweep2Stop();
}
if (channelSettingsKeys.contains("sweep2Step")) {
@ -1017,14 +1040,30 @@ void RadioAstronomy::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings @@ -1017,14 +1040,30 @@ void RadioAstronomy::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings
response.getRadioAstronomySettings()->setIntegration(settings.m_integration);
response.getRadioAstronomySettings()->setFftSize(settings.m_fftSize);
response.getRadioAstronomySettings()->setFftWindow((int)settings.m_fftWindow);
response.getRadioAstronomySettings()->setFilterFreqs(new QString(settings.m_filterFreqs));
if (response.getRadioAstronomySettings()->getFilterFreqs()) {
*response.getRadioAstronomySettings()->getFilterFreqs() = settings.m_filterFreqs;
} else {
response.getRadioAstronomySettings()->setFilterFreqs(new QString(settings.m_filterFreqs));
}
response.getRadioAstronomySettings()->setStarTracker(new QString(settings.m_starTracker));
response.getRadioAstronomySettings()->setRotator(new QString(settings.m_rotator));
if (response.getRadioAstronomySettings()->getStarTracker()) {
*response.getRadioAstronomySettings()->getStarTracker() = settings.m_starTracker;
} else {
response.getRadioAstronomySettings()->setStarTracker(new QString(settings.m_starTracker));
}
if (response.getRadioAstronomySettings()->getRotator()) {
*response.getRadioAstronomySettings()->getRotator() = settings.m_rotator;
} else {
response.getRadioAstronomySettings()->setRotator(new QString(settings.m_rotator));
}
response.getRadioAstronomySettings()->setRunMode((int)settings.m_runMode);
response.getRadioAstronomySettings()->setSweepStartAtTime((int)settings.m_sweepStartAtTime);
response.getRadioAstronomySettings()->setSweepStartDateTime(new QString(settings.m_sweepStartDateTime.toString(Qt::ISODate)));
if (response.getRadioAstronomySettings()->getSweepStartDateTime()) {
*response.getRadioAstronomySettings()->getSweepStartDateTime() = settings.m_sweepStartDateTime.toString(Qt::ISODate);
} else {
response.getRadioAstronomySettings()->setSweepStartDateTime(new QString(settings.m_sweepStartDateTime.toString(Qt::ISODate)));
}
response.getRadioAstronomySettings()->setSweepType((int)settings.m_sweepType);
response.getRadioAstronomySettings()->setSweep1Start(settings.m_sweep1Start);
response.getRadioAstronomySettings()->setSweep1Stop(settings.m_sweep1Stop);
@ -1119,7 +1158,11 @@ void RadioAstronomy::webapiFormatChannelSettings( @@ -1119,7 +1158,11 @@ void RadioAstronomy::webapiFormatChannelSettings(
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("RadioAstronomy"));
if (swgChannelSettings->getChannelType()) {
*swgChannelSettings->getChannelType() = "RadioAstronomy";
} else {
swgChannelSettings->setChannelType(new QString("RadioAstronomy"));
}
swgChannelSettings->setRadioAstronomySettings(new SWGSDRangel::SWGRadioAstronomySettings());
SWGSDRangel::SWGRadioAstronomySettings *swgRadioAstronomySettings = swgChannelSettings->getRadioAstronomySettings();
@ -1144,14 +1187,26 @@ void RadioAstronomy::webapiFormatChannelSettings( @@ -1144,14 +1187,26 @@ void RadioAstronomy::webapiFormatChannelSettings(
swgRadioAstronomySettings->setRfBandwidth((int)settings.m_fftWindow);
}
if (channelSettingsKeys.contains("filterFreqs") || force) {
swgRadioAstronomySettings->setFilterFreqs(new QString(settings.m_filterFreqs));
if (swgRadioAstronomySettings->getFilterFreqs()) {
*swgRadioAstronomySettings->getFilterFreqs() = settings.m_filterFreqs;
} else {
swgRadioAstronomySettings->setFilterFreqs(new QString(settings.m_filterFreqs));
}
}
if (channelSettingsKeys.contains("starTracker") || force) {
swgRadioAstronomySettings->setStarTracker(new QString(settings.m_starTracker));
if (swgRadioAstronomySettings->getStarTracker()) {
*swgRadioAstronomySettings->getStarTracker() = settings.m_starTracker;
} else {
swgRadioAstronomySettings->setStarTracker(new QString(settings.m_starTracker));
}
}
if (channelSettingsKeys.contains("rotator") || force) {
swgRadioAstronomySettings->setRotator(new QString(settings.m_rotator));
if (swgRadioAstronomySettings->getRotator()) {
*swgRadioAstronomySettings->getRotator() = settings.m_rotator;
} else {
swgRadioAstronomySettings->setRotator(new QString(settings.m_rotator));
}
}
if (channelSettingsKeys.contains("runMode") || force) {
@ -1161,7 +1216,11 @@ void RadioAstronomy::webapiFormatChannelSettings( @@ -1161,7 +1216,11 @@ void RadioAstronomy::webapiFormatChannelSettings(
swgRadioAstronomySettings->setSweepStartAtTime((int)settings.m_sweepStartAtTime);
}
if (channelSettingsKeys.contains("sweepStartDateTime") || force) {
swgRadioAstronomySettings->setSweepStartDateTime(new QString(settings.m_sweepStartDateTime.toString(Qt::ISODate)));
if (swgRadioAstronomySettings->getSweepStartDateTime()) {
*swgRadioAstronomySettings->getSweepStartDateTime() = settings.m_sweepStartDateTime.toString(Qt::ISODate);
} else {
swgRadioAstronomySettings->setSweepStartDateTime(new QString(settings.m_sweepStartDateTime.toString(Qt::ISODate)));
}
}
if (channelSettingsKeys.contains("sweepType") || force) {
swgRadioAstronomySettings->setSweepType(settings.m_sweepType);
@ -1195,7 +1254,11 @@ void RadioAstronomy::webapiFormatChannelSettings( @@ -1195,7 +1254,11 @@ void RadioAstronomy::webapiFormatChannelSettings(
swgRadioAstronomySettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgRadioAstronomySettings->setTitle(new QString(settings.m_title));
if (swgRadioAstronomySettings->getTitle()) {
*swgRadioAstronomySettings->getTitle() = settings.m_title;
} else {
swgRadioAstronomySettings->setTitle(new QString(settings.m_title));
}
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgRadioAstronomySettings->setStreamIndex(settings.m_streamIndex);

5
plugins/channelrx/radioastronomy/radioastronomy.h

@ -426,6 +426,10 @@ public: @@ -426,6 +426,10 @@ public:
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage) override;
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage) override;
virtual int webapiActionsPost(
const QStringList& channelActionsKeys,
SWGSDRangel::SWGChannelActions& query,
@ -486,6 +490,7 @@ private: @@ -486,6 +490,7 @@ private:
virtual bool handleMessage(const Message& cmd);
void applySettings(const QStringList& settingsKeys, const RadioAstronomySettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(const QList<QString>& channelSettingsKeys, const RadioAstronomySettings& settings, bool force);
void webapiFormatChannelSettings(
const QList<QString>& channelSettingsKeys,

5
plugins/channelrx/radioastronomy/radioastronomybaseband.cpp

@ -192,6 +192,11 @@ void RadioAstronomyBaseband::applySettings(const QStringList& settingsKeys, cons @@ -192,6 +192,11 @@ void RadioAstronomyBaseband::applySettings(const QStringList& settingsKeys, cons
}
}
int RadioAstronomyBaseband::getChannelSampleRate() const
{
return m_channelizer->getChannelSampleRate();
}
void RadioAstronomyBaseband::setBasebandSampleRate(int sampleRate)
{
m_channelizer->setBasebandSampleRate(sampleRate);

1
plugins/channelrx/radioastronomy/radioastronomybaseband.h

@ -74,6 +74,7 @@ public: @@ -74,6 +74,7 @@ public:
}
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_sink.setMessageQueueToChannel(messageQueue); }
void setBasebandSampleRate(int sampleRate);
int getChannelSampleRate() const;
void setChannel(ChannelAPI *channel);
double getMagSq() const { return m_sink.getMagSq(); }
bool isRunning() const { return m_running; }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save