Merge branch 'bug_618_fix_display_recording_indication'
[enigma2.git] / lib / python / Components / TuneTest.py
index de7b0098b789c531680767dbd95fb6bad75e5ebb..44b1909174580aebabf1229ed14e85c7b6110fa1 100644 (file)
@@ -1,11 +1,12 @@
 from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParameters, eDVBResourceManager, eTimer
 
 class Tuner:
-       def __init__(self, frontend):
+       def __init__(self, frontend, ignore_rotor=False):
                self.frontend = frontend
+               self.ignore_rotor = ignore_rotor
 
-       # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, system, modulation)
-       #                    0         1             2         3       4         5       6        7
+       # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, system, modulation, rolloff, pilot, tsid, onid)
+       #                    0         1             2         3       4         5       6        7          8       9      10    11
        def tune(self, transponder):
                if self.frontend:
                        print "tuning to transponder with data", transponder
@@ -21,7 +22,7 @@ class Tuner:
                        parm.rolloff = transponder[8]
                        parm.pilot = transponder[9]
                        feparm = eDVBFrontendParameters()
-                       feparm.setDVBS(parm)
+                       feparm.setDVBS(parm, self.ignore_rotor)
                        self.lastparm = feparm
                        self.frontend.tune(feparm)
 
@@ -95,22 +96,22 @@ class TuneTest:
                else:
                        if dict["tuner_state"] == "LOSTLOCK" or dict["tuner_state"] == "FAILED":
                                self.tuningtransponder = self.nextTransponder()
-                               self.failedTune.append([self.currTuned, self.oldTuned, "tune_failed"])
+                               self.failedTune.append([self.currTuned, self.oldTuned, "tune_failed", dict])  # last parameter is the frontend status)
                                if self.stopOnError != -1 and self.stopOnError <= len(self.failedTune):
                                        stop = True
                        elif dict["tuner_state"] == "LOCKED":
                                pidsFailed = False
                                if self.checkPIDs:
                                        if self.currTuned is not None:
-                                               if self.tsid != self.currTuned[8] or self.onid != self.currTuned[9]:
-                                                       self.failedTune.append([self.currTuned, self.oldTuned, "pids_failed", {"real": (self.tsid, self.onid), "expected": (self.currTuned[8], self.currTuned[9])}])
+                                               if self.tsid != self.currTuned[10] or self.onid != self.currTuned[11]:
+                                                       self.failedTune.append([self.currTuned, self.oldTuned, "pids_failed", {"real": (self.tsid, self.onid), "expected": (self.currTuned[10], self.currTuned[11])}, dict])  # last parameter is the frontend status
                                                        pidsFailed = True
                                                else:
-                                                       self.successfullyTune.append([self.currTuned, self.oldTuned])
+                                                       self.successfullyTune.append([self.currTuned, self.oldTuned, dict])  # 3rd parameter is the frontend status
                                                        if self.stopOnSuccess != -1 and self.stopOnSuccess <= len(self.successfullyTune):
                                                                stop = True
                                elif not self.checkPIDs or (self.checkPids and not pidsFailed):  
-                                       self.successfullyTune.append([self.currTuned, self.oldTuned])
+                                       self.successfullyTune.append([self.currTuned, self.oldTuned, dict]) # 3rd parameter is the frontend status
                                        if self.stopOnSuccess != -1 and self.stopOnSuccess <= len(self.successfullyTune):
                                                                stop = True
                                self.tuningtransponder = self.nextTransponder()
@@ -140,7 +141,7 @@ class TuneTest:
                        # check for tsid != -1 and onid != -1 
                        print "index:", index
                        print "len(self.transponderlist):", len(self.transponderlist)
-                       while (index < len(self.transponderlist) and (self.transponderlist[index][8] == -1 or self.transponderlist[index][9] == -1)):
+                       while (index < len(self.transponderlist) and (self.transponderlist[index][10] == -1 or self.transponderlist[index][11] == -1)):
                                index += 1
                print "FirstTransponder final index:", index
                return index
@@ -153,7 +154,7 @@ class TuneTest:
                        # check for tsid != -1 and onid != -1 
                        print "index:", index
                        print "len(self.transponderlist):", len(self.transponderlist)
-                       while (index < len(self.transponderlist) and (self.transponderlist[index][8] == -1 or self.transponderlist[index][9] == -1)):
+                       while (index < len(self.transponderlist) and (self.transponderlist[index][10] == -1 or self.transponderlist[index][11] == -1)):
                                index += 1
 
                print "next transponder index:", index
@@ -203,8 +204,8 @@ class TuneTest:
                self.progressCallback((self.getProgressLength(), self.tuningtransponder, self.STATUS_START, self.currTuned))
                self.timer.start(100, True)
        
-       # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, <system>, <modulation>, <tsid>, <onid>)
-       #                    0         1             2         3       4         5       6        7              8      9
+       # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, <system>, <modulation>, <rolloff>, <pilot>, <tsid>, <onid>)
+       #                    0         1             2         3       4         5       6        7              8         9        10       11
        def addTransponder(self, transponder):
                self.transponderlist.append(transponder)