From aa929a1e790fd8b57fe6683077b8bb253e32dc72 Mon Sep 17 00:00:00 2001 From: Kenji Rikitake Date: Sun, 25 Jun 2023 13:51:51 +0900 Subject: [PATCH 1/3] Add answering code for rigctl \get_powerstat * Answer "1" (Power is ON) to \get_powerstat inquiry --- misc_modules/rigctl_server/src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc_modules/rigctl_server/src/main.cpp b/misc_modules/rigctl_server/src/main.cpp index 801bec3f..89520ef9 100644 --- a/misc_modules/rigctl_server/src/main.cpp +++ b/misc_modules/rigctl_server/src/main.cpp @@ -690,6 +690,11 @@ private: "0\n" /* RIG_PARM_NONE */; client->write(resp.size(), (uint8_t*)resp.c_str()); } + // This get_powerstat stuff is a wordaround for WSJT-X 2.7.0 + else if (parts[0] == "\\get_powerstat") { + resp = "1\n"; + client->write(resp.size(), (uint8_t*)resp.c_str()); + } else { // If command is not recognized, return error flog::error("Rigctl client sent invalid command: '{0}'", cmd); From 168e28cc448ce12a2308573f216927bc547a1d58 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 10 Jul 2023 04:41:34 +0200 Subject: [PATCH 2/3] added SNR meter smoothing --- core/src/core.cpp | 2 ++ core/src/gui/menus/display.cpp | 40 ++++++++++++++++++++++-------- core/src/gui/widgets/waterfall.cpp | 26 +++++++++++++++---- core/src/gui/widgets/waterfall.h | 13 +++++++--- 4 files changed, 63 insertions(+), 18 deletions(-) diff --git a/core/src/core.cpp b/core/src/core.cpp index 3ce32a47..09148d0a 100644 --- a/core/src/core.cpp +++ b/core/src/core.cpp @@ -119,6 +119,8 @@ int sdrpp_main(int argc, char* argv[]) { defConfig["fftHoldSpeed"] = 60; defConfig["fftSmoothing"] = false; defConfig["fftSmoothingSpeed"] = 100; + defConfig["snrSmoothing"] = false; + defConfig["snrSmoothingSpeed"] = 20; defConfig["fastFFT"] = false; defConfig["fftHeight"] = 300; defConfig["fftRate"] = 20; diff --git a/core/src/gui/menus/display.cpp b/core/src/gui/menus/display.cpp index b9552987..2f9f1b7e 100644 --- a/core/src/gui/menus/display.cpp +++ b/core/src/gui/menus/display.cpp @@ -25,6 +25,8 @@ namespace displaymenu { int fftHoldSpeed = 60; bool fftSmoothing = false; int fftSmoothingSpeed = 100; + bool snrSmoothing = false; + int snrSmoothingSpeed = 20; OptionList uiScales; @@ -63,6 +65,7 @@ namespace displaymenu { void updateFFTSpeeds() { gui::waterfall.setFFTHoldSpeed((float)fftHoldSpeed / ((float)fftRate * 10.0f)); gui::waterfall.setFFTSmoothingSpeed(std::min((float)fftSmoothingSpeed / (float)(fftRate * 10.0f), 1.0f)); + gui::waterfall.setSNRSmoothingSpeed(std::min((float)snrSmoothingSpeed / (float)(fftRate * 10.0f), 1.0f)); } void init() { @@ -111,6 +114,9 @@ namespace displaymenu { fftSmoothing = core::configManager.conf["fftSmoothing"]; fftSmoothingSpeed = core::configManager.conf["fftSmoothingSpeed"]; gui::waterfall.setFFTSmoothing(fftSmoothing); + snrSmoothing = core::configManager.conf["snrSmoothing"]; + snrSmoothingSpeed = core::configManager.conf["snrSmoothingSpeed"]; + gui::waterfall.setSNRSmoothing(snrSmoothing); updateFFTSpeeds(); // Define and load UI scales @@ -151,15 +157,7 @@ namespace displaymenu { core::configManager.conf["fftHold"] = fftHold; core::configManager.release(true); } - - if (ImGui::Checkbox("FFT Smoothing##_sdrpp", &fftSmoothing)) { - gui::waterfall.setFFTSmoothing(fftSmoothing); - core::configManager.acquire(); - core::configManager.conf["fftSmoothing"] = fftSmoothing; - core::configManager.release(true); - } - - ImGui::LeftLabel("FFT Hold Speed"); + ImGui::SameLine(); ImGui::FillWidth(); if (ImGui::InputInt("##sdrpp_fft_hold_speed", &fftHoldSpeed)) { updateFFTSpeeds(); @@ -168,7 +166,13 @@ namespace displaymenu { core::configManager.release(true); } - ImGui::LeftLabel("FFT Smoothing Speed"); + if (ImGui::Checkbox("FFT Smoothing##_sdrpp", &fftSmoothing)) { + gui::waterfall.setFFTSmoothing(fftSmoothing); + core::configManager.acquire(); + core::configManager.conf["fftSmoothing"] = fftSmoothing; + core::configManager.release(true); + } + ImGui::SameLine(); ImGui::FillWidth(); if (ImGui::InputInt("##sdrpp_fft_smoothing_speed", &fftSmoothingSpeed)) { fftSmoothingSpeed = std::max(fftSmoothingSpeed, 1); @@ -178,6 +182,22 @@ namespace displaymenu { core::configManager.release(true); } + if (ImGui::Checkbox("SNR Smoothing##_sdrpp", &snrSmoothing)) { + gui::waterfall.setSNRSmoothing(snrSmoothing); + core::configManager.acquire(); + core::configManager.conf["snrSmoothing"] = snrSmoothing; + core::configManager.release(true); + } + ImGui::SameLine(); + ImGui::FillWidth(); + if (ImGui::InputInt("##sdrpp_snr_smoothing_speed", &snrSmoothingSpeed)) { + snrSmoothingSpeed = std::max(snrSmoothingSpeed, 1); + updateFFTSpeeds(); + core::configManager.acquire(); + core::configManager.conf["snrSmoothingSpeed"] = snrSmoothingSpeed; + core::configManager.release(true); + } + ImGui::LeftLabel("High-DPI Scaling"); ImGui::FillWidth(); if (ImGui::Combo("##sdrpp_ui_scale", &uiScaleId, uiScales.txt)) { diff --git a/core/src/gui/widgets/waterfall.cpp b/core/src/gui/widgets/waterfall.cpp index 48404abe..de31b524 100644 --- a/core/src/gui/widgets/waterfall.cpp +++ b/core/src/gui/widgets/waterfall.cpp @@ -886,15 +886,22 @@ namespace ImGui { // Apply smoothing if enabled if (fftSmoothing && latestFFT != NULL && smoothingBuf != NULL && fftLines != 0) { std::lock_guard lck2(smoothingBufMtx); - volk_32f_s32f_multiply_32f(latestFFT, latestFFT, smoothingAlpha, dataWidth); - volk_32f_s32f_multiply_32f(smoothingBuf, smoothingBuf, smoothingBeta, dataWidth); + volk_32f_s32f_multiply_32f(latestFFT, latestFFT, fftSmoothingAlpha, dataWidth); + volk_32f_s32f_multiply_32f(smoothingBuf, smoothingBuf, fftSmoothingBeta, dataWidth); volk_32f_x2_add_32f(smoothingBuf, latestFFT, smoothingBuf, dataWidth); memcpy(latestFFT, smoothingBuf, dataWidth * sizeof(float)); } if (selectedVFO != "" && vfos.size() > 0) { float dummy; - calculateVFOSignalInfo(waterfallVisible ? &rawFFTs[currentFFTLine * rawFFTSize] : rawFFTs, vfos[selectedVFO], dummy, selectedVFOSNR); + if (snrSmoothing) { + float newSNR = 0.0f; + calculateVFOSignalInfo(waterfallVisible ? &rawFFTs[currentFFTLine * rawFFTSize] : rawFFTs, vfos[selectedVFO], dummy, newSNR); + selectedVFOSNR = (snrSmoothingBeta*selectedVFOSNR) + (snrSmoothingAlpha*newSNR); + } + else { + calculateVFOSignalInfo(waterfallVisible ? &rawFFTs[currentFFTLine * rawFFTSize] : rawFFTs, vfos[selectedVFO], dummy, selectedVFOSNR); + } } // If FFT hold is enabled, update it @@ -1155,8 +1162,17 @@ namespace ImGui { void WaterFall::setFFTSmoothingSpeed(float speed) { std::lock_guard lck(smoothingBufMtx); - smoothingAlpha = speed; - smoothingBeta = 1.0f - speed; + fftSmoothingAlpha = speed; + fftSmoothingBeta = 1.0f - speed; + } + + void WaterFall::setSNRSmoothing(bool enabled) { + snrSmoothing = enabled; + } + + void WaterFall::setSNRSmoothingSpeed(float speed) { + snrSmoothingAlpha = speed; + snrSmoothingBeta = 1.0f - speed; } float* WaterFall::acquireLatestFFT(int& width) { diff --git a/core/src/gui/widgets/waterfall.h b/core/src/gui/widgets/waterfall.h index 15748b27..a54df011 100644 --- a/core/src/gui/widgets/waterfall.h +++ b/core/src/gui/widgets/waterfall.h @@ -172,6 +172,9 @@ namespace ImGui { void setFFTSmoothing(bool enabled); void setFFTSmoothingSpeed(float speed); + void setSNRSmoothing(bool enabled); + void setSNRSmoothingSpeed(float speed); + float* acquireLatestFFT(int& width); void releaseLatestFFT(); @@ -185,7 +188,7 @@ namespace ImGui { bool mouseInFFT = false; bool mouseInWaterfall = false; - float selectedVFOSNR = NAN; + float selectedVFOSNR = 0.0f; bool centerFrequencyLocked = false; @@ -331,8 +334,12 @@ namespace ImGui { float fftHoldSpeed = 0.3f; bool fftSmoothing = false; - float smoothingAlpha = 0.5; - float smoothingBeta = 0.5; + float fftSmoothingAlpha = 0.5; + float fftSmoothingBeta = 0.5; + + bool snrSmoothing = false; + float snrSmoothingAlpha = 0.5; + float snrSmoothingBeta = 0.5; // UI Select elements bool fftResizeSelect = false; From dddf84510e594e54a947c3b5bbf36ead34cdef0f Mon Sep 17 00:00:00 2001 From: Vladimir <60815271+rmdlv@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:18:33 +0800 Subject: [PATCH 3/3] Fixed russia.json Source - https://digital.gov.ru/ru/documents/3634/ --- root/res/bandplans/russia.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/root/res/bandplans/russia.json b/root/res/bandplans/russia.json index d6cf2da2..74a8af1a 100644 --- a/root/res/bandplans/russia.json +++ b/root/res/bandplans/russia.json @@ -529,9 +529,9 @@ }, { "name": "Train communications", - "type": "aviation", - "start": 151775000, - "end": 151875000 + "type": "railway", + "start": 151712500, + "end": 156012500 }, { "name": "Marine", @@ -557,12 +557,6 @@ "start": 270000000, "end": 380000000 }, - { - "name": "Train communications", - "type": "aviation", - "start": 299999000, - "end": 300001000 - }, { "name": "70cm", "type": "amateur",