mirror of
https://github.com/ha7ilm/openwebrx.git
synced 2026-04-04 14:07:32 +00:00
use information from the mode registry to set up services
This commit is contained in:
parent
a3fd931931
commit
bee6ddc843
3 changed files with 44 additions and 22 deletions
|
|
@ -24,6 +24,12 @@ class Mode(object):
|
|||
def is_service(self):
|
||||
return self.service
|
||||
|
||||
def get_bandpass(self):
|
||||
return self.bandpass
|
||||
|
||||
def get_modulation(self):
|
||||
return self.modulation
|
||||
|
||||
|
||||
class AnalogMode(Mode):
|
||||
pass
|
||||
|
|
@ -36,6 +42,14 @@ class DigitalMode(Mode):
|
|||
super().__init__(modulation, name, bandpass, requirements, service, squelch)
|
||||
self.underlying = underlying
|
||||
|
||||
def get_bandpass(self):
|
||||
if self.bandpass is not None:
|
||||
return self.bandpass
|
||||
return Modes.findByModulation(self.underlying[0]).get_bandpass()
|
||||
|
||||
def get_modulation(self):
|
||||
return Modes.findByModulation(self.underlying[0]).get_modulation()
|
||||
|
||||
|
||||
class Modes(object):
|
||||
mappings = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue