diff --git a/csdr/chain/selector.py b/csdr/chain/selector.py index e4b1be24..7b42dc7a 100644 --- a/csdr/chain/selector.py +++ b/csdr/chain/selector.py @@ -1,6 +1,7 @@ from csdr.chain import Chain from pycsdr.modules import Shift, FirDecimate, Bandpass, Squelch, FractionalDecimator, Writer from pycsdr.types import Format +from typing import Union import math @@ -133,11 +134,11 @@ class Selector(Chain): scaled = [x / self.outputRate for x in self.bandpassCutoffs] self.bandpass.setBandpass(*scaled) - def setLowCut(self, lowCut: float | None) -> None: + def setLowCut(self, lowCut: Union[float, None]) -> None: self.bandpassCutoffs[0] = lowCut self.setBandpass(*self.bandpassCutoffs) - def setHighCut(self, highCut: float | None) -> None: + def setHighCut(self, highCut: Union[float, None]) -> None: self.bandpassCutoffs[1] = highCut self.setBandpass(*self.bandpassCutoffs) diff --git a/owrx/dsp.py b/owrx/dsp.py index bca9e206..3156a693 100644 --- a/owrx/dsp.py +++ b/owrx/dsp.py @@ -220,10 +220,10 @@ class ClientDemodulatorChain(Chain): else: self.selector.setSquelchLevel(self.squelchLevel) - def setLowCut(self, lowCut: float | None): + def setLowCut(self, lowCut: Union[float, None]): self.selector.setLowCut(lowCut) - def setHighCut(self, highCut: float | None): + def setHighCut(self, highCut: Union[float, None]): self.selector.setHighCut(highCut) def setBandpass(self, lowCut, highCut): @@ -648,10 +648,10 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient) self.chain.setSecondaryFftWriter(buffer) self.wireOutput("secondary_fft", buffer) - def setLowCut(self, lowCut: float | PropertyDeletion): + def setLowCut(self, lowCut: Union[float, PropertyDeletion]): self.chain.setLowCut(None if lowCut is PropertyDeleted else lowCut) - def setHighCut(self, highCut: float | PropertyDeletion): + def setHighCut(self, highCut: Union[float, PropertyDeletion]): self.chain.setHighCut(None if highCut is PropertyDeleted else highCut) def start(self):