aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Converter
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-06-12 22:37:52 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-06-12 22:37:52 +0000
commit330f9198e1a85021c32a1ce9f53e5259eabc6795 (patch)
tree670db830d00c50e4a68aa395bfcb298fb76f3aff /lib/python/Components/Converter
parentb6fb1984add5d1fbc08686d510d6aa46efa7f3bd (diff)
downloadenigma2-330f9198e1a85021c32a1ce9f53e5259eabc6795.tar.gz
enigma2-330f9198e1a85021c32a1ce9f53e5259eabc6795.zip
add stv0299 snr to dB Calculation (thx to adenin for this)
fallback to normal SNR when no SNR to dB calculation is available
Diffstat (limited to 'lib/python/Components/Converter')
-rw-r--r--lib/python/Components/Converter/FrontendInfo.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/python/Components/Converter/FrontendInfo.py b/lib/python/Components/Converter/FrontendInfo.py
index 34d55be4..6377d680 100644
--- a/lib/python/Components/Converter/FrontendInfo.py
+++ b/lib/python/Components/Converter/FrontendInfo.py
@@ -24,6 +24,7 @@ class FrontendInfo(Converter, object):
@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:
@@ -35,9 +36,11 @@ class FrontendInfo(Converter, object):
elif self.type == self.SNR:
percent = self.source.snr
elif self.type == self.SNRdB:
- if self.source.snr_db is None:
- return "N/A"
- return "%3.02f dB" % (self.source.snr_db / 100.0)
+ 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"