use information from the mode registry to set up services

This commit is contained in:
Jakob Ketterl
2020-12-06 00:36:20 +01:00
parent a3fd931931
commit bee6ddc843
3 changed files with 44 additions and 22 deletions

View File

@ -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 = [