fix bluescreen
[enigma2.git] / lib / python / Screens / ServiceInfo.py
index e76d3dd080b764c4004f7983594a30b0f80b71b4..faa006bd6b857f4b0b9361aac17201b99d5c1ea5 100644 (file)
@@ -20,7 +20,7 @@ def ServiceInfoListEntry(a, b, valueType=TYPE_TEXT, param=4):
 
        #PyObject *type, *px, *py, *pwidth, *pheight, *pfnt, *pstring, *pflags;
        res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 200, 30, 0, RT_HALIGN_LEFT, ""))
-       res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 150, 25, 0, RT_HALIGN_LEFT, a))
+       res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 200, 25, 0, RT_HALIGN_LEFT, a))
        print "b:", b
        if type(b) is not str:
                if valueType == TYPE_VALUE_HEX:
@@ -33,7 +33,7 @@ def ServiceInfoListEntry(a, b, valueType=TYPE_TEXT, param=4):
                        b = str(b)              
        
        
-       res.append((eListboxPythonMultiContent.TYPE_TEXT, 170, 0, 350, 25, 0, RT_HALIGN_LEFT, b))
+       res.append((eListboxPythonMultiContent.TYPE_TEXT, 220, 0, 350, 25, 0, RT_HALIGN_LEFT, b))
 
        return res
 
@@ -64,20 +64,22 @@ class ServiceInfo(Screen):
                        "cancel": self.close,
                        "red": self.information,
                        "green": self.pids,
-                       "yellow": self.transponder
+                       "yellow": self.transponder,
+                       "blue": self.tuner
                }, -1)
                
                service = session.nav.getCurrentService()
                if service is not None:
                        self.info = service.info()
+                       self.feinfo = service.frontendStatusInfo()
                else:
                        self.info = None
 
-       
+
                self["red"] = Label("Serviceinfo")
                self["green"] = Label("PIDs")
                self["yellow"] = Label("Transponder")
-               self["blue"] = Label("")
+               self["blue"] = Label("Tuner status")
        
                tlist = [ ]
 
@@ -107,10 +109,40 @@ class ServiceInfo(Screen):
                self.fillList(Labels)
        
        def transponder(self):
-               Labels = ( ("Frequency", "11823", TYPE_TEXT),
-                                  ("Polarity", "H", TYPE_TEXT))
+               frontendData = self.feinfo.getFrontendData(True)
+               Labels = self.getFEData(frontendData)
                self.fillList(Labels)
-       
+               
+       def tuner(self):
+               frontendData = self.feinfo.getFrontendData(False)
+               Labels = self.getFEData(frontendData)
+               self.fillList(Labels)
+               
+       def getFEData(self, frontendData):
+               if frontendData is None:
+                       return []
+               if frontendData["tuner_type"] == "DVB-S":
+                       return ( ("NIM", ['A', 'B', 'C', 'D'][frontendData["tuner_number"]], TYPE_TEXT),
+                                          ("Type", frontendData["tuner_type"], TYPE_TEXT),
+                                          ("Orbital position", frontendData["orbital_position"], TYPE_VALUE_DEC),
+                                          ("Frequency", frontendData["frequency"], TYPE_VALUE_DEC),
+                                          ("Symbolrate", frontendData["symbol_rate"], TYPE_VALUE_DEC),
+                                          ("Polarization", frontendData["polarization"], TYPE_TEXT),
+                                          ("Inversion", frontendData["inversion"], TYPE_TEXT),
+                                          ("FEC inner", frontendData["fec_inner"], TYPE_TEXT),
+                                               )
+               elif frontendData["tuner_type"] == "DVB-C":
+                       return ( ("NIM", ['A', 'B', 'C', 'D'][frontendData["tuner_number"]], TYPE_TEXT),
+                                          ("Type", frontendData["tuner_type"], TYPE_TEXT),
+                                          ("Frequency", frontendData["frequency"], TYPE_VALUE_DEC),
+                                          ("Symbolrate", frontendData["symbol_rate"], TYPE_VALUE_DEC),
+                                          ("Modulation", frontendData["modulation"], TYPE_TEXT),
+                                          ("Inversion", frontendData["inversion"], TYPE_TEXT),
+                                          ("FEC inner", frontendData["fec_inner"], TYPE_TEXT),
+                                               )
+               elif frontendData["tuner_type"] == "DVB-T":
+                       return []
+               
        def fillList(self, Labels):
                tlist = [ ]