From 25b287344f3ec9284f252c6d84b29e1255f4f518 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 24 Mar 2020 22:16:11 +0100 Subject: [PATCH] rename collect -> filter --- owrx/connection.py | 6 +++--- owrx/dsp.py | 6 +++--- owrx/fft.py | 4 ++-- owrx/property/__init__.py | 2 +- owrx/sdrhu.py | 2 +- owrx/service/__init__.py | 2 +- owrx/service/schedule.py | 2 +- owrx/source/__init__.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/owrx/connection.py b/owrx/connection.py index b420568..9266a79 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -199,7 +199,7 @@ class OpenWebRxReceiverClient(Client): stack = PropertyStack() stack.addLayer(0, self.sdr.getProps()) stack.addLayer(1, Config.get()) - configProps = stack.collect(*OpenWebRxReceiverClient.config_keys) + configProps = stack.filter(*OpenWebRxReceiverClient.config_keys) def sendConfig(key, value): #config = dict((key, configProps[key]) for key in OpenWebRxReceiverClient.config_keys) @@ -257,7 +257,7 @@ class OpenWebRxReceiverClient(Client): stack = PropertyStack() stack.addLayer(0, self.sdr.getProps()) stack.addLayer(1, config) - protected = stack.collect(*keys) + protected = stack.filter(*keys) for key, value in params.items(): protected[key] = value @@ -335,7 +335,7 @@ class MapConnection(Client): super().__init__(conn) pm = Config.get() - self.write_config(pm.collect("google_maps_api_key", "receiver_gps", "map_position_retention_time").__dict__()) + self.write_config(pm.filter("google_maps_api_key", "receiver_gps", "map_position_retention_time").__dict__()) Map.getSharedInstance().addClient(self) diff --git a/owrx/dsp.py b/owrx/dsp.py index 50039e3..f0f1fd5 100644 --- a/owrx/dsp.py +++ b/owrx/dsp.py @@ -26,7 +26,7 @@ class DspManager(csdr.output): self.props = PropertyStack() # local demodulator properties not forwarded to the sdr - self.props.addLayer(0, PropertyLayer().collect( + self.props.addLayer(0, PropertyLayer().filter( "output_rate", "squelch_level", "secondary_mod", @@ -37,7 +37,7 @@ class DspManager(csdr.output): "secondary_offset_freq", )) # properties that we inherit from the sdr - self.props.addLayer(1, self.sdrSource.getProps().collect( + self.props.addLayer(1, self.sdrSource.getProps().filter( "audio_compression", "fft_compression", "digimodes_fft_size", @@ -84,7 +84,7 @@ class DspManager(csdr.output): self.props.wireProperty("digital_voice_unvoiced_quality", self.dsp.set_unvoiced_quality), self.props.wireProperty("dmr_filter", self.dsp.set_dmr_filter), self.props.wireProperty("temporary_directory", self.dsp.set_temporary_directory), - self.props.collect("center_freq", "offset_freq").wire(set_dial_freq), + self.props.filter("center_freq", "offset_freq").wire(set_dial_freq), ] self.dsp.set_offset_freq(0) diff --git a/owrx/fft.py b/owrx/fft.py index 9d37bcf..cbb98a6 100644 --- a/owrx/fft.py +++ b/owrx/fft.py @@ -17,7 +17,7 @@ class SpectrumThread(csdr.output): stack = PropertyStack() stack.addLayer(0, self.sdrSource.props) stack.addLayer(1, Config.get()) - self.props = props = stack.collect( + self.props = props = stack.filter( "samp_rate", "fft_size", "fft_fps", @@ -51,7 +51,7 @@ class SpectrumThread(csdr.output): props.wireProperty("fft_fps", dsp.set_fft_fps), props.wireProperty("fft_compression", dsp.set_fft_compression), props.wireProperty("temporary_directory", dsp.set_temporary_directory), - props.collect("samp_rate", "fft_size", "fft_fps", "fft_voverlap_factor").wire(set_fft_averages), + props.filter("samp_rate", "fft_size", "fft_fps", "fft_voverlap_factor").wire(set_fft_averages), ] set_fft_averages(None, None) diff --git a/owrx/property/__init__.py b/owrx/property/__init__.py index 4454bfd..256c391 100644 --- a/owrx/property/__init__.py +++ b/owrx/property/__init__.py @@ -44,7 +44,7 @@ class PropertyManager(ABC): def keys(self): pass - def collect(self, *props): + def filter(self, *props): return PropertyFilter(self, *props) def wire(self, callback): diff --git a/owrx/sdrhu.py b/owrx/sdrhu.py index 939d352..193399f 100644 --- a/owrx/sdrhu.py +++ b/owrx/sdrhu.py @@ -14,7 +14,7 @@ class SdrHuUpdater(threading.Thread): super().__init__(daemon=True) def update(self): - pm = Config.get().collect("server_hostname", "web_port", "sdrhu_key") + pm = Config.get().filter("server_hostname", "web_port", "sdrhu_key") data = parse.urlencode({ "url": "http://{server_hostname}:{web_port}".format(**pm.__dict__()), "apikey": pm["sdrhu_key"] diff --git a/owrx/service/__init__.py b/owrx/service/__init__.py index 7bda36b..66a7880 100644 --- a/owrx/service/__init__.py +++ b/owrx/service/__init__.py @@ -57,7 +57,7 @@ class ServiceHandler(object): self.startupTimer = None self.source.addClient(self) props = self.source.getProps() - props.collect("center_freq", "samp_rate").wire(self.onFrequencyChange) + props.filter("center_freq", "samp_rate").wire(self.onFrequencyChange) if self.source.isAvailable(): self.scheduleServiceStartup() self.scheduler = None diff --git a/owrx/service/schedule.py b/owrx/service/schedule.py index ade3976..62df44d 100644 --- a/owrx/service/schedule.py +++ b/owrx/service/schedule.py @@ -210,7 +210,7 @@ class ServiceScheduler(object): self.source.addClient(self) props = self.source.getProps() self.schedule = Schedule.parse(props) - props.collect("center_freq", "samp_rate").wire(self.onFrequencyChange) + props.filter("center_freq", "samp_rate").wire(self.onFrequencyChange) self.scheduleSelection() def shutdown(self): diff --git a/owrx/source/__init__.py b/owrx/source/__init__.py index 7726a0b..781db97 100644 --- a/owrx/source/__init__.py +++ b/owrx/source/__init__.py @@ -38,7 +38,7 @@ class SdrSource(ABC): # layer 0 reserved for profile properties self.props.addLayer(1, props) self.props.addLayer(2, Config.get()) - self.rtlProps = self.props.collect(*self.getEventNames()) + self.rtlProps = self.props.filter(*self.getEventNames()) self.profile_id = None self.activateProfile()