mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-22 19:58:39 -05:00
Merge branch 'master' into digital_lab
This commit is contained in:
commit
a96a3b2234
153
CMakeLists.txt
153
CMakeLists.txt
@ -345,6 +345,21 @@ SET (cubicsdr_headers
|
||||
external/cubicvr2/math/vec4.h
|
||||
)
|
||||
|
||||
SET (CUBICSDR_RESOURCES
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48_0.png
|
||||
)
|
||||
|
||||
set(REG_EXT "[^/]*([.]cpp|[.]c|[.]h|[.]hpp)$")
|
||||
|
||||
SOURCE_GROUP("Base" REGULAR_EXPRESSION "src/${REG_EXT}")
|
||||
@ -447,34 +462,12 @@ IF (APPLE AND BUNDLE_APP)
|
||||
MACOSX_BUNDLE
|
||||
${cubicsdr_sources}
|
||||
${cubicsdr_headers}
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48_0.png
|
||||
${CUBICSDR_RESOURCES}
|
||||
${PROJECT_SOURCE_DIR}/icon/CubicSDR.icns
|
||||
)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48_0.png
|
||||
${CUBICSDR_RESOURCES}
|
||||
${PROJECT_SOURCE_DIR}/icon/CubicSDR.icns
|
||||
PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION Resources
|
||||
@ -543,7 +536,32 @@ IF (APPLE AND BUNDLE_APP)
|
||||
|
||||
set(CPACK_BINARY_DRAGNDROP ON)
|
||||
include(CPack)
|
||||
ENDIF (APPLE AND BUNDLE_APP)
|
||||
ENDIF()
|
||||
IF(APPLE AND NOT BUNDLE_APP)
|
||||
IF (NOT CMAKE_INSTALL_PREFIX)
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr/")
|
||||
ENDIF()
|
||||
ADD_DEFINITIONS(
|
||||
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
|
||||
)
|
||||
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")
|
||||
|
||||
INSTALL(TARGETS CubicSDR DESTINATION bin)
|
||||
install(FILES
|
||||
${CUBICSDR_RESOURCES}
|
||||
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
|
||||
DESTINATION share/cubicsdr)
|
||||
|
||||
CONFIGURE_FILE(
|
||||
"${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
@ONLY IMMEDIATE)
|
||||
ADD_CUSTOM_TARGET(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
|
||||
ENDIF ()
|
||||
|
||||
IF (WIN32 AND BUILD_INSTALLER)
|
||||
set(BUNDLE_SOAPY_MODS OFF CACHE BOOL "Bundle local SoapySDR modules")
|
||||
@ -572,18 +590,7 @@ IF (WIN32 AND BUILD_INSTALLER)
|
||||
install(TARGETS CubicSDR RUNTIME DESTINATION .)
|
||||
|
||||
install(FILES
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48_0.png
|
||||
${CUBICSDR_RESOURCES}
|
||||
${PROJECT_SOURCE_DIR}/icon/CubicSDR.ico
|
||||
${PROJECT_SOURCE_DIR}/external/fftw-3.3.4/${EX_PLATFORM}/libfftw3f-3.dll
|
||||
${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.dll
|
||||
@ -619,8 +626,7 @@ IF (WIN32 AND BUILD_INSTALLER)
|
||||
ENDIF (WIN32 AND BUILD_INSTALLER)
|
||||
|
||||
|
||||
IF (UNIX AND BUILD_DEB)
|
||||
|
||||
IF (UNIX AND NOT APPLE AND BUILD_DEB)
|
||||
set(CPACK_GENERATOR DEB)
|
||||
set(CPACK_PACKAGE_NAME "CubicSDR")
|
||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS " libfftw3-single3, libwxgtk3.0-0, libpulse0")
|
||||
@ -629,34 +635,63 @@ IF (UNIX AND BUILD_DEB)
|
||||
SET(CPACK_DEBIAN_PACKAGE_SECTION "comm")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${EX_PLATFORM_NAME}")
|
||||
|
||||
|
||||
IF (NOT CMAKE_INSTALL_PREFIX)
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr/")
|
||||
ENDIF()
|
||||
ADD_DEFINITIONS(
|
||||
-DRES_FOLDER="/usr/share/cubicsdr/"
|
||||
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
|
||||
-D_FORTIFY_SOURCE=2
|
||||
)
|
||||
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")
|
||||
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")
|
||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/external/deb/deb_post.sh.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/deb_post.sh" @ONLY IMMEDIATE)
|
||||
|
||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/external/deb/deb_post.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/deb_post.sh" @ONLY IMMEDIATE)
|
||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CubicSDR.desktop.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop" @ONLY IMMEDIATE)
|
||||
|
||||
INSTALL(TARGETS CubicSDR DESTINATION bin)
|
||||
install(FILES
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32_0.png
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48_0.png
|
||||
${CUBICSDR_RESOURCES}
|
||||
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
|
||||
DESTINATION share/cubicsdr)
|
||||
INSTALL(FILES CubicSDR.desktop
|
||||
DESTINATION share/applications)
|
||||
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop"
|
||||
DESTINATION share/applications)
|
||||
|
||||
INCLUDE(CPack)
|
||||
ENDIF (UNIX AND BUILD_DEB)
|
||||
ENDIF()
|
||||
IF(UNIX AND NOT APPLE AND NOT BUILD_DEB)
|
||||
IF (NOT CMAKE_INSTALL_PREFIX)
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr/")
|
||||
ENDIF()
|
||||
ADD_DEFINITIONS(
|
||||
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
|
||||
)
|
||||
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")
|
||||
|
||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CubicSDR.desktop.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop" @ONLY IMMEDIATE)
|
||||
|
||||
INSTALL(TARGETS CubicSDR DESTINATION bin)
|
||||
install(FILES
|
||||
${CUBICSDR_RESOURCES}
|
||||
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
|
||||
DESTINATION share/cubicsdr)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop"
|
||||
DESTINATION share/applications)
|
||||
|
||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/external/deb/deb_post.sh.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/deb_post.sh" @ONLY IMMEDIATE)
|
||||
CONFIGURE_FILE(
|
||||
"${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
@ONLY IMMEDIATE)
|
||||
ADD_CUSTOM_TARGET(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
ENDIF()
|
||||
|
@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=CubicSDR %u
|
||||
Icon=/usr/share/cubicsdr/CubicSDR.png
|
||||
Icon=@CMAKE_INSTALL_PREFIX@/share/cubicsdr/CubicSDR.png
|
||||
Terminal=false
|
||||
Name=CubicSDR
|
||||
GenericName=CubicSDR
|
22
cmake/cmake_uninstall.cmake.in
Normal file
22
cmake/cmake_uninstall.cmake.in
Normal file
@ -0,0 +1,22 @@
|
||||
IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
|
||||
MESSAGE(FATAL_ERROR "Cannot find install manifest: '${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt'")
|
||||
ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
|
||||
|
||||
FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" files)
|
||||
STRING(REGEX REPLACE " " ";" files "${files}")
|
||||
STRING(REGEX REPLACE "\n" ";" files "${files}")
|
||||
FOREACH(file ${files})
|
||||
MESSAGE(STATUS "Uninstalling '$ENV{DESTDIR}${file}'")
|
||||
IF(EXISTS "$ENV{DESTDIR}${file}")
|
||||
EXEC_PROGRAM(
|
||||
"${CMAKE_COMMAND}" ARGS "-E remove '$ENV{DESTDIR}${file}'"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
IF(NOT "${rm_retval}" STREQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Problem when removing '$ENV{DESTDIR}${file}'")
|
||||
ENDIF(NOT "${rm_retval}" STREQUAL 0)
|
||||
ELSE(EXISTS "$ENV{DESTDIR}${file}")
|
||||
MESSAGE(STATUS "File '$ENV{DESTDIR}${file}' does not exist.")
|
||||
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
|
||||
ENDFOREACH(file)
|
@ -795,6 +795,8 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
|
||||
}
|
||||
|
||||
void AppFrame::OnClose(wxCloseEvent& event) {
|
||||
wxGetApp().closeDeviceSelector();
|
||||
|
||||
wxGetApp().getDemodSpectrumProcessor()->removeOutput(demodSpectrumCanvas->getVisualDataQueue());
|
||||
wxGetApp().getDemodSpectrumProcessor()->removeOutput(demodWaterfallCanvas->getVisualDataQueue());
|
||||
wxGetApp().getSpectrumProcessor()->removeOutput(spectrumCanvas->getVisualDataQueue());
|
||||
|
@ -301,10 +301,26 @@ bool CubicSDR::OnCmdLineParsed(wxCmdLineParser& parser) {
|
||||
#else
|
||||
useLocalMod.store(true);
|
||||
#endif
|
||||
|
||||
wxString *modPath = new wxString;
|
||||
|
||||
if (parser.Found("m",modPath)) {
|
||||
if (modPath) {
|
||||
modulePath = modPath->ToStdString();
|
||||
} else {
|
||||
modulePath = "";
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CubicSDR::closeDeviceSelector() {
|
||||
if (deviceSelectorOpen) {
|
||||
deviceSelectorDialog->Close();
|
||||
}
|
||||
}
|
||||
|
||||
void CubicSDR::deviceSelector() {
|
||||
if (deviceSelectorOpen) {
|
||||
deviceSelectorDialog->Raise();
|
||||
@ -645,4 +661,8 @@ void CubicSDR::setDeviceArgs(SoapySDR::Kwargs settingArgs_in) {
|
||||
|
||||
bool CubicSDR::getUseLocalMod() {
|
||||
return useLocalMod.load();
|
||||
}
|
||||
}
|
||||
|
||||
std::string CubicSDR::getModulePath() {
|
||||
return modulePath;
|
||||
}
|
||||
|
@ -102,6 +102,8 @@ public:
|
||||
|
||||
void setDeviceSelectorClosed();
|
||||
bool isDeviceSelectorOpen();
|
||||
void closeDeviceSelector();
|
||||
|
||||
|
||||
void setAGCMode(bool mode);
|
||||
bool getAGCMode();
|
||||
@ -113,6 +115,8 @@ public:
|
||||
void setDeviceArgs(SoapySDR::Kwargs settingArgs_in);
|
||||
|
||||
bool getUseLocalMod();
|
||||
std::string getModulePath();
|
||||
|
||||
private:
|
||||
AppFrame *appframe;
|
||||
AppConfig config;
|
||||
@ -153,6 +157,7 @@ private:
|
||||
std::atomic_bool sampleRateInitialized;
|
||||
std::atomic_bool useLocalMod;
|
||||
std::string notifyMessage;
|
||||
std::string modulePath;
|
||||
std::mutex notify_busy;
|
||||
};
|
||||
|
||||
@ -161,6 +166,7 @@ static const wxCmdLineEntryDesc commandLineInfo [] =
|
||||
{
|
||||
{ wxCMD_LINE_SWITCH, "h", "help", "Command line parameter help", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
|
||||
{ wxCMD_LINE_OPTION, "c", "config", "Specify a named configuration to use, i.e. '-c ham'" },
|
||||
{ wxCMD_LINE_OPTION, "m", "modpath", "Load modules from suppplied path, i.e. '-m ~/SoapyMods/'" },
|
||||
{ wxCMD_LINE_SWITCH, "b", "bundled", "Use bundled SoapySDR modules first instead of local." },
|
||||
{ wxCMD_LINE_NONE }
|
||||
};
|
||||
@ -169,6 +175,7 @@ static const wxCmdLineEntryDesc commandLineInfo [] =
|
||||
{
|
||||
{ wxCMD_LINE_SWITCH, "h", "help", "Command line parameter help", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
|
||||
{ wxCMD_LINE_OPTION, "c", "config", "Specify a named configuration to use, i.e. '-c ham'" },
|
||||
{ wxCMD_LINE_OPTION, "m", "modpath", "Load modules from suppplied path, i.e. '-m ~/SoapyMods/'" },
|
||||
{ wxCMD_LINE_NONE }
|
||||
};
|
||||
#endif
|
||||
|
@ -229,12 +229,17 @@ void SDRDevicesDialog::OnDeviceTimer( wxTimerEvent& event ) {
|
||||
|
||||
wxTreeItemId devRoot = devTree->AddRoot("Devices");
|
||||
wxTreeItemId localBranch = devTree->AppendItem(devRoot, "Local");
|
||||
wxTreeItemId dsBranch = devTree->AppendItem(devRoot, "Local Net");
|
||||
wxTreeItemId remoteBranch = devTree->AppendItem(devRoot, "Remote");
|
||||
|
||||
devs[""] = SDREnumerator::enumerate_devices("",true);
|
||||
if (devs[""] != NULL) {
|
||||
for (devs_i = devs[""]->begin(); devs_i != devs[""]->end(); devs_i++) {
|
||||
devItems[devTree->AppendItem(localBranch, (*devs_i)->getName())] = (*devs_i);
|
||||
if ((*devs_i)->isRemote()) {
|
||||
devItems[devTree->AppendItem(dsBranch, (*devs_i)->getName())] = (*devs_i);
|
||||
} else {
|
||||
devItems[devTree->AppendItem(localBranch, (*devs_i)->getName())] = (*devs_i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,9 +56,7 @@ void WaterfallPanel::step() {
|
||||
int half_fft_size = fft_size / 2;
|
||||
|
||||
if (!bufferInitialized.load()) {
|
||||
if (waterfall_slice != NULL) {
|
||||
delete waterfall_slice;
|
||||
}
|
||||
delete waterfall_slice;
|
||||
waterfall_slice = new unsigned char[half_fft_size];
|
||||
bufferInitialized.store(true);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ std::vector<std::string> SDRDeviceChannel::getStreamArgNames() {
|
||||
}
|
||||
|
||||
|
||||
SDRDeviceInfo::SDRDeviceInfo() : name(""), serial(""), available(false) {
|
||||
SDRDeviceInfo::SDRDeviceInfo() : name(""), serial(""), available(false), remote(false) {
|
||||
|
||||
}
|
||||
|
||||
@ -254,6 +254,14 @@ void SDRDeviceInfo::setTimestamps(bool timestamps) {
|
||||
this->timestamps = timestamps;
|
||||
}
|
||||
|
||||
bool SDRDeviceInfo::isRemote() const {
|
||||
return remote;
|
||||
}
|
||||
|
||||
void SDRDeviceInfo::setRemote(bool remote) {
|
||||
this->remote = remote;
|
||||
}
|
||||
|
||||
void SDRDeviceInfo::setDeviceArgs(SoapySDR::Kwargs deviceArgs) {
|
||||
this->deviceArgs = deviceArgs;
|
||||
}
|
||||
|
@ -136,6 +136,9 @@ public:
|
||||
|
||||
bool hasTimestamps() const;
|
||||
void setTimestamps(bool timestamps);
|
||||
|
||||
bool isRemote() const;
|
||||
void setRemote(bool remote);
|
||||
|
||||
void addChannel(SDRDeviceChannel *chan);
|
||||
std::vector<SDRDeviceChannel *> &getChannels();
|
||||
@ -157,7 +160,7 @@ private:
|
||||
int index;
|
||||
std::string name, serial, product, manufacturer, tuner;
|
||||
std::string driver, hardware;
|
||||
bool timestamps, available;
|
||||
bool timestamps, available, remote;
|
||||
|
||||
SoapySDR::Kwargs deviceArgs, streamArgs;
|
||||
SoapySDR::ArgInfoList settingInfo;
|
||||
|
@ -38,32 +38,45 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
|
||||
std::cout << "\tInstall root: " << SoapySDR::getRootPath() << std::endl;
|
||||
|
||||
std::cout << "\tLoading modules... " << std::endl;
|
||||
#ifdef BUNDLE_SOAPY_MODS
|
||||
bool localModPref = wxGetApp().getUseLocalMod();
|
||||
if (localModPref) {
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Loading SoapySDR modules..");
|
||||
std::cout << "Checking local system SoapySDR modules.." << std::flush;
|
||||
SoapySDR::loadModules();
|
||||
}
|
||||
|
||||
std::string userModPath = wxGetApp().getModulePath();
|
||||
|
||||
if (userModPath != "") {
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Loading SoapySDR modules from " + userModPath + "..");
|
||||
std::vector<std::string> localMods = SoapySDR::listModules(userModPath);
|
||||
for (std::vector<std::string>::iterator mods_i = localMods.begin(); mods_i != localMods.end(); mods_i++) {
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Initializing user specified SoapySDR module " + (*mods_i) + "..");
|
||||
std::cout << "Initializing user specified SoapySDR module " << (*mods_i) << ".." << std::endl;
|
||||
SoapySDR::loadModule(*mods_i);
|
||||
}
|
||||
} else {
|
||||
#ifdef BUNDLE_SOAPY_MODS
|
||||
bool localModPref = wxGetApp().getUseLocalMod();
|
||||
if (localModPref) {
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Loading SoapySDR modules..");
|
||||
std::cout << "Checking local system SoapySDR modules.." << std::flush;
|
||||
SoapySDR::loadModules();
|
||||
}
|
||||
|
||||
wxFileName exePath = wxFileName(wxStandardPaths::Get().GetExecutablePath());
|
||||
std::vector<std::string> localMods = SoapySDR::listModules(exePath.GetPath().ToStdString() + "/modules/");
|
||||
for (std::vector<std::string>::iterator mods_i = localMods.begin(); mods_i != localMods.end(); mods_i++) {
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Initializing bundled SoapySDR module " + (*mods_i) + "..");
|
||||
std::cout << "Loading bundled SoapySDR module " << (*mods_i) << ".." << std::endl;
|
||||
SoapySDR::loadModule(*mods_i);
|
||||
}
|
||||
|
||||
if (!localModPref) {
|
||||
wxFileName exePath = wxFileName(wxStandardPaths::Get().GetExecutablePath());
|
||||
std::vector<std::string> localMods = SoapySDR::listModules(exePath.GetPath().ToStdString() + "/modules/");
|
||||
for (std::vector<std::string>::iterator mods_i = localMods.begin(); mods_i != localMods.end(); mods_i++) {
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Initializing bundled SoapySDR module " + (*mods_i) + "..");
|
||||
std::cout << "Loading bundled SoapySDR module " << (*mods_i) << ".." << std::endl;
|
||||
SoapySDR::loadModule(*mods_i);
|
||||
}
|
||||
|
||||
if (!localModPref) {
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Loading SoapySDR modules..");
|
||||
std::cout << "Checking system SoapySDR modules.." << std::flush;
|
||||
SoapySDR::loadModules();
|
||||
}
|
||||
#else
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Loading SoapySDR modules..");
|
||||
std::cout << "Checking system SoapySDR modules.." << std::flush;
|
||||
SoapySDR::loadModules();
|
||||
}
|
||||
#else
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Loading SoapySDR modules..");
|
||||
SoapySDR::loadModules();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
// modules = SoapySDR::listModules();
|
||||
// for (size_t i = 0; i < modules.size(); i++) {
|
||||
// std::cout << "\tModule found: " << modules[i] << std::endl;
|
||||
@ -115,7 +128,6 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Opening remote server ") + remoteAddr + "..");
|
||||
}
|
||||
for (size_t i = 0; i < results.size(); i++) {
|
||||
// std::cout << "Found device " << i << std::endl;
|
||||
SDRDeviceInfo *dev = new SDRDeviceInfo();
|
||||
|
||||
SoapySDR::Kwargs deviceArgs = results[i];
|
||||
@ -128,6 +140,14 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
|
||||
dev->setName(it->second);
|
||||
}
|
||||
}
|
||||
|
||||
if (deviceArgs.count("remote")) {
|
||||
isRemote = true;
|
||||
} else {
|
||||
isRemote = false;
|
||||
}
|
||||
|
||||
dev->setRemote(isRemote);
|
||||
|
||||
dev->setDeviceArgs(deviceArgs);
|
||||
|
||||
@ -141,7 +161,7 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
|
||||
dev->setHardware(it->second);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isRemote) {
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Querying remote " + remoteAddr + " device #" + std::to_string(i) + ": " + dev-> getName());
|
||||
} else {
|
||||
@ -191,25 +211,6 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
|
||||
dev->addChannel(chan);
|
||||
}
|
||||
|
||||
|
||||
SoapySDR::Kwargs streamArgs;
|
||||
|
||||
if (isRemote) {
|
||||
// if (deviceArgs.count("rtl") != 0) {
|
||||
// streamArgs["remote:mtu"] = "8192";
|
||||
// streamArgs["remote:window"] = "16384000";
|
||||
// }
|
||||
double fullScale = 0;
|
||||
std::string nativeFormat = device->getNativeStreamFormat(SOAPY_SDR_RX, dev->getRxChannel()->getChannel(), fullScale);
|
||||
|
||||
if (nativeFormat.length()) {
|
||||
streamArgs["remote:format"] = nativeFormat;
|
||||
}
|
||||
}
|
||||
|
||||
dev->setStreamArgs(streamArgs);
|
||||
|
||||
|
||||
dev->setSettingsInfo(device->getSettingInfo());
|
||||
|
||||
SoapySDR::Device::unmake(device);
|
||||
@ -237,10 +238,6 @@ void SDREnumerator::run() {
|
||||
|
||||
std::cout << "SDR enumerator starting." << std::endl;
|
||||
terminated.store(false);
|
||||
|
||||
// if (!remotes.size()) {
|
||||
// remotes.push_back("raspberrypi.local");
|
||||
// }
|
||||
|
||||
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Scanning local devices, please wait..");
|
||||
SDREnumerator::enumerate_devices("");
|
||||
|
Loading…
Reference in New Issue
Block a user