From 087380c9664794013fe2591ae3a0b3c3417bda60 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Thu, 22 Oct 2020 02:33:50 +0200 Subject: [PATCH] Push before merge --- core/src/signal_path/vfo_manager.cpp | 4 ++++ core/src/signal_path/vfo_manager.h | 1 + radio/src/main.cpp | 8 ++++++++ radio/src/path.cpp | 2 +- radio/src/path.h | 3 ++- root_dev/config.json | 12 ++++++------ root_dev/soapy_source_config.json | 4 ++-- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/core/src/signal_path/vfo_manager.cpp b/core/src/signal_path/vfo_manager.cpp index 63165a5b..e049b4b8 100644 --- a/core/src/signal_path/vfo_manager.cpp +++ b/core/src/signal_path/vfo_manager.cpp @@ -46,6 +46,10 @@ int VFOManager::VFO::getOutputBlockSize() { return dspVFO->getOutputBlockSize(); } +void VFOManager::VFO::setSnapInterval(double interval) { + wtfVFO->setSnapInterval(interval); +} + VFOManager::VFOManager() { diff --git a/core/src/signal_path/vfo_manager.h b/core/src/signal_path/vfo_manager.h index 42e490b5..29bb8922 100644 --- a/core/src/signal_path/vfo_manager.h +++ b/core/src/signal_path/vfo_manager.h @@ -18,6 +18,7 @@ public: void setSampleRate(double sampleRate, double bandwidth); void setReference(int ref); int getOutputBlockSize(); + void setSnapInterval(double interval); dsp::stream* output; diff --git a/radio/src/main.cpp b/radio/src/main.cpp index 182203a8..0967c718 100644 --- a/radio/src/main.cpp +++ b/radio/src/main.cpp @@ -26,6 +26,7 @@ public: sigPath.init(name, 200000, 1000); sigPath.start(); sigPath.setDemodulator(SigPath::DEMOD_FM, bandWidth); + sigPath.vfo->setSnapInterval(100000.0); gui::menu.registerEntry(name, menuHandler, this); ScriptManager::ScriptRunHandler_t handler; @@ -121,12 +122,19 @@ private: _this->sigPath.setBandwidth(_this->bandWidth); } + ImGui::Text("Squelch"); + ImGui::SameLine(); + ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX()); ImGui::SliderFloat(CONCAT("##_squelch_select_", _this->name), &_this->sigPath.squelch.level, -100, 0); ImGui::PopItemWidth(); ImGui::Text("Snap Interval"); + ImGui::SameLine(); ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX()); + if (ImGui::InputDouble(CONCAT("##_snap_select_", _this->name), &_this->snapInterval)) { + _this->sigPath.vfo->setSnapInterval(_this->snapInterval); + } } static void scriptCreateHandler(void* ctx, duk_context* dukCtx, duk_idx_t objId) { diff --git a/radio/src/path.cpp b/radio/src/path.cpp index 97f52962..cc49403f 100644 --- a/radio/src/path.cpp +++ b/radio/src/path.cpp @@ -36,7 +36,7 @@ void SigPath::init(std::string vfoName, uint64_t sampleRate, int blockSize) { // TODO: Add a mono to stereo for different modes squelch.init(vfo->output, 800); - squelch.level = 40; + squelch.level = -100.0; squelch.onCount = 1; squelch.offCount = 2560; diff --git a/radio/src/path.h b/radio/src/path.h index fdf02956..7d5318d4 100644 --- a/radio/src/path.h +++ b/radio/src/path.h @@ -46,11 +46,12 @@ public: dsp::FMDeemphasis deemp; dsp::Squelch squelch; + VFOManager::VFO* vfo; private: static int sampleRateChangeHandler(void* ctx, double sampleRate); - VFOManager::VFO* vfo; + dsp::stream input; diff --git a/root_dev/config.json b/root_dev/config.json index e7e945a1..15b8dabe 100644 --- a/root_dev/config.json +++ b/root_dev/config.json @@ -6,9 +6,9 @@ "volume": 0.60546875 }, "Radio 1": { - "device": "CABLE-A Input (VB-Audio Cable A)", + "device": "Speakers (Realtek High Definition Audio)", "sampleRate": 48000.0, - "volume": 1.0 + "volume": 0.609375 }, "Radio 2": { "device": "CABLE Input (VB-Audio Virtual Cable)", @@ -18,10 +18,10 @@ }, "bandPlan": "General", "bandPlanEnabled": true, - "fftHeight": 300, - "frequency": 99100000, + "fftHeight": 298, + "frequency": 98200000, "max": 0.0, - "maximized": false, + "maximized": true, "menuOrder": [ "Source", "Radio", @@ -32,7 +32,7 @@ "Display" ], "menuWidth": 300, - "min": -72.05882263183594, + "min": -53.676475524902344, "showWaterfall": true, "source": "", "sourceSettings": {}, diff --git a/root_dev/soapy_source_config.json b/root_dev/soapy_source_config.json index b682a34a..3401091d 100644 --- a/root_dev/soapy_source_config.json +++ b/root_dev/soapy_source_config.json @@ -1,5 +1,5 @@ { - "device": "Generic RTL2832U OEM :: 00000001", + "device": "HackRF One #0 901868dc282c8f8b", "devices": { "AirSpy HF+ [c852435de0224af7]": { "gains": { @@ -18,7 +18,7 @@ "gains": { "AMP": 0.0, "LNA": 24.711999893188477, - "VGA": 15.906000137329102 + "VGA": 14.282999992370605 }, "sampleRate": 8000000.0 },