From 83efddee9aecfce0668e8dc010cc8a3ede07c9a2 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 9 Apr 2018 00:54:25 +0200 Subject: [PATCH] Build ModWFM tx channel server plugin and apply corrections to other server plugins --- plugins/channelrx/demodam/amdemodplugin.cpp | 1 - plugins/channeltx/modam/ammodplugin.cpp | 12 +++++- plugins/channeltx/modnfm/nfmmodplugin.cpp | 4 +- plugins/channeltx/modwfm/wfmmodplugin.cpp | 12 +++++- pluginssrv/channelrx/demodam/CMakeLists.txt | 2 +- pluginssrv/channeltx/CMakeLists.txt | 1 + pluginssrv/channeltx/modam/CMakeLists.txt | 2 +- pluginssrv/channeltx/modnfm/CMakeLists.txt | 2 - pluginssrv/channeltx/modwfm/CMakeLists.txt | 41 +++++++++++++++++++++ 9 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 pluginssrv/channeltx/modwfm/CMakeLists.txt diff --git a/plugins/channelrx/demodam/amdemodplugin.cpp b/plugins/channelrx/demodam/amdemodplugin.cpp index d8bbd0ac5..76149cd3c 100644 --- a/plugins/channelrx/demodam/amdemodplugin.cpp +++ b/plugins/channelrx/demodam/amdemodplugin.cpp @@ -1,5 +1,4 @@ #include -#include #include "plugin/pluginapi.h" #ifndef SERVER_MODE diff --git a/plugins/channeltx/modam/ammodplugin.cpp b/plugins/channeltx/modam/ammodplugin.cpp index 4913395e7..c50ef1d87 100644 --- a/plugins/channeltx/modam/ammodplugin.cpp +++ b/plugins/channeltx/modam/ammodplugin.cpp @@ -15,10 +15,11 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include "plugin/pluginapi.h" +#ifndef SERVER_MODE #include "ammodgui.h" +#endif #include "ammod.h" #include "ammodplugin.h" @@ -50,10 +51,19 @@ void AMModPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI->registerTxChannel(AMMod::m_channelIdURI, AMMod::m_channelId, this); } +#ifdef SERVER_MODE +PluginInstanceGUI* AMModPlugin::createTxChannelGUI( + DeviceUISet *deviceUISet __attribute__((unused)), + BasebandSampleSource *txChannel __attribute__((unused))) +{ + return 0; +} +#else PluginInstanceGUI* AMModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) { return AMModGUI::create(m_pluginAPI, deviceUISet, txChannel); } +#endif BasebandSampleSource* AMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI) { diff --git a/plugins/channeltx/modnfm/nfmmodplugin.cpp b/plugins/channeltx/modnfm/nfmmodplugin.cpp index 8447328d6..e6c05ab9e 100644 --- a/plugins/channeltx/modnfm/nfmmodplugin.cpp +++ b/plugins/channeltx/modnfm/nfmmodplugin.cpp @@ -15,10 +15,12 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include "plugin/pluginapi.h" +#ifndef SERVER_MODE #include "nfmmodgui.h" +#endif +#include "nfmmod.h" #include "nfmmodplugin.h" const PluginDescriptor NFMModPlugin::m_pluginDescriptor = { diff --git a/plugins/channeltx/modwfm/wfmmodplugin.cpp b/plugins/channeltx/modwfm/wfmmodplugin.cpp index ae13046d8..14ef9a471 100644 --- a/plugins/channeltx/modwfm/wfmmodplugin.cpp +++ b/plugins/channeltx/modwfm/wfmmodplugin.cpp @@ -15,10 +15,11 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include "plugin/pluginapi.h" +#ifndef SERVER_MODE #include "wfmmodgui.h" +#endif #include "wfmmod.h" #include "wfmmodplugin.h" @@ -50,10 +51,19 @@ void WFMModPlugin::initPlugin(PluginAPI* pluginAPI) m_pluginAPI->registerTxChannel(WFMMod::m_channelIdURI, WFMMod::m_channelId, this); } +#ifdef SERVER_MODE +PluginInstanceGUI* WFMModPlugin::createTxChannelGUI( + DeviceUISet *deviceUISet __attribute__((unused)), + BasebandSampleSource *txChannel __attribute__((unused))) +{ + return 0; +} +#else PluginInstanceGUI* WFMModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) { return WFMModGUI::create(m_pluginAPI, deviceUISet, txChannel); } +#endif BasebandSampleSource* WFMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI) { diff --git a/pluginssrv/channelrx/demodam/CMakeLists.txt b/pluginssrv/channelrx/demodam/CMakeLists.txt index aaa777cf1..7f0ade068 100644 --- a/pluginssrv/channelrx/demodam/CMakeLists.txt +++ b/pluginssrv/channelrx/demodam/CMakeLists.txt @@ -37,6 +37,6 @@ target_link_libraries(demodamsrv swagger ) -qt5_use_modules(demodamsrv Core Widgets) +qt5_use_modules(demodamsrv Core) install(TARGETS demodamsrv DESTINATION lib/pluginssrv/channelrx) \ No newline at end of file diff --git a/pluginssrv/channeltx/CMakeLists.txt b/pluginssrv/channeltx/CMakeLists.txt index c43165da7..661d661ee 100644 --- a/pluginssrv/channeltx/CMakeLists.txt +++ b/pluginssrv/channeltx/CMakeLists.txt @@ -2,3 +2,4 @@ project(mod) add_subdirectory(modam) add_subdirectory(modnfm) +add_subdirectory(modwfm) diff --git a/pluginssrv/channeltx/modam/CMakeLists.txt b/pluginssrv/channeltx/modam/CMakeLists.txt index c7c948b84..5f0430448 100644 --- a/pluginssrv/channeltx/modam/CMakeLists.txt +++ b/pluginssrv/channeltx/modam/CMakeLists.txt @@ -36,6 +36,6 @@ target_link_libraries(modamsrv swagger ) -qt5_use_modules(modamsrv Core Widgets) +qt5_use_modules(modamsrv Core) install(TARGETS modamsrv DESTINATION lib/pluginssrv/channeltx) \ No newline at end of file diff --git a/pluginssrv/channeltx/modnfm/CMakeLists.txt b/pluginssrv/channeltx/modnfm/CMakeLists.txt index ef8114298..7d1eb0d6f 100644 --- a/pluginssrv/channeltx/modnfm/CMakeLists.txt +++ b/pluginssrv/channeltx/modnfm/CMakeLists.txt @@ -28,13 +28,11 @@ add_definitions(-DQT_SHARED) add_library(modnfmsrv SHARED ${modnfm_SOURCES} ${modnfm_HEADERS_MOC} - ${modnfm_FORMS_HEADERS} ) target_link_libraries(modnfmsrv ${QT_LIBRARIES} sdrbase - sdrgui swagger ) diff --git a/pluginssrv/channeltx/modwfm/CMakeLists.txt b/pluginssrv/channeltx/modwfm/CMakeLists.txt new file mode 100644 index 000000000..090d63b99 --- /dev/null +++ b/pluginssrv/channeltx/modwfm/CMakeLists.txt @@ -0,0 +1,41 @@ +project(modwfm) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(PLUGIN_PREFIX "../../../plugins/channeltx/modwfm") + +set(modwfm_SOURCES + ${PLUGIN_PREFIX}/wfmmod.cpp + ${PLUGIN_PREFIX}/wfmmodplugin.cpp + ${PLUGIN_PREFIX}/wfmmodsettings.cpp +) + +set(modwfm_HEADERS + ${PLUGIN_PREFIX}/wfmmod.h + ${PLUGIN_PREFIX}/wfmmodplugin.h + ${PLUGIN_PREFIX}/wfmmodsettings.h +) + +include_directories( + . + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client +) + +add_definitions(${QT_DEFINITIONS}) +add_definitions(-DQT_PLUGIN) +add_definitions(-DQT_SHARED) + +add_library(modwfmsrv SHARED + ${modwfm_SOURCES} + ${modwfm_HEADERS_MOC} +) + +target_link_libraries(modwfmsrv + ${QT_LIBRARIES} + sdrbase + swagger +) + +qt5_use_modules(modwfmsrv Core) + +install(TARGETS modwfmsrv DESTINATION lib/pluginssrv/channeltx) \ No newline at end of file