X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4e1e6ba3e78de639bf72a7d4456da78f9cad1acf..29f60fdaf6f0ff1dd112c9e0e913ec734b304bf1:/lib/python/Screens/ScanSetup.py diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py index 67ea1b19..f007f6f2 100644 --- a/lib/python/Screens/ScanSetup.py +++ b/lib/python/Screens/ScanSetup.py @@ -5,6 +5,7 @@ from Components.ActionMap import NumberActionMap from Components.ConfigList import ConfigList from Components.NimManager import nimmanager from Components.Label import Label +from Screens.MessageBox import MessageBox from enigma import eDVBFrontendParametersSatellite, eComponentScan, eDVBSatelliteEquipmentControl, eDVBFrontendParametersTerrestrial def buildTerTransponder(frequency, @@ -111,12 +112,13 @@ def getInitialTerrestrialTransponderList(tlist, region): # FIXME: we need to convert the other parameters... # convert terrestrial.xml bandwidth to our enum - if x[2] in [0, 1]: - bandwidth = [1, 0][x[2]] - else: - bandwidth = 3 # auto - - parm = buildTerTransponder(x[1], bandwidth = [1, 0][x[2]]) + #if x[2] in [0, 1]: + # bandwidth = [1, 0][x[2]] + #else: + # bandwidth = 3 # auto + # + #parm = buildTerTransponder(x[1], bandwidth = [1, 0][x[2]]) + parm = buildTerTransponder(x[1], inversion = x[9], bandwidth = x[2]) tlist.append(parm) @@ -389,20 +391,26 @@ class ScanSetup(Screen): flags = 0 if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"]): if currentConfigSelectionElement(config.scan.type) == "single_transponder": - - self.addSatTransponder(tlist, config.scan.sat.frequency.value[0], - config.scan.sat.symbolrate.value[0], - config.scan.sat.polarization.value, - config.scan.sat.fec.value, - config.scan.sat.inversion.value, - self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1]) + l = len(self.satList) + if l and l > config.scan.nims.value: + nimsats=self.satList[config.scan.nims.value] + l = len(config.scan.satselection) + if l and l > config.scan.nims.value: + selsatidx=config.scan.satselection[config.scan.nims.value].value + l = len(nimsats) + if l and l > selsatidx: + orbpos=nimsats[selsatidx][1] + self.addSatTransponder(tlist, config.scan.sat.frequency.value[0], + config.scan.sat.symbolrate.value[0], + config.scan.sat.polarization.value, + config.scan.sat.fec.value, + config.scan.sat.inversion.value, + orbpos) elif currentConfigSelectionElement(config.scan.type) == "single_satellite": getInitialTransponderList(tlist, int(self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1])) flags |= eComponentScan.scanNetworkSearch - elif currentConfigSelectionElement(config.scan.type) == "multisat": SatList = nimmanager.getSatListForNim(config.scan.nims.value) - for x in self.multiscanlist: if x[1].parent.value == 0: print " " + str(x[1].parent.configPath) @@ -416,7 +424,7 @@ class ScanSetup(Screen): config.scan.cab.modulation.value, config.scan.cab.fec.value, config.scan.cab.inversion.value) - if currentConfigSelectionElement(config.scan.cab.networkScan) == "yes": + if currentConfigSelectionElement(config.scan.cab.networkScan) == "yes": flags |= eComponentScan.scanNetworkSearch elif currentConfigSelectionElement(config.scan.typecable) == "complete": getInitialCableTransponderList(tlist, nimmanager.getCableDescription(config.scan.nims.value)) @@ -443,11 +451,13 @@ class ScanSetup(Screen): for x in self["config"].list: x[1].save() - feid = config.scan.nims.value - # flags |= eComponentScan.scanSearchBAT - self.session.openWithCallback(self.doNothing, ServiceScan, [{"transponders": tlist, "feid": feid, "flags": flags}]) + if len(tlist): + feid = config.scan.nims.value + # flags |= eComponentScan.scanSearchBAT + self.session.openWithCallback(self.doNothing, ServiceScan, [{"transponders": tlist, "feid": feid, "flags": flags}]) + else: + self.session.open(MessageBox, _("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR) - #self.close() def doNothing(self): pass @@ -477,6 +487,7 @@ class ScanSimple(Screen): slotid = x[1].parent.configPath print "Scan Tuner", slotid, "-", currentConfigSelectionElement(x[1].parent) if currentConfigSelectionElement(x[1].parent) == "yes": + scanPossible = False tlist = [ ] if nimmanager.getNimType(x[1].parent.configPath) == nimmanager.nimType["DVB-S"]: if two_sat_tuners: @@ -489,14 +500,21 @@ class ScanSimple(Screen): SatList = nimmanager.getSatListForNim(slotid) for sat in SatList: if not two_sat_tuners or (sat[1] in exclusive_nim_sats or slotid == 0): + scanPossible = True print sat getInitialTransponderList(tlist, sat[1]) elif nimmanager.getNimType(x[1].parent.configPath) == nimmanager.nimType["DVB-C"]: + scanPossible = True getInitialCableTransponderList(tlist, nimmanager.getCableDescription(slotid)) elif nimmanager.getNimType(x[1].parent.configPath) == nimmanager.nimType["DVB-T"]: + scanPossible = True getInitialTerrestrialTransponderList(tlist, nimmanager.getTerrestrialDescription(slotid)) - scanList.append({"transponders": tlist, "feid": slotid, "flags": eComponentScan.scanNetworkSearch}) - self.session.openWithCallback(self.doNothing, ServiceScan, scanList = scanList) + if scanPossible: + scanList.append({"transponders": tlist, "feid": slotid, "flags": eComponentScan.scanNetworkSearch}) + if len(scanList): + self.session.openWithCallback(self.doNothing, ServiceScan, scanList = scanList) + else: + self.session.open(MessageBox, _("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR) def doNothing(self): pass @@ -525,9 +543,13 @@ class ScanSimple(Screen): sec = eDVBSatelliteEquipmentControl.getInstance() if sec is not None: exclusive_satellites = sec.get_exclusive_satellites(0,1) - if len(exclusive_satellites) == 0: + if len(exclusive_satellites) == 2: return False - return True + idx = exclusive_satellites[0]+1 + exclusive_nim_sats = exclusive_satellites[idx+1:idx+1+exclusive_satellites[idx]] + if len(exclusive_nim_sats): + return True + return False # two -C or two -T tuners def __init__(self, session): Screen.__init__(self, session)