fix initial setup of dial frequency

This commit is contained in:
Jakob Ketterl 2021-09-09 22:24:41 +02:00
parent 66cf940523
commit 72920135e9
2 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class DigihamChain(BaseDemodulatorChain, FixedIfSampleRateChain, FixedAudioRateC
agc agc
] ]
self.metaParser = None self.metaParser = None
self.dialFrequency = None
super().__init__(workers) super().__init__(workers)
def getFixedIfSampleRate(self): def getFixedIfSampleRate(self):
@ -39,12 +40,15 @@ class DigihamChain(BaseDemodulatorChain, FixedIfSampleRateChain, FixedAudioRateC
buffer = Buffer(Format.CHAR) buffer = Buffer(Format.CHAR)
self.decoder.setMetaWriter(buffer) self.decoder.setMetaWriter(buffer)
self.metaParser.setReader(buffer.getReader()) self.metaParser.setReader(buffer.getReader())
if self.dialFrequency is not None:
self.metaParser.setDialFrequency(self.dialFrequency)
self.metaParser.setWriter(writer) self.metaParser.setWriter(writer)
def supportsSquelch(self): def supportsSquelch(self):
return False return False
def setDialFrequency(self, frequency: int) -> None: def setDialFrequency(self, frequency: int) -> None:
self.dialFrequency = frequency
if self.metaParser is None: if self.metaParser is None:
return return
self.metaParser.setDialFrequency(frequency) self.metaParser.setDialFrequency(frequency)

View File

@ -106,6 +106,7 @@ class ClientDemodulatorChain(Chain):
else: else:
self.clientAudioChain.setInputRate(outputRate) self.clientAudioChain.setInputRate(outputRate)
self._updateDialFrequency()
self._syncSquelch() self._syncSquelch()
self.clientAudioChain.setClientRate(outputRate) self.clientAudioChain.setClientRate(outputRate)