X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ad1e20175ad282a750315eb17861258668dfb2c9..17815854118aa7187570e0e4492064f43a1b94b7:/lib/python/Screens/ScanSetup.py diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py index 357888f8..f32904a1 100644 --- a/lib/python/Screens/ScanSetup.py +++ b/lib/python/Screens/ScanSetup.py @@ -7,7 +7,7 @@ from Components.ActionMap import NumberActionMap, ActionMap from Components.ConfigList import ConfigListScreen from Components.NimManager import nimmanager, getConfigSatlist from Components.Label import Label -from Tools.Directories import resolveFilename, SCOPE_DEFAULTPARTITIONMOUNTDIR +from Tools.Directories import resolveFilename, SCOPE_DEFAULTPARTITIONMOUNTDIR, SCOPE_DEFAULTDIR, SCOPE_DEFAULTPARTITION from Screens.MessageBox import MessageBox from enigma import eTimer, eDVBFrontendParametersSatellite, eComponentScan, \ eDVBSatelliteEquipmentControl, eDVBFrontendParametersTerrestrial, \ @@ -160,8 +160,8 @@ class CableTransponderSearchSupport: def cableTransponderSearchSessionClosed(self, *val): print "cableTransponderSearchSessionClosed, val", val - self.cable_search_container.appClosed.get().remove(self.cableTransponderSearchClosed) - self.cable_search_container.dataAvail.get().remove(self.getCableTransponderData) + self.cable_search_container.appClosed.remove(self.cableTransponderSearchClosed) + self.cable_search_container.dataAvail.remove(self.getCableTransponderData) self.cable_search_container = None self.cable_search_session = None if val and len(val) and val[0]: @@ -207,8 +207,8 @@ class CableTransponderSearchSupport: return self.__tlist = [ ] self.cable_search_container = eConsoleAppContainer() - self.cable_search_container.appClosed.get().append(self.cableTransponderSearchClosed) - self.cable_search_container.dataAvail.get().append(self.getCableTransponderData) + self.cable_search_container.appClosed.append(self.cableTransponderSearchClosed) + self.cable_search_container.dataAvail.append(self.getCableTransponderData) cableConfig = config.Nims[nim_idx].cable cmd = "tda1002x --init --scan --verbose --wakeup --inv 2 --bus " #FIXMEEEEEE hardcoded i2c devices for dm7025 and dm8000 @@ -281,17 +281,22 @@ class CableTransponderSearchSupport: class DefaultSatLists(DefaultWizard): def __init__(self, session, silent = True, showSteps = False): + self.xmlfile = "defaultsatlists.xml" DefaultWizard.__init__(self, session, silent, showSteps, neededTag = "services") + print "configuredSats:", nimmanager.getConfiguredSats() def setDirectory(self): - self.directory = resolveFilename(SCOPE_DEFAULTPARTITIONMOUNTDIR) - self.xmlfile = "defaultsatlists.xml" - + self.directory = [] + self.directory.append(resolveFilename(SCOPE_DEFAULTDIR)) + import os + os.system("mount %s %s" % (resolveFilename(SCOPE_DEFAULTPARTITION), resolveFilename(SCOPE_DEFAULTPARTITIONMOUNTDIR))) + self.directory.append(resolveFilename(SCOPE_DEFAULTPARTITIONMOUNTDIR)) + def statusCallback(self, status, progress): print "statusCallback:", status, progress from Components.DreamInfoHandler import DreamInfoHandler if status == DreamInfoHandler.STATUS_DONE: - self["text"].setText(_("The installation of the default services lists is finished.")) + self["text"].setText(_("The installation of the default services lists is finished.") + "\n\n" + _("Please press OK to continue.")) self.markDone() self.disableKeys = False @@ -367,6 +372,7 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.typeOfScanEntry = getConfigListEntry(_("Type of scan"), self.scan_typeterrestrial) self.list.append(self.typeOfScanEntry) + self.scan_networkScan.value = False if nim.isCompatible("DVB-S"): if self.scan_type.value == "single_transponder": self.updateSatList() @@ -388,29 +394,23 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.modulationEntry = getConfigListEntry(_('Modulation'), self.scan_sat.modulation) self.list.append(self.modulationEntry) self.list.append(getConfigListEntry(_('Rolloff'), self.scan_sat.rolloff)) - if self.scan_sat.modulation.value == "8psk": - self.list.append(getConfigListEntry(_('Pilot'), self.scan_sat.pilot)) - self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan)) + self.list.append(getConfigListEntry(_('Pilot'), self.scan_sat.pilot)) elif self.scan_type.value == "single_satellite": self.updateSatList() print self.scan_satselection[index_to_scan] self.list.append(getConfigListEntry(_("Satellite"), self.scan_satselection[index_to_scan])) - self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices)) - elif self.scan_type.value == "multisat": - # if (norotor) + self.scan_networkScan.value = True + elif self.scan_type.value.find("multisat") != -1: tlist = [] SatList = nimmanager.getSatListForNim(index_to_scan) - self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices)) for x in SatList: if self.Satexists(tlist, x[0]) == 0: tlist.append(x[0]) - sat = ConfigEnableDisable(default = True) + sat = ConfigEnableDisable(default = self.scan_type.value.find("_yes") != -1 and True or False) configEntry = getConfigListEntry(nimmanager.getSatDescription(x[0]), sat) self.list.append(configEntry) self.multiscanlist.append((x[0], sat)) - # if (rotor): - # for sat in nimmanager.satList: - # self.list.append(getConfigListEntry(sat[1], self.scan_scansat[sat[0]])) + self.scan_networkScan.value = True elif nim.isCompatible("DVB-C"): if self.scan_typecable.value == "single_transponder": self.list.append(getConfigListEntry(_("Frequency"), self.scan_cab.frequency)) @@ -418,9 +418,6 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.list.append(getConfigListEntry(_("Symbol Rate"), self.scan_cab.symbolrate)) self.list.append(getConfigListEntry(_("Modulation"), self.scan_cab.modulation)) self.list.append(getConfigListEntry(_("FEC"), self.scan_cab.fec)) - self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan)) - elif self.scan_typecable.value == "complete": - self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices)) elif nim.isCompatible("DVB-T"): if self.scan_typeterrestrial.value == "single_transponder": self.list.append(getConfigListEntry(_("Frequency"), self.scan_ter.frequency)) @@ -432,23 +429,9 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.list.append(getConfigListEntry(_("Transmission mode"), self.scan_ter.transmission)) self.list.append(getConfigListEntry(_("Guard interval mode"), self.scan_ter.guard)) self.list.append(getConfigListEntry(_("Hierarchy mode"), self.scan_ter.hierarchy)) - self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan)) - elif self.scan_typeterrestrial.value == "complete": - self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices)) - -# if (nim.isCompatible("DVB-S") and self.scan_type.type == "single_transponder") or \ -# (nim.isCompatbile("DVB-C") and self.scan_typecable.type == "single_transponder") or \ -# (nim.isCompatible("DVB-T") and self.scan_typeterrestrial.type == "single_transponder"): -# self.configElementSNR = getConfigListEntry(_("SNR"), self.scan_snr) -# self.list.append(self.configElementSNR) -# self.configElementACG = getConfigListEntry(_("AGC"), self.scan_agc) -# self.list.append(self.configElementACG) -# self.configElementBER = getConfigListEntry(_("BER"), self.scan_ber) -# self.list.append(self.configElementBER) -# self.statusTimer.start(500, False) -# else: -# self.statusTimer.stop() - + self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan)) + self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices)) + self.list.append(getConfigListEntry(_("Only Free scan"), self.scan_onlyfree)) self["config"].list = self.list self["config"].l.setList(self.list) @@ -504,9 +487,9 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): ttype = frontendData.get("tuner_type", "UNKNOWN") if ttype == "DVB-S": defaultSat["system"] = {"DVB-S": "dvb-s", "DVB-S2": "dvb-s2"}[frontendData.get("system", "DVB-S")] - defaultSat["frequency"] = int(frontendData.get("frequency", 0) / 1000) + defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000 defaultSat["inversion"] = {"INVERSION_OFF": "off", "INVERSION_ON": "on", "INVERSION_AUTO": "auto"}[frontendData.get("inversion", "INVERSION_AUTO")] - defaultSat["symbolrate"] = int(frontendData.get("symbol_rate", 0) / 1000) + defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000 defaultSat["polarization"] = {"HORIZONTAL": "horizontal", "VERTICAL": "vertical", "CIRCULAR_LEFT": "circular_left", "CIRCULAR_RIGHT": "circular_right", "UNKNOWN": None}[frontendData.get("polarization", "HORIZONTAL")] if frontendData.get("system", "DVB-S") == "DVB-S2": @@ -521,8 +504,8 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): defaultSat["modulation"] = {"QPSK": "qpsk", "8PSK": "8psk"}[frontendData.get("modulation", "QPSK")] defaultSat["orbpos"] = frontendData.get("orbital_position", 0) elif ttype == "DVB-C": - defaultCab["frequency"] = int(frontendData.get("frequency", 0) / 1000) - defaultCab["symbolrate"] = int(frontendData.get("symbol_rate", 0) / 1000) + defaultCab["frequency"] = frontendData.get("frequency", 0) / 1000 + defaultCab["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000 defaultCab["inversion"] = {"INVERSION_OFF": "off", "INVERSION_ON": "on", "INVERSION_AUTO": "auto"}[frontendData.get("inversion", "INVERSION_AUTO")] defaultCab["fec"] = {"FEC_AUTO": "auto", "FEC_1_2": "1_2", "FEC_2_3": "2_3", "FEC_3_4": "3_4", "FEC_5_6": "5_6", "FEC_7_8": "7_8", "FEC_8_9": "8_9", "FEC_NONE": "none"}[frontendData.get("fec_inner", "FEC_AUTO")] defaultCab["modulation"] = {"QAM_AUTO": "auto", "QAM_16": "16qam", "QAM_32": "32qam", "QAM_64": "64qam", "QAM_128": "128qam", "QAM_256": "256qam"}[frontendData.get("modulation", "QAM_16")] @@ -531,16 +514,17 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.scan_cab = ConfigSubsection() self.scan_ter = ConfigSubsection() - self.scan_type = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("single_satellite", _("Single satellite")), ("multisat", _("Multisat"))]) + self.scan_type = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("single_satellite", _("Single satellite")), ("multisat", _("Multisat")), ("multisat_yes", _("Multisat"))]) self.scan_typecable = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("complete", _("Complete"))]) self.scan_typeterrestrial = ConfigSelection(default = "single_transponder", choices = [("single_transponder", _("Single transponder")), ("complete", _("Complete"))]) self.scan_clearallservices = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))]) + self.scan_onlyfree = ConfigYesNo(default = False) self.scan_networkScan = ConfigYesNo(default = False) nim_list = [] # collect all nims which are *not* set to "nothing" for n in nimmanager.nim_slots: - if n.config_mode != "nothing": + if not n.config_mode in ("loopthrough", "satposdepends", "nothing"): nim_list.append((str(n.slot), n.friendly_full_description)) self.scan_nims = ConfigSelection(choices = nim_list) @@ -593,7 +577,7 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.scan_satselection = [] for slot in nimmanager.nim_slots: if slot.isCompatible("DVB-S"): - self.scan_satselection.append(getConfigSatlist(int(defaultSat["orbpos"]), self.satList[slot.slot])) + self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot])) else: self.scan_satselection.append(None) @@ -637,9 +621,9 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): parm.polarisation = polarisation parm.fec = self.fecmap[fec] parm.inversion = inversion - parm.orbital_position = int(orbital_position) - parm.rolloff = int(rolloff) - parm.pilot = int(pilot) + parm.orbital_position = orbital_position + parm.rolloff = rolloff + parm.pilot = pilot tlist.append(parm) def addCabTransponder(self, tlist, frequency, symbol_rate, modulation, fec, inversion): @@ -658,9 +642,8 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): def keyGo(self): tlist = [] flags = None - extFlags = True - startScan = True + removeAll = True index_to_scan = int(self.scan_nims.value) if self.scan_nims == [ ]: @@ -697,12 +680,11 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.scan_sat.modulation.index, self.scan_sat.rolloff.index, self.scan_sat.pilot.index) - flags = self.scan_networkScan.value and eComponentScan.scanNetworkSearch or 0 - extFlags = False + removeAll = False elif self.scan_type.value == "single_satellite": sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index] getInitialTransponderList(tlist, sat[0]) - elif self.scan_type.value == "multisat": + elif self.scan_type.value.find("multisat") != -1: SatList = nimmanager.getSatListForNim(index_to_scan) for x in self.multiscanlist: if x[1].value: @@ -717,8 +699,7 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): self.scan_cab.modulation.index + 1, fec, self.scan_cab.inversion.index) - flags = self.scan_networkScan.value and eComponentScan.scanNetworkSearch or 0 - extFlags = False + removeAll = False elif self.scan_typecable.value == "complete": if config.Nims[index_to_scan].cable.scan_type.value == "provider": getInitialCableTransponderList(tlist, index_to_scan) @@ -737,21 +718,24 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport): transmission = self.scan_ter.transmission.index, guard = self.scan_ter.guard.index, hierarchy = self.scan_ter.hierarchy.index) - flags = self.scan_networkScan.value and eComponentScan.scanNetworkSearch or 0 - extFlags = False + removeAll = False elif self.scan_typeterrestrial.value == "complete": getInitialTerrestrialTransponderList(tlist, nimmanager.getTerrestrialDescription(index_to_scan)) - if flags is None: - flags = eComponentScan.scanNetworkSearch + flags = self.scan_networkScan.value and eComponentScan.scanNetworkSearch or 0 + + tmp = self.scan_clearallservices.value + if tmp == "yes": + flags |= eComponentScan.scanRemoveServices + elif tmp == "yes_hold_feeds": + flags |= eComponentScan.scanRemoveServices + flags |= eComponentScan.scanDontRemoveFeeds + + if tmp != "no" and not removeAll: + flags |= eComponentScan.scanDontRemoveUnscanned - if extFlags: - tmp = self.scan_clearallservices.value - if tmp == "yes": - flags |= eComponentScan.scanRemoveServices - elif tmp == "yes_hold_feeds": - flags |= eComponentScan.scanRemoveServices - flags |= eComponentScan.scanDontRemoveFeeds + if self.scan_onlyfree.value: + flags |= eComponentScan.scanOnlyFree for x in self["config"].list: x[1].save() @@ -792,18 +776,6 @@ class ScanSimple(ConfigListScreen, Screen, CableTransponderSearchSupport): def getNetworksForNim(self, nim): if nim.isCompatible("DVB-S"): networks = nimmanager.getSatListForNim(nim.slot) -# the original code took "loopthrough" etc. into account. Do we need this? -# if nimmanager.getNimConfigMode(1) in ["loopthrough", "satposdepends", "equal", "nothing"]: -# return False -# sec = eDVBSatelliteEquipmentControl.getInstance() -# if sec is not None: -# exclusive_satellites = sec.get_exclusive_satellites(0,1) -# if len(exclusive_satellites) == 2: -# return False -# idx = exclusive_satellites[0]+1 -# exclusive_nim_sats = exclusive_satellites[idx+1:idx+1+exclusive_satellites[idx]] -# if len(exclusive_nim_sats): -# return True elif not nim.empty: networks = [ nim.type ] # "DVB-C" or "DVB-T". TODO: seperate networks for different C/T tuners, if we want to support that. else: