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,
# 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)
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)
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))
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
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:
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
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)