aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Screens/InfoBarGenerics.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index fc3f011c..da648d13 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -402,10 +402,12 @@ class InfoBarTuner:
self.timer.timeout.get().append(self.updateTunerInfo)
self.timer.start(500)
- def log2(self,val):
+ def calc(self,val):
if not val:
return 0
- return (long)(log(val)/log(2))
+ if val < 2500:
+ return (long)(log(val)/log(2))
+ return val*100/65535
def updateTunerInfo(self):
if self.instance.isVisible():
@@ -424,7 +426,7 @@ class InfoBarTuner:
self["ber_count"].setText("%d"%(ber))
self["snr_progress"].setValue(snr)
self["agc_progress"].setValue(agc)
- self["ber_progress"].setValue(self.log2(ber))
+ self["ber_progress"].setValue(self.calc(ber))
class InfoBarEvent:
"""provides a current/next event info display"""