SNR = 1
AGC = 2
LOCK = 3
+ SNRdB = 4
def __init__(self, type):
Converter.__init__(self, type)
self.type = self.BER
elif type == "SNR":
self.type = self.SNR
+ elif type == "SNRdB":
+ self.type = self.SNRdB
elif type == "AGC":
self.type = self.AGC
else:
@cached
def getText(self):
assert self.type != self.LOCK, "the text output of FrontendInfo cannot be used for lock info"
+ percent = None
if self.type == self.BER: # as count
count = self.source.ber
if count is not None:
percent = self.source.agc
elif self.type == self.SNR:
percent = self.source.snr
-
+ elif self.type == self.SNRdB:
+ if self.source.snr_db is not None:
+ return "%3.02f dB" % (self.source.snr_db / 100.0)
+ elif self.source.snr is not None: #fallback to normal SNR...
+ percent = self.source.snr
+ return "SNR:%d %%" % (percent * 100 / 65536)
if percent is None:
return "N/A"