Exemple #1
0
	def createConfig(self, foo):
		self.preDefTransponders = None
		self.tuning_type = ConfigSelection(choices = [("manual_transponder", _("User defined transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.orbital_position = 192
		if self.frontendData and self.frontendData.has_key('orbital_position'):
			self.orbital_position = self.frontendData['orbital_position']
		ScanSetup.createConfig(self, self.frontendData)

		for x in (self.tuning_type, self.scan_sat.frequency,
			self.scan_sat.inversion, self.scan_sat.symbolrate,
			self.scan_sat.polarization, self.scan_sat.fec, self.scan_sat.pilot,
			self.scan_sat.fec_s2, self.scan_sat.fec, self.scan_sat.modulation,
			self.scan_sat.rolloff, self.scan_sat.system):
			x.addNotifier(self.retune, initial_call = False)

		satfinder_nim_list = []
		for n in nimmanager.nim_slots:
			if not n.isCompatible("DVB-S"):
				continue
			if n.config_mode  in ("loopthrough", "satposdepends", "nothing"):
				continue
			if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			satfinder_nim_list.append((str(n.slot), n.friendly_full_description))
		self.satfinder_scan_nims = ConfigSelection(choices = satfinder_nim_list)
		self.feid = int(self.satfinder_scan_nims.value)

		self.satList = []
		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.satList.append(nimmanager.getSatListForNim(slot.slot))
				self.scan_satselection.append(getConfigSatlist(self.orbital_position, self.satList[slot.slot]))
			else:
				self.satList.append(None)
Exemple #2
0
	def createConfig(self, foo):
		self.preDefTransponders = None
		self.tuning_type = ConfigSelection(choices = [("manual_transponder", _("User defined transponder")), ("predefined_transponder", _("Predefined transponder"))], default = "predefined_transponder")
		self.orbital_position = 192
		if self.frontendData and self.frontendData.has_key('orbital_position'):
			self.orbital_position = self.frontendData['orbital_position']
		ScanSetup.createConfig(self, self.frontendData)

		for x in (self.tuning_type, self.scan_sat.frequency,
			self.scan_sat.inversion, self.scan_sat.symbolrate,
			self.scan_sat.polarization, self.scan_sat.fec, self.scan_sat.pilot,
			self.scan_sat.fec_s2, self.scan_sat.fec, self.scan_sat.modulation,
			self.scan_sat.rolloff, self.scan_sat.system):
			x.addNotifier(self.retune, initial_call = False)

		satfinder_nim_list = []
		for n in nimmanager.nim_slots:
			if not n.isCompatible("DVB-S"):
				continue
			if n.config_mode  in ("loopthrough", "satposdepends", "nothing"):
				continue
			if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			satfinder_nim_list.append((str(n.slot), n.friendly_full_description))
		self.satfinder_scan_nims = ConfigSelection(choices = satfinder_nim_list)
		self.feid = int(self.satfinder_scan_nims.value)

		self.satList = []
		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.satList.append(nimmanager.getSatListForNim(slot.slot))
				self.scan_satselection.append(getConfigSatlist(self.orbital_position, self.satList[slot.slot]))
			else:
				self.satList.append(None)
Exemple #3
0
	def createConfig(self, foo):
		self.tuning_type = ConfigSelection(default = "predefined_transponder", choices = [("single_transponder", _("User defined transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.orbital_position = 192
		if self.frontendData and self.frontendData.has_key('orbital_position'):
			self.orbital_position = self.frontendData['orbital_position']
		ScanSetup.createConfig(self, self.frontendData)

		for x in (self.scan_sat.frequency,
			self.scan_sat.inversion, self.scan_sat.symbolrate,
			self.scan_sat.polarization, self.scan_sat.fec, self.scan_sat.pilot,
			self.scan_sat.fec_s2, self.scan_sat.fec, self.scan_sat.modulation,
			self.scan_sat.rolloff, self.scan_sat.system,
			self.scan_ter.channel, self.scan_ter.frequency, self.scan_ter.inversion,
			self.scan_ter.bandwidth, self.scan_ter.fechigh, self.scan_ter.feclow,
			self.scan_ter.modulation, self.scan_ter.transmission,
			self.scan_ter.guard, self.scan_ter.hierarchy, self.scan_ter.plp_id,
			self.scan_cab.frequency, self.scan_cab.inversion, self.scan_cab.symbolrate,
			self.scan_cab.modulation, self.scan_cab.fec):
			x.addNotifier(self.retune, initial_call = False)

		satfinder_nim_list = []
		for n in nimmanager.nim_slots:
			if not (n.isCompatible("DVB-S") or n.isCompatible("DVB-T") or n.isCompatible("DVB-C")):
				continue
			if n.config_mode  in ("loopthrough", "satposdepends", "nothing"):
				continue
			if n.isCompatible("DVB-S") and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			if n.isCompatible("DVB-S") and n.isFBCTuner() and not n.isFBCRoot():
				continue
			satfinder_nim_list.append((str(n.slot), n.friendly_full_description))
		self.satfinder_scan_nims = ConfigSelection(choices = satfinder_nim_list)
		if self.frontendData is not None and len(satfinder_nim_list) > 0: # open the plugin with the currently active NIM as default
			active_nim = self.frontendData.get("tuner_number", int(satfinder_nim_list[0][0]))
			if not nimmanager.nim_slots[active_nim].isFBCLink():
				self.satfinder_scan_nims.setValue(str(active_nim))

		self.feid = int(self.satfinder_scan_nims.value)

		self.satList = []
		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.satList.append(nimmanager.getSatListForNim(slot.slot))
				self.scan_satselection.append(getConfigSatlist(self.orbital_position, self.satList[slot.slot]))
			else:
				self.satList.append(None)

		if self.frontendData:
			ttype = self.frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S" and self.predefinedTranspondersList(self.getSelectedSatIndex(self.feid)) is None and len(nimmanager.getTransponders(self.getSelectedSatIndex(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-T" and self.predefinedTerrTranspondersList() is None and len(nimmanager.getTranspondersTerrestrial(nimmanager.getTerrestrialDescription(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-C" and self.predefinedCabTranspondersList() is None and len(nimmanager.getTranspondersCable(self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
Exemple #4
0
	def createConfig(self, foo):
		self.tuning_type = ConfigSelection(default = "predefined_transponder", choices = [("single_transponder", _("User defined transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.orbital_position = 192
		if self.frontendData and self.frontendData.has_key('orbital_position'):
			self.orbital_position = self.frontendData['orbital_position']
		ScanSetup.createConfig(self, self.frontendData)

		for x in (self.scan_sat.frequency,
			self.scan_sat.inversion, self.scan_sat.symbolrate,
			self.scan_sat.polarization, self.scan_sat.fec, self.scan_sat.pilot,
			self.scan_sat.fec_s2, self.scan_sat.fec, self.scan_sat.modulation,
			self.scan_sat.rolloff, self.scan_sat.system,
			self.scan_sat.is_id, self.scan_sat.pls_mode, self.scan_sat.pls_code,
			self.scan_ter.channel, self.scan_ter.frequency, self.scan_ter.inversion,
			self.scan_ter.bandwidth, self.scan_ter.fechigh, self.scan_ter.feclow,
			self.scan_ter.modulation, self.scan_ter.transmission,
			self.scan_ter.guard, self.scan_ter.hierarchy, self.scan_ter.plp_id,
			self.scan_cab.frequency, self.scan_cab.inversion, self.scan_cab.symbolrate,
			self.scan_cab.modulation, self.scan_cab.fec):
			x.addNotifier(self.retune, initial_call = False)

		satfinder_nim_list = []
		for n in nimmanager.nim_slots:
			if not (n.isCompatible("DVB-S") or n.isCompatible("DVB-T") or n.isCompatible("DVB-C")):
				continue
			if n.config_mode  in ("loopthrough", "satposdepends", "nothing"):
				continue
			if n.isCompatible("DVB-S") and n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			satfinder_nim_list.append((str(n.slot), n.friendly_full_description))
		self.satfinder_scan_nims = ConfigSelection(choices = satfinder_nim_list)
		if self.frontendData is not None and len(satfinder_nim_list) > 0: # open the plugin with the currently active NIM as default
			self.satfinder_scan_nims.setValue(str(self.frontendData.get("tuner_number", satfinder_nim_list[0][0])))

		self.feid = int(self.satfinder_scan_nims.value)

		self.satList = []
		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.satList.append(nimmanager.getSatListForNim(slot.slot))
				self.scan_satselection.append(getConfigSatlist(self.orbital_position, self.satList[slot.slot]))
			else:
				self.satList.append(None)

		if self.frontendData:
			ttype = self.frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S" and self.predefinedTranspondersList(self.getSelectedSatIndex(self.feid)) is None and len(nimmanager.getTransponders(self.getSelectedSatIndex(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-T" and self.predefinedTerrTranspondersList() is None and len(nimmanager.getTranspondersTerrestrial(nimmanager.getTerrestrialDescription(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-C" and self.predefinedCabTranspondersList() is None and len(nimmanager.getTranspondersCable(self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
Exemple #5
0
	def createConfig(self, foo):
		self.tuning_transponder = None
		self.tuning_type = ConfigSelection(choices = [("manual_transponder", _("Manual transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.tuning_sat = getConfigSatlist(192, nimmanager.getSatListForNim(self.feid))
		ScanSetup.createConfig(self, None)
		
		self.updateSats()

		for x in (self.tuning_type, self.tuning_sat, self.scan_sat.frequency,
			self.scan_sat.inversion, self.scan_sat.symbolrate,
			self.scan_sat.polarization, self.scan_sat.fec, self.scan_sat.pilot,
			self.scan_sat.fec_s2, self.scan_sat.fec, self.scan_sat.modulation,
			self.scan_sat.rolloff, self.scan_sat.system):
			x.addNotifier(self.retune, initial_call = False)
Exemple #6
0
	def createConfig(self, foo):
		self.tuning_transponder = None
		self.tuning_type = ConfigSelection(choices = [("manual_transponder", _("Manual transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.tuning_sat = getConfigSatlist(192, nimmanager.getSatListForNim(self.feid))
		ScanSetup.createConfig(self, None)
		
		self.updateSats()

		for x in (self.tuning_type, self.tuning_sat, self.scan_sat.frequency,
			self.scan_sat.inversion, self.scan_sat.symbolrate,
			self.scan_sat.polarization, self.scan_sat.fec, self.scan_sat.pilot,
			self.scan_sat.fec_s2, self.scan_sat.fec, self.scan_sat.modulation,
			self.scan_sat.rolloff, self.scan_sat.system):
			x.addNotifier(self.retune, initial_call = False)
Exemple #7
0
	def createConfig(self, foo):
		self.tuning_transponder = None
		self.tuning_type = ConfigSelection(choices = [("manual_transponder", _("Manual transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.tuning_sat = getConfigSatlist(192, nimmanager.getSatListForNim(self.feid))
		ScanSetup.createConfig(self, None)
		
		self.updateSats()

		setup_list = [self.tuning_type, self.tuning_sat, self.scan_sat.frequency,
			self.scan_sat.inversion, self.scan_sat.symbolrate,
			self.scan_sat.polarization, self.scan_sat.fec, self.scan_sat.pilot,
			self.scan_sat.fec_s2, self.scan_sat.fec, self.scan_sat.modulation,
			self.scan_sat.rolloff, self.scan_sat.system,
			self.scan_sat.is_id_bool, self.scan_sat.is_id, self.scan_sat.pls_mode, self.scan_sat.pls_code]

		nim = nimmanager.nim_slots[self.feid]
		if nim.isCompatible("DVB-S2X"):
			dvbs2x_setup_list = [self.scan_sat.system_dvbs2x, self.scan_sat.modulation_dvbs2x, self.scan_sat.fec_s2x_qpsk,
				self.scan_sat.fec_s2x_8psk, self.scan_sat.fec_s2x_8apsk, self.scan_sat.fec_s2x_16apsk, self.scan_sat.fec_s2x_32apsk]
			setup_list.extend(dvbs2x_setup_list)

		for x in setup_list:
			x.addNotifier(self.retune, initial_call = False)
Exemple #8
0
    def createConfig(self, foo):
        self.tuning_transponder = None
        self.tuning_type = ConfigSelection(
            choices=[("manual_transponder", _("Manual transponder")
                      ), ("predefined_transponder",
                          _("Predefined transponder"))])
        orb_pos = 192
        if foo is not None:
            orb_pos = foo.get("orbital_position", 192)
        self.tuning_sat = getConfigSatlist(
            orb_pos, nimmanager.getSatListForNim(self.feid))
        ScanSetup.createConfig(self, foo)
        self.updateSats()

        for x in (self.tuning_sat, self.scan_sat.frequency,
                  self.scan_sat.inversion, self.scan_sat.symbolrate,
                  self.scan_sat.polarization, self.scan_sat.fec,
                  self.scan_sat.fec_s2_8psk, self.scan_sat.fec_s2_8psk_auto,
                  self.scan_sat.fec_s2_qpsk, self.scan_sat.fec_s2_qpsk_auto,
                  self.scan_sat.modulation, self.scan_sat.modulation_auto,
                  self.scan_sat.enable_mis, self.scan_sat.is_id,
                  self.scan_sat.pls_mode, self.scan_sat.pls_code,
                  self.scan_sat.pilot, self.scan_sat.rolloff):
            x.addNotifier(self.retune, initial_call=False)
Exemple #9
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self.logfile = open("/tmp/satscan.log", "w+", 0)
        self.executable = None

        self.executable = None

        for tryname in ("avl_azbox_blindscan", "avl_xtrend_blindscan",
                        "vuplus_blindscan"):
            print "try:", tryname

            try:
                subprocess.check_call((tryname))
                self.executable = tryname
                break
            except OSError:
                print tryname + ": OSError"
                None
            except subprocess.CalledProcessError:
                # vuplus_blindscan returns -1 when called with no arguments
                print tryname + ": CalledProcessError"
                self.executable = tryname
                break

        print "executable = ", self.executable

        self.scan_circular = ConfigYesNo(default=False)
        self.scan_transponders = ConfigYesNo(default=False)
        self.scan_clearservices = ConfigYesNo(default=False)
        self.scan_fta = ConfigYesNo(default=False)

        self.current_service = self.session.nav.getCurrentlyPlayingServiceReference(
        )
        self.all_pos_per_dvbs_nim = []

        nimmanager.enumerateNIMs()

        for nim_slot in nimmanager.nim_slots:
            if nim_slot.isCompatible("DVB-S"):
                self.all_pos_per_dvbs_nim.append(
                    nimmanager.getSatListForNim(nim_slot.slot))
            else:
                self.all_pos_per_dvbs_nim.append(None)

        #print "*** all_pos_per_dvbs_nim: ", self.all_pos_per_dvbs_nim

        self.current_orb_pos = 192
        current_service = self.session.nav.getCurrentService()

        if current_service is not None:
            feinfo = current_service.frontendInfo()
            if feinfo is not None:
                fedata = feinfo.getAll(True)
                if fedata.get("tuner_type", "UNKNOWN") == "DVB-S":
                    self.current_orb_pos = fedata.get("orbital_position", 0)

        selectable_nims = []
        for nim in nimmanager.nim_slots:
            if nim.config_mode == "nothing":
                continue
            if nim.config_mode == "advanced" and len(
                    nimmanager.getSatListForNim(nim.slot)) < 1:
                continue
            if nim.config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(
                    nim.slot_id, int(nim.config.connectedTo.value))
                if nim.type == nimmanager.nim_slots[
                        root_id].type:  # check if connected from a DVB-S to DVB-S2 Nim or vice versa
                    continue
            if nim.isCompatible("DVB-S"):
                selectable_nims.append(
                    (str(nim.slot), nim.friendly_full_description))

        self.select_nim = ConfigSelection(choices=selectable_nims)

        self.positions_config_list = []
        for nim_slot in nimmanager.nim_slots:
            if nim_slot.isCompatible("DVB-S"):
                self.positions_config_list.append(
                    getConfigSatlist(self.current_orb_pos,
                                     self.all_pos_per_dvbs_nim[nim_slot.slot]))

        self.config_list = []
        ConfigListScreen.__init__(self, self.config_list)

        if self.select_nim.value != None and self.select_nim.value != "":
            self["actions"] = ActionMap(
                ["OkCancelActions", "ShortcutActions", "ColorActions"], {
                    "red": self.keyCancel,
                    "green": self.keyGo,
                    "ok": self.keyGo,
                    "cancel": self.keyCancel,
                }, -2)

            self["key_red"] = StaticText(_("Exit"))
            self["key_green"] = StaticText(_("Start"))
            self["text"] = Label(_("Press OK to start scanning"))

            self.FillConfigList()
        else:
            self["actions"] = ActionMap(
                ["OkCancelActions", "ShortcutActions", "ColorActions"], {
                    "red": self.keyCancel,
                    "green": self.KeyNone,
                    "ok": self.KeyNone,
                    "cancel": self.keyCancel,
                }, -2)

            self["key_red"] = StaticText(_("Exit"))
            self["key_green"] = StaticText(" ")
            self["text"] = Label(_("Tuner not set up, can't scan"))
Exemple #10
0
	def createConfig(self, frontendData):
			defaultSat = {
				"orbpos": 192,
				"system": eDVBFrontendParametersSatellite.System_DVB_S,
				"frequency": 11836,
				"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
				"symbolrate": 27500,
				"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
				"fec": eDVBFrontendParametersSatellite.FEC_Auto,
				"fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
				"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK }
			defaultCab = {
				"frequency": 466,
				"inversion": eDVBFrontendParametersCable.Inversion_Unknown,
				"modulation": eDVBFrontendParametersCable.Modulation_QAM64,
				"fec": eDVBFrontendParametersCable.FEC_Auto,
				"symbolrate": 6900,
				"system": eDVBFrontendParametersCable.System_DVB_C_ANNEX_A }
			defaultTer = {
				"frequency" : 474000,
				"inversion" : eDVBFrontendParametersTerrestrial.Inversion_Unknown,
				"bandwidth" : 8000000,
				"fechigh" : eDVBFrontendParametersTerrestrial.FEC_Auto,
				"feclow" : eDVBFrontendParametersTerrestrial.FEC_Auto,
				"modulation" : eDVBFrontendParametersTerrestrial.Modulation_Auto,
				"transmission_mode" : eDVBFrontendParametersTerrestrial.TransmissionMode_Auto,
				"guard_interval" : eDVBFrontendParametersTerrestrial.GuardInterval_Auto,
				"hierarchy": eDVBFrontendParametersTerrestrial.Hierarchy_Auto,
				"system": eDVBFrontendParametersTerrestrial.System_DVB_T,
				"plp_id": 0 }

			if frontendData is not None:
				ttype = frontendData.get("tuner_type", "UNKNOWN")
				if ttype == "DVB-S":
					defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
					defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
					defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
					defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
					defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
					if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
						defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
						defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
						defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
					else:
						defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
					defaultSat["orbpos"] = frontendData.get("orbital_position", 0)
				elif ttype == "DVB-C":
					defaultCab["frequency"] = frontendData.get("frequency", 0) / 1000
					defaultCab["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
					defaultCab["inversion"] = frontendData.get("inversion", eDVBFrontendParametersCable.Inversion_Unknown)
					defaultCab["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersCable.FEC_Auto)
					defaultCab["modulation"] = frontendData.get("modulation", eDVBFrontendParametersCable.Modulation_QAM16)
					defaultTer["system"] = frontendData.get("system", eDVBFrontendParametersCable.System_DVB_C_ANNEX_A)
				elif ttype == "DVB-T":
					defaultTer["frequency"] = frontendData.get("frequency", 0)
					defaultTer["inversion"] = frontendData.get("inversion", eDVBFrontendParametersTerrestrial.Inversion_Unknown)
					defaultTer["bandwidth"] = frontendData.get("bandwidth", 8000000)
					defaultTer["fechigh"] = frontendData.get("code_rate_hp", eDVBFrontendParametersTerrestrial.FEC_Auto)
					defaultTer["feclow"] = frontendData.get("code_rate_lp", eDVBFrontendParametersTerrestrial.FEC_Auto)
					defaultTer["modulation"] = frontendData.get("constellation", eDVBFrontendParametersTerrestrial.Modulation_Auto)
					defaultTer["transmission_mode"] = frontendData.get("transmission_mode", eDVBFrontendParametersTerrestrial.TransmissionMode_Auto)
					defaultTer["guard_interval"] = frontendData.get("guard_interval", eDVBFrontendParametersTerrestrial.GuardInterval_Auto)
					defaultTer["hierarchy"] = frontendData.get("hierarchy_information", eDVBFrontendParametersTerrestrial.Hierarchy_Auto)
					defaultTer["system"] = frontendData.get("system", eDVBFrontendParametersTerrestrial.System_DVB_T)

			self.scan_sat = ConfigSubsection()
			self.scan_cab = ConfigSubsection()
			self.scan_ter = ConfigSubsection()

			nim_list = []
			# collect all nims which are *not* set to "nothing"
			for n in nimmanager.nim_slots:
				if n.config_mode == "nothing":
					continue
				if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
					continue
				if n.config_mode in ("loopthrough", "satposdepends"):
					root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.value))
					if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
						continue
				nim_list.append((str(n.slot), n.friendly_full_description))

			self.scan_nims = ConfigSelection(choices = nim_list)
			if frontendData is not None and len(nim_list) > 0:
				self.scan_nims.value = str(frontendData.get("tuner_number", nim_list[0][0]))

			for slot in nimmanager.nim_slots:
				if slot.isCompatible("DVB-T"):
					self.ter_tnumber = slot.slot
			if self.ter_tnumber:
				self.ter_channel_input = channelnumbers.supportedChannels(self.ter_tnumber)

			# status
			self.scan_snr = ConfigSlider()
			self.scan_snr.enabled = False
			self.scan_agc = ConfigSlider()
			self.scan_agc.enabled = False
			self.scan_ber = ConfigSlider()
			self.scan_ber.enabled = False

			# sat
			self.scan_sat.system = ConfigSelection(default = defaultSat["system"], choices = [
				(eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S")),
				(eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S2"))])
			self.scan_sat.frequency = ConfigInteger(default = defaultSat["frequency"], limits = (1, 99999))
			self.scan_sat.inversion = ConfigSelection(default = defaultSat["inversion"], choices = [
				(eDVBFrontendParametersSatellite.Inversion_Off, _("Off")),
				(eDVBFrontendParametersSatellite.Inversion_On, _("On")),
				(eDVBFrontendParametersSatellite.Inversion_Unknown, _("Auto"))])
			self.scan_sat.symbolrate = ConfigInteger(default = defaultSat["symbolrate"], limits = (1, 99999))
			self.scan_sat.polarization = ConfigSelection(default = defaultSat["polarization"], choices = [
				(eDVBFrontendParametersSatellite.Polarisation_Horizontal, _("horizontal")),
				(eDVBFrontendParametersSatellite.Polarisation_Vertical, _("vertical")),
				(eDVBFrontendParametersSatellite.Polarisation_CircularLeft, _("circular left")),
				(eDVBFrontendParametersSatellite.Polarisation_CircularRight, _("circular right"))])
			self.scan_sat.fec = ConfigSelection(default = defaultSat["fec"], choices = [
				(eDVBFrontendParametersSatellite.FEC_Auto, _("Auto")),
				(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
				(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
				(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
				(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
				(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
				(eDVBFrontendParametersSatellite.FEC_None, _("None"))])
			self.scan_sat.fec_s2 = ConfigSelection(default = defaultSat["fec_s2"], choices = [
				(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
				(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
				(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
				(eDVBFrontendParametersSatellite.FEC_3_5, "3/5"),
				(eDVBFrontendParametersSatellite.FEC_4_5, "4/5"),
				(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
				(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
				(eDVBFrontendParametersSatellite.FEC_8_9, "8/9"),
				(eDVBFrontendParametersSatellite.FEC_9_10, "9/10")])
			self.scan_sat.modulation = ConfigSelection(default = defaultSat["modulation"], choices = [
				(eDVBFrontendParametersSatellite.Modulation_QPSK, "QPSK"),
				(eDVBFrontendParametersSatellite.Modulation_8PSK, "8PSK")])
			self.scan_sat.rolloff = ConfigSelection(default = defaultSat.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35), choices = [
				(eDVBFrontendParametersSatellite.RollOff_alpha_0_35, "0.35"),
				(eDVBFrontendParametersSatellite.RollOff_alpha_0_25, "0.25"),
				(eDVBFrontendParametersSatellite.RollOff_alpha_0_20, "0.20"),
				(eDVBFrontendParametersSatellite.RollOff_auto, _("Auto"))])
			self.scan_sat.pilot = ConfigSelection(default = defaultSat.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown), choices = [
				(eDVBFrontendParametersSatellite.Pilot_Off, _("Off")),
				(eDVBFrontendParametersSatellite.Pilot_On, _("On")),
				(eDVBFrontendParametersSatellite.Pilot_Unknown, _("Auto"))])

			# cable
			self.scan_cab.frequency = ConfigInteger(default = defaultCab["frequency"], limits = (50, 999))
			self.scan_cab.inversion = ConfigSelection(default = defaultCab["inversion"], choices = [
				(eDVBFrontendParametersCable.Inversion_Off, _("Off")),
				(eDVBFrontendParametersCable.Inversion_On, _("On")),
				(eDVBFrontendParametersCable.Inversion_Unknown, _("Auto"))])
			self.scan_cab.modulation = ConfigSelection(default = defaultCab["modulation"], choices = [
				(eDVBFrontendParametersCable.Modulation_QAM16, "16-QAM"),
				(eDVBFrontendParametersCable.Modulation_QAM32, "32-QAM"),
				(eDVBFrontendParametersCable.Modulation_QAM64, "64-QAM"),
				(eDVBFrontendParametersCable.Modulation_QAM128, "128-QAM"),
				(eDVBFrontendParametersCable.Modulation_QAM256, "256-QAM")])
			self.scan_cab.fec = ConfigSelection(default = defaultCab["fec"], choices = [
				(eDVBFrontendParametersCable.FEC_Auto, _("Auto")),
				(eDVBFrontendParametersCable.FEC_1_2, "1/2"),
				(eDVBFrontendParametersCable.FEC_2_3, "2/3"),
				(eDVBFrontendParametersCable.FEC_3_4, "3/4"),
				(eDVBFrontendParametersCable.FEC_5_6, "5/6"),
				(eDVBFrontendParametersCable.FEC_6_7, "6/7"),
				(eDVBFrontendParametersCable.FEC_7_8, "7/8"),
				(eDVBFrontendParametersCable.FEC_8_9, "8/9"),
				(eDVBFrontendParametersCable.FEC_None, _("None"))])
			self.scan_cab.symbolrate = ConfigInteger(default = defaultCab["symbolrate"], limits = (1, 99999))
			self.scan_cab.system = ConfigSelection(default = defaultCab["system"], choices = [
				(eDVBFrontendParametersCable.System_DVB_C_ANNEX_A, _("DVB-C")),
				(eDVBFrontendParametersCable.System_DVB_C_ANNEX_C, _("DVB-C ANNEX C"))])

			# terrestial
			self.scan_ter.frequency = ConfigInteger(default = 474000, limits = (50000, 999000))
			self.scan_ter.channel = ConfigInteger(default = 21, limits = (1, 99))
			self.scan_ter.inversion = ConfigSelection(default = defaultTer["inversion"], choices = [
				(eDVBFrontendParametersTerrestrial.Inversion_Off, _("Off")),
				(eDVBFrontendParametersTerrestrial.Inversion_On, _("On")),
				(eDVBFrontendParametersTerrestrial.Inversion_Unknown, _("Auto"))])
			# WORKAROUND: we can't use BW-auto
			self.scan_ter.bandwidth = ConfigSelection(default = defaultTer["bandwidth"], choices = [
				(1712000, "1.712MHz"),
				(5000000, "5MHz"),
				(6000000, "6MHz"),
				(7000000, "7MHz"),
				(8000000, "8MHz"),
				(10000000,"10MHz")
				])
			#, (eDVBFrontendParametersTerrestrial.Bandwidth_Auto, _("Auto"))))
			self.scan_ter.fechigh = ConfigSelection(default = defaultTer["fechigh"], choices = [
				(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
				(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
				(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
				(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
				(eDVBFrontendParametersTerrestrial.FEC_6_7, "6/7"),
				(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
				(eDVBFrontendParametersTerrestrial.FEC_8_9, "8/9"),
				(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
			self.scan_ter.feclow = ConfigSelection(default = defaultTer["feclow"], choices = [
				(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
				(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
				(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
				(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
				(eDVBFrontendParametersTerrestrial.FEC_6_7, "6/7"),
				(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
				(eDVBFrontendParametersTerrestrial.FEC_8_9, "8/9"),
				(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
			self.scan_ter.modulation = ConfigSelection(default = defaultTer["modulation"], choices = [
				(eDVBFrontendParametersTerrestrial.Modulation_QPSK, "QPSK"),
				(eDVBFrontendParametersTerrestrial.Modulation_QAM16, "QAM16"),
				(eDVBFrontendParametersTerrestrial.Modulation_QAM64, "QAM64"),
				(eDVBFrontendParametersTerrestrial.Modulation_QAM256, "QAM256"),
				(eDVBFrontendParametersTerrestrial.Modulation_Auto, _("Auto"))])
			self.scan_ter.transmission = ConfigSelection(default = defaultTer["transmission_mode"], choices = [
				(eDVBFrontendParametersTerrestrial.TransmissionMode_1k, "1K"),
				(eDVBFrontendParametersTerrestrial.TransmissionMode_2k, "2K"),
				(eDVBFrontendParametersTerrestrial.TransmissionMode_4k, "4K"),
				(eDVBFrontendParametersTerrestrial.TransmissionMode_8k, "8K"),
				(eDVBFrontendParametersTerrestrial.TransmissionMode_16k, "16K"),
				(eDVBFrontendParametersTerrestrial.TransmissionMode_32k, "32K"),
				(eDVBFrontendParametersTerrestrial.TransmissionMode_Auto, _("Auto"))])
			self.scan_ter.guard = ConfigSelection(default = defaultTer["guard_interval"], choices = [
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_32, "1/32"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_16, "1/16"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_8, "1/8"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_4, "1/4"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_128, "1/128"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_19_128, "19/128"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_19_256, "19/256"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_Auto, _("Auto"))])
			self.scan_ter.hierarchy = ConfigSelection(default = defaultTer["hierarchy"], choices = [
				(eDVBFrontendParametersTerrestrial.Hierarchy_None, _("None")),
				(eDVBFrontendParametersTerrestrial.Hierarchy_1, "1"),
				(eDVBFrontendParametersTerrestrial.Hierarchy_2, "2"),
				(eDVBFrontendParametersTerrestrial.Hierarchy_4, "4"),
				(eDVBFrontendParametersTerrestrial.Hierarchy_Auto, _("Auto"))])
			self.scan_ter.system = ConfigSelection(default = defaultTer["system"], choices = [
				(eDVBFrontendParametersTerrestrial.System_DVB_T, _("DVB-T")),
				(eDVBFrontendParametersTerrestrial.System_DVB_T2, _("DVB-T2"))])
			self.scan_ter.plp_id = ConfigInteger(default = defaultTer["plp_id"], limits = (0, 255))

			if frontendData is not None and ttype == "DVB-S" and self.predefinedTranspondersList(defaultSat["orbpos"]) != None:
				defaultSatSearchType = "predefined_transponder"
			else:
				defaultSatSearchType = "single_transponder"

			self.scan_type = ConfigSelection(default = defaultSatSearchType, choices = [("single_transponder", _("User defined transponder")), ("predefined_transponder", _("Predefined transponder")), ("single_satellite", _("Single satellite")), ("multisat", _("Multisat")), ("multisat_yes", _("Multisat all select"))])
			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_input_as = ConfigSelection(default = "channel", choices = [("frequency", _("Frequency")), ("channel", _("Channel"))])
			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)

			self.scan_scansat = {}
			for sat in nimmanager.satList:
				#print sat[1]
				self.scan_scansat[sat[0]] = ConfigYesNo(default = False)

			self.scan_satselection = []
			for slot in nimmanager.nim_slots:
				if slot.isCompatible("DVB-S"):
					self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot]))
				else:
					self.scan_satselection.append(None)

			return True
Exemple #11
0
class Satfinder(ScanSetup, ServiceScan):
    def __init__(self, session):
        self.initcomplete = False
        service = session and session.nav.getCurrentService()
        feinfo = service and service.frontendInfo()
        self.frontendData = feinfo and feinfo.getAll(True)
        del feinfo
        del service

        self.preDefTransponders = None
        self.TerrestrialTransponders = None
        self.CableTransponders = None
        self.typeOfTuningEntry = None
        self.systemEntry = None
        self.systemEntryATSC = None
        self.satfinderTunerEntry = None
        self.satEntry = None
        self.typeOfInputEntry = None
        self.frequencyEntry = None
        self.polarizationEntry = None
        self.symbolrateEntry = None
        self.inversionEntry = None
        self.rolloffEntry = None
        self.pilotEntry = None
        self.modulationEntry = None
        self.fecEntry = None
        self.transponder = None
        self.DVB_TypeEntry = None
        self.systemEntryTerr = None

        ScanSetup.__init__(self, session)
        self.setTitle(_("Signal Finder"))
        self["introduction"].setText(_("Press OK to scan"))
        self["Frontend"] = FrontendStatus(
            frontend_source=lambda: self.frontend, update_interval=100)

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions"], {
                "save": self.keyGoScan,
                "ok": self.keyGoScan,
                "cancel": self.keyCancel,
            }, -3)

        self.initcomplete = True
        self.session.postScanService = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        self.onClose.append(self.__onClose)
        self.onShow.append(self.prepareFrontend)

    def openFrontend(self):
        res_mgr = eDVBResourceManager.getInstance()
        if res_mgr:
            self.raw_channel = res_mgr.allocateRawChannel(self.feid)
            if self.raw_channel:
                self.frontend = self.raw_channel.getFrontend()
                if self.frontend:
                    return True
        return False

    def prepareFrontend(self):
        self.frontend = None
        if not self.openFrontend():
            self.session.nav.stopService()
            if not self.openFrontend():
                if self.session.pipshown:
                    from Screens.InfoBar import InfoBar
                    InfoBar.instance and hasattr(
                        InfoBar.instance,
                        "showPiP") and InfoBar.instance.showPiP()
                    if not self.openFrontend():
                        self.frontend = None  # in normal case this should not happen
        self.tuner = Tuner(self.frontend)
        if nimmanager.nim_slots[int(
                self.satfinder_scan_nims.value)].isCompatible("DVB-S"):
            self.updatePreDefTransponders()
        self.createSetup()
        self.retune(None)

    def __onClose(self):
        self.session.nav.playService(self.session.postScanService)

    def newConfig(self):
        cur = self["config"].getCurrent()
        if cur in (self.typeOfTuningEntry, self.systemEntry,
                   self.typeOfInputEntry, self.systemEntryATSC,
                   self.DVB_TypeEntry, self.systemEntryTerr):
            self.createSetup()
        elif cur == self.satfinderTunerEntry:
            self.preDefTransponders = None
            self.TerrestrialTransponders = None
            self.CableTransponders = None
            self.feid = int(self.satfinder_scan_nims.value)
            self.createSetup()
            self.prepareFrontend()
            if self.frontend is None:
                msg = _("Tuner not available.")
                if self.session.nav.RecordTimer.isRecording():
                    msg += _("\nRecording in progress.")
                self.session.open(MessageBox, msg, MessageBox.TYPE_ERROR)
        else:
            if cur == self.satEntry:
                self.preDefTransponders = None
            self.createSetup()
        if cur not in (self.systemEntry, self.satfinderTunerEntry,
                       self.frequencyEntry, self.polarizationEntry,
                       self.symbolrateEntry, self.inversionEntry,
                       self.rolloffEntry, self.fecEntry, self.pilotEntry,
                       self.modulationEntry, self.systemEntryATSC):
            self.retune(None)

    def createSetup(self):
        self.list = []
        self.satfinderTunerEntry = getConfigListEntry(_("Tuner"),
                                                      self.satfinder_scan_nims)
        self.list.append(self.satfinderTunerEntry)
        if nimmanager.nim_slots[int(
                self.satfinder_scan_nims.value)].isCompatible("DVB-S"):
            self.tuning_sat = self.scan_satselection[self.getSelectedSatIndex(
                self.feid)]
            if self.tuning_sat.value:
                self.satEntry = getConfigListEntry(_('Satellite'),
                                                   self.tuning_sat)
                self.list.append(self.satEntry)
                self.typeOfTuningEntry = getConfigListEntry(
                    _('Tune'), self.tuning_type)
                if len(
                        nimmanager.getTransponders(int(self.tuning_sat.value))
                ) < 1:  # Only offer 'predefined transponder' if some transponders exist
                    self.tuning_type.value = "single_transponder"
                else:
                    self.list.append(self.typeOfTuningEntry)

                nim = nimmanager.nim_slots[self.feid]

                if self.tuning_type.value == "single_transponder":
                    if nim.isCompatible("DVB-S2"):
                        self.systemEntry = getConfigListEntry(
                            _('System'), self.scan_sat.system)
                        self.list.append(self.systemEntry)
                    else:
                        # downgrade to dvb-s, in case a -s2 config was active
                        self.scan_sat.system.value = eDVBFrontendParametersSatellite.System_DVB_S
                    self.frequencyEntry = getConfigListEntry(
                        _('Frequency'), self.scan_sat.frequency)
                    self.list.append(self.frequencyEntry)
                    self.polarizationEntry = getConfigListEntry(
                        _('Polarization'), self.scan_sat.polarization)
                    self.list.append(self.polarizationEntry)
                    self.symbolrateEntry = (getConfigListEntry(
                        _('Symbol rate'), self.scan_sat.symbolrate))
                    self.list.append(self.symbolrateEntry)
                    self.inversionEntry = getConfigListEntry(
                        _('Inversion'), self.scan_sat.inversion)
                    self.list.append(self.inversionEntry)

                    if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
                        self.fecEntry = getConfigListEntry(
                            _("FEC"), self.scan_sat.fec)
                        self.list.append(self.fecEntry)
                    elif self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
                        self.fecEntry = getConfigListEntry(
                            _("FEC"), self.scan_sat.fec_s2)
                        self.list.append(self.fecEntry)
                        self.modulationEntry = getConfigListEntry(
                            _('Modulation'), self.scan_sat.modulation)
                        self.list.append(self.modulationEntry)
                        self.rolloffEntry = getConfigListEntry(
                            _('Roll-off'), self.scan_sat.rolloff)
                        self.list.append(self.rolloffEntry)
                        self.pilotEntry = getConfigListEntry(
                            _('Pilot'), self.scan_sat.pilot)
                        self.list.append(self.pilotEntry)
                        if nim.isMultistream():
                            self.list.append(
                                getConfigListEntry(_('Input Stream ID'),
                                                   self.scan_sat.is_id))
                            self.list.append(
                                getConfigListEntry(_('PLS Mode'),
                                                   self.scan_sat.pls_mode))
                            self.list.append(
                                getConfigListEntry(_('PLS Code'),
                                                   self.scan_sat.pls_code))
                elif self.tuning_type.value == "predefined_transponder":
                    if self.preDefTransponders is None:
                        self.updatePreDefTransponders()
                    self.list.append(
                        getConfigListEntry(_("Transponder"),
                                           self.preDefTransponders))
        elif nimmanager.nim_slots[int(
                self.satfinder_scan_nims.value)].isCompatible("DVB-C"):
            self.typeOfTuningEntry = getConfigListEntry(
                _('Tune'), self.tuning_type)
            if config.Nims[self.feid].cable.scan_type.value != "provider" or len(
                    nimmanager.getTranspondersCable(
                        int(self.satfinder_scan_nims.value))
            ) < 1:  # only show 'predefined transponder' if in provider mode and transponders exist
                self.tuning_type.value = "single_transponder"
            else:
                self.list.append(self.typeOfTuningEntry)
            if self.tuning_type.value == "single_transponder":
                self.list.append(
                    getConfigListEntry(_("Frequency"),
                                       self.scan_cab.frequency))
                self.list.append(
                    getConfigListEntry(_("Inversion"),
                                       self.scan_cab.inversion))
                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))
            elif self.tuning_type.value == "predefined_transponder":
                self.scan_nims.value = self.satfinder_scan_nims.value
                if self.CableTransponders is None:
                    self.predefinedCabTranspondersList()
                self.list.append(
                    getConfigListEntry(_('Transponder'),
                                       self.CableTransponders))
        elif nimmanager.nim_slots[int(
                self.satfinder_scan_nims.value)].isCompatible("DVB-T"):
            self.typeOfTuningEntry = getConfigListEntry(
                _('Tune'), self.tuning_type)
            region = nimmanager.getTerrestrialDescription(
                int(self.satfinder_scan_nims.value))
            if len(
                    nimmanager.getTranspondersTerrestrial(region)
            ) < 1:  # Only offer 'predefined transponder' if some transponders exist
                self.tuning_type.value = "single_transponder"
            else:
                self.list.append(self.typeOfTuningEntry)
            if self.tuning_type.value == "single_transponder":
                if nimmanager.nim_slots[int(
                        self.satfinder_scan_nims.value)].isCompatible(
                            "DVB-T2"):
                    self.systemEntryTerr = getConfigListEntry(
                        _('System'), self.scan_ter.system)
                    self.list.append(self.systemEntryTerr)
                else:
                    self.scan_ter.system.value = eDVBFrontendParametersTerrestrial.System_DVB_T
                self.typeOfInputEntry = getConfigListEntry(
                    _("Use frequency or channel"), self.scan_input_as)
                if self.ter_channel_input:
                    self.list.append(self.typeOfInputEntry)
                else:
                    self.scan_input_as.value = self.scan_input_as.choices[0]
                if self.ter_channel_input and self.scan_input_as.value == "channel":
                    channel = getChannelNumber(
                        self.scan_ter.frequency.floatint * 1000,
                        self.ter_tnumber)
                    if channel:
                        self.scan_ter.channel.removeNotifier(
                            self.retuneTriggeredByConfigElement)
                        self.scan_ter.channel.value = int(
                            channel.replace("+", "").replace("-", ""))
                    self.list.append(
                        getConfigListEntry(_("Channel"),
                                           self.scan_ter.channel))
                else:
                    prev_val = self.scan_ter.frequency.floatint
                    self.scan_ter.frequency.floatint = channel2frequency(
                        self.scan_ter.channel.value, self.ter_tnumber) / 1000
                    if self.scan_ter.frequency.floatint == 474000:
                        self.scan_ter.frequency.floatint = prev_val
                    self.list.append(
                        getConfigListEntry(_("Frequency"),
                                           self.scan_ter.frequency))
                self.list.append(
                    getConfigListEntry(_("Inversion"),
                                       self.scan_ter.inversion))
                self.list.append(
                    getConfigListEntry(_("Bandwidth"),
                                       self.scan_ter.bandwidth))
                self.list.append(
                    getConfigListEntry(_("Code rate HP"),
                                       self.scan_ter.fechigh))
                self.list.append(
                    getConfigListEntry(_("Code rate LP"),
                                       self.scan_ter.feclow))
                self.list.append(
                    getConfigListEntry(_("Modulation"),
                                       self.scan_ter.modulation))
                self.list.append(
                    getConfigListEntry(_("Transmission mode"),
                                       self.scan_ter.transmission))
                self.list.append(
                    getConfigListEntry(_("Guard interval"),
                                       self.scan_ter.guard))
                self.list.append(
                    getConfigListEntry(_("Hierarchy info"),
                                       self.scan_ter.hierarchy))
                if self.scan_ter.system.value == eDVBFrontendParametersTerrestrial.System_DVB_T2:
                    self.list.append(
                        getConfigListEntry(_('PLP ID'), self.scan_ter.plp_id))
            elif self.tuning_type.value == "predefined_transponder":
                self.scan_nims.value = self.satfinder_scan_nims.value
                if self.TerrestrialTransponders is None:
                    self.predefinedTerrTranspondersList()
                self.list.append(
                    getConfigListEntry(_('Transponder'),
                                       self.TerrestrialTransponders))
        elif nimmanager.nim_slots[int(
                self.satfinder_scan_nims.value)].isCompatible("ATSC"):
            self.typeOfTuningEntry = getConfigListEntry(
                _('Tune'), self.tuning_type)
            if len(
                    nimmanager.getTranspondersATSC(
                        int(self.satfinder_scan_nims.value))
            ) < 1:  # only show 'predefined transponder' if transponders exist
                self.tuning_type.value = "single_transponder"
            else:
                self.list.append(self.typeOfTuningEntry)
            if self.tuning_type.value == "single_transponder":
                self.systemEntryATSC = getConfigListEntry(
                    _("System"), self.scan_ats.system)
                self.list.append(self.systemEntryATSC)
                self.list.append(
                    getConfigListEntry(_("Frequency"),
                                       self.scan_ats.frequency))
                self.list.append(
                    getConfigListEntry(_("Inversion"),
                                       self.scan_ats.inversion))
                self.list.append(
                    getConfigListEntry(_("Modulation"),
                                       self.scan_ats.modulation))
            elif self.tuning_type.value == "predefined_transponder":
                #FIXME add region
                self.scan_nims.value = self.satfinder_scan_nims.value
                self.predefinedATSCTranspondersList()
                self.list.append(
                    getConfigListEntry(_('Transponder'),
                                       self.ATSCTransponders))
        self["config"].list = self.list
        self["config"].l.setList(self.list)

    def createConfig(self, foo):
        self.tuning_type = ConfigSelection(
            default="predefined_transponder",
            choices=[("single_transponder", _("User defined transponder")),
                     ("predefined_transponder", _("Predefined transponder"))])
        self.orbital_position = 192
        if self.frontendData and 'orbital_position' in self.frontendData:
            self.orbital_position = self.frontendData['orbital_position']
        ScanSetup.createConfig(self, self.frontendData)

        for x in (self.scan_sat.frequency, self.scan_sat.inversion,
                  self.scan_sat.symbolrate, self.scan_sat.polarization,
                  self.scan_sat.fec, self.scan_sat.pilot, self.scan_sat.fec_s2,
                  self.scan_sat.fec, self.scan_sat.modulation,
                  self.scan_sat.rolloff, self.scan_sat.system,
                  self.scan_sat.is_id, self.scan_sat.pls_mode,
                  self.scan_sat.pls_code, self.scan_ter.channel,
                  self.scan_ter.frequency, self.scan_ter.inversion,
                  self.scan_ter.bandwidth, self.scan_ter.fechigh,
                  self.scan_ter.feclow, self.scan_ter.modulation,
                  self.scan_ter.transmission, self.scan_ter.guard,
                  self.scan_ter.hierarchy, self.scan_ter.plp_id,
                  self.scan_cab.frequency, self.scan_cab.inversion,
                  self.scan_cab.symbolrate, self.scan_cab.modulation,
                  self.scan_cab.fec, self.scan_ats.frequency,
                  self.scan_ats.modulation, self.scan_ats.inversion,
                  self.scan_ats.system):
            x.addNotifier(self.retune, initial_call=False)

        satfinder_nim_list = []
        for n in nimmanager.nim_slots:
            if not any(
                [n.isCompatible(x)
                 for x in "DVB-S", "DVB-T", "DVB-C", "ATSC"]):
                continue
            if n.config_mode in ("loopthrough_internal",
                                 "loopthrough_external", "satposdepends",
                                 "nothing"):
                continue
            if n.isCompatible("DVB-S") and n.config_mode == "advanced" and len(
                    nimmanager.getSatListForNim(n.slot)) < 1:
                continue
            satfinder_nim_list.append(
                (str(n.slot), n.friendly_full_description))
        self.satfinder_scan_nims = ConfigSelection(choices=satfinder_nim_list)
        if self.frontendData is not None and len(
                satfinder_nim_list
        ) > 0:  # open the plugin with the currently active NIM as default
            self.satfinder_scan_nims.setValue(
                str(
                    self.frontendData.get("tuner_number",
                                          satfinder_nim_list[0][0])))

        self.feid = int(self.satfinder_scan_nims.value)

        self.satList = []
        self.scan_satselection = []
        for slot in nimmanager.nim_slots:
            if slot.isCompatible("DVB-S"):
                self.satList.append(nimmanager.getSatListForNim(slot.slot))
                self.scan_satselection.append(
                    getConfigSatlist(self.orbital_position,
                                     self.satList[slot.slot]))
            else:
                self.satList.append(None)

        if self.frontendData:
            ttype = self.frontendData.get("tuner_type", "UNKNOWN")
            if ttype == "DVB-S" and self.predefinedTranspondersList(
                    self.getSelectedSatIndex(self.feid)) is None and len(
                        nimmanager.getTransponders(
                            self.getSelectedSatIndex(self.feid))) > 0:
                self.tuning_type.value = "single_transponder"
            elif ttype == "DVB-T" and self.predefinedTerrTranspondersList(
            ) is None and len(
                    nimmanager.getTranspondersTerrestrial(
                        nimmanager.getTerrestrialDescription(self.feid))) > 0:
                self.tuning_type.value = "single_transponder"
            elif ttype == "DVB-C" and self.predefinedCabTranspondersList(
            ) is None and len(nimmanager.getTranspondersCable(self.feid)) > 0:
                self.tuning_type.value = "single_transponder"
            elif ttype == "ATSC" and self.predefinedATSCTranspondersList(
            ) is None and len(nimmanager.getTranspondersATSC(self.feid)) > 0:
                self.tuning_type.value = "single_transponder"
Exemple #12
0
	def createConfig(self):
		self.feinfo = None
		frontendData = None
		defaultSat = {
			"orbpos": 192,
			"system": eDVBFrontendParametersSatellite.System_DVB_S,
			"frequency": 11836,
			"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
			"symbolrate": 27500,
			"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
			"fec": eDVBFrontendParametersSatellite.FEC_Auto,
			"fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
			"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK
		}

		self.service = self.session.nav.getCurrentService()
		if self.service is not None:
			self.feinfo = self.service.frontendInfo()
			frontendData = self.feinfo and self.feinfo.getAll(True)
		if frontendData is not None:
			ttype = frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S":
				defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
				defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
				defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
				defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
				defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
				if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
					defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
					defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
				else:
					defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
				defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
				defaultSat["orbpos"] = frontendData.get("orbital_position", 0)
		del self.feinfo
		del self.service
		del frontendData

		self.scan_sat = ConfigSubsection()
		self.scan_networkScan = ConfigYesNo(default = False)

		#ConfigYesNo(default = True)
		self.blindscan_start_frequency = ConfigInteger(default = 10700, limits = (1, 99999))
		self.blindscan_stop_frequency = ConfigInteger(default = 12750, limits = (1, 99999))
		self.blindscan_start_symbol = ConfigInteger(default = 2, limits = (1, 99))
		self.blindscan_stop_symbol = ConfigInteger(default = 45, limits = (1, 99))
		self.scan_clearallservices = ConfigYesNo(default = False)
		self.scan_onlyfree = ConfigYesNo(default = False)
		self.dont_scan_known_tps = ConfigYesNo(default = False)
		self.filter_off_adjacent_satellites = ConfigSelection(default = 0, choices = [
			(0, _("no")),
			(1, _("up to 1 degree")),
			(2, _("up to 2 degrees")),
			(3, _("up to 3 degrees"))])
		self.search_type = ConfigSelection(default = 0, choices = [
			(0, _("scan for channels")),
			(1, _("save to XML file"))])


		# collect all nims which are *not* set to "nothing"
		nim_list = []
		for n in nimmanager.nim_slots:
			if n.config_mode == "nothing":
				continue
			if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			if n.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.value))
				if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			if n.isCompatible("DVB-S"):
				nim_list.append((str(n.slot), n.friendly_full_description))
		self.scan_nims = ConfigSelection(choices = nim_list)

		# sat
		self.scan_sat.frequency = ConfigInteger(default = defaultSat["frequency"], limits = (1, 99999))
		self.scan_sat.polarization = ConfigSelection(default = eDVBFrontendParametersSatellite.Polarisation_CircularRight + 1, choices = [
			(eDVBFrontendParametersSatellite.Polarisation_CircularRight + 1, _("vertical and horizontal")),
			(eDVBFrontendParametersSatellite.Polarisation_Vertical, _("vertical")),
			(eDVBFrontendParametersSatellite.Polarisation_Horizontal, _("horizontal")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularRight + 2, _("circular right and circular left")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularRight, _("circular right")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularLeft, _("circular left"))])
		self.scan_scansat = {}
		for sat in nimmanager.satList:
			self.scan_scansat[sat[0]] = ConfigYesNo(default = False)

		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot]))
		return True
Exemple #13
0
    def createConfig(self, frontendData):
        defaultSat = {
            "orbpos": 192,
            "system": eDVBFrontendParametersSatellite.System_DVB_S,
            "frequency": 11836,
            "inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
            "symbolrate": 27500,
            "polarization":
            eDVBFrontendParametersSatellite.Polarisation_Horizontal,
            "fec": eDVBFrontendParametersSatellite.FEC_Auto,
            "fec_s2_8psk": eDVBFrontendParametersSatellite.FEC_Auto,
            "fec_s2_qpsk": eDVBFrontendParametersSatellite.FEC_Auto,
            "modulation": eDVBFrontendParametersSatellite.Modulation_QPSK
        }

        if frontendData is not None:
            ttype = frontendData.get("tuner_type", "UNKNOWN")
            if ttype == "DVB-S":
                defaultSat["system"] = frontendData.get(
                    "system", eDVBFrontendParametersSatellite.System_DVB_S)
                defaultSat["frequency"] = frontendData.get("frequency",
                                                           0) / 1000
                defaultSat["inversion"] = frontendData.get(
                    "inversion",
                    eDVBFrontendParametersSatellite.Inversion_Unknown)
                defaultSat["symbolrate"] = frontendData.get("symbol_rate",
                                                            0) / 1000
                defaultSat["polarization"] = frontendData.get(
                    "polarization",
                    eDVBFrontendParametersSatellite.Polarisation_Horizontal)
                defaultSat["modulation"] = frontendData.get(
                    "modulation",
                    eDVBFrontendParametersSatellite.Modulation_QPSK)
                if defaultSat[
                        "system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
                    if defaultSat[
                            "modulation"] == eDVBFrontendParametersSatellite.Modulation_QPSK:
                        defaultSat["fec_s2_qpsk"] = frontendData.get(
                            "fec_inner",
                            eDVBFrontendParametersSatellite.FEC_Auto)
                    else:
                        defaultSat["fec_s2_8psk"] = frontendData.get(
                            "fec_inner",
                            eDVBFrontendParametersSatellite.FEC_Auto)
                    defaultSat["rolloff"] = frontendData.get(
                        "rolloff",
                        eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
                    defaultSat["pilot"] = frontendData.get(
                        "pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
                else:
                    defaultSat["fec"] = frontendData.get(
                        "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                defaultSat["orbpos"] = frontendData.get("orbital_position", 0)

        self.scan_sat = ConfigSubsection()
        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)
        #			self.scan_skipEmpty = ConfigYesNo(default = True)
        #			self.scan_otherSDT = ConfigYesNo(default = False)

        nim_list = []
        # collect all nims which are *not* set to "nothing"
        for n in nimmanager.nim_slots:
            if not n.isCompatible("DVB-S"):
                continue
            if not self.legacy:
                config = n.config.dvbs
            else:
                config = n.config
            config_mode = config.configMode.value
            if config_mode == "nothing":
                continue
            if config_mode == "advanced" and len(
                    nimmanager.getSatListForNim(n.slot)) < 1:
                continue
            if config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(n.slot_id,
                                                 int(config.connectedTo.value))
                if n.type == nimmanager.nim_slots[
                        root_id].type:  # check if connected from a DVB-S to DVB-S2 Nim or vice versa
                    continue
            nim_list.append((str(n.slot), n.friendly_full_description))

        self.scan_nims = ConfigSelection(choices=nim_list)

        self.scan_sat.bs_system = ConfigSelection(
            default=eDVBFrontendParametersSatellite.System_DVB_S2,
            choices=[(eDVBFrontendParametersSatellite.System_DVB_S2,
                      _("DVB-S + DVB-S2")),
                     (eDVBFrontendParametersSatellite.System_DVB_S,
                      _("DVB-S only"))])

        self.scan_sat.bs_accuracy = ConfigSelection(default=2,
                                                    choices=[
                                                        (1, "1"), (2, "2"),
                                                        (3, "3"), (4, "4"),
                                                        (5, "5")
                                                    ])

        self.scan_sat.bs_horizontal = ConfigYesNo(default=True)
        self.scan_sat.bs_vertical = ConfigYesNo(default=True)

        self.scan_scansat = {}
        for sat in nimmanager.satList:
            #print sat[1]
            self.scan_scansat[sat[0]] = ConfigYesNo(default=False)

        sec = secClass.getInstance()

        self.nim_sat_frequency_range = []
        self.nim_sat_band_cutoff_frequency = []
        self.scan_satselection = []
        for slot in nimmanager.nim_slots:
            slot_id = slot.slot
            self.nim_sat_frequency_range.append
            if slot.isCompatible("DVB-S"):
                satlist_for_slot = self.satList[slot_id]
                self.scan_satselection.append(
                    getConfigSatlist(defaultSat["orbpos"], satlist_for_slot))
                sat_freq_range = {}
                sat_band_cutoff = {}
                for sat in satlist_for_slot:
                    orbpos = sat[0]
                    sat_freq_range[orbpos] = sec.getFrequencyRangeList(
                        slot_id, orbpos)
                    sat_band_cutoff[orbpos] = sec.getBandCutOffFrequency(
                        slot_id, orbpos)
                self.nim_sat_frequency_range.append(sat_freq_range)
                self.nim_sat_band_cutoff_frequency.append(sat_band_cutoff)
            else:
                self.nim_sat_frequency_range.append(None)
                self.nim_sat_band_cutoff_frequency.append(None)
                self.scan_satselection.append(None)

        return True
Exemple #14
0
class Satfinder(ScanSetup, ServiceScan):
	"""Inherits StaticText [key_red] and [key_green] properties from ScanSetup"""

	def __init__(self, session):
		self.initcomplete = False
		service = session and session.nav.getCurrentService()
		feinfo = service and service.frontendInfo()
		self.frontendData = feinfo and feinfo.getAll(True)
		del feinfo
		del service

		self.typeOfTuningEntry = None
		self.systemEntry = None
		self.systemEntryATSC = None
		self.satfinderTunerEntry = None
		self.satEntry = None
		self.typeOfInputEntry = None
		self.DVB_TypeEntry = None
		self.systemEntryTerr = None
		self.preDefTransponderEntry = None
		self.preDefTransponderCableEntry = None
		self.preDefTransponderTerrEntry = None
		self.preDefTransponderAtscEntry = None
		self.frontend = None
		self.is_id_boolEntry = None
		self.t2mi_plp_id_boolEntry = None
		self.timer = eTimer()
		self.timer.callback.append(self.updateFrontendStatus)

		ScanSetup.__init__(self, session)
		self.setTitle(_("Signal finder"))
		self["Frontend"] = FrontendStatus(frontend_source = lambda : self.frontend, update_interval = 100)

		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"save": self.keyGoScan,
			"ok": self.keyGoScan,
			"cancel": self.keyCancel,
		}, -3)

		self.initcomplete = True
		self.session.postScanService = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		self.session.nav.stopService()
		self.onClose.append(self.__onClose)
		self.onShow.append(self.prepareFrontend)

	def openFrontend(self):
		res_mgr = eDVBResourceManager.getInstance()
		if res_mgr:
			self.raw_channel = res_mgr.allocateRawChannel(self.feid)
			if self.raw_channel:
				self.frontend = self.raw_channel.getFrontend()
				if self.frontend:
					return True
		return False

	def prepareFrontend(self):
		self.frontend = None
		if not self.openFrontend():
			self.session.nav.stopService()
			if not self.openFrontend():
				if self.session.pipshown:
					from Screens.InfoBar import InfoBar
					InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()
					if not self.openFrontend():
						self.frontend = None # in normal case this should not happen
		self.tuner = Tuner(self.frontend)
		self.retune()

	def updateFrontendStatus(self):
		if self.frontend:
			dict = {}
			self.frontend.getFrontendStatus(dict)
			if dict["tuner_state"] == "FAILED" or dict["tuner_state"] == "LOSTLOCK":
				self.retune()
			else:
				self.timer.start(500, True)

	def __onClose(self):
		self.session.nav.playService(self.session.postScanService)

	def newConfig(self):
		cur = self["config"].getCurrent()
		if cur in (
					self.typeOfTuningEntry,
					self.systemEntry,
					self.typeOfInputEntry,
					self.systemEntryATSC,
					self.DVB_TypeEntry,
					self.systemEntryTerr,
					self.satEntry
					):  # update screen and retune
			self.createSetup()
			self.retune()

		elif cur == self.satfinderTunerEntry: # switching tuners, update screen, get frontend, and retune (in prepareFrontend())
			self.feid = int(self.satfinder_scan_nims.value)
			self.createSetup()
			self.prepareFrontend()
			if self.frontend is None:
				msg = _("Tuner not available.")
				if self.session.nav.RecordTimer.isRecording():
					msg += _("\nRecording in progress.")
				self.session.open(MessageBox, msg, MessageBox.TYPE_ERROR)

		elif cur in (self.preDefTransponderEntry, self.preDefTransponderCableEntry, self.preDefTransponderTerrEntry, self.preDefTransponderAtscEntry): # retune only
			self.retune()
		elif cur == self.is_id_boolEntry:
			if self.is_id_boolEntry[1].value:
				self.scan_sat.is_id.value = 0 if self.is_id_memory < 0 else self.is_id_memory
				self.scan_sat.pls_mode.value = self.pls_mode_memory
				self.scan_sat.pls_code.value = self.pls_code_memory
			else:
				self.is_id_memory = self.scan_sat.is_id.value
				self.pls_mode_memory = self.scan_sat.pls_mode.value
				self.pls_code_memory = self.scan_sat.pls_code.value
				self.scan_sat.is_id.value = eDVBFrontendParametersSatellite.No_Stream_Id_Filter
				self.scan_sat.pls_mode.value = eDVBFrontendParametersSatellite.PLS_Gold
				self.scan_sat.pls_code.value = eDVBFrontendParametersSatellite.PLS_Default_Gold_Code
			self.createSetup()
			self.retune()
		elif cur == self.t2mi_plp_id_boolEntry:
			if self.t2mi_plp_id_boolEntry[1].value:
				self.scan_sat.t2mi_plp_id.value = 0 if self.t2mi_plp_id_memory < 0 else self.t2mi_plp_id_memory
				self.scan_sat.t2mi_pid.value = self.t2mi_pid_memory
			else:
				self.t2mi_plp_id_memory = self.scan_sat.t2mi_plp_id.value
				self.t2mi_pid_memory = self.scan_sat.t2mi_pid.value
				self.scan_sat.t2mi_plp_id.value = eDVBFrontendParametersSatellite.No_T2MI_PLP_Id
				self.scan_sat.t2mi_pid.value = eDVBFrontendParametersSatellite.T2MI_Default_Pid
			self.createSetup()
			self.retune()

	def createSetup(self):
		self.list = []
		indent = "- "
		self.satfinderTunerEntry = getConfigListEntry(_("Tuner"), self.satfinder_scan_nims)
		self.list.append(self.satfinderTunerEntry)
		self.DVB_type = self.nim_type_dict[int(self.satfinder_scan_nims.value)]["selection"]
		self.DVB_TypeEntry = getConfigListEntry(_("DVB type"), self.DVB_type) # multitype?
		if len(self.nim_type_dict[int(self.satfinder_scan_nims.value)]["modes"]) > 1:
			 self.list.append(self.DVB_TypeEntry)
		if self.DVB_type.value == "DVB-S":
			self.tuning_sat = self.scan_satselection[self.getSelectedSatIndex(self.feid)]
			self.satEntry = getConfigListEntry(_('Satellite'), self.tuning_sat)
			self.list.append(self.satEntry)
			self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
			if len(nimmanager.getTransponders(int(self.tuning_sat.value), self.feid)) < 1: # Only offer 'predefined transponder' if some transponders exist
				self.tuning_type.value = "single_transponder"
			else:
				self.list.append(self.typeOfTuningEntry)

			nim = nimmanager.nim_slots[self.feid]

			if self.tuning_type.value == "single_transponder":
				if nim.canBeCompatible("DVB-S2"):
					self.systemEntry = getConfigListEntry(_('System'), self.scan_sat.system)
					self.list.append(self.systemEntry)
				else:
					# downgrade to dvb-s, in case a -s2 config was active
					self.scan_sat.system.value = eDVBFrontendParametersSatellite.System_DVB_S
				self.list.append(getConfigListEntry(_('Frequency'), self.scan_sat.frequency))
				self.list.append(getConfigListEntry(_('Polarization'), self.scan_sat.polarization))
				self.list.append(getConfigListEntry(_('Symbol rate'), self.scan_sat.symbolrate))
				self.list.append(getConfigListEntry(_('Inversion'), self.scan_sat.inversion))
				if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
					self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec))
				elif self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
					self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec_s2))
					self.modulationEntry = getConfigListEntry(_('Modulation'), self.scan_sat.modulation)
					self.list.append(self.modulationEntry)
					self.list.append(getConfigListEntry(_('Roll-off'), self.scan_sat.rolloff))
					self.list.append(getConfigListEntry(_('Pilot'), self.scan_sat.pilot))
					if nim.isMultistream():
						self.is_id_boolEntry = getConfigListEntry(_('Transport Stream Type'), self.scan_sat.is_id_bool)
						self.list.append(self.is_id_boolEntry)
						if self.scan_sat.is_id_bool.value:
							self.list.append(getConfigListEntry(indent + _('Input Stream ID'), self.scan_sat.is_id))
							self.list.append(getConfigListEntry(indent + _('PLS Mode'), self.scan_sat.pls_mode))
							self.list.append(getConfigListEntry(indent + _('PLS Code'), self.scan_sat.pls_code))
					else:
						self.scan_sat.is_id.value = eDVBFrontendParametersSatellite.No_Stream_Id_Filter
						self.scan_sat.pls_mode.value = eDVBFrontendParametersSatellite.PLS_Gold
						self.scan_sat.pls_code.value = eDVBFrontendParametersSatellite.PLS_Default_Gold_Code
					if nim.isT2MI():
						self.t2mi_plp_id_boolEntry = getConfigListEntry(_('T2MI PLP'), self.scan_sat.t2mi_plp_id_bool)
						self.list.append(self.t2mi_plp_id_boolEntry)
						if self.scan_sat.t2mi_plp_id_bool.value:
							self.list.append(getConfigListEntry(indent + _('T2MI PLP ID'), self.scan_sat.t2mi_plp_id))
							self.list.append(getConfigListEntry(indent + _('T2MI PID'), self.scan_sat.t2mi_pid))
					else:
						self.scan_sat.t2mi_plp_id.value = eDVBFrontendParametersSatellite.No_T2MI_PLP_Id
						self.scan_sat.t2mi_pid.value = eDVBFrontendParametersSatellite.T2MI_Default_Pid
			elif self.tuning_type.value == "predefined_transponder":
				self.scan_nims.value = self.satfinder_scan_nims.value
				self.updatePreDefTransponders()
				self.preDefTransponderEntry = getConfigListEntry(_("Transponder"), self.preDefTransponders)
				self.list.append(self.preDefTransponderEntry)
		elif self.DVB_type.value == "DVB-C":
			self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
			if config.Nims[self.feid].cable.scan_type.value != "provider" or len(nimmanager.getTranspondersCable(int(self.satfinder_scan_nims.value))) < 1: # only show 'predefined transponder' if in provider mode and transponders exist
				self.tuning_type.value = "single_transponder"
			else:
				self.list.append(self.typeOfTuningEntry)
			if self.tuning_type.value == "single_transponder":
				self.list.append(getConfigListEntry(_("Frequency (kHz)"), self.scan_cab.frequency))
				self.list.append(getConfigListEntry(_("Inversion"), self.scan_cab.inversion))
				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))
			elif self.tuning_type.value == "predefined_transponder":
				self.scan_nims.value = self.satfinder_scan_nims.value
				self.predefinedCabTranspondersList()
				self.preDefTransponderCableEntry = getConfigListEntry(_("Transponder"), self.CableTransponders)
				self.list.append(self.preDefTransponderCableEntry)
		elif self.DVB_type.value == "DVB-T":
			self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
			region = nimmanager.getTerrestrialDescription(int(self.satfinder_scan_nims.value))
			if len(nimmanager.getTranspondersTerrestrial(region)) < 1: # Only offer 'predefined transponder' if some transponders exist
				self.tuning_type.value = "single_transponder"
			else:
				self.list.append(self.typeOfTuningEntry)
			if self.tuning_type.value == "single_transponder":
				if nimmanager.nim_slots[int(self.satfinder_scan_nims.value)].canBeCompatible("DVB-T2"):
					self.systemEntryTerr = getConfigListEntry(_('System'), self.scan_ter.system)
					self.list.append(self.systemEntryTerr)
				else:
					self.scan_ter.system.value = eDVBFrontendParametersTerrestrial.System_DVB_T
				self.typeOfInputEntry = getConfigListEntry(_("Use frequency or channel"), self.scan_input_as)
				if self.ter_channel_input:
					self.list.append(self.typeOfInputEntry)
				else:
					self.scan_input_as.value = self.scan_input_as.choices[0]
				if self.ter_channel_input and self.scan_input_as.value == "channel":
					channel = getChannelNumber(self.scan_ter.frequency.value*1000, self.ter_tnumber)
					if channel:
						self.scan_ter.channel.value = int(channel.replace("+","").replace("-",""))
					self.list.append(getConfigListEntry(_("Channel"), self.scan_ter.channel))
				else:
					prev_val = self.scan_ter.frequency.value
					self.scan_ter.frequency.value = channel2frequency(self.scan_ter.channel.value, self.ter_tnumber)/1000
					if self.scan_ter.frequency.value == 474000:
						self.scan_ter.frequency.value = prev_val
					self.list.append(getConfigListEntry(_("Frequency (kHz)"), self.scan_ter.frequency))
				self.list.append(getConfigListEntry(_("Inversion"), self.scan_ter.inversion))
				self.list.append(getConfigListEntry(_("Bandwidth"), self.scan_ter.bandwidth))
				self.list.append(getConfigListEntry(_("Code rate HP"), self.scan_ter.fechigh))
				self.list.append(getConfigListEntry(_("Code rate LP"), self.scan_ter.feclow))
				self.list.append(getConfigListEntry(_("Modulation"), self.scan_ter.modulation))
				self.list.append(getConfigListEntry(_("Transmission mode"), self.scan_ter.transmission))
				self.list.append(getConfigListEntry(_("Guard interval"), self.scan_ter.guard))
				self.list.append(getConfigListEntry(_("Hierarchy info"), self.scan_ter.hierarchy))
				if self.scan_ter.system.value == eDVBFrontendParametersTerrestrial.System_DVB_T2:
					self.list.append(getConfigListEntry(_('PLP ID'), self.scan_ter.plp_id))
			elif self.tuning_type.value == "predefined_transponder":
				self.scan_nims.value = self.satfinder_scan_nims.value
				self.predefinedTerrTranspondersList()
				self.preDefTransponderTerrEntry = getConfigListEntry(_('Transponder'), self.TerrestrialTransponders)
				self.list.append(self.preDefTransponderTerrEntry)
		elif self.DVB_type.value == "ATSC":
			self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
			if len(nimmanager.getTranspondersATSC(int(self.satfinder_scan_nims.value))) < 1: # only show 'predefined transponder' if transponders exist
				self.tuning_type.value = "single_transponder"
			else:
				self.list.append(self.typeOfTuningEntry)
			if self.tuning_type.value == "single_transponder":
				self.systemEntryATSC = getConfigListEntry(_("System"), self.scan_ats.system)
				self.list.append(self.systemEntryATSC)
				self.list.append(getConfigListEntry(_("Frequency"), self.scan_ats.frequency))
				self.list.append(getConfigListEntry(_("Inversion"), self.scan_ats.inversion))
				self.list.append(getConfigListEntry(_("Modulation"), self.scan_ats.modulation))
			elif self.tuning_type.value == "predefined_transponder":
				#FIXME add region
				self.scan_nims.value = self.satfinder_scan_nims.value
				self.predefinedATSCTranspondersList()
				self.preDefTransponderAtscEntry = getConfigListEntry(_('Transponder'), self.ATSCTransponders)
				self.list.append(self.preDefTransponderAtscEntry)
		self["config"].list = self.list
		self["config"].l.setList(self.list)

	def createConfig(self, foo):
		self.tuning_type = ConfigSelection(default = "predefined_transponder", choices = [("single_transponder", _("User defined transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.orbital_position = 192
		if self.frontendData and 'orbital_position' in self.frontendData:
			self.orbital_position = self.frontendData['orbital_position']
		ScanSetup.createConfig(self, self.frontendData)

		# The following are updated in self.newConfig(). Do not add here.
		# self.scan_sat.system, self.tuning_type, self.scan_input_as, self.scan_ats.system, self.DVB_type, self.scan_ter.system, self.satfinder_scan_nims, self.tuning_sat
		for x in (self.scan_sat.frequency,
			self.scan_sat.inversion, self.scan_sat.symbolrate,
			self.scan_sat.polarization, self.scan_sat.fec, self.scan_sat.pilot,
			self.scan_sat.fec_s2, self.scan_sat.fec, self.scan_sat.modulation,
			self.scan_sat.rolloff,
			self.scan_sat.is_id, self.scan_sat.pls_mode, self.scan_sat.pls_code,
			self.scan_sat.t2mi_plp_id, self.scan_sat.t2mi_pid,
			self.scan_ter.channel, self.scan_ter.frequency, self.scan_ter.inversion,
			self.scan_ter.bandwidth, self.scan_ter.fechigh, self.scan_ter.feclow,
			self.scan_ter.modulation, self.scan_ter.transmission,
			self.scan_ter.guard, self.scan_ter.hierarchy, self.scan_ter.plp_id,
			self.scan_cab.frequency, self.scan_cab.inversion, self.scan_cab.symbolrate,
			self.scan_cab.modulation, self.scan_cab.fec,
			self.scan_ats.frequency, self.scan_ats.modulation, self.scan_ats.inversion):
			x.addNotifier(self.retune, initial_call = False)

		satfinder_nim_list = []
		for n in nimmanager.nim_slots:
			if not any([n.isCompatible(x) for x in "DVB-S", "DVB-T", "DVB-C", "ATSC"]):
				continue
			if n.config_mode  in ("loopthrough", "satposdepends", "nothing"):
				continue
			if n.isCompatible("DVB-S") and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			if n.isCompatible("DVB-S") and n.isFBCTuner() and not n.isFBCRoot():
				continue
			satfinder_nim_list.append((str(n.slot), n.friendly_full_description))
		self.satfinder_scan_nims = ConfigSelection(choices = satfinder_nim_list)
		if self.frontendData is not None and len(satfinder_nim_list) > 0: # open the plugin with the currently active NIM as default
			active_nim = self.frontendData.get("tuner_number", int(satfinder_nim_list[0][0]))
			if not nimmanager.nim_slots[active_nim].isFBCLink():
				self.satfinder_scan_nims.setValue(str(active_nim))

		self.feid = int(self.satfinder_scan_nims.value)

		self.satList = []
		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.satList.append(nimmanager.getSatListForNim(slot.slot))
				self.scan_satselection.append(getConfigSatlist(self.orbital_position, self.satList[slot.slot]))
			else:
				self.satList.append(None)

		if self.frontendData:
			ttype = self.frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S" and self.predefinedTranspondersList(self.getSelectedSatIndex(self.feid)) is None and len(nimmanager.getTransponders(self.getSelectedSatIndex(self.feid), self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-T" and self.predefinedTerrTranspondersList() is None and len(nimmanager.getTranspondersTerrestrial(nimmanager.getTerrestrialDescription(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-C" and self.predefinedCabTranspondersList() is None and len(nimmanager.getTranspondersCable(self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "ATSC" and self.predefinedATSCTranspondersList() is None and len(nimmanager.getTranspondersATSC(self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
Exemple #15
0
	def createConfig(self, frontendData):
		self.tunerEntry = None
		self.satelliteEntry = None
		self.searchtypeEntry = None
		self.onlyUnknownTpsEntry = None

		defaultSat = {
			"orbpos": 192,
			"system": eDVBFrontendParametersSatellite.System_DVB_S,
			"frequency": 11836,
			"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
			"symbolrate": 27500,
			"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
			"fec": eDVBFrontendParametersSatellite.FEC_Auto,
			"fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
			"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK}

		if frontendData is not None:
			ttype = frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S":
				defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
				defaultSat["frequency"] = frontendData.get("frequency", 0) // 1000
				defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
				defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) // 1000
				defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
				defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
				if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
					defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
					defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
				else:
					defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
				defaultSat["orbpos"] = frontendData.get("orbital_position", 0)

		self.dmmBlindscan = ConfigSubsection()
		self.dmmBlindscan.scan_clearallservices = ConfigSelection(default="no", choices=[("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))])
		self.dmmBlindscan.scan_onlyfree = ConfigYesNo(default=False)

		self.sr_limits = (1, 60)
		sr_defaults = (2, 45)
		self.dmmBlindscan.sr_start = ConfigInteger(default=sr_defaults[0], limits=(self.sr_limits[0], self.sr_limits[1] - 1))
		self.dmmBlindscan.sr_stop = ConfigInteger(default=sr_defaults[1], limits=(self.sr_limits[0] + 1, self.sr_limits[1]))

		self.dmmBlindscan.dont_scan_known_tps = ConfigYesNo(default=False)
		self.dmmBlindscan.disable_sync_with_known_tps = ConfigYesNo(default=False)
		self.dmmBlindscan.disable_remove_duplicate_tps = ConfigYesNo(default=False)
		self.dmmBlindscan.filter_off_adjacent_satellites = ConfigSelection(default="1", choices=[
			("0", _("no")),
			("1", _("up to 1 degree")),
			("2", _("up to 2 degrees")),
			("3", _("up to 3 degrees"))])

		nim_list = []
		for n in nimmanager.nim_slots:
			if hasattr(n, 'isFBCLink') and n.isFBCLink():
				continue
			if n.isCompatible("DVB-S"):
				if not self.legacy:
					nimconfig = n.config.dvbs
				else:
					nimconfig = n.config
				config_mode = nimconfig.configMode.value
				if config_mode == "nothing":
					continue
			if n.isCompatible("DVB-S") and len(nimmanager.getSatListForNim(n.slot)) < 1:
				if config_mode in ("advanced", "simple"):
					if not self.legacy:
						config.Nims[n.slot].dvbs.configMode.value = "nothing"
						config.Nims[n.slot].dvbs.configMode.save()
					else:
						config.Nims[n.slot].configMode.value = "nothing"
						config.Nims[n.slot].configMode.save()
					continue
			if n.isCompatible("DVB-S") and config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(n.slot_id, int(nimconfig.connectedTo.value))
				if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			if n.isCompatible("DVB-S"):
				nim_list.append((str(n.slot), n.friendly_full_description))
		self.scan_nims = ConfigSelection(choices=nim_list)

		# this is not currently a user option
		self.dmmBlindscan.system = ConfigSelection(default=eDVBFrontendParametersSatellite.System_DVB_S2,
			choices=[(eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S + DVB-S2")),
				(eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S only"))])

		self.dmmBlindscan.accuracy = ConfigSelection(default=2, choices=[(1, "1"), (2, "2"), (3, "3"), (4, "4"), (5, "5")])
#		self.dmmBlindscan.multiple_scan = ConfigSelection(default = 1, choices = [(1, "only scan once"), (2, "scan twice"), (3, "scan three times")])
		self.search_type = ConfigSelection(default="services", choices=[
			("services", _("scan for channels")),
			("xml", _("save to XML file"))])

		self.dmmBlindscan.polarization = ConfigSelection(default="vertical and horizontal", choices=[
			("vertical and horizontal", _("vertical and horizontal")),
			("vertical", _("vertical")),
			("horizontal", _("horizontal"))])
		self.nim_sat_frequency_range = []
		self.nim_sat_band_cutoff_frequency = []
		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			slot_id = slot.slot
			if slot.isCompatible("DVB-S"):
				satlist_for_slot = self.satList[slot_id]
				self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], satlist_for_slot))
				sat_freq_range = {(10700000, 12750000)}
				sat_band_cutoff = {11700000}
				for sat in satlist_for_slot:
					orbpos = sat[0]
				self.nim_sat_frequency_range.append(sat_freq_range)
				self.nim_sat_band_cutoff_frequency.append(sat_band_cutoff)
			else:
				self.nim_sat_frequency_range.append(None)
				self.nim_sat_band_cutoff_frequency.append(None)
				self.scan_satselection.append(None)

		self.Ku_band_freq_limits = {"low": 10700, "high": 12750}
		self.universal_lo_freq = {"low": 9750, "high": 10600}
		self.c_band_freq_limits = {"low": 3000, "high": 4200, "default_low": 3400, "default_high": 4200}
		self.tunerIfLimits = {"low": 950, "high": 2150}
		self.circular_lnb_lo_freq = 10750
	def createConfig(self, frontendData):
		defaultSat = {
			"orbpos": 192,
			"system": eDVBFrontendParametersSatellite.System_DVB_S,
			"frequency": 11836,
			"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
			"symbolrate": 27500,
			"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
			"fec": eDVBFrontendParametersSatellite.FEC_Auto,
			"fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
			"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK }

		if frontendData is not None:
			ttype = frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S":
				defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
				defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
				defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
				defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
				defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
				defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
				if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
					defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
					defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
				else:
					defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
				defaultSat["orbpos"] = frontendData.get("orbital_position", 0)

		self.scan_sat = ConfigSubsection()
		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 = []
		for n in nimmanager.nim_slots:
			if hasattr(n, 'isFBCLink') and n.isFBCLink():
				continue
			if n.config_mode == "nothing":
				continue
			if n.isCompatible("DVB-S") and len(nimmanager.getSatListForNim(n.slot)) < 1:
				if n.config_mode in ("advanced", "simple"):
					config.Nims[n.slot].configMode.value = "nothing"
					config.Nims[n.slot].configMode.save()
				continue
			if n.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.value))
				if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			if n.isCompatible("DVB-S"):
				nim_list.append((str(n.slot), n.friendly_full_description))
		self.scan_nims = ConfigSelection(choices = nim_list)

		self.scan_sat.bs_system = ConfigSelection(default = eDVBFrontendParametersSatellite.System_DVB_S2, 
			choices = [ (eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S + DVB-S2")),
				(eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S only"))])

		self.scan_sat.bs_accuracy = ConfigSelection(default = 2, choices = [ (1, "1"), (2, "2"), (3, "3"), (4, "4"), (5, "5")])
		self.search_type = ConfigSelection(default = 0, choices = [
			(0, _("scan for channels")),
			(1, _("save to XML file"))])

		self.scan_sat.bs_horizontal = ConfigYesNo(default = True)
		self.scan_sat.bs_vertical = ConfigYesNo(default = True)
		self.nim_sat_frequency_range = []
		self.nim_sat_band_cutoff_frequency = []
		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			slot_id = slot.slot
			if slot.isCompatible("DVB-S"):
				satlist_for_slot = self.satList[slot_id]
				self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], satlist_for_slot))
				sat_freq_range = {(10700000, 12750000) }
				sat_band_cutoff = {11700000 }
				for sat in satlist_for_slot:
					orbpos = sat[0]
				self.nim_sat_frequency_range.append(sat_freq_range)
				self.nim_sat_band_cutoff_frequency.append(sat_band_cutoff)
			else:
				self.nim_sat_frequency_range.append(None)
				self.nim_sat_band_cutoff_frequency.append(None)
				self.scan_satselection.append(None)
		return True
	def __init__(self, session):
		Screen.__init__(self, session)

		self.logfile			= open("/tmp/satscan.log", "w+", 0)
		self.executable			= None
		self.vuplus_quirks		= False

		for tryname in ("avl_azbox_blindscan", "avl_xtrend_blindscan", "vuplus_blindscan"):
			print "try:", tryname

			try:
				subprocess.check_call((tryname))
				self.executable = tryname
				break
			except OSError:
				print tryname + ": OSError"
				None
			except subprocess.CalledProcessError:
				# vuplus_blindscan returns -1 when called with no arguments
				print tryname + ": CalledProcessError"
				self.executable = tryname
				break

		print "executable = ", self.executable

		if self.executable == "vuplus_blindscan":
			self.vuplus_quirks = True

		self.scan_circular		= ConfigYesNo(default = False)
		self.scan_transponders	= ConfigYesNo(default = False)
		self.scan_clearservices	= ConfigYesNo(default = False)
		self.scan_fta			= ConfigYesNo(default = False)

		self.current_service		= self.session.nav.getCurrentlyPlayingServiceReference()
		self.all_pos_per_dvbs_nim	= []

		nimmanager.enumerateNIMs()

		for nim_slot in nimmanager.nim_slots:
			if nim_slot.isCompatible("DVB-S"):
				self.all_pos_per_dvbs_nim.append(nimmanager.getSatListForNim(nim_slot.slot))
			else:
				self.all_pos_per_dvbs_nim.append(None)

		#print "*** all_pos_per_dvbs_nim: ", self.all_pos_per_dvbs_nim

		self.current_orb_pos = 192
		current_service = self.session.nav.getCurrentService()

		if current_service is not None:
			feinfo = current_service.frontendInfo()
			if feinfo is not None:
				fedata = feinfo.getAll(True)
				if fedata.get("tuner_type", "UNKNOWN") == "DVB-S":
					self.current_orb_pos = fedata.get("orbital_position", 0);

		selectable_nims = []
		for nim in nimmanager.nim_slots:
			if nim.config_mode == "nothing":
				continue
			if nim.config_mode == "advanced" and len(nimmanager.getSatListForNim(nim.slot)) < 1:
				continue
			if nim.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(nim.slot_id, int(nim.config.connectedTo.value))
				if nim.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			if nim.isCompatible("DVB-S"):
				selectable_nims.append((str(nim.slot), nim.friendly_full_description))

		self.select_nim = ConfigSelection(choices = selectable_nims)

		self.positions_config_list = []
		for nim_slot in nimmanager.nim_slots:
			if nim_slot.isCompatible("DVB-S"):
				self.positions_config_list.append(getConfigSatlist(self.current_orb_pos, self.all_pos_per_dvbs_nim[nim_slot.slot]))

		self.config_list = []
		ConfigListScreen.__init__(self, self.config_list)

		if self.select_nim.value != None and self.select_nim.value != "" :
			self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "ColorActions" ],
			{
				"red":		self.keyCancel,
				"green":	self.keyGo,
				"ok":		self.keyGo,
				"cancel":	self.keyCancel,
			}, -2)

			self["key_red"]		= StaticText(_("Exit"))
			self["key_green"]	= StaticText(_("Start"))

			if self.vuplus_quirks:
				disclaimer = _("WARNING! Blindscan may make the tuner malfunction on a VU+ receiver. A reboot afterwards may be required to return to proper tuner function.\n\n")
			else:
				disclaimer = ""

			self["text"] = Label(disclaimer + _("Press OK to start scanning"))

			self.FillConfigList()
		else:
			self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "ColorActions" ],
			{
				"red": self.keyCancel,
				"green": self.KeyNone,
				"ok": self.KeyNone,
				"cancel": self.keyCancel,
			}, -2)

			self["key_red"]		= StaticText(_("Exit"))
			self["key_green"]	= StaticText(" ")
			self["text"]		= Label(_("Tuner not set up, can't scan"))
	def createConfig(self, frontendData):
		defaultSat = {
			"orbpos": 192,
			"system": eDVBFrontendParametersSatellite.System_DVB_S,
			"frequency": 11836,
			"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
			"symbolrate": 27500,
			"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
			"fec": eDVBFrontendParametersSatellite.FEC_Auto,
			"fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
			"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK }
		defaultCab = {
			"frequency": 466,
			"inversion": eDVBFrontendParametersCable.Inversion_Unknown,
			"modulation": eDVBFrontendParametersCable.Modulation_QAM64,
			"fec": eDVBFrontendParametersCable.FEC_Auto,
			"symbolrate": 6900,
			"system": eDVBFrontendParametersCable.System_DVB_C_ANNEX_A }
		defaultTer = {
			"frequency" : 466000,
			"inversion" : eDVBFrontendParametersTerrestrial.Inversion_Unknown,
			"bandwidth" : 7000000,
			"fechigh" : eDVBFrontendParametersTerrestrial.FEC_Auto,
			"feclow" : eDVBFrontendParametersTerrestrial.FEC_Auto,
			"modulation" : eDVBFrontendParametersTerrestrial.Modulation_Auto,
			"transmission_mode" : eDVBFrontendParametersTerrestrial.TransmissionMode_Auto,
			"guard_interval" : eDVBFrontendParametersTerrestrial.GuardInterval_Auto,
			"hierarchy": eDVBFrontendParametersTerrestrial.Hierarchy_Auto,
			"system": eDVBFrontendParametersTerrestrial.System_DVB_T }

		if frontendData is not None:
			ttype = frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S":
				defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
				defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
				defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
				defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
				defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
				if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
					defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
					defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
				else:
					defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
				defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
				defaultSat["orbpos"] = frontendData.get("orbital_position", 0)
			elif ttype == "DVB-C":
				defaultCab["frequency"] = frontendData.get("frequency", 0) / 1000
				defaultCab["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
				defaultCab["inversion"] = frontendData.get("inversion", eDVBFrontendParametersCable.Inversion_Unknown)
				defaultCab["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersCable.FEC_Auto)
				defaultCab["modulation"] = frontendData.get("modulation", eDVBFrontendParametersCable.Modulation_QAM16)
				defaultTer["system"] = frontendData.get("system", eDVBFrontendParametersCable.System_DVB_C_ANNEX_A)
			elif ttype == "DVB-T":
				defaultTer["frequency"] = frontendData.get("frequency", 0)
				defaultTer["inversion"] = frontendData.get("inversion", eDVBFrontendParametersTerrestrial.Inversion_Unknown)
				defaultTer["bandwidth"] = frontendData.get("bandwidth", 7000000)
				defaultTer["fechigh"] = frontendData.get("code_rate_hp", eDVBFrontendParametersTerrestrial.FEC_Auto)
				defaultTer["feclow"] = frontendData.get("code_rate_lp", eDVBFrontendParametersTerrestrial.FEC_Auto)
				defaultTer["modulation"] = frontendData.get("constellation", eDVBFrontendParametersTerrestrial.Modulation_Auto)
				defaultTer["transmission_mode"] = frontendData.get("transmission_mode", eDVBFrontendParametersTerrestrial.TransmissionMode_Auto)
				defaultTer["guard_interval"] = frontendData.get("guard_interval", eDVBFrontendParametersTerrestrial.GuardInterval_Auto)
				defaultTer["hierarchy"] = frontendData.get("hierarchy_information", eDVBFrontendParametersTerrestrial.Hierarchy_Auto)
				defaultTer["system"] = frontendData.get("system", eDVBFrontendParametersTerrestrial.System_DVB_T)

		self.scan_sat = ConfigSubsection()
		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")), ("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":
				continue
			if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
				continue
			if n.config_mode in ("loopthrough", "satposdepends"):
				root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.getValue()))
				if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
					continue
			nim_list.append((str(n.slot), n.friendly_full_description))

		self.scan_nims = ConfigSelection(choices = nim_list)

		# status
		self.scan_snr = ConfigSlider()
		self.scan_snr.enabled = False
		self.scan_agc = ConfigSlider()
		self.scan_agc.enabled = False
		self.scan_ber = ConfigSlider()
		self.scan_ber.enabled = False

		# sat
		self.scan_sat.system = ConfigSelection(default = defaultSat["system"], choices = [
			(eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S")),
			(eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S2"))])
		self.scan_sat.frequency = ConfigInteger(default = defaultSat["frequency"], limits = (1, 99999))
		self.scan_sat.inversion = ConfigSelection(default = defaultSat["inversion"], choices = [
			(eDVBFrontendParametersSatellite.Inversion_Off, _("Off")),
			(eDVBFrontendParametersSatellite.Inversion_On, _("On")),
			(eDVBFrontendParametersSatellite.Inversion_Unknown, _("Auto"))])
		self.scan_sat.symbolrate = ConfigInteger(default = defaultSat["symbolrate"], limits = (1, 99999))
		self.scan_sat.polarization = ConfigSelection(default = defaultSat["polarization"], choices = [
			(eDVBFrontendParametersSatellite.Polarisation_Horizontal, _("horizontal")),
			(eDVBFrontendParametersSatellite.Polarisation_Vertical, _("vertical")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularLeft, _("circular left")),
			(eDVBFrontendParametersSatellite.Polarisation_CircularRight, _("circular right"))])
		self.scan_sat.fec = ConfigSelection(default = defaultSat["fec"], choices = [
			(eDVBFrontendParametersSatellite.FEC_Auto, _("Auto")),
			(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
			(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
			(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
			(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
			(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
			(eDVBFrontendParametersSatellite.FEC_None, _("None"))])
		self.scan_sat.fec_s2 = ConfigSelection(default = defaultSat["fec_s2"], choices = [
			(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
			(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
			(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
			(eDVBFrontendParametersSatellite.FEC_3_5, "3/5"),
			(eDVBFrontendParametersSatellite.FEC_4_5, "4/5"),
			(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
			(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
			(eDVBFrontendParametersSatellite.FEC_8_9, "8/9"),
			(eDVBFrontendParametersSatellite.FEC_9_10, "9/10")])
		self.scan_sat.modulation = ConfigSelection(default = defaultSat["modulation"], choices = [
			(eDVBFrontendParametersSatellite.Modulation_QPSK, "QPSK"),
			(eDVBFrontendParametersSatellite.Modulation_8PSK, "8PSK")])
		self.scan_sat.rolloff = ConfigSelection(default = defaultSat.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35), choices = [
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_35, "0.35"),
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_25, "0.25"),
			(eDVBFrontendParametersSatellite.RollOff_alpha_0_20, "0.20"),
			(eDVBFrontendParametersSatellite.RollOff_auto, _("Auto"))])
		self.scan_sat.pilot = ConfigSelection(default = defaultSat.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown), choices = [
			(eDVBFrontendParametersSatellite.Pilot_Off, _("Off")),
			(eDVBFrontendParametersSatellite.Pilot_On, _("On")),
			(eDVBFrontendParametersSatellite.Pilot_Unknown, _("Auto"))])

		# cable
		self.scan_cab.frequency = ConfigInteger(default = defaultCab["frequency"], limits = (50, 999))
		self.scan_cab.inversion = ConfigSelection(default = defaultCab["inversion"], choices = [
			(eDVBFrontendParametersCable.Inversion_Off, _("Off")),
			(eDVBFrontendParametersCable.Inversion_On, _("On")),
			(eDVBFrontendParametersCable.Inversion_Unknown, _("Auto"))])
		self.scan_cab.modulation = ConfigSelection(default = defaultCab["modulation"], choices = [
			(eDVBFrontendParametersCable.Modulation_QAM16, "16-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM32, "32-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM64, "64-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM128, "128-QAM"),
			(eDVBFrontendParametersCable.Modulation_QAM256, "256-QAM")])
		self.scan_cab.fec = ConfigSelection(default = defaultCab["fec"], choices = [
			(eDVBFrontendParametersCable.FEC_Auto, _("Auto")),
			(eDVBFrontendParametersCable.FEC_1_2, "1/2"),
			(eDVBFrontendParametersCable.FEC_2_3, "2/3"),
			(eDVBFrontendParametersCable.FEC_3_4, "3/4"),
			(eDVBFrontendParametersCable.FEC_5_6, "5/6"),
			(eDVBFrontendParametersCable.FEC_6_7, "6/7"),
			(eDVBFrontendParametersCable.FEC_7_8, "7/8"),
			(eDVBFrontendParametersCable.FEC_8_9, "8/9"),
			(eDVBFrontendParametersCable.FEC_None, _("None"))])
		self.scan_cab.symbolrate = ConfigInteger(default = defaultCab["symbolrate"], limits = (1, 99999))
		self.scan_cab.system = ConfigSelection(default = defaultCab["system"], choices = [
			(eDVBFrontendParametersCable.System_DVB_C_ANNEX_A, _("DVB-C")),
			(eDVBFrontendParametersCable.System_DVB_C_ANNEX_C, _("DVB-C ANNEX C"))])

		# terrestial
		self.scan_ter.frequency = ConfigInteger(default = 466000, limits = (50000, 999000))
		self.scan_ter.inversion = ConfigSelection(default = defaultTer["inversion"], choices = [
			(eDVBFrontendParametersTerrestrial.Inversion_Off, _("Off")),
			(eDVBFrontendParametersTerrestrial.Inversion_On, _("On")),
			(eDVBFrontendParametersTerrestrial.Inversion_Unknown, _("Auto"))])
		# WORKAROUND: we can't use BW-auto
		self.scan_ter.bandwidth = ConfigSelection(default = defaultTer["bandwidth"], choices = [
			(10000000, "10MHz"),
			(8000000, "8MHz"),
			(7000000, "7MHz"),
			(6000000, "6MHz"),
			(5000000, "5MHz"),
			(1712000, "1.712MHz")
			])
		#, (eDVBFrontendParametersTerrestrial.Bandwidth_Auto, _("Auto"))))
		self.scan_ter.fechigh = ConfigSelection(default = defaultTer["fechigh"], choices = [
			(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
			(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
			(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
			(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
			(eDVBFrontendParametersTerrestrial.FEC_6_7, "6/7"),
			(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
			(eDVBFrontendParametersTerrestrial.FEC_8_9, "8/9"),
			(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
		self.scan_ter.feclow = ConfigSelection(default = defaultTer["feclow"], choices = [
			(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
			(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
			(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
			(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
			(eDVBFrontendParametersTerrestrial.FEC_6_7, "6/7"),
			(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
			(eDVBFrontendParametersTerrestrial.FEC_8_9, "8/9"),
			(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
		self.scan_ter.modulation = ConfigSelection(default = defaultTer["modulation"], choices = [
			(eDVBFrontendParametersTerrestrial.Modulation_QPSK, "QPSK"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM16, "QAM16"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM64, "QAM64"),
			(eDVBFrontendParametersTerrestrial.Modulation_QAM256, "QAM256"),
			(eDVBFrontendParametersTerrestrial.Modulation_Auto, _("Auto"))])
		self.scan_ter.transmission = ConfigSelection(default = defaultTer["transmission_mode"], choices = [
			(eDVBFrontendParametersTerrestrial.TransmissionMode_2k, "2K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_4k, "4K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_8k, "8K"),
			(eDVBFrontendParametersTerrestrial.TransmissionMode_Auto, _("Auto"))])
		self.scan_ter.guard = ConfigSelection(default = defaultTer["guard_interval"], choices = [
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_32, "1/32"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_16, "1/16"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_8, "1/8"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_1_4, "1/4"),
			(eDVBFrontendParametersTerrestrial.GuardInterval_Auto, _("Auto"))])
		self.scan_ter.hierarchy = ConfigSelection(default = defaultTer["hierarchy"], choices = [
			(eDVBFrontendParametersTerrestrial.Hierarchy_None, _("None")),
			(eDVBFrontendParametersTerrestrial.Hierarchy_1, "1"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_2, "2"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_4, "4"),
			(eDVBFrontendParametersTerrestrial.Hierarchy_Auto, _("Auto"))])
		self.scan_ter.system = ConfigSelection(default = defaultTer["system"], choices = [
			(eDVBFrontendParametersTerrestrial.System_DVB_T, _("DVB-T")),
			(eDVBFrontendParametersTerrestrial.System_DVB_T2, _("DVB-T2"))])

		self.scan_scansat = {}
		for sat in nimmanager.satList:
			#print sat[1]
			self.scan_scansat[sat[0]] = ConfigYesNo(default = False)

		self.scan_satselection = []
		for slot in nimmanager.nim_slots:
			if slot.isCompatible("DVB-S"):
				self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot]))
			else:
				self.scan_satselection.append(None)

		return True
Exemple #19
0
    def createConfig(self, frontendData):
        defaultSat = {
            "orbpos": 192,
            "system": eDVBFrontendParametersSatellite.System_DVB_S,
            "frequency": 11836,
            "inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
            "symbolrate": 27500,
            "polarization":
            eDVBFrontendParametersSatellite.Polarisation_Horizontal,
            "fec": eDVBFrontendParametersSatellite.FEC_Auto,
            "fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
            "modulation": eDVBFrontendParametersSatellite.Modulation_QPSK
        }

        if frontendData is not None:
            ttype = frontendData.get("tuner_type", "UNKNOWN")
            if ttype == "DVB-S":
                defaultSat["system"] = frontendData.get(
                    "system", eDVBFrontendParametersSatellite.System_DVB_S)
                defaultSat["frequency"] = frontendData.get("frequency",
                                                           0) / 1000
                defaultSat["inversion"] = frontendData.get(
                    "inversion",
                    eDVBFrontendParametersSatellite.Inversion_Unknown)
                defaultSat["symbolrate"] = frontendData.get("symbol_rate",
                                                            0) / 1000
                defaultSat["polarization"] = frontendData.get(
                    "polarization",
                    eDVBFrontendParametersSatellite.Polarisation_Horizontal)
                defaultSat["modulation"] = frontendData.get(
                    "modulation",
                    eDVBFrontendParametersSatellite.Modulation_QPSK)
                if defaultSat[
                        "system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
                    defaultSat["fec_s2"] = frontendData.get(
                        "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                    defaultSat["rolloff"] = frontendData.get(
                        "rolloff",
                        eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
                    defaultSat["pilot"] = frontendData.get(
                        "pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
                else:
                    defaultSat["fec"] = frontendData.get(
                        "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                defaultSat["orbpos"] = frontendData.get("orbital_position", 0)

        self.scan_sat = ConfigSubsection()
        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 = []
        for n in nimmanager.nim_slots:
            if hasattr(n, 'isFBCLink') and n.isFBCLink():
                continue
            if n.config_mode == "nothing":
                continue
            if n.isCompatible("DVB-S") and len(
                    nimmanager.getSatListForNim(n.slot)) < 1:
                if n.config_mode in ("advanced", "simple"):
                    config.Nims[n.slot].configMode.value = "nothing"
                    config.Nims[n.slot].configMode.save()
                continue
            if n.config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(
                    n.slot_id, int(n.config.connectedTo.value))
                if n.type == nimmanager.nim_slots[
                        root_id].type:  # check if connected from a DVB-S to DVB-S2 Nim or vice versa
                    continue
            if n.isCompatible("DVB-S"):
                nim_list.append((str(n.slot), n.friendly_full_description))
        self.scan_nims = ConfigSelection(choices=nim_list)

        self.scan_sat.bs_system = ConfigSelection(
            default=eDVBFrontendParametersSatellite.System_DVB_S2,
            choices=[(eDVBFrontendParametersSatellite.System_DVB_S2,
                      _("DVB-S + DVB-S2")),
                     (eDVBFrontendParametersSatellite.System_DVB_S,
                      _("DVB-S only"))])

        self.scan_sat.bs_accuracy = ConfigSelection(default=2,
                                                    choices=[
                                                        (1, "1"), (2, "2"),
                                                        (3, "3"), (4, "4"),
                                                        (5, "5")
                                                    ])
        self.search_type = ConfigSelection(default=0,
                                           choices=[
                                               (0, _("scan for channels")),
                                               (1, _("save to XML file"))
                                           ])

        self.scan_sat.bs_horizontal = ConfigYesNo(default=True)
        self.scan_sat.bs_vertical = ConfigYesNo(default=True)
        self.nim_sat_frequency_range = []
        self.nim_sat_band_cutoff_frequency = []
        self.scan_satselection = []
        for slot in nimmanager.nim_slots:
            slot_id = slot.slot
            if slot.isCompatible("DVB-S"):
                satlist_for_slot = self.satList[slot_id]
                self.scan_satselection.append(
                    getConfigSatlist(defaultSat["orbpos"], satlist_for_slot))
                sat_freq_range = {(10700000, 12750000)}
                sat_band_cutoff = {11700000}
                for sat in satlist_for_slot:
                    orbpos = sat[0]
                self.nim_sat_frequency_range.append(sat_freq_range)
                self.nim_sat_band_cutoff_frequency.append(sat_band_cutoff)
            else:
                self.nim_sat_frequency_range.append(None)
                self.nim_sat_band_cutoff_frequency.append(None)
                self.scan_satselection.append(None)
        return True
Exemple #20
0
	def createConfig(self, frontendData):
			defaultSat = {
				"orbpos": 192,
				"system": eDVBFrontendParametersSatellite.System_DVB_S,
				"frequency": 11836,
				"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
				"symbolrate": 27500,
				"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
				"fec": eDVBFrontendParametersSatellite.FEC_Auto,
				"fec_s2_8psk": eDVBFrontendParametersSatellite.FEC_Auto,
				"fec_s2_qpsk": eDVBFrontendParametersSatellite.FEC_Auto,
				"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK }

			if frontendData is not None:
				ttype = frontendData.get("tuner_type", "UNKNOWN")
				if ttype == "DVB-S":
					defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
					defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
					defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
					defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
					defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
					defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
					if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
						if defaultSat["modulation"] == eDVBFrontendParametersSatellite.Modulation_QPSK:
							defaultSat["fec_s2_qpsk"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
						else:
							defaultSat["fec_s2_8psk"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
						defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
						defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
					else:
						defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["orbpos"] = frontendData.get("orbital_position", 0)

			self.scan_sat = ConfigSubsection()
			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)
#			self.scan_skipEmpty = ConfigYesNo(default = True)
#			self.scan_otherSDT = ConfigYesNo(default = False)

			nim_list = []
			# collect all nims which are *not* set to "nothing"
			for n in nimmanager.nim_slots:
				if not n.isCompatible("DVB-S"):
					continue
				if not self.legacy:
					nimconfig = n.config.dvbs
				else:
					nimconfig = n.config
				config_mode = nimconfig.configMode.value
				if config_mode == "nothing":
					continue
				if config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
					continue
				if config_mode in ("loopthrough", "satposdepends"):
					root_id = nimmanager.sec.getRoot(n.slot_id, int(nimconfig.connectedTo.value))
					if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
						continue
				nim_list.append((str(n.slot), n.friendly_full_description))

			self.scan_nims = ConfigSelection(choices = nim_list)

			self.scan_sat.bs_system = ConfigSelection(default = eDVBFrontendParametersSatellite.System_DVB_S2, 
				choices = [ (eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S + DVB-S2")),
					(eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S only"))])

			self.scan_sat.bs_accuracy = ConfigSelection(default = 2, choices = [ (1, "1"), (2, "2"), (3, "3"), (4, "4"), (5, "5")])

			self.scan_sat.bs_horizontal = ConfigYesNo(default = True)
			self.scan_sat.bs_vertical = ConfigYesNo(default = True)

			self.scan_scansat = {}
			for sat in nimmanager.satList:
				#print sat[1]
				self.scan_scansat[sat[0]] = ConfigYesNo(default = False)

			sec = secClass.getInstance()

			self.nim_sat_frequency_range = []
			self.nim_sat_band_cutoff_frequency = []
			self.scan_satselection = []
			for slot in nimmanager.nim_slots:
				slot_id = slot.slot
				self.nim_sat_frequency_range.append
				if slot.isCompatible("DVB-S"):
					satlist_for_slot = self.satList[slot_id]
					self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], satlist_for_slot))
					sat_freq_range = {}
					sat_band_cutoff = {}
					for sat in satlist_for_slot:
						orbpos = sat[0]
						sat_freq_range[orbpos] = sec.getFrequencyRangeList(slot_id, orbpos)
						sat_band_cutoff[orbpos] = sec.getBandCutOffFrequency(slot_id, orbpos)
					self.nim_sat_frequency_range.append(sat_freq_range)
					self.nim_sat_band_cutoff_frequency.append(sat_band_cutoff)
				else:
					self.nim_sat_frequency_range.append(None)
					self.nim_sat_band_cutoff_frequency.append(None)
					self.scan_satselection.append(None)

			return True
Exemple #21
0
    def createConfig(self, frontendData):
        defaultSat = {
            "orbpos": 192,
            "system": eDVBFrontendParametersSatellite.System_DVB_S,
            "frequency": 11836,
            "inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
            "symbolrate": 27500,
            "polarization":
            eDVBFrontendParametersSatellite.Polarisation_Horizontal,
            "fec": eDVBFrontendParametersSatellite.FEC_Auto,
            "fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
            "modulation": eDVBFrontendParametersSatellite.Modulation_QPSK
        }

        if frontendData is not None:
            ttype = frontendData.get("tuner_type", "UNKNOWN")
            if ttype == "DVB-S":
                defaultSat["system"] = frontendData.get(
                    "system", eDVBFrontendParametersSatellite.System_DVB_S)
                defaultSat["frequency"] = frontendData.get("frequency",
                                                           0) / 1000
                defaultSat["inversion"] = frontendData.get(
                    "inversion",
                    eDVBFrontendParametersSatellite.Inversion_Unknown)
                defaultSat["symbolrate"] = frontendData.get("symbol_rate",
                                                            0) / 1000
                defaultSat["polarization"] = frontendData.get(
                    "polarization",
                    eDVBFrontendParametersSatellite.Polarisation_Horizontal)
                if defaultSat[
                        "system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
                    defaultSat["fec_s2"] = frontendData.get(
                        "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                    defaultSat["rolloff"] = frontendData.get(
                        "rolloff",
                        eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
                    defaultSat["pilot"] = frontendData.get(
                        "pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
                else:
                    defaultSat["fec"] = frontendData.get(
                        "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                defaultSat["modulation"] = frontendData.get(
                    "modulation",
                    eDVBFrontendParametersSatellite.Modulation_QPSK)
                defaultSat["orbpos"] = frontendData.get("orbital_position", 0)

        self.scan_sat = ConfigSubsection()

        self.scan_type = ConfigSelection(
            default="single_transponder",
            choices=[("single_transponder", _("Single transponder")),
                     ("predefined_transponder", _("Predefined transponder")),
                     ("single_satellite", _("Single satellite")),
                     ("multisat", _("Multisat"))])
        self.scan_transponders = None
        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 = []
        for n in nimmanager.nim_slots:
            if n.config_mode == "nothing":
                continue
            if n.config_mode == "advanced" and len(
                    nimmanager.getSatListForNim(n.slot)) < 1:
                continue
            if n.config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(
                    n.slot_id, int(n.config.connectedTo.value))
                if n.type == nimmanager.nim_slots[root_id].type:
                    continue
            if n.isCompatible("DVB-S"):
                nim_list.append((str(n.slot), n.friendly_full_description))

        self.scan_nims = ConfigSelection(choices=nim_list)

        self.scan_sat.system = ConfigSelection(
            default=defaultSat["system"],
            choices=[
                (eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S")),
                (eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S2"))
            ])
        self.scan_sat.frequency = ConfigInteger(
            default=defaultSat["frequency"], limits=(1, 99999))
        self.scan_sat.inversion = ConfigSelection(
            default=defaultSat["inversion"],
            choices=[(eDVBFrontendParametersSatellite.Inversion_Off, _("off")),
                     (eDVBFrontendParametersSatellite.Inversion_On, _("on")),
                     (eDVBFrontendParametersSatellite.Inversion_Unknown,
                      _("Auto"))])
        self.scan_sat.symbolrate = ConfigInteger(
            default=defaultSat["symbolrate"], limits=(1, 99999))
        self.scan_sat.polarization = ConfigSelection(
            default=defaultSat["polarization"],
            choices=[
                (eDVBFrontendParametersSatellite.Polarisation_Horizontal,
                 _("horizontal")),
                (eDVBFrontendParametersSatellite.Polarisation_Vertical,
                 _("vertical")),
                (eDVBFrontendParametersSatellite.Polarisation_CircularLeft,
                 _("circular left")),
                (eDVBFrontendParametersSatellite.Polarisation_CircularRight,
                 _("circular right"))
            ])
        self.scan_sat.fec = ConfigSelection(
            default=defaultSat["fec"],
            choices=[(eDVBFrontendParametersSatellite.FEC_Auto, _("Auto")),
                     (eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
                     (eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
                     (eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
                     (eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
                     (eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
                     (eDVBFrontendParametersSatellite.FEC_None, _("None"))])
        self.scan_sat.fec_s2 = ConfigSelection(
            default=defaultSat["fec_s2"],
            choices=[(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
                     (eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
                     (eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
                     (eDVBFrontendParametersSatellite.FEC_3_5, "3/5"),
                     (eDVBFrontendParametersSatellite.FEC_4_5, "4/5"),
                     (eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
                     (eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
                     (eDVBFrontendParametersSatellite.FEC_8_9, "8/9"),
                     (eDVBFrontendParametersSatellite.FEC_9_10, "9/10")])
        self.scan_sat.modulation = ConfigSelection(
            default=defaultSat["modulation"],
            choices=[(eDVBFrontendParametersSatellite.Modulation_QPSK, "QPSK"),
                     (eDVBFrontendParametersSatellite.Modulation_8PSK, "8PSK")
                     ])
        self.scan_sat.rolloff = ConfigSelection(
            default=defaultSat.get(
                "rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35),
            choices=[
                (eDVBFrontendParametersSatellite.RollOff_alpha_0_35, "0.35"),
                (eDVBFrontendParametersSatellite.RollOff_alpha_0_25, "0.25"),
                (eDVBFrontendParametersSatellite.RollOff_alpha_0_20, "0.20")
            ])
        self.scan_sat.pilot = ConfigSelection(
            default=defaultSat.get(
                "pilot", eDVBFrontendParametersSatellite.Pilot_Unknown),
            choices=[(eDVBFrontendParametersSatellite.Pilot_Off, _("off")),
                     (eDVBFrontendParametersSatellite.Pilot_On, _("on")),
                     (eDVBFrontendParametersSatellite.Pilot_Unknown, _("Auto"))
                     ])

        self.scan_scansat = {}
        for sat in nimmanager.satList:
            self.scan_scansat[sat[0]] = ConfigYesNo(default=False)

        self.scan_satselection = []
        for slot in nimmanager.nim_slots:
            if slot.isCompatible("DVB-S"):
                x = getConfigSatlist(defaultSat["orbpos"],
                                     self.satList[slot.slot])
                x.addNotifier(self.retune, initial_call=False)
                self.scan_satselection.append(x)
            else:
                self.scan_satselection.append(None)

        for x in (self.scan_nims, self.scan_type, self.scan_sat.frequency,
                  self.scan_sat.inversion, self.scan_sat.symbolrate,
                  self.scan_sat.polarization, self.scan_sat.fec,
                  self.scan_sat.pilot, self.scan_sat.fec_s2, self.scan_sat.fec,
                  self.scan_sat.modulation, self.scan_sat.rolloff,
                  self.scan_sat.system):
            x.addNotifier(self.retune, initial_call=False)

        return True
Exemple #22
0
    def createConfig(self):
        self.feinfo = None
        frontendData = None
        defaultSat = {
            "orbpos": 192,
            "system": eDVBFrontendParametersSatellite.System_DVB_S,
            "frequency": 11836,
            "inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
            "symbolrate": 27500,
            "polarization":
            eDVBFrontendParametersSatellite.Polarisation_Horizontal,
            "fec": eDVBFrontendParametersSatellite.FEC_Auto,
            "fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
            "modulation": eDVBFrontendParametersSatellite.Modulation_QPSK
        }

        self.service = self.session.nav.getCurrentService()
        if self.service is not None:
            self.feinfo = self.service.frontendInfo()
            frontendData = self.feinfo and self.feinfo.getAll(True)
        if frontendData is not None:
            ttype = frontendData.get("tuner_type", "UNKNOWN")
            if ttype == "DVB-S":
                defaultSat["system"] = frontendData.get(
                    "system", eDVBFrontendParametersSatellite.System_DVB_S)
                defaultSat["frequency"] = frontendData.get("frequency",
                                                           0) / 1000
                defaultSat["inversion"] = frontendData.get(
                    "inversion",
                    eDVBFrontendParametersSatellite.Inversion_Unknown)
                defaultSat["symbolrate"] = frontendData.get("symbol_rate",
                                                            0) / 1000
                defaultSat["polarization"] = frontendData.get(
                    "polarization",
                    eDVBFrontendParametersSatellite.Polarisation_Horizontal)
                if defaultSat[
                        "system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
                    defaultSat["fec_s2"] = frontendData.get(
                        "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                    defaultSat["rolloff"] = frontendData.get(
                        "rolloff",
                        eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
                    defaultSat["pilot"] = frontendData.get(
                        "pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
                else:
                    defaultSat["fec"] = frontendData.get(
                        "fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                defaultSat["modulation"] = frontendData.get(
                    "modulation",
                    eDVBFrontendParametersSatellite.Modulation_QPSK)
                defaultSat["orbpos"] = frontendData.get("orbital_position", 0)
        del self.feinfo
        del self.service
        del frontendData

        self.scan_sat = ConfigSubsection()
        self.scan_networkScan = ConfigYesNo(default=False)

        # blindscan add
        self.blindscan_hi = ConfigSelection(default="hi_low",
                                            choices=[("low", _("low")),
                                                     ("high", _("high")),
                                                     ("hi_low", _("hi_low"))])

        #ConfigYesNo(default = True)
        self.blindscan_start_frequency = ConfigInteger(default=950 * 1000000)
        self.blindscan_stop_frequency = ConfigInteger(default=2150 * 1000000)
        self.blindscan_start_symbol = ConfigInteger(default=2 * 1000000)
        self.blindscan_stop_symbol = ConfigInteger(default=45 * 1000000)
        self.scan_clearallservices = ConfigYesNo(default=False)
        self.scan_onlyfree = ConfigYesNo(default=False)

        # collect all nims which are *not* set to "nothing"
        nim_list = []
        for n in nimmanager.nim_slots:
            if n.config_mode == "nothing":
                continue
            if n.config_mode == "advanced" and len(
                    nimmanager.getSatListForNim(n.slot)) < 1:
                continue
            if n.config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(
                    n.slot_id, int(n.config.connectedTo.value))
                if n.type == nimmanager.nim_slots[
                        root_id].type:  # check if connected from a DVB-S to DVB-S2 Nim or vice versa
                    continue
            if n.isCompatible("DVB-S"):
                nim_list.append((str(n.slot), n.friendly_full_description))
        self.scan_nims = ConfigSelection(choices=nim_list)

        # sat
        self.scan_sat.frequency = ConfigInteger(
            default=defaultSat["frequency"], limits=(1, 99999))
        #self.scan_sat.polarization = ConfigSelection(default = defaultSat["polarization"], choices = [
        self.scan_sat.polarization = ConfigSelection(
            default=eDVBFrontendParametersSatellite.Polarisation_CircularRight
            + 1,
            choices=[
                (eDVBFrontendParametersSatellite.Polarisation_CircularRight +
                 1, _("horizontal_vertical")),
                (eDVBFrontendParametersSatellite.Polarisation_Horizontal,
                 _("horizontal")),
                (eDVBFrontendParametersSatellite.Polarisation_Vertical,
                 _("vertical")),
                (eDVBFrontendParametersSatellite.Polarisation_CircularLeft,
                 _("circular left")),
                (eDVBFrontendParametersSatellite.Polarisation_CircularRight,
                 _("circular right"))
            ])
        self.scan_scansat = {}
        for sat in nimmanager.satList:
            self.scan_scansat[sat[0]] = ConfigYesNo(default=False)

        self.scan_satselection = []
        for slot in nimmanager.nim_slots:
            if slot.isCompatible("DVB-S"):
                self.scan_satselection.append(
                    getConfigSatlist(defaultSat["orbpos"],
                                     self.satList[slot.slot]))
        return True
	def createConfig(self, frontendData):
							   #("Type", frontendData["system"], TYPE_TEXT),
					   #("Modulation", frontendData["modulation"], TYPE_TEXT),
					   #("Orbital position", frontendData["orbital_position"], TYPE_VALUE_DEC),
					   #("Frequency", frontendData["frequency"], TYPE_VALUE_DEC),
					   #("Symbolrate", frontendData["symbol_rate"], TYPE_VALUE_DEC),
					   #("Polarization", frontendData["polarization"], TYPE_TEXT),
					   #("Inversion", frontendData["inversion"], TYPE_TEXT),
					   #("FEC inner", frontendData["fec_inner"], TYPE_TEXT),
				   		#)
		#elif frontendData["tuner_type"] == "DVB-C":
			#return ( ("NIM", ['A', 'B', 'C', 'D'][frontendData["tuner_number"]], TYPE_TEXT),
					   #("Type", frontendData["tuner_type"], TYPE_TEXT),
					   #("Frequency", frontendData["frequency"], TYPE_VALUE_DEC),
					   #("Symbolrate", frontendData["symbol_rate"], TYPE_VALUE_DEC),
					   #("Modulation", frontendData["modulation"], TYPE_TEXT),
					   #("Inversion", frontendData["inversion"], TYPE_TEXT),
			#		   ("FEC inner", frontendData["fec_inner"], TYPE_TEXT),
				   		#)
		#elif frontendData["tuner_type"] == "DVB-T":
			#return ( ("NIM", ['A', 'B', 'C', 'D'][frontendData["tuner_number"]], TYPE_TEXT),
					   #("Type", frontendData["tuner_type"], TYPE_TEXT),
					   #("Frequency", frontendData["frequency"], TYPE_VALUE_DEC),
					   #("Inversion", frontendData["inversion"], TYPE_TEXT),
					   #("Bandwidth", frontendData["bandwidth"], TYPE_VALUE_DEC),
					   #("CodeRateLP", frontendData["code_rate_lp"], TYPE_TEXT),
					   #("CodeRateHP", frontendData["code_rate_hp"], TYPE_TEXT),
					   #("Constellation", frontendData["constellation"], TYPE_TEXT),
					   #("Transmission Mode", frontendData["transmission_mode"], TYPE_TEXT),
					   #("Guard Interval", frontendData["guard_interval"], TYPE_TEXT),
					   #("Hierarchy Inform.", frontendData["hierarchy_information"], TYPE_TEXT),
			defaultSat = {
				"orbpos": 192,
				"system": eDVBFrontendParametersSatellite.System_DVB_S,
				"frequency": 11836,
				"inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
				"symbolrate": 27500,
				"polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
				"fec": eDVBFrontendParametersSatellite.FEC_Auto,
				"fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
				"modulation": eDVBFrontendParametersSatellite.Modulation_QPSK }
			defaultCab = {
				"frequency": 466,
				"inversion": eDVBFrontendParametersCable.Inversion_Unknown,
				"modulation": eDVBFrontendParametersCable.Modulation_QAM64,
				"fec": eDVBFrontendParametersCable.FEC_Auto,
				"symbolrate": 6900 }
			defaultTer = {
				"frequency" : 466000,
				"inversion" : eDVBFrontendParametersTerrestrial.Inversion_Unknown,
				"bandwidth" : eDVBFrontendParametersTerrestrial.Bandwidth_7MHz,
				"fechigh" : eDVBFrontendParametersTerrestrial.FEC_Auto,
				"feclow" : eDVBFrontendParametersTerrestrial.FEC_Auto,
				"modulation" : eDVBFrontendParametersTerrestrial.Modulation_Auto,
				"transmission_mode" : eDVBFrontendParametersTerrestrial.TransmissionMode_Auto,
				"guard_interval" : eDVBFrontendParametersTerrestrial.GuardInterval_Auto,
				"hierarchy": eDVBFrontendParametersTerrestrial.Hierarchy_Auto }

			if frontendData is not None:
				ttype = frontendData.get("tuner_type", "UNKNOWN")
				if ttype == "DVB-S":
					defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
					defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
					defaultSat["inversion"] = frontendData.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown)
					defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
					defaultSat["polarization"] = frontendData.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal)
					if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
						defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
						defaultSat["rolloff"] = frontendData.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35)
						defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
					else:
						defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
					defaultSat["modulation"] = frontendData.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK)
					defaultSat["orbpos"] = frontendData.get("orbital_position", 0)
				elif ttype == "DVB-C":
					defaultCab["frequency"] = frontendData.get("frequency", 0) / 1000
					defaultCab["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
					defaultCab["inversion"] = frontendData.get("inversion", eDVBFrontendParametersCable.Inversion_Unknown)
					defaultCab["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersCable.FEC_Auto)
					defaultCab["modulation"] = frontendData.get("modulation", eDVBFrontendParametersCable.Modulation_QAM16)
				elif ttype == "DVB-T":
					defaultTer["frequency"] = frontendData.get("frequency", 0)
					defaultTer["inversion"] = frontendData.get("inversion", eDVBFrontendParametersTerrestrial.Inversion_Unknown)
					defaultTer["bandwidth"] = frontendData.get("bandwidth", eDVBFrontendParametersTerrestrial.Bandwidth_7MHz)
					defaultTer["fechigh"] = frontendData.get("code_rate_hp", eDVBFrontendParametersTerrestrial.FEC_Auto)
					defaultTer["feclow"] = frontendData.get("code_rate_lp", eDVBFrontendParametersTerrestrial.FEC_Auto)
					defaultTer["modulation"] = frontendData.get("constellation", eDVBFrontendParametersTerrestrial.Modulation_Auto)
					defaultTer["transmission_mode"] = frontendData.get("transmission_mode", eDVBFrontendParametersTerrestrial.TransmissionMode_Auto)
					defaultTer["guard_interval"] = frontendData.get("guard_interval", eDVBFrontendParametersTerrestrial.GuardInterval_Auto)
					defaultTer["hierarchy"] = frontendData.get("hierarchy_information", eDVBFrontendParametersTerrestrial.Hierarchy_Auto)

			self.scan_sat = ConfigSubsection()
			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")), ("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":
					continue
				if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
					continue
				if n.config_mode in ("loopthrough", "satposdepends"):
					root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.value))
					if n.type == nimmanager.nim_slots[root_id].type: # check if connected from a DVB-S to DVB-S2 Nim or vice versa
						continue
				nim_list.append((str(n.slot), n.friendly_full_description))

			self.scan_nims = ConfigSelection(choices = nim_list)

			# status
			self.scan_snr = ConfigSlider()
			self.scan_snr.enabled = False
			self.scan_agc = ConfigSlider()
			self.scan_agc.enabled = False
			self.scan_ber = ConfigSlider()
			self.scan_ber.enabled = False

			# sat
			self.scan_sat.system = ConfigSelection(default = defaultSat["system"], choices = [
				(eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S")),
				(eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S2"))])
			self.scan_sat.frequency = ConfigInteger(default = defaultSat["frequency"], limits = (1, 99999))
			self.scan_sat.inversion = ConfigSelection(default = defaultSat["inversion"], choices = [
				(eDVBFrontendParametersSatellite.Inversion_Off, _("off")),
				(eDVBFrontendParametersSatellite.Inversion_On, _("on")),
				(eDVBFrontendParametersSatellite.Inversion_Unknown, _("Auto"))])
			self.scan_sat.symbolrate = ConfigInteger(default = defaultSat["symbolrate"], limits = (1, 99999))
			self.scan_sat.polarization = ConfigSelection(default = defaultSat["polarization"], choices = [
				(eDVBFrontendParametersSatellite.Polarisation_Horizontal, _("horizontal")),
				(eDVBFrontendParametersSatellite.Polarisation_Vertical, _("vertical")),
				(eDVBFrontendParametersSatellite.Polarisation_CircularLeft, _("circular left")),
				(eDVBFrontendParametersSatellite.Polarisation_CircularRight, _("circular right"))])
			self.scan_sat.fec = ConfigSelection(default = defaultSat["fec"], choices = [
				(eDVBFrontendParametersSatellite.FEC_Auto, _("Auto")),
				(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
				(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
				(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
				(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
				(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
				(eDVBFrontendParametersSatellite.FEC_None, _("None"))])
			self.scan_sat.fec_s2 = ConfigSelection(default = defaultSat["fec_s2"], choices = [
				(eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
				(eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
				(eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
				(eDVBFrontendParametersSatellite.FEC_3_5, "3/5"),
				(eDVBFrontendParametersSatellite.FEC_4_5, "4/5"),
				(eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
				(eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
				(eDVBFrontendParametersSatellite.FEC_8_9, "8/9"),
				(eDVBFrontendParametersSatellite.FEC_9_10, "9/10")])
			self.scan_sat.modulation = ConfigSelection(default = defaultSat["modulation"], choices = [
				(eDVBFrontendParametersSatellite.Modulation_QPSK, "QPSK"),
				(eDVBFrontendParametersSatellite.Modulation_8PSK, "8PSK")])
			self.scan_sat.rolloff = ConfigSelection(default = defaultSat.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35), choices = [
				(eDVBFrontendParametersSatellite.RollOff_alpha_0_35, "0.35"),
				(eDVBFrontendParametersSatellite.RollOff_alpha_0_25, "0.25"),
				(eDVBFrontendParametersSatellite.RollOff_alpha_0_20, "0.20"),
				(eDVBFrontendParametersSatellite.RollOff_auto, _("Auto"))])
			self.scan_sat.pilot = ConfigSelection(default = defaultSat.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown), choices = [
				(eDVBFrontendParametersSatellite.Pilot_Off, _("off")),
				(eDVBFrontendParametersSatellite.Pilot_On, _("on")),
				(eDVBFrontendParametersSatellite.Pilot_Unknown, _("Auto"))])

			# cable
			self.scan_cab.frequency = ConfigInteger(default = defaultCab["frequency"], limits = (50, 999))
			self.scan_cab.inversion = ConfigSelection(default = defaultCab["inversion"], choices = [
				(eDVBFrontendParametersCable.Inversion_Off, _("off")),
				(eDVBFrontendParametersCable.Inversion_On, _("on")),
				(eDVBFrontendParametersCable.Inversion_Unknown, _("Auto"))])
			self.scan_cab.modulation = ConfigSelection(default = defaultCab["modulation"], choices = [
				(eDVBFrontendParametersCable.Modulation_QAM16, "16-QAM"),
				(eDVBFrontendParametersCable.Modulation_QAM32, "32-QAM"),
				(eDVBFrontendParametersCable.Modulation_QAM64, "64-QAM"),
				(eDVBFrontendParametersCable.Modulation_QAM128, "128-QAM"),
				(eDVBFrontendParametersCable.Modulation_QAM256, "256-QAM")])
			self.scan_cab.fec = ConfigSelection(default = defaultCab["fec"], choices = [
				(eDVBFrontendParametersCable.FEC_Auto, _("Auto")),
				(eDVBFrontendParametersCable.FEC_1_2, "1/2"),
				(eDVBFrontendParametersCable.FEC_2_3, "2/3"),
				(eDVBFrontendParametersCable.FEC_3_4, "3/4"),
				(eDVBFrontendParametersCable.FEC_5_6, "5/6"),
				(eDVBFrontendParametersCable.FEC_7_8, "7/8"),
				(eDVBFrontendParametersCable.FEC_8_9, "8/9"),
				(eDVBFrontendParametersCable.FEC_None, _("None"))])
			self.scan_cab.symbolrate = ConfigInteger(default = defaultCab["symbolrate"], limits = (1, 99999))

			# terrestial
			self.scan_ter.frequency = ConfigInteger(default = 466000, limits = (50000, 999000))
			self.scan_ter.inversion = ConfigSelection(default = defaultTer["inversion"], choices = [
				(eDVBFrontendParametersTerrestrial.Inversion_Off, _("off")),
				(eDVBFrontendParametersTerrestrial.Inversion_On, _("on")),
				(eDVBFrontendParametersTerrestrial.Inversion_Unknown, _("Auto"))])
			# WORKAROUND: we can't use BW-auto
			self.scan_ter.bandwidth = ConfigSelection(default = defaultTer["bandwidth"], choices = [
				(eDVBFrontendParametersTerrestrial.Bandwidth_8MHz, "8MHz"),
				(eDVBFrontendParametersTerrestrial.Bandwidth_7MHz, "7MHz"),
				(eDVBFrontendParametersTerrestrial.Bandwidth_6MHz, "6MHz")])
			#, (eDVBFrontendParametersTerrestrial.Bandwidth_Auto, _("Auto"))))
			self.scan_ter.fechigh = ConfigSelection(default = defaultTer["fechigh"], choices = [
				(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
				(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
				(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
				(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
				(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
				(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
			self.scan_ter.feclow = ConfigSelection(default = defaultTer["feclow"], choices = [
				(eDVBFrontendParametersTerrestrial.FEC_1_2, "1/2"),
				(eDVBFrontendParametersTerrestrial.FEC_2_3, "2/3"),
				(eDVBFrontendParametersTerrestrial.FEC_3_4, "3/4"),
				(eDVBFrontendParametersTerrestrial.FEC_5_6, "5/6"),
				(eDVBFrontendParametersTerrestrial.FEC_7_8, "7/8"),
				(eDVBFrontendParametersTerrestrial.FEC_Auto, _("Auto"))])
			self.scan_ter.modulation = ConfigSelection(default = defaultTer["modulation"], choices = [
				(eDVBFrontendParametersTerrestrial.Modulation_QPSK, "QPSK"),
				(eDVBFrontendParametersTerrestrial.Modulation_QAM16, "QAM16"),
				(eDVBFrontendParametersTerrestrial.Modulation_QAM64, "QAM64"),
				(eDVBFrontendParametersTerrestrial.Modulation_Auto, _("Auto"))])
			self.scan_ter.transmission = ConfigSelection(default = defaultTer["transmission_mode"], choices = [
				(eDVBFrontendParametersTerrestrial.TransmissionMode_2k, "2K"),
				(eDVBFrontendParametersTerrestrial.TransmissionMode_8k, "8K"),
				(eDVBFrontendParametersTerrestrial.TransmissionMode_Auto, _("Auto"))])
			self.scan_ter.guard = ConfigSelection(default = defaultTer["guard_interval"], choices = [
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_32, "1/32"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_16, "1/16"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_8, "1/8"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_1_4, "1/4"),
				(eDVBFrontendParametersTerrestrial.GuardInterval_Auto, _("Auto"))])
			self.scan_ter.hierarchy = ConfigSelection(default = defaultTer["hierarchy"], choices = [
				(eDVBFrontendParametersTerrestrial.Hierarchy_None, _("None")),
				(eDVBFrontendParametersTerrestrial.Hierarchy_1, "1"),
				(eDVBFrontendParametersTerrestrial.Hierarchy_2, "2"),
				(eDVBFrontendParametersTerrestrial.Hierarchy_4, "4"),
				(eDVBFrontendParametersTerrestrial.Hierarchy_Auto, _("Auto"))])

			self.scan_scansat = {}
			for sat in nimmanager.satList:
				#print sat[1]
				self.scan_scansat[sat[0]] = ConfigYesNo(default = False)

			self.scan_satselection = []
			for slot in nimmanager.nim_slots:
				if slot.isCompatible("DVB-S"):
					self.scan_satselection.append(getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot]))
				else:
					self.scan_satselection.append(None)

			return True
Exemple #24
0
    def createConfig(self, frontendData):
        defaultSat = {
            "orbpos": 192,
            "system": eDVBFrontendParametersSatellite.System_DVB_S,
            "frequency": 11836,
            "inversion": eDVBFrontendParametersSatellite.Inversion_Unknown,
            "symbolrate": 27500,
            "polarization": eDVBFrontendParametersSatellite.Polarisation_Horizontal,
            "fec": eDVBFrontendParametersSatellite.FEC_Auto,
            "fec_s2": eDVBFrontendParametersSatellite.FEC_9_10,
            "modulation": eDVBFrontendParametersSatellite.Modulation_QPSK,
        }

        if frontendData is not None:
            ttype = frontendData.get("tuner_type", "UNKNOWN")
            if ttype == "DVB-S":
                defaultSat["system"] = frontendData.get("system", eDVBFrontendParametersSatellite.System_DVB_S)
                defaultSat["frequency"] = frontendData.get("frequency", 0) / 1000
                defaultSat["inversion"] = frontendData.get(
                    "inversion", eDVBFrontendParametersSatellite.Inversion_Unknown
                )
                defaultSat["symbolrate"] = frontendData.get("symbol_rate", 0) / 1000
                defaultSat["polarization"] = frontendData.get(
                    "polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal
                )
                if defaultSat["system"] == eDVBFrontendParametersSatellite.System_DVB_S2:
                    defaultSat["fec_s2"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                    defaultSat["rolloff"] = frontendData.get(
                        "rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35
                    )
                    defaultSat["pilot"] = frontendData.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown)
                else:
                    defaultSat["fec"] = frontendData.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto)
                defaultSat["modulation"] = frontendData.get(
                    "modulation", eDVBFrontendParametersSatellite.Modulation_QPSK
                )
                defaultSat["orbpos"] = frontendData.get("orbital_position", 0)

        self.scan_sat = ConfigSubsection()

        self.scan_type = ConfigSelection(
            default="single_transponder",
            choices=[
                ("single_transponder", _("Single transponder")),
                ("predefined_transponder", _("Predefined transponder")),
                ("single_satellite", _("Single satellite")),
                ("multisat", _("Multisat")),
            ],
        )
        self.scan_transponders = None
        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 = []
        for n in nimmanager.nim_slots:
            if n.config_mode == "nothing":
                continue
            if n.config_mode == "advanced" and len(nimmanager.getSatListForNim(n.slot)) < 1:
                continue
            if n.config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(n.slot_id, int(n.config.connectedTo.value))
                if n.type == nimmanager.nim_slots[root_id].type:
                    continue
            if n.isCompatible("DVB-S"):
                nim_list.append((str(n.slot), n.friendly_full_description))

        self.scan_nims = ConfigSelection(choices=nim_list)

        self.scan_sat.system = ConfigSelection(
            default=defaultSat["system"],
            choices=[
                (eDVBFrontendParametersSatellite.System_DVB_S, _("DVB-S")),
                (eDVBFrontendParametersSatellite.System_DVB_S2, _("DVB-S2")),
            ],
        )
        self.scan_sat.frequency = ConfigInteger(default=defaultSat["frequency"], limits=(1, 99999))
        self.scan_sat.inversion = ConfigSelection(
            default=defaultSat["inversion"],
            choices=[
                (eDVBFrontendParametersSatellite.Inversion_Off, _("off")),
                (eDVBFrontendParametersSatellite.Inversion_On, _("on")),
                (eDVBFrontendParametersSatellite.Inversion_Unknown, _("Auto")),
            ],
        )
        self.scan_sat.symbolrate = ConfigInteger(default=defaultSat["symbolrate"], limits=(1, 99999))
        self.scan_sat.polarization = ConfigSelection(
            default=defaultSat["polarization"],
            choices=[
                (eDVBFrontendParametersSatellite.Polarisation_Horizontal, _("horizontal")),
                (eDVBFrontendParametersSatellite.Polarisation_Vertical, _("vertical")),
                (eDVBFrontendParametersSatellite.Polarisation_CircularLeft, _("circular left")),
                (eDVBFrontendParametersSatellite.Polarisation_CircularRight, _("circular right")),
            ],
        )
        self.scan_sat.fec = ConfigSelection(
            default=defaultSat["fec"],
            choices=[
                (eDVBFrontendParametersSatellite.FEC_Auto, _("Auto")),
                (eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
                (eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
                (eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
                (eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
                (eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
                (eDVBFrontendParametersSatellite.FEC_None, _("None")),
            ],
        )
        self.scan_sat.fec_s2 = ConfigSelection(
            default=defaultSat["fec_s2"],
            choices=[
                (eDVBFrontendParametersSatellite.FEC_1_2, "1/2"),
                (eDVBFrontendParametersSatellite.FEC_2_3, "2/3"),
                (eDVBFrontendParametersSatellite.FEC_3_4, "3/4"),
                (eDVBFrontendParametersSatellite.FEC_3_5, "3/5"),
                (eDVBFrontendParametersSatellite.FEC_4_5, "4/5"),
                (eDVBFrontendParametersSatellite.FEC_5_6, "5/6"),
                (eDVBFrontendParametersSatellite.FEC_7_8, "7/8"),
                (eDVBFrontendParametersSatellite.FEC_8_9, "8/9"),
                (eDVBFrontendParametersSatellite.FEC_9_10, "9/10"),
            ],
        )
        self.scan_sat.modulation = ConfigSelection(
            default=defaultSat["modulation"],
            choices=[
                (eDVBFrontendParametersSatellite.Modulation_QPSK, "QPSK"),
                (eDVBFrontendParametersSatellite.Modulation_8PSK, "8PSK"),
            ],
        )
        self.scan_sat.rolloff = ConfigSelection(
            default=defaultSat.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35),
            choices=[
                (eDVBFrontendParametersSatellite.RollOff_alpha_0_35, "0.35"),
                (eDVBFrontendParametersSatellite.RollOff_alpha_0_25, "0.25"),
                (eDVBFrontendParametersSatellite.RollOff_alpha_0_20, "0.20"),
            ],
        )
        self.scan_sat.pilot = ConfigSelection(
            default=defaultSat.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown),
            choices=[
                (eDVBFrontendParametersSatellite.Pilot_Off, _("off")),
                (eDVBFrontendParametersSatellite.Pilot_On, _("on")),
                (eDVBFrontendParametersSatellite.Pilot_Unknown, _("Auto")),
            ],
        )

        self.scan_scansat = {}
        for sat in nimmanager.satList:
            self.scan_scansat[sat[0]] = ConfigYesNo(default=False)

        self.scan_satselection = []
        for slot in nimmanager.nim_slots:
            if slot.isCompatible("DVB-S"):
                x = getConfigSatlist(defaultSat["orbpos"], self.satList[slot.slot])
                x.addNotifier(self.retune, initial_call=False)
                self.scan_satselection.append(x)
            else:
                self.scan_satselection.append(None)

        for x in (
            self.scan_nims,
            self.scan_type,
            self.scan_sat.frequency,
            self.scan_sat.inversion,
            self.scan_sat.symbolrate,
            self.scan_sat.polarization,
            self.scan_sat.fec,
            self.scan_sat.pilot,
            self.scan_sat.fec_s2,
            self.scan_sat.fec,
            self.scan_sat.modulation,
            self.scan_sat.rolloff,
            self.scan_sat.system,
        ):
            x.addNotifier(self.retune, initial_call=False)

        return True