fixed translation
[enigma2.git] / lib / python / Screens / ScanSetup.py
index 2a32592..5832723 100644 (file)
@@ -61,30 +61,63 @@ class ScanSetup(Screen):
        def updateSatList(self):
                self.satList = []
                for slot in nimmanager.nimslots:
-                       self.satList.append(nimmanager.getSatListForNim(slot.slotid))
+                       if (nimmanager.getNimType(slot.slotid) == nimmanager.nimType["DVB-S"]):
+                               self.satList.append(nimmanager.getSatListForNim(slot.slotid))
 
        def createSetup(self):
                self.list = []
 
-               self.list.append(getConfigListEntry("Type of scan", config.scan.type))
-               self.list.append(getConfigListEntry("Tuner", config.scan.nims))
-
-               # single transponder scan
-               if (config.scan.type.value == 0):
-                       if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"]):
-                               self.list.append(getConfigListEntry("Satellite", config.scan.satselection[config.scan.nims.value]))
-                               self.list.append(getConfigListEntry("Frequency", config.scan.sat.frequency))
-                               self.list.append(getConfigListEntry("Inversion", config.scan.sat.inversion))
-                               self.list.append(getConfigListEntry("Symbolrate", config.scan.sat.symbolrate))
+               self.list.append(getConfigListEntry(_("Tuner"), config.scan.nims))
+               
+               if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"]):
+                       self.list.append(getConfigListEntry(_("Type of scan"), config.scan.type))
+               elif (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"]):
+                       self.list.append(getConfigListEntry(_("Type of scan"), config.scan.typecable))
+               elif (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
+                       self.list.append(getConfigListEntry(_("Type of scan"), config.scan.typeterrestrial))
+
+
+               if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"]):
+                       if (config.scan.type.value == 0): # single transponder scan
+                               self.list.append(getConfigListEntry(_('Satellite'), config.scan.satselection[config.scan.nims.value]))
+                               self.list.append(getConfigListEntry(_('Frequency'), config.scan.sat.frequency))
+                               self.list.append(getConfigListEntry(_('Inversion'), config.scan.sat.inversion))
+                               self.list.append(getConfigListEntry(_('Symbolrate'), config.scan.sat.symbolrate))
                                self.list.append(getConfigListEntry("Polarity", config.scan.sat.polarization))
                                self.list.append(getConfigListEntry("FEC", config.scan.sat.fec))
-                       if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"]):
+                       if (config.scan.type.value == 1): # single satellite scan
+                               self.updateSatList()
+                               print config.scan.satselection[config.scan.nims.value]
+                               self.list.append(getConfigListEntry("Satellite", config.scan.satselection[config.scan.nims.value]))
+                       if (config.scan.type.value == 2): # multi sat scan
+                               # if (norotor)
+                               tlist = []
+                               SatList = nimmanager.getSatListForNim(config.scan.nims.value)
+       
+                               for x in SatList:
+                                       if self.Satexists(tlist, x[1]) == 0:
+                                               tlist.append(x[1])
+                                               sat = configElement_nonSave(x[1], configSelection, 0, ("Enable", "Disable"))
+                                               self.list.append(getConfigListEntry(nimmanager.getSatDescription(x[1]), sat))
+       
+                               # if (rotor):
+                          # for sat in nimmanager.satList:
+                               #       self.list.append(getConfigListEntry(sat[0], config.scan.scansat[sat[1]]))
+
+
+               if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"]):
+                       if (config.scan.typecable.value == 0): # single transponder
                                self.list.append(getConfigListEntry("Frequency", config.scan.cab.frequency))
                                self.list.append(getConfigListEntry("Inversion", config.scan.cab.inversion))
                                self.list.append(getConfigListEntry("Symbolrate", config.scan.cab.symbolrate))
                                self.list.append(getConfigListEntry("Modulation", config.scan.cab.modulation))
                                self.list.append(getConfigListEntry("FEC", config.scan.cab.fec))
-                       if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
+                       if (config.scan.typecable.value == 1): # complete
+                               pass
+       
+                               
+               if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
+                       if (config.scan.typeterrestrial.value == 0): # single transponder
                                self.list.append(getConfigListEntry("Frequency", config.scan.ter.frequency))
                                self.list.append(getConfigListEntry("Inversion", config.scan.ter.inversion))
                                self.list.append(getConfigListEntry("Bandwidth", config.scan.ter.bandwidth))
@@ -94,30 +127,11 @@ class ScanSetup(Screen):
                                self.list.append(getConfigListEntry("Transmission mode", config.scan.ter.transmission))
                                self.list.append(getConfigListEntry("Guard interval mode", config.scan.ter.guard))
                                self.list.append(getConfigListEntry("Hierarchy mode", config.scan.ter.hierarchy))
+                       if (config.scan.typeterrestrial.value == 1): # complete
+                               pass
 
-               # single satellite scan
-               print config.scan.satselection
-               if (config.scan.type.value == 1):
-                       self.updateSatList()
-                       print config.scan.satselection[config.scan.nims.value]
-                       self.list.append(getConfigListEntry("Satellite", config.scan.satselection[config.scan.nims.value]))
-
-
-               # multi sat scan
-               if (config.scan.type.value == 2):
-                       # if (norotor)
-                       tlist = []
-                       SatList = nimmanager.getSatListForNim(config.scan.nims.value)
 
-                       for x in SatList:
-                               if self.Satexists(tlist, x[1]) == 0:
-                                       tlist.append(x[1])
-                                       sat = configElement_nonSave(x[1], configSelection, 0, ("Enable", "Disable"))
-                                       self.list.append(getConfigListEntry(nimmanager.getSatDescription(x[1]), sat))
 
-                       # if (rotor):
-                  # for sat in nimmanager.satList:
-                       #       self.list.append(getConfigListEntry(sat[0], config.scan.scansat[sat[1]]))
 
                self["config"].list = self.list
                self["config"].l.setList(self.list)
@@ -130,9 +144,9 @@ class ScanSetup(Screen):
 
        def newConfig(self):
                print self["config"].getCurrent()
-               if self["config"].getCurrent()[0] == "Type of scan":
+               if self["config"].getCurrent()[0] == _("Type of scan"):
                        self.createSetup()
-               if self["config"].getCurrent()[0] == "Tuner":
+               if self["config"].getCurrent()[0] == _("Tuner"):
                        self.createSetup()
 
        def createConfig(self):
@@ -142,6 +156,9 @@ class ScanSetup(Screen):
                        config.scan.ter = ConfigSubsection()
 
                        config.scan.type = configElement_nonSave("config.scan.type", configSelection, 0, ("Single transponder", "Single satellite", "Multisat"))
+                       config.scan.typecable = configElement_nonSave("config.scan.typecable", configSelection, 0, ("Single transponder", "Complete"))
+                       config.scan.typeterrestrial = configElement_nonSave("config.scan.typeterrestrial", configSelection, 0, ("Single transponder", "Complete"))
+
                        nimList = [ ]
                        for nim in nimmanager.nimList():
                                nimList.append(nim[0])
@@ -165,7 +182,7 @@ class ScanSetup(Screen):
 
                        # terrestial
                        config.scan.ter.frequency = configElement_nonSave("config.scan.ter.frequency", configSequence, [466], configsequencearg.get("INTEGER", (10000, 14000)))
-                       config.scan.ter.inversion = configElement_nonSave("config.scan.ter.inversion", configSelection, 0, ("auto", "off", "on"))
+                       config.scan.ter.inversion = configElement_nonSave("config.scan.ter.inversion", configSelection, 0, ("Auto", "off", "on"))
                        config.scan.ter.bandwidth = configElement_nonSave("config.scan.ter.bandwidth", configSelection, 0, ("Auto", "6 MHz", "7MHz", "8MHz"))
                        config.scan.ter.fechigh = configElement_nonSave("config.scan.ter.fechigh", configSelection, 0, ("Auto", "1/2", "2/3", "3/4", "4/5", "5/6", "7/8", "8/9"))
                        config.scan.ter.feclow = configElement_nonSave("config.scan.ter.feclow", configSelection, 0, ("Auto", "1/2", "2/3", "3/4", "4/5", "5/6", "7/8", "8/9"))
@@ -182,7 +199,8 @@ class ScanSetup(Screen):
                        config.scan.satselection = []
                        slotid = 0
                        for slot in nimmanager.nimslots:
-                               config.scan.satselection.append(configElement_nonSave("config.scan.satselection[" + str(slot.slotid) + "]", configSatlist, 0, self.satList[slot.slotid]))
+                               if (nimmanager.getNimType(slot.slotid) == nimmanager.nimType["DVB-S"]):
+                                       config.scan.satselection.append(configElement_nonSave("config.scan.satselection[" + str(slot.slotid) + "]", configSatlist, 0, self.satList[slot.slotid]))
 
        def keyLeft(self):
                self["config"].handleKey(config.key["prevElement"])
@@ -212,18 +230,16 @@ class ScanSetup(Screen):
                tlist.append(parm)
 
        # FIXME use correct parameters
-       def addCabTransponder(self, tlist, frequency, symbol_rate, polarisation, fec, inversion, orbital_position):
-               print "Add Sat: frequ: " + str(frequency) + " symbol: " + str(symbol_rate) + " pol: " + str(polarisation) + " fec: " + str(fec) + " inversion: " + str(inversion)
-               print "orbpos: " + str(orbital_position)
+       def addCabTransponder(self, tlist, frequency, symbol_rate, modulation, fec, inversion):
+               print "Add Sat: frequ: " + str(frequency) + " symbol: " + str(symbol_rate) + " pol: " + str(modulation) + " fec: " + str(fec) + " inversion: " + str(inversion)
                parm = eDVBFrontendParametersCable()
                parm.frequency = frequency * 1000
                parm.symbol_rate = symbol_rate * 1000
-               parm.polarisation = polarisation # eDVBFrontendParametersSatellite.Polarisation.Verti   
+               parm.modulation = modulation # eDVBFrontendParametersSatellite.Polarisation.Verti       
                parm.fec = fec                  # eDVBFrontendParametersSatellite.FEC.f3_4;
                #parm.fec = 6                                   # AUTO
                parm.inversion = inversion      #eDVBFrontendParametersSatellite.Inversion.Off;
                #parm.inversion = 2             #AUTO
-               parm.orbital_position = int(orbital_position)
                tlist.append(parm)
 
        # FIXME use correct parameters
@@ -243,6 +259,7 @@ class ScanSetup(Screen):
 
        def keyGo(self):
                tlist = []
+               flags = 0
                if (config.scan.type.value == 0): # single transponder scan
                        if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"]):
                                self.addSatTransponder(tlist, config.scan.sat.frequency.value[0],
@@ -254,10 +271,9 @@ class ScanSetup(Screen):
                        if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"]):
                                self.addCabTransponder(tlist, config.scan.cab.frequency.value[0],
                                                                                          config.scan.cab.symbolrate.value[0],
-                                                                                         config.scan.cab.polarization.value,
+                                                                                         config.scan.cab.modulation.value,
                                                                                          config.scan.cab.fec.value,
-                                                                                         config.scan.cab.inversion.value,
-                                                                                         self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1])
+                                                                                         config.scan.cab.inversion.value)
                        if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
                                self.addTerTransponder(tlist, config.scan.sat.frequency.value[0],
                                                                                          config.scan.sat.symbolrate.value[0],
@@ -266,8 +282,9 @@ class ScanSetup(Screen):
                                                                                          config.scan.sat.inversion.value,
                                                                                          self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1])
 
-               if (config.scan.type.value == 1):
+               if (config.scan.type.value == 1): # single sat scan
                        getInitialTransponderList(tlist, int(self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1]))
+                       flags |= eComponentScan.scanNetworkSearch
 
                if (config.scan.type.value == 2): # multi sat scan
                        SatList = nimmanager.getSatListForNim(config.scan.nims.value)
@@ -276,15 +293,14 @@ class ScanSetup(Screen):
                                if x[1].parent.value == 0:
                                        print "   " + str(x[1].parent.configPath)
                                        getInitialTransponderList(tlist, x[1].parent.configPath)
-
+                       flags |= eComponentScan.scanNetworkSearch
 
                for x in self["config"].list:
                        x[1].save()
 
-               flags = 0
-               flags |= eComponentScan.scanNetworkSearch
+               feid = config.scan.nims.value
                # flags |= eComponentScan.scanSearchBAT
-               self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, flags)
+               self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, feid, flags)
 
                #self.close()
 
@@ -303,7 +319,8 @@ class ScanSimple(Screen):
                                print "   " + str(x[1].parent.configPath)
                                getInitialTransponderList(tlist, x[1].parent.configPath)
 
-               self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, eComponentScan.scanNetworkSearch)
+               feid = 0 # FIXME
+               self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, feid, eComponentScan.scanNetworkSearch)
 
        def keyCancel(self):
                self.close()