from Components.config import *
from Components.ActionMap import NumberActionMap
from Components.ConfigList import ConfigList
-from Components.config import config
-from Components.config import getConfigListEntry
from Components.NimManager import nimmanager
from Components.Label import Label
-from enigma import eDVBFrontendParametersSatellite, eComponentScan
+from enigma import eDVBFrontendParametersSatellite, eComponentScan, eDVBSatelliteEquipmentControl
def getInitialTransponderList(tlist, pos):
- print "pos", pos
list = nimmanager.getTransponders(pos)
for x in list:
parm = eDVBFrontendParametersSatellite()
parm.frequency = x[1]
parm.symbol_rate = x[2]
- parm.polarisation = x[3] # eDVBFrontendParametersSatellite.Polarisation.Vertical
+ parm.polarisation = x[3]#lookup_sat_polarisation[x[3]] # eDVBFrontendParametersSatellite.Polarisation.Vertical
parm.fec = x[4] # eDVBFrontendParametersSatellite.FEC.f3_4;
#parm.fec = 6 # AUTO
#parm.inversion = 1 #eDVBFrontendParametersSatellite.Inversion.Off;
parm.orbital_position = pos
tlist.append(parm)
+def getInitialCableTransponderList(tlist, cable):
+ list = nimmanager.getTranspondersCable(cable)
+
+ for x in list:
+ if x[0] == 1: #CABLE
+ parm = eDVBFrontendParametersCable()
+ parm.frequency = x[1]
+ parm.symbol_rate = x[2]
+ parm.modulation = x[3] # AUTO
+ parm.fec_inner = x[4] # AUTO
+ parm.inversion = 2 # AUTO
+ tlist.append(parm)
+
class ScanSetup(Screen):
def __init__(self, session):
Screen.__init__(self, session)
"9": self.keyNumberGlobal,
"0": self.keyNumberGlobal
}, -1)
+
+ self.statusTimer = eTimer()
+ self.statusTimer.timeout.get().append(self.updateStatus)
+ #self.statusTimer.start(5000, True)
self.list = []
self["config"] = ConfigList(self.list)
self["introduction"] = Label(_("Press OK to start the scan"))
+ def run(self):
+ self.keyGo()
+
def updateSatList(self):
self.satList = []
for slot in nimmanager.nimslots:
self.list.append(getConfigListEntry(_("Symbol Rate"), config.scan.cab.symbolrate))
self.list.append(getConfigListEntry(_("Modulation"), config.scan.cab.modulation))
self.list.append(getConfigListEntry(_("FEC"), config.scan.cab.fec))
+ self.list.append(getConfigListEntry(_("Network scan"), config.scan.cab.networkScan))
elif currentConfigSelectionElement(config.scan.typecable) == "complete":
pass
elif currentConfigSelectionElement(config.scan.typeterrestrial) == "complete":
pass
+ if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"] and currentConfigSelectionElement(config.scan.type) == "single_transponder") or \
+ (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"] and currentConfigSelectionElement(config.scan.typecable) == "single_transponder") or \
+ (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"] and currentConfigSelectionElement(config.scan.typeterrestrial) == "single_transponder"):
+ self.configElementSNR = getConfigListEntry(_("SNR"), config.scan.snr)
+ self.list.append(self.configElementSNR)
+ self.configElementACG = getConfigListEntry(_("AGC"), config.scan.agc)
+ self.list.append(self.configElementACG)
+ self.configElementBER = getConfigListEntry(_("BER"), config.scan.ber)
+ self.list.append(self.configElementBER)
+ self.statusTimer.start(500, False)
+ else:
+ self.statusTimer.stop()
+
self["config"].list = self.list
self["config"].l.setList(self.list)
nimList.append(nim[0])
#nimList.append("all")
config.scan.nims = configElement_nonSave("config.scan.nims", configSelection, 0, nimList)
+
+ # status
+ config.scan.snr = configElement_nonSave("config.scan.snr", configSlider, 0, (1, 100))
+ config.scan.snr.enabled = False
+ config.scan.agc = configElement_nonSave("config.scan.agc", configSlider, 0, (1, 100))
+ config.scan.agc.enabled = False
+ config.scan.ber = configElement_nonSave("config.scan.ber", configSlider, 0, (1, 100))
+ config.scan.ber.enabled = False
# sat
config.scan.sat.frequency = configElement_nonSave("config.scan.sat.frequency", configSequence, [11836], configsequencearg.get("INTEGER", (1, 99999)))
config.scan.sat.fec = configElement_nonSave("config.scan.sat.fec", configSelection, 7, (("auto", _("Auto")), ("1_2", "1/2"), ("2_3", "2/3"), ("3_4", "3/4"), ("5_6", "5/6"), ("7_8", "7/8"), ("none", _("None"))))
# cable
- config.scan.cab.frequency = configElement_nonSave("config.scan.cab.frequency", configSequence, [466], configsequencearg.get("INTEGER", (50, 9999)))
+ config.scan.cab.frequency = configElement_nonSave("config.scan.cab.frequency", configSequence, [466], configsequencearg.get("INTEGER", (50, 999)))
config.scan.cab.inversion = configElement_nonSave("config.scan.cab.inversion", configSelection, 2, (("off", _("off")), ("on", _("on")), ("auto", _("Auto"))))
- config.scan.cab.modulation = configElement_nonSave("config.scan.cab.modulation", configSelection, 2, (("16qam", "16-QAM"), ("32qam", "32-QAM"), ("64qam", "64-QAM"), ("128qam", "128-QAM"), ("256qam", "256-QAM"), ("auto", _("Auto"))))
- config.scan.cab.fec = configElement_nonSave("config.scan.cab.fec", configSelection, 9, (("none", _("None")), ("1_2", "1/2"), ("2_3", "2/3"), ("3_4", "3/4"), ("5_6", "5/6"), ("7_8", "7/8"), ("auto", _("Auto"))))
+ config.scan.cab.modulation = configElement_nonSave("config.scan.cab.modulation", configSelection, 0, (("auto", _("Auto")), ("16qam", "16-QAM"), ("32qam", "32-QAM"), ("64qam", "64-QAM"), ("128qam", "128-QAM"), ("256qam", "256-QAM")))
+ config.scan.cab.fec = configElement_nonSave("config.scan.cab.fec", configSelection, 0, (("auto", _("Auto")), ("1_2", "1/2"), ("2_3", "2/3"), ("3_4", "3/4"), ("5_6", "5/6"), ("7_8", "7/8"), ("8_9", "8/9"), ("none", _("None"))))
config.scan.cab.symbolrate = configElement_nonSave("config.scan.cab.symbolrate", configSequence, [6900], configsequencearg.get("INTEGER", (1, 9999)))
+ config.scan.cab.networkScan = configElement_nonSave("config.scan.cab.networkScan", configSelection, 0, (("no", _("no")), ("yes", _("yes"))))
# terrestial
config.scan.ter.frequency = configElement_nonSave("config.scan.ter.frequency", configSequence, [466], configsequencearg.get("INTEGER", (100, 900)))
self["config"].handleKey(config.key["nextElement"])
self.newConfig()
+ def updateStatus(self):
+ print "updatestatus"
+
def keyNumberGlobal(self, number):
print "You pressed number " + str(number)
if (self["config"].getCurrent()[1].parent.enabled == True):
# FIXME use correct parameters
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)
+ print "Add Cab: 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.modulation = modulation # eDVBFrontendParametersSatellite.Polarisation.Verti
+ parm.modulation = modulation # modulation # eDVBFrontendParametersSatellite.Polarisation.Verti
parm.fec = fec # eDVBFrontendParametersSatellite.FEC.f3_4;
#parm.fec = 6 # AUTO
parm.inversion = inversion #eDVBFrontendParametersSatellite.Inversion.Off;
def keyGo(self):
tlist = []
flags = 0
- if currentConfigSelectionElement(config.scan.type) == "single_transponder":
- if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"]):
+ 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])
- elif (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"]):
+ 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)
+ getInitialTransponderList(tlist, x[1].parent.configPath)
+ flags |= eComponentScan.scanNetworkSearch
+
+ elif (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-C"]):
+ if currentConfigSelectionElement(config.scan.typecable) == "single_transponder":
self.addCabTransponder(tlist, config.scan.cab.frequency.value[0],
config.scan.cab.symbolrate.value[0],
config.scan.cab.modulation.value,
config.scan.cab.fec.value,
config.scan.cab.inversion.value)
- elif (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
- self.addTerTransponder(tlist,
- config.scan.ter.frequency.value[0])
+ if currentConfigSelectionElement(config.scan.cab.networkScan) == "yes":
+ flags |= eComponentScan.scanNetworkSearch
+ elif currentConfigSelectionElement(config.scan.typecable) == "complete":
+ getInitialCableTransponderList(tlist, nimmanager.getCableDescription(config.scan.nims.value))
+ flags |= eComponentScan.scanNetworkSearch
- 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 (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-T"]):
+ if currentConfigSelectionElement(config.scan.typeterrestrial) == "single_transponder":
+ self.addTerTransponder(tlist,
+ config.scan.ter.frequency.value[0])
+ if currentConfigSelectionElement(config.scan.typeterrestrial) == "complete":
+ pass
- 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)
- getInitialTransponderList(tlist, x[1].parent.configPath)
- flags |= eComponentScan.scanNetworkSearch
for x in self["config"].list:
x[1].save()
feid = config.scan.nims.value
# flags |= eComponentScan.scanSearchBAT
- self.session.openWithCallback(self.doNothing, ServiceScan, tlist, feid, flags)
+ self.session.openWithCallback(self.doNothing, ServiceScan, [{"transponders": tlist, "feid": feid, "flags": flags}])
#self.close()
def doNothing(self):
self.close()
class ScanSimple(Screen):
-
def run(self):
- print "start scan for sats:"
- tlist = [ ]
- for x in self.list:
- if x[1].parent.value == 0:
- print " " + str(x[1].parent.configPath)
- getInitialTransponderList(tlist, x[1].parent.configPath)
-
- feid = 0 # FIXME
- self.session.openWithCallback(self.doNothing, ServiceScan, tlist, feid, eComponentScan.scanNetworkSearch)
-
+ self.keyGo()
def keyGo(self):
- print "start scan for sats:"
- tlist = [ ]
+ scanList = []
for x in self.list:
- if x[1].parent.value == 0:
- print " " + str(x[1].parent.configPath)
- getInitialTransponderList(tlist, x[1].parent.configPath)
-
- feid = 0 # FIXME
- self.session.openWithCallback(self.doNothing, ServiceScan, tlist, feid, eComponentScan.scanNetworkSearch)
+ slotid = x[1].parent.configPath
+ print "configpath:", x[1].parent.configPath, "-", currentConfigSelectionElement(x[1].parent)
+ if currentConfigSelectionElement(x[1].parent) == "yes":
+ tlist = [ ]
+ if nimmanager.getNimType(x[1].parent.configPath) == nimmanager.nimType["DVB-S"]:
+ SatList = nimmanager.getSatListForNim(slotid)
+ for sat in SatList:
+ getInitialTransponderList(tlist, sat[1])
+ elif nimmanager.getNimType(x[1].parent.configPath) == nimmanager.nimType["DVB-C"]:
+ getInitialCableTransponderList(tlist, nimmanager.getCableDescription(slotid))
+ scanList.append({"transponders": tlist, "feid": slotid, "flags": eComponentScan.scanNetworkSearch})
+ self.session.openWithCallback(self.doNothing, ServiceScan, scanList = scanList)
def doNothing(self):
pass
return 1
return 0
+ def ScanNimTwoNeeded(self):
+ if nimmanager.getNimType(0) != nimmanager.getNimType(1):
+ return True
+ if nimmanager.getNimType(0) == nimmanager.nimType["DVB-S"]: #two dvb-s nims
+ if nimmanager.getNimConfigMode(1) in ["loopthrough", "satposdepends", "equal", "nothing"]:
+ return False
+ sec = eDVBSatelliteEquipmentControl.getInstance()
+ if sec is not None:
+ different_satellites = sec.get_different_satellites(0,1)
+ if different_satellites is None:# or not len(different_satellites):
+ return False
+ return True
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
tlist = []
-
- for slotid in nimmanager.getNimListOfType(nimmanager.nimType["DVB-S"]):
- SatList = nimmanager.getSatListForNim(slotid)
-
- for x in SatList:
- if self.Satexists(tlist, x[1]) == 0:
- tlist.append(x[1])
- sat = configElement_nonSave(x[1], configSelection, 0, (("enable", _("Enable")), ("disable", _("Disable"))))
- self.list.append(getConfigListEntry(nimmanager.getSatDescription(x[1]), sat))
+ nimcount = nimmanager.getNimSocketCount()
+ if nimcount > 0:
+ nim = configElement_nonSave(0, configSelection, 0,(("yes", _("yes")),("no", _("no"))))
+ self.list.append(getConfigListEntry(_("Scan NIM") + " 0 (" + nimmanager.getNimTypeName(0) + ")", nim))
+ if nimcount > 1 and self.ScanNimTwoNeeded():
+ nim = configElement_nonSave(1, configSelection, 0, (("yes", _("yes")), ("no", _("no"))))
+ self.list.append(getConfigListEntry(_("Scan NIM") + " 1 (" + nimmanager.getNimTypeName(1) + ")", nim))
self["config"] = ConfigList(self.list)
self["header"] = Label(_("Automatic Scan"))