From 8f9fdd8b708b70ed672af2f109c192b343751534 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Mon, 15 Feb 2021 14:55:48 +0100 Subject: [PATCH] Added sample rates for RTL-SDR --- rtl_sdr_source/src/main.cpp | 8 ++++++-- sdrplay_source/src/main.cpp | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rtl_sdr_source/src/main.cpp b/rtl_sdr_source/src/main.cpp index 5d16335..5067f4e 100644 --- a/rtl_sdr_source/src/main.cpp +++ b/rtl_sdr_source/src/main.cpp @@ -30,6 +30,7 @@ const double sampleRates[] = { 1920000, 2048000, 2160000, + 2400000, 2560000, 2880000, 3200000 @@ -43,6 +44,7 @@ const char* sampleRatesTxt[] = { "1.92MHz", "2.048MHz", "2.16MHz", + "2.4MHz", "2.56MHz", "2.88MHz", "3.2MHz" @@ -68,7 +70,7 @@ public: strcpy(dbTxt, "--"); - for (int i = 0; i < 10; i++) { + for (int i = 0; i < 11; i++) { sampleRateListTxt += sampleRatesTxt[i]; sampleRateListTxt += '\0'; } @@ -169,7 +171,7 @@ public: // Load config if (config.conf["devices"][selectedDevName].contains("sampleRate")) { int selectedSr = config.conf["devices"][selectedDevName]["sampleRate"]; - for (int i = 0; i < 10; i++) { + for (int i = 0; i < 11; i++) { if (sampleRates[i] == selectedSr) { srId = i; sampleRate = selectedSr; @@ -241,6 +243,8 @@ private: return; } + spdlog::info("RTL-SDR Sample Rate: {0}", _this->sampleRate); + rtlsdr_set_sample_rate(_this->openDev, _this->sampleRate); rtlsdr_set_center_freq(_this->openDev, _this->freq); rtlsdr_set_tuner_bandwidth(_this->openDev, 0); diff --git a/sdrplay_source/src/main.cpp b/sdrplay_source/src/main.cpp index daa0288..079135c 100644 --- a/sdrplay_source/src/main.cpp +++ b/sdrplay_source/src/main.cpp @@ -241,6 +241,8 @@ private: } + if (_this->running) { style::endDisabled(); } + if (_this->deviceOpen) { switch (_this->openDev.hwVer) { case SDRPLAY_RSP1_ID: @@ -265,9 +267,7 @@ private: } else { ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "No device available"); - } - - if (_this->running) { style::endDisabled(); } + } } void RSP1Menu(float menuWidth) { @@ -275,7 +275,7 @@ private: } void RSP1AMenu(float menuWidth) { - ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Device currently unsupported"); + } void RSP2Menu(float menuWidth) { @@ -327,6 +327,8 @@ private: int devId = 0; int srId = 0; + int gainTest = 0; + std::vector devList; std::string devListTxt; std::vector sampleRateList;