more codecleanup
authorghost <andreas.monzner@multimedia-labs.de>
Mon, 19 Jan 2009 21:56:05 +0000 (22:56 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Mon, 19 Jan 2009 21:56:05 +0000 (22:56 +0100)
lib/python/Components/TuneTest.py
lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
lib/python/Plugins/SystemPlugins/Satfinder/plugin.py

index 422036c..de7b009 100644 (file)
@@ -3,7 +3,7 @@ from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParameters, eDVB
 class Tuner:
        def __init__(self, frontend):
                self.frontend = frontend
 class Tuner:
        def __init__(self, frontend):
                self.frontend = frontend
-       
+
        # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, system, modulation)
        #                    0         1             2         3       4         5       6        7
        def tune(self, transponder):
        # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, system, modulation)
        #                    0         1             2         3       4         5       6        7
        def tune(self, transponder):
@@ -16,17 +16,25 @@ class Tuner:
                        parm.fec = transponder[3]
                        parm.inversion = transponder[4]
                        parm.orbital_position = transponder[5]
                        parm.fec = transponder[3]
                        parm.inversion = transponder[4]
                        parm.orbital_position = transponder[5]
-                       parm.system = 0  # FIXMEE !! HARDCODED DVB-S (add support for DVB-S2)
-                       parm.modulation = 1 # FIXMEE !! HARDCODED QPSK 
+                       parm.system = transponder[6]
+                       parm.modulation = transponder[7]
+                       parm.rolloff = transponder[8]
+                       parm.pilot = transponder[9]
                        feparm = eDVBFrontendParameters()
                        feparm.setDVBS(parm)
                        self.lastparm = feparm
                        self.frontend.tune(feparm)
                        feparm = eDVBFrontendParameters()
                        feparm.setDVBS(parm)
                        self.lastparm = feparm
                        self.frontend.tune(feparm)
-       
+
        def retune(self):
                if self.frontend:
                        self.frontend.tune(self.lastparm)
 
        def retune(self):
                if self.frontend:
                        self.frontend.tune(self.lastparm)
 
+       def getTransponderData(self):
+               ret = { }
+               if self.frontend:
+                       self.frontend.getTransponderData(ret, True)
+               return ret
+
 # tunes a list of transponders and checks, if they lock and optionally checks the onid/tsid combination
 # 1) add transponders with addTransponder()
 # 2) call run(<checkPIDs = True>)
 # tunes a list of transponders and checks, if they lock and optionally checks the onid/tsid combination
 # 1) add transponders with addTransponder()
 # 2) call run(<checkPIDs = True>)
index 9e87d6d..19076ba 100644 (file)
@@ -14,6 +14,7 @@ from Components.ActionMap import ActionMap
 from Components.NimManager import nimmanager
 from Components.MenuList import MenuList
 from Components.config import ConfigSatlist, ConfigNothing, ConfigSelection, ConfigSubsection, KEY_LEFT, KEY_RIGHT, getConfigListEntry
 from Components.NimManager import nimmanager
 from Components.MenuList import MenuList
 from Components.config import ConfigSatlist, ConfigNothing, ConfigSelection, ConfigSubsection, KEY_LEFT, KEY_RIGHT, getConfigListEntry
+from Components.TuneTest import Tuner
 
 from time import sleep
 
 
 from time import sleep
 
@@ -81,11 +82,11 @@ class PositionerSetup(Screen):
                        cur.get("symbol_rate", 0) / 1000,
                        cur.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal),
                        cur.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto),
                        cur.get("symbol_rate", 0) / 1000,
                        cur.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal),
                        cur.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto),
-                       cur.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
-                       cur.get("orbital_position", 0)
-                       cur.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
-                       cur.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
-                       cur.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
+                       cur.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown),
+                       cur.get("orbital_position", 0),
+                       cur.get("system", eDVBFrontendParametersSatellite.System_DVB_S),
+                       cur.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK),
+                       cur.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35),
                        cur.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown))
 
                self.tuner.tune(tp)
                        cur.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown))
 
                self.tuner.tune(tp)
@@ -404,39 +405,6 @@ class Diseqc:
                                sleep(0.05)
                                self.frontend.sendDiseqc(cmd) # send 2nd time
 
                                sleep(0.05)
                                self.frontend.sendDiseqc(cmd) # send 2nd time
 
-class Tuner:
-       def __init__(self, frontend):
-               self.frontend = frontend
-
-       def tune(self, transponder):
-               print "tuning to transponder with data", transponder
-               parm = eDVBFrontendParametersSatellite()
-               parm.frequency = transponder[0] * 1000
-               parm.symbol_rate = transponder[1] * 1000
-               parm.polarisation = transponder[2]
-               parm.fec = transponder[3]
-               parm.inversion = transponder[4]
-               parm.orbital_position = transponder[5]
-               parm.system = transponder[6]
-               parm.modulation = transponder[7]
-               parm.rolloff = transponder[8]
-               parm.pilot = transponder[9]
-               feparm = eDVBFrontendParameters()
-               feparm.setDVBS(parm, True)
-               self.lastparm = feparm
-               if self.frontend:
-                       self.frontend.tune(feparm)
-
-       def retune(self):
-               if self.frontend:
-                       self.frontend.tune(self.lastparm)
-
-       def getTransponderData(self):
-               ret = { }
-               if self.frontend:
-                       self.frontend.getTransponderData(ret, True)
-               return ret
-
 tuning = None
 
 class TunerScreen(ScanSetup):
 tuning = None
 
 class TunerScreen(ScanSetup):
index 8174eb6..048bad9 100644 (file)
@@ -14,7 +14,6 @@ from Components.MenuList import MenuList
 from Components.config import ConfigSelection, getConfigListEntry
 from Components.TuneTest import Tuner
 
 from Components.config import ConfigSelection, getConfigListEntry
 from Components.TuneTest import Tuner
 
-
 class Satfinder(ScanSetup):
        def openFrontend(self):
                res_mgr = eDVBResourceManager.getInstance()
 class Satfinder(ScanSetup):
        def openFrontend(self):
                res_mgr = eDVBResourceManager.getInstance()