Example #1
0
 def createConfigMode(self):
     if self.nim.isCompatible("DVB-S"):
         choices = {"nothing": _("not configured"), "simple": _("simple"), "advanced": _("advanced")}
         if len(nimmanager.canEqualTo(self.slotid)) > 0:
             choices["equal"] = _("equal to")
         if len(nimmanager.canDependOn(self.slotid)) > 0:
             choices["satposdepends"] = _("second cable of motorized LNB")
         if len(nimmanager.canConnectTo(self.slotid)) > 0:
             choices["loopthrough"] = _("loopthrough to")
         self.nimConfig.configMode.setChoices(choices, default="simple")
Example #2
0
	def createConfigMode(self):
		if self.nim.isCompatible("DVB-S"):
			choices = {"nothing": _("Not configured"),
						"simple": _("Simple"),
						"advanced": _("Advanced")}
			if len(nimmanager.canEqualTo(self.slotid)) > 0:
				choices["equal"] = _("Equal to")
			if len(nimmanager.canDependOn(self.slotid)) > 0:
				choices["satposdepends"] = _("Second cable of motorized LNB")
			if len(nimmanager.canConnectTo(self.slotid)) > 0:
				choices["loopthrough"] = _("Loop through to")
			self.nimConfig.configMode.setChoices(choices, default = "simple")
Example #3
0
 def createConfigMode(self):
     if self.nim.isCompatible("DVB-S"):
         choices = {"nothing": _("Not configured"), "simple": _("Simple"), "advanced": _("Advanced")}
         if len(nimmanager.canEqualTo(self.slotid)) > 0:
             choices["equal"] = _("Equal to")
         if len(nimmanager.canDependOn(self.slotid)) > 0:
             choices["satposdepends"] = _("Second cable of motorized LNB")
         if len(nimmanager.canConnectTo(self.slotid)) > 0:
             choices["loopthrough"] = _("Loop through to")
         if self.nim.isFBCLink():
             choices = {"nothing": _("FBC automatic loop through"), "advanced": _("FBC Unicable")}
         self.nimConfig.configMode.setChoices(choices, self.nim.isFBCLink() and "nothing" or "simple")
Example #4
0
 def createConfigMode(self):
     if self.nim.isCompatible('DVB-S'):
         choices = {'nothing': _('not configured'),
          'simple': _('Simple'),
          'advanced': _('Advanced')}
         if len(nimmanager.canEqualTo(self.slotid)) > 0:
             choices['equal'] = _('Equal to')
         if len(nimmanager.canDependOn(self.slotid)) > 0:
             choices['satposdepends'] = _('Second cable of motorized LNB')
         if len(nimmanager.canConnectTo(self.slotid)) > 0:
             choices['loopthrough'] = _('Loop through to')
         self.nimConfig.configMode.setChoices(choices, default='simple')
Example #5
0
	def createConfigMode(self):
		if self.nim.isCompatible("DVB-S"):
			choices = {"nothing": _("Not configured"),
						"simple": _("Simple"),
						"advanced": _("Advanced")}
			if len(nimmanager.canEqualTo(self.slotid)) > 0:
				choices["equal"] = _("Equal to")
			if len(nimmanager.canDependOn(self.slotid)) > 0:
				choices["satposdepends"] = _("Second cable of motorized LNB")
			if len(nimmanager.canConnectTo(self.slotid)) > 0:
				choices["loopthrough"] = _("Loop through from")
			if self.nim.isFBCLink():
				choices = { "nothing": _("FBC automatic"), "advanced": _("FBC SCR (Unicable/JESS)")}
			self.nimConfig.configMode.setChoices(choices, self.nim.isFBCLink() and "nothing" or "simple")
Example #6
0
	def createConfigMode(self):
		if self.nim.isCompatible("DVB-S"):
			getConfigModeTuple = nimmanager.getConfigModeTuple
			choices = [ getConfigModeTuple("nothing"), getConfigModeTuple("simple"), getConfigModeTuple("advanced") ]
			#if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0:
			#	choices.append(getConfigModeTuple("equal"))
			#	choices.append(getConfigModeTuple("satposdepends"))
			if len(nimmanager.canEqualTo(self.slotid)) > 0:
				choices.append(getConfigModeTuple("equal"))
			if len(nimmanager.canDependOn(self.slotid)) > 0:
				choices.append(getConfigModeTuple("satposdepends"))
			if len(nimmanager.canConnectTo(self.slotid)) > 0:
				choices.append(getConfigModeTuple("loopthrough"))
			self.nimConfig.configMode.setChoices(dict(choices), default = "nothing")
Example #7
0
	def createConfigMode(self):
		if self.nim.isCompatible("DVB-S"):
			choices = { "nothing": _("not configured"),
						"simple": _("simple"),
						"advanced": _("advanced")}
			#if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0:
			#	choices["equal"] = _("equal to")
			#	choices["satposdepends"] = _("second cable of motorized LNB")
			if len(nimmanager.canEqualTo(self.slotid)) > 0:
				choices["equal"] = _("equal to")
			if len(nimmanager.canDependOn(self.slotid)) > 0:
				choices["satposdepends"] = _("second cable of motorized LNB")
			if len(nimmanager.canConnectTo(self.slotid)) > 0:
				choices["loopthrough"] = _("loopthrough to")
			self.nimConfig.configMode.setChoices(choices, default = "nothing")
Example #8
0
	def createConfigMode(self):
		if self.nim.canBeCompatible("DVB-S"):
			choices = {"nothing": _("not configured"),
						"simple": _("Simple"),
						"advanced": _("Advanced")}
			if len(nimmanager.canEqualTo(self.slotid)) > 0:
				choices["equal"] = _("Equal to")
			if len(nimmanager.canDependOn(self.slotid)) > 0:
				choices["satposdepends"] = _("Second cable of motorized LNB")
			if len(nimmanager.canConnectTo(self.slotid)) > 0:
				choices["loopthrough"] = _("Loop through to")
			if isFBCLink(self.nim.slot):
				choices = { "nothing": _("not configured"),
						"advanced": _("Advanced")}
			if self.nim.isMultiType():
				self.nimConfig.dvbs.configMode.setChoices(choices, default = "nothing")
			else:
				self.nimConfig.dvbs.configMode.setChoices(choices, default = "simple")
Example #9
0
	def createConfigMode(self):
		# FIXMEE
		# no support for satpos depends, equal to and loopthough setting for nims with
		# with multiple inputs and multiple channels
		if self.nim.isCompatible("DVB-S") and self.nim.inputs is None:
			getConfigModeTuple = nimmanager.getConfigModeTuple
			choices = [ getConfigModeTuple("nothing"), getConfigModeTuple("simple"), getConfigModeTuple("advanced") ]
			#if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0:
			#	choices.append(getConfigModeTuple("equal"))
			#	choices.append(getConfigModeTuple("satposdepends"))
			if len(nimmanager.canEqualTo(self.slotid)) > 0:
				choices.append(getConfigModeTuple("equal"))
			canDepend = nimmanager.canDependOn(self.slotid)
			if len([ val for val in canDepend if val[1] == 0 ]):
				choices.append(getConfigModeTuple("satposdepends"))
			canConnect = nimmanager.canConnectTo(self.slotid)
			if len([ val for val in canConnect if val[1] == 0 ]):
				choices.append(getConfigModeTuple("loopthrough"))
			self.nimConfig.sat.configMode.setChoices(dict(choices), default = "nothing")
Example #10
0
	def createConfigMode(self):
		# FIXMEE
		# no support for satpos depends, equal to and loopthough setting for nims with
		# with multiple inputs and multiple channels
		if self.nim.isCompatible("DVB-S") and self.nim.inputs is None:
			getConfigModeTuple = nimmanager.getConfigModeTuple
			choices = [ getConfigModeTuple("nothing"), getConfigModeTuple("simple"), getConfigModeTuple("advanced") ]
			#if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0:
			#	choices.append(getConfigModeTuple("equal"))
			#	choices.append(getConfigModeTuple("satposdepends"))
			if len(nimmanager.canEqualTo(self.slotid)) > 0:
				choices.append(getConfigModeTuple("equal"))
			canDepend = nimmanager.canDependOn(self.slotid)
			if len([ val for val in canDepend if val[1] == 0 ]):
				choices.append(getConfigModeTuple("satposdepends"))
			canConnect = nimmanager.canConnectTo(self.slotid)
			if len([ val for val in canConnect if val[1] == 0 ]):
				choices.append(getConfigModeTuple("loopthrough"))
			self.nimConfig.sat.configMode.setChoices(dict(choices), default = "nothing")
Example #11
0
 def createConfigMode(self):
     if self.nim.isCompatible("DVB-S"):
         getConfigModeTuple = nimmanager.getConfigModeTuple
         choices = [
             getConfigModeTuple("nothing"),
             getConfigModeTuple("simple"),
             getConfigModeTuple("advanced")
         ]
         #if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0:
         #	choices.append(getConfigModeTuple("equal"))
         #	choices.append(getConfigModeTuple("satposdepends"))
         if len(nimmanager.canEqualTo(self.slotid)) > 0:
             choices.append(getConfigModeTuple("equal"))
         if len(nimmanager.canDependOn(self.slotid)) > 0:
             choices.append(getConfigModeTuple("satposdepends"))
         if len(nimmanager.canConnectTo(self.slotid)) > 0:
             choices.append(getConfigModeTuple("loopthrough"))
         self.nimConfig.configMode.setChoices(dict(choices),
                                              default="nothing")
Example #12
0
	def createSetup(self):
		print "Creating setup"
		self.list = [ ]

		self.multiType = None
		self.configMode = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.uncommittedDiseqcCommand = None
		self.cableScanType = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None
		self.advancedConnected = None

		if self.nim.isMultiType():
			try:
				multiType = self.nimConfig.multiType
				self.multiType = getConfigListEntry(_("Tuner type"), multiType)
				self.list.append(self.multiType)
			except:
				self.multiType = None

		if self.nim.isCompatible("DVB-S"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)

			if self.nimConfig.configMode.getValue() == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(pgettext("Satellite configuration mode", "Mode"), self.nimConfig.diseqcMode)
				self.list.append(self.diseqcModeEntry)
				if self.nimConfig.diseqcMode.getValue() in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.getValue())
				if self.nimConfig.diseqcMode.getValue() == "positioner":
					self.createPositionerSetup(self.list)
			elif self.nimConfig.configMode.getValue() == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.getValue() == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.getValue() == "loopthrough":
				choices = []
				print "connectable to:", nimmanager.canConnectTo(self.slotid)
				connectable = nimmanager.canConnectTo(self.slotid)
				for id in connectable:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.getValue() == "nothing":
				pass
			elif self.nimConfig.configMode.getValue() == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
				satlist = self.nimConfig.advanced.sat.keys()
				if cur_orb_pos is not None:
					if cur_orb_pos not in satlist:
						cur_orb_pos = satlist[0]
					currSat = self.nimConfig.advanced.sat[cur_orb_pos]
					self.fillListWithAdvancedSatEntrys(currSat)
				self.have_advanced = True
			if path.exists("/proc/stb/frontend/%d/tone_amplitude" % self.nim.slot) and config.usage.setup_level.index >= 2: # expert
				self.list.append(getConfigListEntry(_("Tone amplitude"), self.nimConfig.toneAmplitude))
		elif self.nim.isCompatible("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.getValue() == "enabled":
				self.list.append(getConfigListEntry(_("Network ID"), self.nimConfig.cable.scan_networkid))
				self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
				self.list.append(self.cableScanType)
				if self.nimConfig.cable.scan_type.getValue() == "provider":
					self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.cable.scan_provider))
				else:
					if self.nimConfig.cable.scan_type.getValue() == "bands":
						# TRANSLATORS: option name, indicating which type of (DVB-C) band should be scanned. The name of the band is printed in '%s'. E.g.: 'Scan EU MID band'
						self.list.append(getConfigListEntry(_("Scan %s band") % ("EU VHF I"), self.nimConfig.cable.scan_band_EU_VHF_I))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("EU MID"), self.nimConfig.cable.scan_band_EU_MID))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("EU VHF III"), self.nimConfig.cable.scan_band_EU_VHF_III))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("EU UHF IV"), self.nimConfig.cable.scan_band_EU_UHF_IV))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("EU UHF V"), self.nimConfig.cable.scan_band_EU_UHF_V))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("EU SUPER"), self.nimConfig.cable.scan_band_EU_SUPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("EU HYPER"), self.nimConfig.cable.scan_band_EU_HYPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("US LOW"), self.nimConfig.cable.scan_band_US_LOW))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("US MID"), self.nimConfig.cable.scan_band_US_MID))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("US HIGH"), self.nimConfig.cable.scan_band_US_HIGH))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("US SUPER"), self.nimConfig.cable.scan_band_US_SUPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % ("US HYPER"), self.nimConfig.cable.scan_band_US_HYPER))
					elif self.nimConfig.cable.scan_type.getValue() == "steps":
						self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
					# TRANSLATORS: option name, indicating which type of (DVB-C) modulation should be scanned. The modulation type is printed in '%s'. E.g.: 'Scan QAM16'
					self.list.append(getConfigListEntry(_("Scan %s") % ("QAM16"), self.nimConfig.cable.scan_mod_qam16))
					self.list.append(getConfigListEntry(_("Scan %s") % ("QAM32"), self.nimConfig.cable.scan_mod_qam32))
					self.list.append(getConfigListEntry(_("Scan %s") % ("QAM64"), self.nimConfig.cable.scan_mod_qam64))
					self.list.append(getConfigListEntry(_("Scan %s") % ("QAM128"), self.nimConfig.cable.scan_mod_qam128))
					self.list.append(getConfigListEntry(_("Scan %s") % ("QAM256"), self.nimConfig.cable.scan_mod_qam256))
					self.list.append(getConfigListEntry(_("Scan %s") % ("SR6900"), self.nimConfig.cable.scan_sr_6900))
					self.list.append(getConfigListEntry(_("Scan %s") % ("SR6875"), self.nimConfig.cable.scan_sr_6875))
					self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
					self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
			self.have_advanced = False
		elif self.nim.isCompatible("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.configMode.getValue() == "enabled":
				self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
				self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
		else:
			self.have_advanced = False
		self["config"].list = self.list
		self["config"].l.setList(self.list)
Example #13
0
    def createSetup(self):
        print "Creating setup"
        self.list = []

        self.multiType = None
        self.configMode = None
        self.diseqcModeEntry = None
        self.advancedSatsEntry = None
        self.advancedLnbsEntry = None
        self.advancedDiseqcMode = None
        self.advancedUsalsEntry = None
        self.advancedLof = None
        self.advancedPowerMeasurement = None
        self.turningSpeed = None
        self.turnFastEpochBegin = None
        self.turnFastEpochEnd = None
        self.uncommittedDiseqcCommand = None
        self.cableScanType = None
        self.have_advanced = False
        self.advancedUnicable = None
        self.advancedType = None
        self.advancedManufacturer = None
        self.advancedSCR = None
        self.advancedConnected = None

        if self.nim.isMultiType():
            multiType = self.nimConfig.multiType
            self.multiType = getConfigListEntry(_("Tuner type"), multiType)
            self.list.append(self.multiType)

        if self.nim.isCompatible("DVB-S"):
            self.configMode = getConfigListEntry(_("Configuration Mode"),
                                                 self.nimConfig.configMode)
            self.list.append(self.configMode)

            if self.nimConfig.configMode.value == "simple":  #simple setup
                self.diseqcModeEntry = getConfigListEntry(
                    _("Mode"), self.nimConfig.diseqcMode)
                self.list.append(self.diseqcModeEntry)
                if self.nimConfig.diseqcMode.value in ("single",
                                                       "toneburst_a_b",
                                                       "diseqc_a_b",
                                                       "diseqc_a_b_c_d"):
                    self.createSimpleSetup(self.list,
                                           self.nimConfig.diseqcMode.value)
                if self.nimConfig.diseqcMode.value == "positioner":
                    self.createPositionerSetup(self.list)
            elif self.nimConfig.configMode.value == "equal":
                choices = []
                nimlist = nimmanager.canEqualTo(self.nim.slot)
                for id in nimlist:
                    #choices.append((str(id), str(chr(65 + id))))
                    choices.append((str(id), nimmanager.getNimDescription(id)))
                self.nimConfig.connectedTo.setChoices(choices)
                #self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
                self.list.append(
                    getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == "satposdepends":
                choices = []
                nimlist = nimmanager.canDependOn(self.nim.slot)
                for id in nimlist:
                    #choices.append((str(id), str(chr(65 + id))))
                    choices.append((str(id), nimmanager.getNimDescription(id)))
                self.nimConfig.connectedTo.setChoices(choices)
                #self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
                self.list.append(
                    getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == "loopthrough":
                choices = []
                print "connectable to:", nimmanager.canConnectTo(self.slotid)
                connectable = nimmanager.canConnectTo(self.slotid)
                for id in connectable:
                    choices.append((str(id), nimmanager.getNimDescription(id)))
                self.nimConfig.connectedTo.setChoices(choices)
                #self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
                self.list.append(
                    getConfigListEntry(_("Connected to"),
                                       self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == "nothing":
                pass
            elif self.nimConfig.configMode.value == "advanced":  # advanced
                # SATs
                self.advancedSatsEntry = getConfigListEntry(
                    _("Satellite"), self.nimConfig.advanced.sats)
                self.list.append(self.advancedSatsEntry)
                cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
                satlist = self.nimConfig.advanced.sat.keys()
                if cur_orb_pos is not None:
                    if cur_orb_pos not in satlist:
                        cur_orb_pos = satlist[0]
                    currSat = self.nimConfig.advanced.sat[cur_orb_pos]
                    self.fillListWithAdvancedSatEntrys(currSat)
                self.have_advanced = True
            if self.nim.description == "Alps BSBE2" and config.usage.setup_level.index >= 2:  # expert
                self.list.append(
                    getConfigListEntry(_("Tone Amplitude"),
                                       self.nimConfig.toneAmplitude))
        elif self.nim.isCompatible("DVB-C"):
            self.configMode = getConfigListEntry(_("Configuration Mode"),
                                                 self.nimConfig.configMode)
            self.list.append(self.configMode)
            if self.nimConfig.configMode.value == "enabled":
                self.list.append(
                    getConfigListEntry(_("Network ID"),
                                       self.nimConfig.cable.scan_networkid))
                self.cableScanType = getConfigListEntry(
                    _("Used service scan type"),
                    self.nimConfig.cable.scan_type)
                self.list.append(self.cableScanType)
                if self.nimConfig.cable.scan_type.value == "provider":
                    self.list.append(
                        getConfigListEntry(_("Provider to scan"),
                                           self.nimConfig.cable.scan_provider))
                else:
                    if self.nimConfig.cable.scan_type.value == "bands":
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band EU VHF I"),
                                self.nimConfig.cable.scan_band_EU_VHF_I))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band EU MID"),
                                self.nimConfig.cable.scan_band_EU_MID))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band EU VHF III"),
                                self.nimConfig.cable.scan_band_EU_VHF_III))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band EU UHF IV"),
                                self.nimConfig.cable.scan_band_EU_UHF_IV))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band EU UHF V"),
                                self.nimConfig.cable.scan_band_EU_UHF_V))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band EU SUPER"),
                                self.nimConfig.cable.scan_band_EU_SUPER))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band EU HYPER"),
                                self.nimConfig.cable.scan_band_EU_HYPER))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band US LOW"),
                                self.nimConfig.cable.scan_band_US_LOW))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band US MID"),
                                self.nimConfig.cable.scan_band_US_MID))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band US HIGH"),
                                self.nimConfig.cable.scan_band_US_HIGH))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band US SUPER"),
                                self.nimConfig.cable.scan_band_US_SUPER))
                        self.list.append(
                            getConfigListEntry(
                                _("Scan band US HYPER"),
                                self.nimConfig.cable.scan_band_US_HYPER))
                    elif self.nimConfig.cable.scan_type.value == "steps":
                        self.list.append(
                            getConfigListEntry(
                                _("Frequency scan step size(khz)"),
                                self.nimConfig.cable.scan_frequency_steps))
                    self.list.append(
                        getConfigListEntry(
                            _("Scan QAM16"),
                            self.nimConfig.cable.scan_mod_qam16))
                    self.list.append(
                        getConfigListEntry(
                            _("Scan QAM32"),
                            self.nimConfig.cable.scan_mod_qam32))
                    self.list.append(
                        getConfigListEntry(
                            _("Scan QAM64"),
                            self.nimConfig.cable.scan_mod_qam64))
                    self.list.append(
                        getConfigListEntry(
                            _("Scan QAM128"),
                            self.nimConfig.cable.scan_mod_qam128))
                    self.list.append(
                        getConfigListEntry(
                            _("Scan QAM256"),
                            self.nimConfig.cable.scan_mod_qam256))
                    self.list.append(
                        getConfigListEntry(_("Scan SR6900"),
                                           self.nimConfig.cable.scan_sr_6900))
                    self.list.append(
                        getConfigListEntry(_("Scan SR6875"),
                                           self.nimConfig.cable.scan_sr_6875))
                    self.list.append(
                        getConfigListEntry(_("Scan additional SR"),
                                           self.nimConfig.cable.scan_sr_ext1))
                    self.list.append(
                        getConfigListEntry(_("Scan additional SR"),
                                           self.nimConfig.cable.scan_sr_ext2))
            self.have_advanced = False
        elif self.nim.isCompatible("DVB-T"):
            self.configMode = getConfigListEntry(_("Configuration Mode"),
                                                 self.nimConfig.configMode)
            self.list.append(self.configMode)
            self.have_advanced = False
            if self.nimConfig.configMode.value == "enabled":
                self.list.append(
                    getConfigListEntry(_("Terrestrial provider"),
                                       self.nimConfig.terrestrial))
                self.list.append(
                    getConfigListEntry(_("Enable 5V for active antenna"),
                                       self.nimConfig.terrestrial_5V))
        else:
            self.have_advanced = False
        self["config"].list = self.list
        self["config"].l.setList(self.list)
Example #14
0
	def createSetup(self):
		self.list = [ ]

		self.multiType = None
		self.configMode = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.toneburst = None
		self.committedDiseqcCommand = None
		self.uncommittedDiseqcCommand = None
		self.commandOrder = None
		self.cableScanType = None
		self.cableConfigScanDetails = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedFormat = None
		self.advancedPosition = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None
		self.advancedConnected = None
		self.showAdditionalMotorOptions = None
		self.selectSatsEntry = None
		self.advancedSelectSatsEntry = None
		self.singleSatEntry = None
		self.toneamplitude = None
		self.scpc = None
		self.forcelnbpower = None
		self.forcetoneburst = None
		self.terrestrialRegionsEntry = None
		self.cableRegionsEntry = None
		
		if not hasattr(self, "terrestrialCountriesEntry"):
			self.terrestrialCountriesEntry = None
		if not hasattr(self, "cableCountriesEntry"):
			self.cableCountriesEntry = None

		if self.nim.isMultiType():
			multiType = self.nimConfig.multiType
			self.multiType = getConfigListEntry(_("Tuner type"), multiType)
			self.list.append(self.multiType)

		if self.nim.isCompatible("DVB-S"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)

			if self.nimConfig.configMode.value == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(pgettext("Satellite configuration mode", "Mode"), self.nimConfig.diseqcMode)
				self.list.append(self.diseqcModeEntry)
				if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
				if self.nimConfig.diseqcMode.value in ("positioner", "positioner_select"):
					self.createPositionerSetup(self.list)
			elif self.nimConfig.configMode.value == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "loopthrough":
				choices = []
				print "connectable to:", nimmanager.canConnectTo(self.slotid)
				connectable = nimmanager.canConnectTo(self.slotid)
				for id in connectable:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "nothing":
				pass
			elif self.nimConfig.configMode.value == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				current_config_sats = self.nimConfig.advanced.sats.value
				if current_config_sats in ("3605", "3606"):
					self.advancedSelectSatsEntry = getConfigListEntry(_("Press OK to select satellites"), self.nimConfig.pressOKtoList)
					self.list.append(self.advancedSelectSatsEntry)
					self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[int(current_config_sats)])
				else:
					cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
					satlist = self.nimConfig.advanced.sat.keys()
					if cur_orb_pos is not None:
						if cur_orb_pos not in satlist:
							cur_orb_pos = satlist[0]
						self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[cur_orb_pos])
				self.have_advanced = True
			if self.nimConfig.configMode.value != "nothing" and config.usage.setup_level.index >= 2:
				if fileExists("/proc/stb/frontend/%d/tone_amplitude" % self.nim.slot):
					self.toneamplitude = getConfigListEntry(_("Tone amplitude"), self.nimConfig.toneAmplitude)
					self.list.append(self.toneamplitude)
				if fileExists("/proc/stb/frontend/%d/use_scpc_optimized_search_range" % self.nim.slot):
					self.scpc = getConfigListEntry(_("SCPC optimized search range"), self.nimConfig.scpcSearchRange)
					self.list.append(self.scpc)
				if SystemInfo["HasForceLNBOn"] and self.nim.isFBCRoot():
					self.forcelnbpower = getConfigListEntry(_("Force LNB Power"), config.misc.forceLnbPower)
					self.list.append(self.forcelnbpower)
				if SystemInfo["HasForceToneburst"] and self.nim.isFBCRoot():
					self.forcetoneburst = getConfigListEntry(_("Force ToneBurst"), config.misc.forceToneBurst)
					self.list.append(self.forcetoneburst)
		elif self.nim.isCompatible("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Network ID"), self.nimConfig.cable.scan_networkid))
				self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
				self.list.append(self.cableScanType)
				if self.nimConfig.cable.scan_type.value == "provider":
					# country/region tier one
					if self.cableCountriesEntry is None:
						cablecountrycodelist = nimmanager.getCablesCountrycodeList()
						cablecountrycode = nimmanager.getCableCountrycode(self.slotid)
						default = cablecountrycode in cablecountrycodelist and cablecountrycode or None
						choices = [("all", _("All"))]+sorted([(x, self.countrycodeToCountry(x)) for x in cablecountrycodelist], key=lambda listItem: listItem[1])
						self.cableCountries = ConfigSelection(default = default, choices = choices)
						self.cableCountriesEntry = getConfigListEntry(_("Country"), self.cableCountries)
						self.originalCableRegion = self.nimConfig.cable.scan_provider.value
					# country/region tier two
					if self.cableCountries.value == "all":
						cableNames = [x[0] for x in sorted(sorted(nimmanager.getCablesList(), key=lambda listItem: listItem[0]), key=lambda listItem: self.countrycodeToCountry(listItem[2]))]
					else:
						cableNames = sorted([x[0] for x in nimmanager.getCablesByCountrycode(self.cableCountries.value)])
					default = self.nimConfig.cable.scan_provider.value in cableNames and self.nimConfig.cable.scan_provider.value or None
					self.cableRegions = ConfigSelection(default = default, choices = cableNames)
					def updateCableProvider(configEntry):
						self.nimConfig.cable.scan_provider.value = configEntry.value
						self.nimConfig.cable.scan_provider.save()
					self.cableRegions.addNotifier(updateCableProvider)
					self.cableRegionsEntry = getConfigListEntry(_("Region"), self.cableRegions)
					self.list.append(self.cableCountriesEntry)
					self.list.append(self.cableRegionsEntry)
				else:
					self.cableConfigScanDetails = getConfigListEntry(_("Config Scan Details"), self.nimConfig.cable.config_scan_details)
					self.list.append(self.cableConfigScanDetails)
					if self.nimConfig.cable.config_scan_details.value:
						if self.nimConfig.cable.scan_type.value == "bands":
							# TRANSLATORS: option name, indicating which type of (DVB-C) band should be scanned. The name of the band is printed in '%s'. E.g.: 'Scan EU MID band'
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU VHF I"), self.nimConfig.cable.scan_band_EU_VHF_I))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU MID"), self.nimConfig.cable.scan_band_EU_MID))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU VHF III"), self.nimConfig.cable.scan_band_EU_VHF_III))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU UHF IV"), self.nimConfig.cable.scan_band_EU_UHF_IV))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU UHF V"), self.nimConfig.cable.scan_band_EU_UHF_V))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU SUPER"), self.nimConfig.cable.scan_band_EU_SUPER))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU HYPER"), self.nimConfig.cable.scan_band_EU_HYPER))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US LOW"), self.nimConfig.cable.scan_band_US_LOW))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US MID"), self.nimConfig.cable.scan_band_US_MID))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US HIGH"), self.nimConfig.cable.scan_band_US_HIGH))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US SUPER"), self.nimConfig.cable.scan_band_US_SUPER))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US HYPER"), self.nimConfig.cable.scan_band_US_HYPER))
						else:
							self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
						# TRANSLATORS: option name, indicating which type of (DVB-C) modulation should be scanned. The modulation type is printed in '%s'. E.g.: 'Scan QAM16'
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM16"), self.nimConfig.cable.scan_mod_qam16))
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM32"), self.nimConfig.cable.scan_mod_qam32))
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM64"), self.nimConfig.cable.scan_mod_qam64))
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM128"), self.nimConfig.cable.scan_mod_qam128))
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM256"), self.nimConfig.cable.scan_mod_qam256))
						self.list.append(getConfigListEntry(_("Scan %s") % ("SR6900"), self.nimConfig.cable.scan_sr_6900))
						self.list.append(getConfigListEntry(_("Scan %s") % ("SR6875"), self.nimConfig.cable.scan_sr_6875))
						self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
						self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
			self.have_advanced = False
		elif self.nim.isCompatible("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.configMode.value == "enabled":
				# country/region tier one
				if self.terrestrialCountriesEntry is None:
					terrestrialcountrycodelist = nimmanager.getTerrestrialsCountrycodeList()
					terrestrialcountrycode = nimmanager.getTerrestrialCountrycode(self.slotid)
					default = terrestrialcountrycode in terrestrialcountrycodelist and terrestrialcountrycode or None
					choices = [("all", _("All"))]+sorted([(x, self.countrycodeToCountry(x)) for x in terrestrialcountrycodelist], key=lambda listItem: listItem[1])
					self.terrestrialCountries = ConfigSelection(default = default, choices = choices)
					self.terrestrialCountriesEntry = getConfigListEntry(_("Country"), self.terrestrialCountries)
					self.originalTerrestrialRegion = self.nimConfig.terrestrial.value
				# country/region tier two
				if self.terrestrialCountries.value == "all":
					terrstrialNames = [x[0] for x in sorted(sorted(nimmanager.getTerrestrialsList(), key=lambda listItem: listItem[0]), key=lambda listItem: self.countrycodeToCountry(listItem[2]))]
				else:
					terrstrialNames = sorted([x[0] for x in nimmanager.getTerrestrialsByCountrycode(self.terrestrialCountries.value)])
				default = self.nimConfig.terrestrial.value in terrstrialNames and self.nimConfig.terrestrial.value or None
				self.terrestrialRegions = ConfigSelection(default = default, choices = terrstrialNames)
				def updateTerrestrialProvider(configEntry):
					self.nimConfig.terrestrial.value = configEntry.value
					self.nimConfig.terrestrial.save()
				self.terrestrialRegions.addNotifier(updateTerrestrialProvider)
				self.terrestrialRegionsEntry = getConfigListEntry(_("Region"), self.terrestrialRegions)
				self.list.append(self.terrestrialCountriesEntry)
				self.list.append(self.terrestrialRegionsEntry)
				self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
		elif self.nim.isCompatible("ATSC"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("ATSC provider"), self.nimConfig.atsc))
			self.have_advanced = False
		else:
			self.have_advanced = False
		self["config"].list = self.list
		self["config"].l.setList(self.list)
		self.setTextKeyYellow()
Example #15
0
	def createSetup(self):
		self.list = [ ]

		self.multiType = None
		self.configMode = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.toneburst = None
		self.committedDiseqcCommand = None
		self.uncommittedDiseqcCommand = None
		self.commandOrder = None
		self.cableScanType = None
		self.cableConfigScanDetails = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedFormat = None
		self.advancedPosition = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None
		self.advancedConnected = None
		self.showAdditionalMotorOptions = None
		self.selectSatsEntry = None
		self.advancedSelectSatsEntry = None
		self.singleSatEntry = None
		self.terrestrialRegionsEntry = None
		self.cableRegionsEntry = None

		if not hasattr(self, "terrestrialCountriesEntry"):
			self.terrestrialCountriesEntry = None

		if not hasattr(self, "cableCountriesEntry"):
			self.cableCountriesEntry = None

		self.toneamplitude = None
		self.scpc = None
		self.forcelnbpower = None
		self.forcetoneburst = None
		self.terrestrialRegionsEntry = None
		self.cableRegionsEntry = None
		
		if not hasattr(self, "terrestrialCountriesEntry"):
			self.terrestrialCountriesEntry = None
		if not hasattr(self, "cableCountriesEntry"):
			self.cableCountriesEntry = None

		if self.nim.isMultiType():
			multiType = self.nimConfig.multiType
			self.multiType = getConfigListEntry(_("Tuner type"), multiType)
			self.list.append(self.multiType)

		if self.nim.isCompatible("DVB-S"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)

			if self.nimConfig.configMode.value == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(pgettext("Satellite configuration mode", "Mode"), self.nimConfig.diseqcMode)
				self.list.append(self.diseqcModeEntry)
				if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
				if self.nimConfig.diseqcMode.value in ("positioner", "positioner_select"):
					self.createPositionerSetup(self.list)
			elif self.nimConfig.configMode.value == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "loopthrough_internal":
				choices = []
				print "internal connectable to:", nimmanager.canInternalConnectTo(self.slotid)
				connectable = nimmanager.canInternalConnectTo(self.slotid)
				for id in connectable:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Internal connected to"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "loopthrough_external":
				choices = []
				print "external connectable to:", nimmanager.canExternalConnectTo(self.slotid)
				connectable = nimmanager.canExternalConnectTo(self.slotid)
				for id in connectable:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("External connected to"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "nothing":
				pass
			elif self.nimConfig.configMode.value == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				current_config_sats = self.nimConfig.advanced.sats.value
				if current_config_sats in ("3605", "3606"):
					self.advancedSelectSatsEntry = getConfigListEntry(_("Press OK to select satellites"), self.nimConfig.pressOKtoList)
					self.list.append(self.advancedSelectSatsEntry)
					self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[int(current_config_sats)])
				else:
					cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
					satlist = self.nimConfig.advanced.sat.keys()
					if cur_orb_pos is not None:
						if cur_orb_pos not in satlist:
							cur_orb_pos = satlist[0]
						self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[cur_orb_pos])
				self.have_advanced = True
			if self.nimConfig.configMode.value != "nothing" and config.usage.setup_level.index >= 2:
				if fileExists("/proc/stb/frontend/%d/tone_amplitude" % self.nim.slot):
					self.toneamplitude = getConfigListEntry(_("Tone amplitude"), self.nimConfig.toneAmplitude)
					self.list.append(self.toneamplitude)
				if fileExists("/proc/stb/frontend/%d/use_scpc_optimized_search_range" % self.nim.slot):
					self.scpc = getConfigListEntry(_("SCPC optimized search range"), self.nimConfig.scpcSearchRange)
					self.list.append(self.scpc)
				if SystemInfo["HasForceLNBOn"] and self.nim.isFBCRoot():
					self.forcelnbpower = getConfigListEntry(_("Force LNB Power"), config.misc.forceLnbPower)
					self.list.append(self.forcelnbpower)
				if SystemInfo["HasForceToneburst"] and self.nim.isFBCRoot():
					self.forcetoneburst = getConfigListEntry(_("Force ToneBurst"), config.misc.forceToneBurst)
					self.list.append(self.forcetoneburst)
		elif self.nim.isCompatible("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Network ID"), self.nimConfig.cable.scan_networkid))
				self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
				self.list.append(self.cableScanType)
				if self.nimConfig.cable.scan_type.value == "provider":
					# country/region tier one
					if self.cableCountriesEntry is None:
						cablecountrycodelist = nimmanager.getCablesCountrycodeList()
						cablecountrycode = nimmanager.getCableCountrycode(self.slotid)
						default = cablecountrycode in cablecountrycodelist and cablecountrycode or None
						choices = [("all", _("All"))]+sorted([(x, self.countrycodeToCountry(x)) for x in cablecountrycodelist], key=lambda listItem: listItem[1])
						self.cableCountries = ConfigSelection(default = default, choices = choices)
						self.cableCountriesEntry = getConfigListEntry(_("Country"), self.cableCountries)
						self.originalCableRegion = self.nimConfig.cable.scan_provider.value
					# country/region tier two
					if self.cableCountries.value == "all":
						cableNames = [x[0] for x in sorted(sorted(nimmanager.getCablesList(), key=lambda listItem: listItem[0]), key=lambda listItem: self.countrycodeToCountry(listItem[2]))]
					else:
						cableNames = sorted([x[0] for x in nimmanager.getCablesByCountrycode(self.cableCountries.value)])
					default = self.nimConfig.cable.scan_provider.value in cableNames and self.nimConfig.cable.scan_provider.value or None
					self.cableRegions = ConfigSelection(default = default, choices = cableNames)
					def updateCableProvider(configEntry):
						self.nimConfig.cable.scan_provider.value = configEntry.value
						self.nimConfig.cable.scan_provider.save()
					self.cableRegions.addNotifier(updateCableProvider)
					self.cableRegionsEntry = getConfigListEntry(_("Region"), self.cableRegions)
					self.list.append(self.cableCountriesEntry)
					self.list.append(self.cableRegionsEntry)
				else:
					self.cableConfigScanDetails = getConfigListEntry(_("Config Scan Details"), self.nimConfig.cable.config_scan_details)
					self.list.append(self.cableConfigScanDetails)
					if self.nimConfig.cable.config_scan_details.value:
						if self.nimConfig.cable.scan_type.value == "bands":
							# TRANSLATORS: option name, indicating which type of (DVB-C) band should be scanned. The name of the band is printed in '%s'. E.g.: 'Scan EU MID band'
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU VHF I"), self.nimConfig.cable.scan_band_EU_VHF_I))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU MID"), self.nimConfig.cable.scan_band_EU_MID))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU VHF III"), self.nimConfig.cable.scan_band_EU_VHF_III))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU UHF IV"), self.nimConfig.cable.scan_band_EU_UHF_IV))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU UHF V"), self.nimConfig.cable.scan_band_EU_UHF_V))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU SUPER"), self.nimConfig.cable.scan_band_EU_SUPER))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("EU HYPER"), self.nimConfig.cable.scan_band_EU_HYPER))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US LOW"), self.nimConfig.cable.scan_band_US_LOW))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US MID"), self.nimConfig.cable.scan_band_US_MID))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US HIGH"), self.nimConfig.cable.scan_band_US_HIGH))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US SUPER"), self.nimConfig.cable.scan_band_US_SUPER))
							self.list.append(getConfigListEntry(_("Scan %s band") % ("US HYPER"), self.nimConfig.cable.scan_band_US_HYPER))
						else:
							self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
						# TRANSLATORS: option name, indicating which type of (DVB-C) modulation should be scanned. The modulation type is printed in '%s'. E.g.: 'Scan QAM16'
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM16"), self.nimConfig.cable.scan_mod_qam16))
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM32"), self.nimConfig.cable.scan_mod_qam32))
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM64"), self.nimConfig.cable.scan_mod_qam64))
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM128"), self.nimConfig.cable.scan_mod_qam128))
						self.list.append(getConfigListEntry(_("Scan %s") % ("QAM256"), self.nimConfig.cable.scan_mod_qam256))
						self.list.append(getConfigListEntry(_("Scan %s") % ("SR6900"), self.nimConfig.cable.scan_sr_6900))
						self.list.append(getConfigListEntry(_("Scan %s") % ("SR6875"), self.nimConfig.cable.scan_sr_6875))
						self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
						self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
			self.have_advanced = False
		elif self.nim.isCompatible("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.configMode.value == "enabled":
				# country/region tier one
				if self.terrestrialCountriesEntry is None:
					terrestrialcountrycodelist = nimmanager.getTerrestrialsCountrycodeList()
					terrestrialcountrycode = nimmanager.getTerrestrialCountrycode(self.slotid)
					default = terrestrialcountrycode in terrestrialcountrycodelist and terrestrialcountrycode or None
					choices = [("all", _("All"))]+sorted([(x, self.countrycodeToCountry(x)) for x in terrestrialcountrycodelist], key=lambda listItem: listItem[1])
					self.terrestrialCountries = ConfigSelection(default = default, choices = choices)
					self.terrestrialCountriesEntry = getConfigListEntry(_("Country"), self.terrestrialCountries)
					self.originalTerrestrialRegion = self.nimConfig.terrestrial.value
				# country/region tier two
				if self.terrestrialCountries.value == "all":
					terrstrialNames = [x[0] for x in sorted(sorted(nimmanager.getTerrestrialsList(), key=lambda listItem: listItem[0]), key=lambda listItem: self.countrycodeToCountry(listItem[2]))]
				else:
					terrstrialNames = sorted([x[0] for x in nimmanager.getTerrestrialsByCountrycode(self.terrestrialCountries.value)])
				default = self.nimConfig.terrestrial.value in terrstrialNames and self.nimConfig.terrestrial.value or None
				self.terrestrialRegions = ConfigSelection(default = default, choices = terrstrialNames)
				def updateTerrestrialProvider(configEntry):
					self.nimConfig.terrestrial.value = configEntry.value
					self.nimConfig.terrestrial.save()
				self.terrestrialRegions.addNotifier(updateTerrestrialProvider)
				self.terrestrialRegionsEntry = getConfigListEntry(_("Region"), self.terrestrialRegions)
				self.list.append(self.terrestrialCountriesEntry)
				self.list.append(self.terrestrialRegionsEntry)
				self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
		elif self.nim.isCompatible("ATSC"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("ATSC provider"), self.nimConfig.atsc))
			self.have_advanced = False
		else:
			self.have_advanced = False
		self["config"].list = self.list
		self["config"].l.setList(self.list)
		self.setTextKeyYellow()
Example #16
0
	def createSetup(self):
		print "[Satconfig] Creating setup"
		self.list = [ ]

		self.multiType = None
		self.configMode = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.toneburst = None
		self.committedDiseqcCommand = None
		self.uncommittedDiseqcCommand = None
		self.commandOrder = None
		self.cableScanType = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None
		self.advancedDiction = None
		self.advancedConnected = None
		self.advancedUnicableTuningAlgo = None
		self.showAdditionalMotorOptions = None
		self.selectSatsEntry = None
		self.advancedSelectSatsEntry = None
		self.singleSatEntry = None

		if self.nim.isMultiType():
			multiType = self.nimConfig.multiType
			self.multiType = getConfigListEntry(_("Tuner type"), multiType)
			self.list.append(self.multiType)

		if self.nim.isCompatible("DVB-S"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)

			if self.nimConfig.configMode.value == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(pgettext("Satellite configuration mode", "Mode"), self.nimConfig.diseqcMode)
				self.list.append(self.diseqcModeEntry)
				if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
				if self.nimConfig.diseqcMode.value in ("positioner", "positioner_select"):
					self.createPositionerSetup(self.list)
			elif self.nimConfig.configMode.value == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "loopthrough":
				choices = []
				print "[Satconfig] connectable to:", nimmanager.canConnectTo(self.slotid)
				connectable = nimmanager.canConnectTo(self.slotid)
				for id in connectable:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "nothing":
				pass
			elif self.nimConfig.configMode.value == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				current_config_sats = self.nimConfig.advanced.sats.value
				if current_config_sats in ("3605", "3606"):
					self.advancedSelectSatsEntry = getConfigListEntry(_("Press OK to select satellites"), self.nimConfig.pressOKtoList)
					self.list.append(self.advancedSelectSatsEntry)
					self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[int(current_config_sats)])
				else:
					cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
					satlist = self.nimConfig.advanced.sat.keys()
					if cur_orb_pos is not None:
						if cur_orb_pos not in satlist:
							cur_orb_pos = satlist[0]
						self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[cur_orb_pos])
				self.have_advanced = True
			if config.usage.setup_level.index >= 2:
				if fileExists("/proc/stb/frontend/%d/tone_amplitude" % self.nim.slot):
					self.list.append(getConfigListEntry(_("Tone amplitude"), self.nimConfig.toneAmplitude))
				if fileExists("/proc/stb/frontend/%d/use_scpc_optimized_search_range" % self.nim.slot):
					self.list.append(getConfigListEntry(_("SCPC optimized search range"), self.nimConfig.scpcSearchRange))
				if SystemInfo["HasForceLNBOn"] and self.nim.isFBCRoot():
					self.list.append(getConfigListEntry(_("Force LNB Power"), config.misc.forceLnbPower))
				if SystemInfo["HasForceToneburst"] and self.nim.isFBCRoot():
					self.list.append(getConfigListEntry(_("Force ToneBurst"), config.misc.forceToneBurst))
		elif self.nim.isCompatible("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Network ID"), self.nimConfig.cable.scan_networkid))
				self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
				self.list.append(self.cableScanType)
				if self.nimConfig.cable.scan_type.value == "provider":
					self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.cable.scan_provider))
				else:
					if self.nimConfig.cable.scan_type.value == "bands":
						# TRANSLATORS: option name, indicating which type of (DVB-C) band should be scanned. The name of the band is printed in '%s'. E.g.: 'Scan EU MID band'
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU VHF I", self.nimConfig.cable.scan_band_EU_VHF_I))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU MID", self.nimConfig.cable.scan_band_EU_MID))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU VHF III", self.nimConfig.cable.scan_band_EU_VHF_III))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU UHF IV", self.nimConfig.cable.scan_band_EU_UHF_IV))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU UHF V", self.nimConfig.cable.scan_band_EU_UHF_V))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU SUPER", self.nimConfig.cable.scan_band_EU_SUPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU HYPER", self.nimConfig.cable.scan_band_EU_HYPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US LOW", self.nimConfig.cable.scan_band_US_LOW))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US MID", self.nimConfig.cable.scan_band_US_MID))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US HIGH", self.nimConfig.cable.scan_band_US_HIGH))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US SUPER", self.nimConfig.cable.scan_band_US_SUPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US HYPER", self.nimConfig.cable.scan_band_US_HYPER))
					elif self.nimConfig.cable.scan_type.value == "steps":
						self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
					# TRANSLATORS: option name, indicating which type of (DVB-C) modulation should be scanned. The modulation type is printed in '%s'. E.g.: 'Scan QAM16'
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM16", self.nimConfig.cable.scan_mod_qam16))
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM32", self.nimConfig.cable.scan_mod_qam32))
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM64", self.nimConfig.cable.scan_mod_qam64))
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM128", self.nimConfig.cable.scan_mod_qam128))
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM256", self.nimConfig.cable.scan_mod_qam256))
					self.list.append(getConfigListEntry(_("Scan %s") % "SR6900", self.nimConfig.cable.scan_sr_6900))
					self.list.append(getConfigListEntry(_("Scan %s") % "SR6875", self.nimConfig.cable.scan_sr_6875))
					self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
					self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
			self.have_advanced = False
		elif self.nim.isCompatible("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
				self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
		elif self.nim.isCompatible("ATSC"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("ATSC provider"), self.nimConfig.atsc))
			self.have_advanced = False
		else:
			self.have_advanced = False
		self["config"].list = self.list
		self["config"].l.setList(self.list)
Example #17
0
	def createSetup(self):
		print "Creating setup"
		self.list = [ ]

		self.configMode = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.uncommittedDiseqcCommand = None
		self.cableScanType = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None

		if self.nim.isCompatible("DVB-S"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)

			if self.nimConfig.configMode.value == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(_("Mode"), self.nimConfig.diseqcMode)
				self.list.append(self.diseqcModeEntry)
				if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
				if self.nimConfig.diseqcMode.value == "positioner":
					self.createPositionerSetup(self.list)
			elif self.nimConfig.configMode.value == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					#choices.append((str(id), str(chr(65 + id))))
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id in nimlist:
					#choices.append((str(id), str(chr(65 + id))))
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "loopthrough":
				choices = []
				print "connectable to:", nimmanager.canConnectTo(self.slotid)
				connectable = nimmanager.canConnectTo(self.slotid)
				for id in connectable:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "nothing":
				pass
			elif self.nimConfig.configMode.value == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
				satlist = self.nimConfig.advanced.sat.keys()
				if cur_orb_pos is not None:
					if cur_orb_pos not in satlist:
						cur_orb_pos = satlist[0]
					currSat = self.nimConfig.advanced.sat[cur_orb_pos]
					self.fillListWithAdvancedSatEntrys(currSat)
				self.have_advanced = True
		elif self.nim.isCompatible("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
				self.list.append(self.cableScanType)
				if self.nimConfig.cable.scan_type.value == "provider":
					self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.cable.scan_provider))
				else:
					if self.nimConfig.cable.scan_type.value == "bands":
						self.list.append(getConfigListEntry(_("Scan band EU VHF I"), self.nimConfig.cable.scan_band_EU_VHF_I))
						self.list.append(getConfigListEntry(_("Scan band EU MID"), self.nimConfig.cable.scan_band_EU_MID))
						self.list.append(getConfigListEntry(_("Scan band EU VHF III"), self.nimConfig.cable.scan_band_EU_VHF_III))
						self.list.append(getConfigListEntry(_("Scan band EU UHF IV"), self.nimConfig.cable.scan_band_EU_UHF_IV))
						self.list.append(getConfigListEntry(_("Scan band EU UHF V"), self.nimConfig.cable.scan_band_EU_UHF_V))
						self.list.append(getConfigListEntry(_("Scan band EU SUPER"), self.nimConfig.cable.scan_band_EU_SUPER))
						self.list.append(getConfigListEntry(_("Scan band EU HYPER"), self.nimConfig.cable.scan_band_EU_HYPER))
						self.list.append(getConfigListEntry(_("Scan band US LOW"), self.nimConfig.cable.scan_band_US_LOW))
						self.list.append(getConfigListEntry(_("Scan band US MID"), self.nimConfig.cable.scan_band_US_MID))
						self.list.append(getConfigListEntry(_("Scan band US HIGH"), self.nimConfig.cable.scan_band_US_HIGH))
						self.list.append(getConfigListEntry(_("Scan band US SUPER"), self.nimConfig.cable.scan_band_US_SUPER))
						self.list.append(getConfigListEntry(_("Scan band US HYPER"), self.nimConfig.cable.scan_band_US_HYPER))
					elif self.nimConfig.cable.scan_type.value == "steps":
						self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
					self.list.append(getConfigListEntry(_("Scan QAM16"), self.nimConfig.cable.scan_mod_qam16))
					self.list.append(getConfigListEntry(_("Scan QAM32"), self.nimConfig.cable.scan_mod_qam32))
					self.list.append(getConfigListEntry(_("Scan QAM64"), self.nimConfig.cable.scan_mod_qam64))
					self.list.append(getConfigListEntry(_("Scan QAM128"), self.nimConfig.cable.scan_mod_qam128))
					self.list.append(getConfigListEntry(_("Scan QAM256"), self.nimConfig.cable.scan_mod_qam256))
					self.list.append(getConfigListEntry(_("Scan SR6900"), self.nimConfig.cable.scan_sr_6900))
					self.list.append(getConfigListEntry(_("Scan SR6875"), self.nimConfig.cable.scan_sr_6875))
					self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
					self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
			self.have_advanced = False
		elif self.nim.isCompatible("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
				self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
		else:
			self.have_advanced = False
		self["config"].list = self.list
		self["config"].l.setList(self.list)
Example #18
0
	def createSetup(self):
		print "[Satconfig] Creating setup"
		self.list = [ ]

		self.multiType = None
		self.configMode = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.toneburst = None
		self.committedDiseqcCommand = None
		self.uncommittedDiseqcCommand = None
		self.commandOrder = None
		self.cableScanType = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedFormat = None
		self.advancedPosition = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None
		self.advancedConnected = None
		self.showAdditionalMotorOptions = None
		self.selectSatsEntry = None
		self.advancedSelectSatsEntry = None
		self.singleSatEntry = None

		if self.nim.isMultiType():
			multiType = self.nimConfig.multiType
			self.multiType = getConfigListEntry(_("Tuner type"), multiType)
			self.list.append(self.multiType)

		if self.nim.isCompatible("DVB-S"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)

			if self.nimConfig.configMode.value == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(pgettext("Satellite configuration mode", "Mode"), self.nimConfig.diseqcMode)
				self.list.append(self.diseqcModeEntry)
				if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
				if self.nimConfig.diseqcMode.value in ("positioner", "positioner_select"):
					self.createPositionerSetup(self.list)
			elif self.nimConfig.configMode.value == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "loopthrough":
				choices = []
				print "[Satconfig] connectable to:", nimmanager.canConnectTo(self.slotid)
				connectable = nimmanager.canConnectTo(self.slotid)
				for id in connectable:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo))
			elif self.nimConfig.configMode.value == "nothing":
				pass
			elif self.nimConfig.configMode.value == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				current_config_sats = self.nimConfig.advanced.sats.value
				if current_config_sats in ("3605", "3606"):
					self.advancedSelectSatsEntry = getConfigListEntry(_("Press OK to select satellites"), self.nimConfig.pressOKtoList)
					self.list.append(self.advancedSelectSatsEntry)
					self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[int(current_config_sats)])
				else:
					cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
					satlist = self.nimConfig.advanced.sat.keys()
					if cur_orb_pos is not None:
						if cur_orb_pos not in satlist:
							cur_orb_pos = satlist[0]
						self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[cur_orb_pos])
				self.have_advanced = True
			if config.usage.setup_level.index >= 2:
				if fileExists("/proc/stb/frontend/%d/tone_amplitude" % self.nim.slot):
					self.list.append(getConfigListEntry(_("Tone amplitude"), self.nimConfig.toneAmplitude))
				if fileExists("/proc/stb/frontend/%d/use_scpc_optimized_search_range" % self.nim.slot):
					self.list.append(getConfigListEntry(_("SCPC optimized search range"), self.nimConfig.scpcSearchRange))
				if SystemInfo["HasForceLNBOn"] and self.nim.isFBCRoot():
					self.list.append(getConfigListEntry(_("Force LNB Power"), config.misc.forceLnbPower))
				if SystemInfo["HasForceToneburst"] and self.nim.isFBCRoot():
					self.list.append(getConfigListEntry(_("Force ToneBurst"), config.misc.forceToneBurst))
		elif self.nim.isCompatible("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Network ID"), self.nimConfig.cable.scan_networkid))
				self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
				self.list.append(self.cableScanType)
				if self.nimConfig.cable.scan_type.value == "provider":
					self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.cable.scan_provider))
				else:
					if self.nimConfig.cable.scan_type.value == "bands":
						# TRANSLATORS: option name, indicating which type of (DVB-C) band should be scanned. The name of the band is printed in '%s'. E.g.: 'Scan EU MID band'
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU VHF I", self.nimConfig.cable.scan_band_EU_VHF_I))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU MID", self.nimConfig.cable.scan_band_EU_MID))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU VHF III", self.nimConfig.cable.scan_band_EU_VHF_III))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU UHF IV", self.nimConfig.cable.scan_band_EU_UHF_IV))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU UHF V", self.nimConfig.cable.scan_band_EU_UHF_V))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU SUPER", self.nimConfig.cable.scan_band_EU_SUPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU HYPER", self.nimConfig.cable.scan_band_EU_HYPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US LOW", self.nimConfig.cable.scan_band_US_LOW))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US MID", self.nimConfig.cable.scan_band_US_MID))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US HIGH", self.nimConfig.cable.scan_band_US_HIGH))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US SUPER", self.nimConfig.cable.scan_band_US_SUPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US HYPER", self.nimConfig.cable.scan_band_US_HYPER))
					elif self.nimConfig.cable.scan_type.value == "steps":
						self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
					# TRANSLATORS: option name, indicating which type of (DVB-C) modulation should be scanned. The modulation type is printed in '%s'. E.g.: 'Scan QAM16'
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM16", self.nimConfig.cable.scan_mod_qam16))
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM32", self.nimConfig.cable.scan_mod_qam32))
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM64", self.nimConfig.cable.scan_mod_qam64))
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM128", self.nimConfig.cable.scan_mod_qam128))
					self.list.append(getConfigListEntry(_("Scan %s") % "QAM256", self.nimConfig.cable.scan_mod_qam256))
					self.list.append(getConfigListEntry(_("Scan %s") % "SR6900", self.nimConfig.cable.scan_sr_6900))
					self.list.append(getConfigListEntry(_("Scan %s") % "SR6875", self.nimConfig.cable.scan_sr_6875))
					self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
					self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
			self.have_advanced = False
		elif self.nim.isCompatible("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
				self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
		elif self.nim.isCompatible("ATSC"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("ATSC provider"), self.nimConfig.atsc))
			self.have_advanced = False
		else:
			self.have_advanced = False
		self["config"].list = self.list
		self["config"].l.setList(self.list)
Example #19
0
	def createSetup(self, fill_advanced_sat=True):
		print "Creating setup"
		self.list = [ ]

		self.multiType = None
		self.configMode = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.uncommittedDiseqcCommand = None
		self.cableScanType = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None
		self.advancedConnected = None
		self.advancedDepends = None
		self.unicableUsePinEntry = None
		
		multiType = self.nimConfig.multiType
		self.multiType = getConfigListEntry(_("Tuner type"), multiType)
		if multiType.enabled:
			self.list.append(self.multiType)

		curType = self.nim.types[multiType.value]
		if curType.startswith("DVB-S"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.sat.configMode)
			self.list.append(self.configMode)
			configMode = self.nimConfig.sat.configMode.value
			if configMode == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(_("Mode"), self.nimConfig.diseqcMode)
				self.list.append(self.diseqcModeEntry)
				if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
				if self.nimConfig.diseqcMode.value == "positioner":
					self.createPositionerSetup(self.list)
			elif configMode == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					#choices.append((str(id), str(chr(65 + id))))
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif configMode == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id, type in nimlist:
					#choices.append((str(id), str(chr(65 + id))))
					if type == 0:
						choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif configMode == "loopthrough":
				choices = []
				connectable = nimmanager.canConnectTo(self.slotid)
				print "connectable to:", connectable
				for id, type in connectable:
					if type == 0:
						choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.nimConfig.sat.configMode.connectedToChanged(self.nimConfig.connectedTo) # call connectedTo Notifier
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif configMode == "nothing":
				pass
			elif configMode == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
				if cur_orb_pos is not None and fill_advanced_sat:
					satlist = self.nimConfig.advanced.sat.keys()
					if cur_orb_pos not in satlist:
						cur_orb_pos = satlist[0]
					currSat = self.nimConfig.advanced.sat[cur_orb_pos]
					self.fillListWithAdvancedSatEntrys(currSat)
				self.have_advanced = True
			if config.usage.setup_level.index >= 2: # expert
				name = self.nim.description
				if name == "Alps BSBE2":
					self.list.append(getConfigListEntry(_("Tone Amplitude"), self.nimConfig.toneAmplitude))
				if self.nimConfig.scpcSearchRange.fe_id is not None and configMode != "nothing":
					self.list.append(getConfigListEntry(_("SCPC optimized search range"), self.nimConfig.scpcSearchRange))

		elif curType.startswith("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.cable.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.cable.configMode.value == "enabled":
				if not self.nim.description.startswith("Si2169"):
					self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
					self.list.append(self.cableScanType)
					if self.nimConfig.cable.scan_type.value == "provider":
						self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.cable.scan_provider))
					else:
						if self.nimConfig.cable.scan_type.value == "bands":
							self.list.append(getConfigListEntry(_("Scan band EU VHF I"), self.nimConfig.cable.scan_band_EU_VHF_I))
							self.list.append(getConfigListEntry(_("Scan band EU MID"), self.nimConfig.cable.scan_band_EU_MID))
							self.list.append(getConfigListEntry(_("Scan band EU VHF III"), self.nimConfig.cable.scan_band_EU_VHF_III))
							self.list.append(getConfigListEntry(_("Scan band EU UHF IV"), self.nimConfig.cable.scan_band_EU_UHF_IV))
							self.list.append(getConfigListEntry(_("Scan band EU UHF V"), self.nimConfig.cable.scan_band_EU_UHF_V))
							self.list.append(getConfigListEntry(_("Scan band EU SUPER"), self.nimConfig.cable.scan_band_EU_SUPER))
							self.list.append(getConfigListEntry(_("Scan band EU HYPER"), self.nimConfig.cable.scan_band_EU_HYPER))
							self.list.append(getConfigListEntry(_("Scan band US LOW"), self.nimConfig.cable.scan_band_US_LOW))
							self.list.append(getConfigListEntry(_("Scan band US MID"), self.nimConfig.cable.scan_band_US_MID))
							self.list.append(getConfigListEntry(_("Scan band US HIGH"), self.nimConfig.cable.scan_band_US_HIGH))
							self.list.append(getConfigListEntry(_("Scan band US SUPER"), self.nimConfig.cable.scan_band_US_SUPER))
							self.list.append(getConfigListEntry(_("Scan band US HYPER"), self.nimConfig.cable.scan_band_US_HYPER))
							self.list.append(getConfigListEntry(_("Scan band US JUMBO"), self.nimConfig.cable.scan_band_US_JUMBO))
							self.list.append(getConfigListEntry(_("Scan band US ULTRA"), self.nimConfig.cable.scan_band_US_ULTRA))
						elif self.nimConfig.cable.scan_type.value == "steps":
							self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
						if self.nim.description != "ATBM781x":
							self.list.append(getConfigListEntry(_("Scan QAM16"), self.nimConfig.cable.scan_mod_qam16))
							self.list.append(getConfigListEntry(_("Scan QAM32"), self.nimConfig.cable.scan_mod_qam32))
							self.list.append(getConfigListEntry(_("Scan QAM64"), self.nimConfig.cable.scan_mod_qam64))
							self.list.append(getConfigListEntry(_("Scan QAM128"), self.nimConfig.cable.scan_mod_qam128))
							self.list.append(getConfigListEntry(_("Scan QAM256"), self.nimConfig.cable.scan_mod_qam256))
							self.list.append(getConfigListEntry(_("Scan SR6900"), self.nimConfig.cable.scan_sr_6900))
							self.list.append(getConfigListEntry(_("Scan SR6875"), self.nimConfig.cable.scan_sr_6875))
							self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
							self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
			self.have_advanced = False
		elif curType.startswith("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.terrest.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.terrest.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrest.provider))
				self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrest.use5V))
		else:
			self.have_advanced = False
		self["config"].list = self.list
		self["config"].l.setList(self.list)
Example #20
0
	def createSetup(self):
		print "Creating setup"
		self.list = [ ]

		self.multiType = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.toneburst = None
		self.committedDiseqcCommand = None
		self.uncommittedDiseqcCommand = None
		self.commandOrder = None
		self.cableScanType = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None
		self.advancedDiction = None
		self.advancedConnected = None
		self.advancedUnicableTuningAlgo = None
		self.showAdditionalMotorOptions = None
		self.selectSatsEntry = None
		self.advancedSelectSatsEntry = None
		self.singleSatEntry = None

		if self.nim.isMultiType():
			try:
				multiType = self.nimConfig.multiType
				choices = "("
				for x in multiType.choices.choices:		# Set list entry corresponding to the current tuner type
					if self.nim.isCompatible(x[1]):
						multiType.setValue(x[0])
					choices += x[1]
					choices += ", "
				choices = choices[:-2] + ")"
				self.multiType = getConfigListEntry(_("Tuner type %s")%(choices), multiType, _("You can switch with left and right this tuner types %s")%(choices))
				self.list.append(self.multiType)
			except:
				self.multiType = None

		if self.nim.isCompatible("DVB-S"):
			nimConfig = self.nimConfig.dvbs
			self.configMode = getConfigListEntry(_("Configuration mode"), nimConfig.configMode, _("Change Configuration mode simple to advanced"))
			self.list.append(self.configMode)

			if nimConfig.configMode.value == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(pgettext(_("Satellite configuration mode"), _("Mode")), nimConfig.diseqcMode, _("Change settings for your switch modes: single lnb, tonburst or diseqc"))
				self.list.append(self.diseqcModeEntry)
				if nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, nimConfig.diseqcMode.value)
				if nimConfig.diseqcMode.value in ("positioner", "positioner_select"):
					self.createPositionerSetup(self.list)
			elif nimConfig.configMode.value == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), nimConfig.connectedTo))
			elif nimConfig.configMode.value == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id in nimlist:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Tuner"), nimConfig.connectedTo))
			elif nimConfig.configMode.value == "loopthrough":
				choices = []
				print "connectable to:", nimmanager.canConnectTo(self.slotid)
				connectable = nimmanager.canConnectTo(self.slotid)
				for id in connectable:
					choices.append((str(id), nimmanager.getNimDescription(id)))
				nimConfig.connectedTo.setChoices(choices)
				self.list.append(getConfigListEntry(_("Connected to"), nimConfig.connectedTo))
			elif nimConfig.configMode.value == "nothing":
				pass
			elif nimConfig.configMode.value == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				current_config_sats = nimConfig.advanced.sats.value
				if current_config_sats in ("3605", "3606"):
					self.advancedSelectSatsEntry = getConfigListEntry(_("Press OK to select satellites"), nimConfig.pressOKtoList)
					self.list.append(self.advancedSelectSatsEntry)
					self.fillListWithAdvancedSatEntrys(nimConfig.advanced.sat[int(current_config_sats)])
				else:
					cur_orb_pos = nimConfig.advanced.sats.orbital_position
					satlist = nimConfig.advanced.sat.keys()
					if cur_orb_pos is not None:
						if cur_orb_pos not in satlist:
							cur_orb_pos = satlist[0]
						self.fillListWithAdvancedSatEntrys(nimConfig.advanced.sat[cur_orb_pos])
				self.have_advanced = True
			if path.exists("/proc/stb/frontend/%d/tone_amplitude" % self.nim.slot) and config.usage.setup_level.index >= 2: # expert
				self.list.append(getConfigListEntry(_("Tone amplitude"), nimConfig.toneAmplitude))
			if path.exists("/proc/stb/frontend/%d/use_scpc_optimized_search_range" % self.nim.slot) and config.usage.setup_level.index >= 2: # expert
				self.list.append(getConfigListEntry(_("SCPC optimized search range"), nimConfig.scpcSearchRange))

		elif self.nim.isCompatible("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.dvbc.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.dvbc.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Network ID"), self.nimConfig.dvbc.scan_networkid))
				self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.dvbc.scan_type)
				self.list.append(self.cableScanType)
				if self.nimConfig.dvbc.scan_type.value == "provider":
					self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.dvbc.scan_provider))
				else:
					if self.nimConfig.dvbc.scan_type.value == "bands":
						# TRANSLATORS: option name, indicating which type of (DVB-C) band should be scanned. The name of the band is printed in '%s'. E.g.: 'Scan EU MID band'
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU VHF I", self.nimConfig.dvbc.scan_band_EU_VHF_I))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU MID", self.nimConfig.dvbc.scan_band_EU_MID))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU VHF III", self.nimConfig.dvbc.scan_band_EU_VHF_III))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU UHF IV", self.nimConfig.dvbc.scan_band_EU_UHF_IV))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU UHF V", self.nimConfig.dvbc.scan_band_EU_UHF_V))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU SUPER", self.nimConfig.dvbc.scan_band_EU_SUPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "EU HYPER", self.nimConfig.dvbc.scan_band_EU_HYPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US LOW", self.nimConfig.dvbc.scan_band_US_LOW))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US MID", self.nimConfig.dvbc.scan_band_US_MID))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US HIGH", self.nimConfig.dvbc.scan_band_US_HIGH))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US SUPER", self.nimConfig.dvbc.scan_band_US_SUPER))
						self.list.append(getConfigListEntry(_("Scan %s band") % "US HYPER", self.nimConfig.dvbc.scan_band_US_HYPER))
					elif self.nimConfig.dvbc.scan_type.value == "steps":
						self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.dvbc.scan_frequency_steps))
					# TRANSLATORS: option name, indicating which type of (DVB-C) modulation should be scanned. The modulation type is printed in '%s'. E.g.: 'Scan QAM16'
					if self.nim.description != "ATBM781x":
						self.list.append(getConfigListEntry(_("Scan %s") % "QAM16", self.nimConfig.dvbc.scan_mod_qam16))
						self.list.append(getConfigListEntry(_("Scan %s") % "QAM32", self.nimConfig.dvbc.scan_mod_qam32))
						self.list.append(getConfigListEntry(_("Scan %s") % "QAM64", self.nimConfig.dvbc.scan_mod_qam64))
						self.list.append(getConfigListEntry(_("Scan %s") % "QAM128", self.nimConfig.dvbc.scan_mod_qam128))
						self.list.append(getConfigListEntry(_("Scan %s") % "QAM256", self.nimConfig.dvbc.scan_mod_qam256))
						self.list.append(getConfigListEntry(_("Scan %s") % "SR6900", self.nimConfig.dvbc.scan_sr_6900))
						self.list.append(getConfigListEntry(_("Scan %s") % "SR6875", self.nimConfig.dvbc.scan_sr_6875))
						self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.dvbc.scan_sr_ext1))
						self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.dvbc.scan_sr_ext2))
			self.have_advanced = False
		elif self.nim.isCompatible("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.dvbt.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.dvbt.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.dvbt.terrestrial))
				if not getBoxType() in ('spycat'):
					self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.dvbt.terrestrial_5V))
		elif self.nim.isCompatible("ATSC"):
			self.configMode = getConfigListEntry(_("Configuration mode"), self.nimConfig.atsc.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.atsc.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("ATSC provider"), self.nimConfig.atsc.atsc))
			self.have_advanced = False
		else:
			self.have_advanced = False
		self["config"].list = self.list
		self["config"].l.setList(self.list)
Example #21
0
	def createSetup(self, fill_advanced_sat=True):
		print("Creating setup")
		self.list = [ ]

		self.multiType = None
		self.configMode = None
		self.diseqcModeEntry = None
		self.advancedSatsEntry = None
		self.advancedLnbsEntry = None
		self.advancedDiseqcMode = None
		self.advancedUsalsEntry = None
		self.advancedLof = None
		self.advancedPowerMeasurement = None
		self.turningSpeed = None
		self.turnFastEpochBegin = None
		self.turnFastEpochEnd = None
		self.uncommittedDiseqcCommand = None
		self.cableScanType = None
		self.have_advanced = False
		self.advancedUnicable = None
		self.advancedType = None
		self.advancedManufacturer = None
		self.advancedSCR = None
		self.advancedConnected = None
		self.advancedDepends = None
		self.unicableUsePinEntry = None
		
		multiType = self.nimConfig.multiType
		self.multiType = getConfigListEntry(_("Tuner type"), multiType)
		if multiType.enabled:
			self.list.append(self.multiType)

		curType = self.nim.types.get(multiType.value, "")
		if curType.startswith("DVB-S"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.sat.configMode)
			self.list.append(self.configMode)
			configMode = self.nimConfig.sat.configMode.value
			if configMode == "simple":			#simple setup
				self.diseqcModeEntry = getConfigListEntry(_("Mode"), self.nimConfig.diseqcMode)
				self.list.append(self.diseqcModeEntry)
				if self.nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
					self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
				if self.nimConfig.diseqcMode.value == "positioner":
					self.createPositionerSetup(self.list)
			elif configMode == "equal":
				choices = []
				nimlist = nimmanager.canEqualTo(self.nim.slot)
				for id in nimlist:
					#choices.append((str(id), str(chr(65 + id))))
					choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif configMode == "satposdepends":
				choices = []
				nimlist = nimmanager.canDependOn(self.nim.slot)
				for id, type in nimlist:
					#choices.append((str(id), str(chr(65 + id))))
					if type == 0:
						choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif configMode == "loopthrough":
				choices = []
				connectable = nimmanager.canConnectTo(self.slotid)
				print("connectable to:", connectable)
				for id, type in connectable:
					if type == 0:
						choices.append((str(id), nimmanager.getNimDescription(id)))
				self.nimConfig.connectedTo.setChoices(choices)
				self.nimConfig.sat.configMode.connectedToChanged(self.nimConfig.connectedTo) # call connectedTo Notifier
				#self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
				self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
			elif configMode == "nothing":
				pass
			elif configMode == "advanced": # advanced
				# SATs
				self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
				self.list.append(self.advancedSatsEntry)
				cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
				if cur_orb_pos is not None and fill_advanced_sat:
					satlist = list(self.nimConfig.advanced.sat.keys())
					if cur_orb_pos not in satlist:
						cur_orb_pos = satlist[0]
					currSat = self.nimConfig.advanced.sat[cur_orb_pos]
					self.fillListWithAdvancedSatEntrys(currSat)
				self.have_advanced = True
			if config.usage.setup_level.index >= 2: # expert
				name = self.nim.description
				if name == "Alps BSBE2":
					self.list.append(getConfigListEntry(_("Tone Amplitude"), self.nimConfig.toneAmplitude))
				if self.nimConfig.scpcSearchRange.fe_id is not None and configMode != "nothing":
					self.list.append(getConfigListEntry(_("SCPC optimized search range"), self.nimConfig.scpcSearchRange))

		elif curType.startswith("DVB-C"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.cable.configMode)
			self.list.append(self.configMode)
			if self.nimConfig.cable.configMode.value == "enabled":
				if not self.nim.description.startswith("Si2169"):
					self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
					self.list.append(self.cableScanType)
					if self.nimConfig.cable.scan_type.value == "provider":
						self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.cable.scan_provider))
					else:
						if self.nimConfig.cable.scan_type.value == "bands":
							self.list.append(getConfigListEntry(_("Scan band EU VHF I"), self.nimConfig.cable.scan_band_EU_VHF_I))
							self.list.append(getConfigListEntry(_("Scan band EU MID"), self.nimConfig.cable.scan_band_EU_MID))
							self.list.append(getConfigListEntry(_("Scan band EU VHF III"), self.nimConfig.cable.scan_band_EU_VHF_III))
							self.list.append(getConfigListEntry(_("Scan band EU UHF IV"), self.nimConfig.cable.scan_band_EU_UHF_IV))
							self.list.append(getConfigListEntry(_("Scan band EU UHF V"), self.nimConfig.cable.scan_band_EU_UHF_V))
							self.list.append(getConfigListEntry(_("Scan band EU SUPER"), self.nimConfig.cable.scan_band_EU_SUPER))
							self.list.append(getConfigListEntry(_("Scan band EU HYPER"), self.nimConfig.cable.scan_band_EU_HYPER))
							self.list.append(getConfigListEntry(_("Scan band US LOW"), self.nimConfig.cable.scan_band_US_LOW))
							self.list.append(getConfigListEntry(_("Scan band US MID"), self.nimConfig.cable.scan_band_US_MID))
							self.list.append(getConfigListEntry(_("Scan band US HIGH"), self.nimConfig.cable.scan_band_US_HIGH))
							self.list.append(getConfigListEntry(_("Scan band US SUPER"), self.nimConfig.cable.scan_band_US_SUPER))
							self.list.append(getConfigListEntry(_("Scan band US HYPER"), self.nimConfig.cable.scan_band_US_HYPER))
							self.list.append(getConfigListEntry(_("Scan band US JUMBO"), self.nimConfig.cable.scan_band_US_JUMBO))
							self.list.append(getConfigListEntry(_("Scan band US ULTRA"), self.nimConfig.cable.scan_band_US_ULTRA))
						elif self.nimConfig.cable.scan_type.value == "steps":
							self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
						if self.nim.description != "ATBM781x":
							if not nimmanager.nim_slots[self.slotid].can_modulation_auto:
								self.list.append(getConfigListEntry(_("Scan QAM16"), self.nimConfig.cable.scan_mod_qam16))
								self.list.append(getConfigListEntry(_("Scan QAM32"), self.nimConfig.cable.scan_mod_qam32))
								self.list.append(getConfigListEntry(_("Scan QAM64"), self.nimConfig.cable.scan_mod_qam64))
								self.list.append(getConfigListEntry(_("Scan QAM128"), self.nimConfig.cable.scan_mod_qam128))
								self.list.append(getConfigListEntry(_("Scan QAM256"), self.nimConfig.cable.scan_mod_qam256))
							self.list.append(getConfigListEntry(_("Scan SR6900"), self.nimConfig.cable.scan_sr_6900))
							self.list.append(getConfigListEntry(_("Scan SR6875"), self.nimConfig.cable.scan_sr_6875))
							self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
							self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
			self.have_advanced = False
		elif curType.startswith("DVB-T"):
			self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.terrest.configMode)
			self.list.append(self.configMode)
			self.have_advanced = False
			if self.nimConfig.terrest.configMode.value == "enabled":
				self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrest.provider))
				self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrest.use5V))
		else:
			self.have_advanced = False

		self._getConfig().list = self.list
		self._getConfig().l.setList(self.list)
Example #22
0
    def createSetup(self):
        print 'Creating setup'
        self.list = []
        self.multiType = None
        self.configMode = None
        self.diseqcModeEntry = None
        self.advancedSatsEntry = None
        self.advancedLnbsEntry = None
        self.advancedDiseqcMode = None
        self.advancedUsalsEntry = None
        self.advancedLof = None
        self.advancedPowerMeasurement = None
        self.turningSpeed = None
        self.turnFastEpochBegin = None
        self.turnFastEpochEnd = None
        self.toneburst = None
        self.committedDiseqcCommand = None
        self.uncommittedDiseqcCommand = None
        self.commandOrder = None
        self.cableScanType = None
        self.have_advanced = False
        self.advancedUnicable = None
        self.advancedType = None
        self.advancedManufacturer = None
        self.advancedSCR = None
        self.advancedDiction = None
        self.advancedConnected = None
        self.showAdditionalMotorOptions = None
        self.selectSatsEntry = None
        self.advancedSelectSatsEntry = None
        self.singleSatEntry = None
        if self.nim.isMultiType():
            try:
                multiType = self.nimConfig.multiType
                self.multiType = getConfigListEntry(_('Tuner type'), multiType)
                self.list.append(self.multiType)
            except:
                self.multiType = None

        if self.nim.isCompatible('DVB-S'):
            self.configMode = getConfigListEntry(_('Configuration mode'), self.nimConfig.configMode)
            self.list.append(self.configMode)
            if self.nimConfig.configMode.value == 'simple':
                self.diseqcModeEntry = getConfigListEntry(pgettext('Satellite configuration mode', 'Mode'), self.nimConfig.diseqcMode)
                self.list.append(self.diseqcModeEntry)
                if self.nimConfig.diseqcMode.value in ('single', 'toneburst_a_b', 'diseqc_a_b', 'diseqc_a_b_c_d'):
                    self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
                if self.nimConfig.diseqcMode.value in ('positioner', 'positioner_select'):
                    self.createPositionerSetup(self.list)
            elif self.nimConfig.configMode.value == 'equal':
                choices = []
                nimlist = nimmanager.canEqualTo(self.nim.slot)
                for id in nimlist:
                    choices.append((str(id), nimmanager.getNimDescription(id)))

                self.nimConfig.connectedTo.setChoices(choices)
                self.list.append(getConfigListEntry(_('Tuner'), self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == 'satposdepends':
                choices = []
                nimlist = nimmanager.canDependOn(self.nim.slot)
                for id in nimlist:
                    choices.append((str(id), nimmanager.getNimDescription(id)))

                self.nimConfig.connectedTo.setChoices(choices)
                self.list.append(getConfigListEntry(_('Tuner'), self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == 'loopthrough':
                choices = []
                print 'connectable to:', nimmanager.canConnectTo(self.slotid)
                connectable = nimmanager.canConnectTo(self.slotid)
                for id in connectable:
                    choices.append((str(id), nimmanager.getNimDescription(id)))

                self.nimConfig.connectedTo.setChoices(choices)
                self.list.append(getConfigListEntry(_('Connected to'), self.nimConfig.connectedTo))
            elif self.nimConfig.configMode.value == 'nothing':
                pass
            elif self.nimConfig.configMode.value == 'advanced':
                self.advancedSatsEntry = getConfigListEntry(_('Satellite'), self.nimConfig.advanced.sats)
                self.list.append(self.advancedSatsEntry)
                current_config_sats = self.nimConfig.advanced.sats.value
                if current_config_sats in ('3605', '3606'):
                    self.advancedSelectSatsEntry = getConfigListEntry(_('Press OK to select satellites'), self.nimConfig.pressOKtoList)
                    self.list.append(self.advancedSelectSatsEntry)
                    self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[int(current_config_sats)])
                else:
                    cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
                    satlist = self.nimConfig.advanced.sat.keys()
                    if cur_orb_pos is not None:
                        if cur_orb_pos not in satlist:
                            cur_orb_pos = satlist[0]
                        self.fillListWithAdvancedSatEntrys(self.nimConfig.advanced.sat[cur_orb_pos])
                self.have_advanced = True
            if path.exists('/proc/stb/frontend/%d/tone_amplitude' % self.nim.slot) and config.usage.setup_level.index >= 2:
                self.list.append(getConfigListEntry(_('Tone amplitude'), self.nimConfig.toneAmplitude))
            if path.exists('/proc/stb/frontend/%d/use_scpc_optimized_search_range' % self.nim.slot) and config.usage.setup_level.index >= 2:
                self.list.append(getConfigListEntry(_('SCPC optimized search range'), self.nimConfig.scpcSearchRange))
        elif self.nim.isCompatible('DVB-C'):
            self.configMode = getConfigListEntry(_('Configuration mode'), self.nimConfig.configMode)
            self.list.append(self.configMode)
            if self.nimConfig.configMode.value == 'enabled':
                self.list.append(getConfigListEntry(_('Network ID'), self.nimConfig.cable.scan_networkid))
                self.cableScanType = getConfigListEntry(_('Used service scan type'), self.nimConfig.cable.scan_type)
                self.list.append(self.cableScanType)
                if self.nimConfig.cable.scan_type.value == 'provider':
                    self.list.append(getConfigListEntry(_('Provider to scan'), self.nimConfig.cable.scan_provider))
                else:
                    if self.nimConfig.cable.scan_type.value == 'bands':
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'EU VHF I', self.nimConfig.cable.scan_band_EU_VHF_I))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'EU MID', self.nimConfig.cable.scan_band_EU_MID))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'EU VHF III', self.nimConfig.cable.scan_band_EU_VHF_III))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'EU UHF IV', self.nimConfig.cable.scan_band_EU_UHF_IV))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'EU UHF V', self.nimConfig.cable.scan_band_EU_UHF_V))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'EU SUPER', self.nimConfig.cable.scan_band_EU_SUPER))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'EU HYPER', self.nimConfig.cable.scan_band_EU_HYPER))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'US LOW', self.nimConfig.cable.scan_band_US_LOW))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'US MID', self.nimConfig.cable.scan_band_US_MID))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'US HIGH', self.nimConfig.cable.scan_band_US_HIGH))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'US SUPER', self.nimConfig.cable.scan_band_US_SUPER))
                        self.list.append(getConfigListEntry(_('Scan %s band') % 'US HYPER', self.nimConfig.cable.scan_band_US_HYPER))
                    elif self.nimConfig.cable.scan_type.value == 'steps':
                        self.list.append(getConfigListEntry(_('Frequency scan step size(khz)'), self.nimConfig.cable.scan_frequency_steps))
                    self.list.append(getConfigListEntry(_('Scan %s') % 'QAM16', self.nimConfig.cable.scan_mod_qam16))
                    self.list.append(getConfigListEntry(_('Scan %s') % 'QAM32', self.nimConfig.cable.scan_mod_qam32))
                    self.list.append(getConfigListEntry(_('Scan %s') % 'QAM64', self.nimConfig.cable.scan_mod_qam64))
                    self.list.append(getConfigListEntry(_('Scan %s') % 'QAM128', self.nimConfig.cable.scan_mod_qam128))
                    self.list.append(getConfigListEntry(_('Scan %s') % 'QAM256', self.nimConfig.cable.scan_mod_qam256))
                    self.list.append(getConfigListEntry(_('Scan %s') % 'SR6900', self.nimConfig.cable.scan_sr_6900))
                    self.list.append(getConfigListEntry(_('Scan %s') % 'SR6875', self.nimConfig.cable.scan_sr_6875))
                    self.list.append(getConfigListEntry(_('Scan additional SR'), self.nimConfig.cable.scan_sr_ext1))
                    self.list.append(getConfigListEntry(_('Scan additional SR'), self.nimConfig.cable.scan_sr_ext2))
            self.have_advanced = False
        elif self.nim.isCompatible('DVB-T'):
            self.configMode = getConfigListEntry(_('Configuration mode'), self.nimConfig.configMode)
            self.list.append(self.configMode)
            self.have_advanced = False
            if self.nimConfig.configMode.value == 'enabled':
                self.list.append(getConfigListEntry(_('Terrestrial provider'), self.nimConfig.terrestrial))
                self.list.append(getConfigListEntry(_('Enable 5V for active antenna'), self.nimConfig.terrestrial_5V))
        else:
            self.have_advanced = False
        self['config'].list = self.list
        self['config'].l.setList(self.list)
        return