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")