From 71a2352d2bd6ba507d4b3c20694009f1fbfdb021 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 19 Sep 2020 21:35:14 +0200 Subject: [PATCH] let the client initiate the dsp again --- htdocs/lib/DemodulatorPanel.js | 15 ++++++++++----- owrx/connection.py | 6 ------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/lib/DemodulatorPanel.js b/htdocs/lib/DemodulatorPanel.js index 421487c..3c91fcc 100644 --- a/htdocs/lib/DemodulatorPanel.js +++ b/htdocs/lib/DemodulatorPanel.js @@ -249,12 +249,17 @@ DemodulatorPanel.prototype.updateButtons = function() { } DemodulatorPanel.prototype.setCenterFrequency = function(center_freq) { - if (this.center_freq === center_freq) { - return; + var me = this; + if (me.centerFreqTimeout) { + clearTimeout(me.centerFreqTimeout); + me.centerFreqTimeout = false; } - this.stopDemodulator(); - this.center_freq = center_freq; - this.startDemodulator(); + this.centerFreqTimeout = setTimeout(function() { + me.stopDemodulator(); + me.center_freq = center_freq; + me.startDemodulator(); + me.centerFreqTimeout = false; + }, 50); }; DemodulatorPanel.prototype.parseHash = function() { diff --git a/owrx/connection.py b/owrx/connection.py index c8cfbec..ddc6fa9 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -133,9 +133,6 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): self.configSub = None self.connectionProperties = {} - # to be able to remember if the dsp has been started before - self.dspState = False - try: ClientRegistry.getSharedInstance().addClient(self) except TooManyClientsException: @@ -186,7 +183,6 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): if "type" in message: if message["type"] == "dspcontrol": if "action" in message and message["action"] == "start": - self.dspState = True self.startDsp() if "params" in message: @@ -278,8 +274,6 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): self.__sendProfiles() self.sdr.addSpectrumClient(self) - if self.dspState: - self.startDsp() def handleNoSdrsAvailable(self): self.write_sdr_error("No SDR Devices available")