Пример #1
0
	def retuneSat(self):
		fe_id = int(self.scan_nims.value)
		nimsats = self.satList[fe_id]
		selsatidx = self.scan_satselection[fe_id].index
		if len(nimsats):
			orbpos = nimsats[selsatidx][0]
			if self.initcomplete:
				if self.scan_type.value == "single_transponder":
					if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
						fec = self.scan_sat.fec_s2.value
					else:
						fec = self.scan_sat.fec.value
					transponder = (
						self.scan_sat.frequency.value,
						self.scan_sat.symbolrate.value,
						self.scan_sat.polarization.value,
						fec,
						self.scan_sat.inversion.value,
						orbpos,
						self.scan_sat.system.value,
						self.scan_sat.modulation.value,
						self.scan_sat.rolloff.value,
						self.scan_sat.pilot.value)
					self.tuner.tune(transponder)
					self.transponder = transponder
				elif self.scan_type.value == "predefined_transponder":
					tps = nimmanager.getTransponders(orbpos)
					if len(tps) > self.preDefTransponders.index:
						tp = tps[self.preDefTransponders.index]
						transponder = (tp[1] / 1000, tp[2] / 1000,
							tp[3], tp[4], 2, orbpos, tp[5], tp[6], tp[8], tp[9])
						self.tuner.tune(transponder)
						self.transponder = transponder
Пример #2
0
	def keyGo(self):
		returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
		satpos = int(tuning.sat.value)
		if tuning.type.value == "manual_transponder":
			if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
				fec = self.scan_sat.fec.value
				mod = eDVBFrontendParametersSatellite.Modulation_QPSK
			else:
				mod = self.modulationEntry[1].value
				fec = self.fecEntry[1].value
			returnvalue = (
				self.scan_sat.frequency.float,
				self.scan_sat.symbolrate.value,
				self.scan_sat.polarization.value,
				fec,
				self.scan_sat.inversion.value,
				satpos,
				self.scan_sat.system.value,
				mod,
				self.scan_sat.rolloff.value,
				self.scan_sat.pilot.value,
				self.scan_sat.is_id.value if self.scan_sat.enable_mis.value else -1,
				self.scan_sat.pls_mode.value,
				self.scan_sat.pls_code.value if self.scan_sat.pls_mode.value < eDVBFrontendParametersSatellite.PLS_Unknown else 0)
		elif tuning.type.value == "predefined_transponder":
			transponder = nimmanager.getTransponders(satpos)[tuning.transponder.index]
			returnvalue = (transponder[1] / 1000, transponder[2] / 1000,
				transponder[3], transponder[4], 2, satpos, transponder[5], transponder[6], transponder[8], transponder[9])
		self.close(returnvalue)
Пример #3
0
 def retune(self, configElement):
     returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
     satpos = int(self.tuning_sat.value)
     if self.tuning_type.value == "manual_transponder":
         if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
             fec = self.scan_sat.fec_s2.value
         else:
             fec = self.scan_sat.fec.value
         returnvalue = (self.scan_sat.frequency.value,
                        self.scan_sat.symbolrate.value,
                        self.scan_sat.polarization.value, fec,
                        self.scan_sat.inversion.value, satpos,
                        self.scan_sat.system.value,
                        self.scan_sat.modulation.value,
                        self.scan_sat.rolloff.value,
                        self.scan_sat.pilot.value)
         self.tune(returnvalue)
     elif self.tuning_type.value == "predefined_transponder":
         tps = nimmanager.getTransponders(satpos)
         l = len(tps)
         if l > self.tuning_transponder.index:
             transponder = tps[self.tuning_transponder.index]
             returnvalue = (transponder[1] / 1000, transponder[2] / 1000,
                            transponder[3], transponder[4], 2, satpos,
                            transponder[5], transponder[6], transponder[8],
                            transponder[9])
             self.tune(returnvalue)
Пример #4
0
 def retune(self, configElement):
     returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
     satpos = int(self.tuning_sat.value)
     if self.tuning_type.value == "manual_transponder":
         if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
             fec = self.scan_sat.fec.value
             mod = eDVBFrontendParametersSatellite.Modulation_QPSK
         else:
             mod = self.modulationEntry[1].value
             fec = self.fecEntry[1].value
         returnvalue = (
             self.scan_sat.frequency.float, self.scan_sat.symbolrate.value,
             self.scan_sat.polarization.value, fec,
             self.scan_sat.inversion.value, satpos,
             self.scan_sat.system.value, mod, self.scan_sat.rolloff.value,
             self.scan_sat.pilot.value, self.scan_sat.is_id.value
             if self.scan_sat.enable_mis.value else -1,
             self.scan_sat.pls_mode.value,
             self.scan_sat.pls_code.value if self.scan_sat.pls_mode.value <
             eDVBFrontendParametersSatellite.PLS_Unknown else 0)
         self.tune(returnvalue)
     elif self.tuning_type.value == "predefined_transponder":
         tps = nimmanager.getTransponders(satpos)
         l = len(tps)
         if l > self.tuning_transponder.index:
             transponder = tps[self.tuning_transponder.index]
             returnvalue = (transponder[1] // 1000, transponder[2] // 1000,
                            transponder[3], transponder[4], 2, satpos,
                            transponder[5], transponder[6], transponder[8],
                            transponder[9])
             self.tune(returnvalue)
Пример #5
0
	def keyGo(self):
		returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
		satpos = int(tuning.sat.value)
		if tuning.type.value == "manual_transponder":
			if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
				if self.scan_sat.modulation.value == eDVBFrontendParametersSatellite.Modulation_QPSK:
					fec = self.scan_sat.fec_s2_qpsk.value
				else:
					fec = self.scan_sat.fec_s2_8psk.value
			else:
				fec = self.scan_sat.fec.value
			returnvalue = (
				self.scan_sat.frequency.value,
				self.scan_sat.symbolrate.value,
				self.scan_sat.polarization.value,
				fec,
				self.scan_sat.inversion.value,
				satpos,
				self.scan_sat.system.value,
				self.scan_sat.modulation.value,
				self.scan_sat.rolloff.value,
				self.scan_sat.pilot.value)
		elif tuning.type.value == "predefined_transponder":
			transponder = nimmanager.getTransponders(satpos)[tuning.transponder.index]
			returnvalue = (transponder[1] / 1000, transponder[2] / 1000,
				transponder[3], transponder[4], 2, satpos, transponder[5], transponder[6], transponder[8], transponder[9])
		self.close(returnvalue)
Пример #6
0
 def retuneSat(self):
     fe_id = int(self.scan_nims.value)
     nimsats = self.satList[fe_id]
     selsatidx = self.scan_satselection[fe_id].index
     if len(nimsats):
         orbpos = nimsats[selsatidx][0]
         if self.initcomplete:
             if self.scan_type.value == "single_transponder":
                 if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
                     fec = self.scan_sat.fec_s2.value
                 else:
                     fec = self.scan_sat.fec.value
                 transponder = (self.scan_sat.frequency.value,
                                self.scan_sat.symbolrate.value,
                                self.scan_sat.polarization.value, fec,
                                self.scan_sat.inversion.value, orbpos,
                                self.scan_sat.system.value,
                                self.scan_sat.modulation.value,
                                self.scan_sat.rolloff.value,
                                self.scan_sat.pilot.value,
                                self.scan_sat.is_id.value,
                                self.scan_sat.pls_mode.value,
                                self.scan_sat.pls_code.value)
                 self.tuner.tune(transponder)
                 self.transponder = transponder
             elif self.scan_type.value == "predefined_transponder":
                 tps = nimmanager.getTransponders(orbpos)
                 if len(tps) > self.preDefTransponders.index:
                     tp = tps[self.preDefTransponders.index]
                     transponder = (tp[1] / 1000, tp[2] / 1000, tp[3],
                                    tp[4], 2, orbpos, tp[5], tp[6], tp[8],
                                    tp[9], tp[10], tp[11], tp[12])
                     self.tuner.tune(transponder)
                     self.transponder = transponder
Пример #7
0
	def startDishMovingIfRotorSat(self):
		self["rotorstatus"].setText("")
		orb_pos = self.getOrbPos()
		self.orb_pos = 0
		self.feid = int(self.scan_nims.value)
		rotorSatsForNim = nimmanager.getRotorSatListForNim(self.feid)
		if len(rotorSatsForNim) < 1:
			self.releaseFrontend() # stop dish if moving due to previous call
			return False
		rotorSat = False
		for sat in rotorSatsForNim:
			if sat[0] == orb_pos:
				rotorSat = True
				break
		if not rotorSat:
			self.releaseFrontend() # stop dish if moving due to previous call
			return False
		tps = nimmanager.getTransponders(orb_pos)
		if len(tps) < 1:
			return False
		if Lastrotorposition is not None and config.misc.lastrotorposition.value != 9999:
			text = _("Rotor: ") + self.OrbToStr(config.misc.lastrotorposition.value)
			self["rotorstatus"].setText(text)
		# freq, sr, pol, fec, inv, orb, sys, mod, roll, pilot 
		transponder = (tps[0][1] / 1000, tps[0][2] / 1000, tps[0][3], tps[0][4], 2, orb_pos, tps[0][5], tps[0][6], tps[0][8], tps[0][9])
		if not self.prepareFrontend():
			return False
		self.tuner.tune(transponder)
		self.orb_pos = orb_pos
		if Lastrotorposition is not None and config.misc.lastrotorposition.value != 9999:
			self.statusTimer.stop()
			self.startStatusTimer()
		return True
Пример #8
0
    def updateTransponders(self):
        if len(self.tuning.sat.choices):
            transponderlist = nimmanager.getTransponders(
                int(self.tuning.sat.value))
            tps = []
            cnt = 0
            for x in transponderlist:
                if x[3] == 0:
                    pol = "H"
                elif x[3] == 1:
                    pol = "V"
                elif x[3] == 2:
                    pol = "CL"
                elif x[3] == 3:
                    pol = "CR"
                else:
                    pol = "??"

                fec_desc = ("FEC Auto", "FEC 1/2", "FEC 2/3", "FEC 3/4", "FEC 5/6", "FEC 7/8", "FEC 8/9", "FEC 3/5", "FEC 4/5", "FEC 9/10", \
                   "FEC Unknown", "FEC Unknown", "FEC Unknown", "FEC Unknown", "FEC Unknown", "FEC None", \
                   "FEC_13_45", "FEC_9_20", "FEC_11_20", "FEC_23_36", "FEC_25_36", \
                   "FEC_13_18", "FEC_26_45", "FEC_28_45", "FEC_7_9", "FEC_77_90", \
                   "FEC_32_45", "FEC_11_15", "FEC_1_2_L", "FEC_8_15_L", "FEC_3_5_L", \
                   "FEC_2_3_L", "FEC_5_9_L", "FEC_26_45_L")
                if x[4] > len(fec_desc) - 1:
                    fec = "FEC Unknown"
                else:
                    fec = fec_desc[x[4]]
                tps.append(str(x[1]) + "," + str(x[2]) + "," + pol + "," + fec)
            self.tuning.transponder = ConfigSelection(choices=tps)
Пример #9
0
 def getKnownTransponders(self, pos):
     tlist = []
     list = nimmanager.getTransponders(pos)
     for x in list:
         if x[0] == 0:
             parm = eDVBFrontendParametersSatellite()
             parm.frequency = x[1]
             parm.symbol_rate = x[2]
             parm.polarisation = x[3]
             parm.fec = x[4]
             parm.inversion = x[7]
             parm.orbital_position = pos
             parm.system = x[5]
             parm.modulation = x[6]
             parm.rolloff = x[8]
             parm.pilot = x[9]
             if len(x) > 12:
                 parm.is_id = x[10]
                 parm.pls_mode = x[11]
                 parm.pls_code = x[12]
                 if hasattr(parm, "t2mi_plp_id") and len(x) > 13:
                     parm.t2mi_plp_id = x[13]
                     if hasattr(parm, "t2mi_pid") and len(x) > 14:
                         parm.t2mi_pid = x[14]
             tlist.append(parm)
     return tlist
Пример #10
0
	def retuneSat(self):
		if not self.tuning_sat.value:
			return
		if self.initcomplete:
			satpos = int(self.tuning_sat.value)
			if self.tuning_type.value == "single_transponder":
				if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
					fec = self.scan_sat.fec_s2.value
				else:
					fec = self.scan_sat.fec.value
				transponder = (
					self.scan_sat.frequency.value,
					self.scan_sat.symbolrate.value,
					self.scan_sat.polarization.value,
					fec,
					self.scan_sat.inversion.value,
					satpos,
					self.scan_sat.system.value,
					self.scan_sat.modulation.value,
					self.scan_sat.rolloff.value,
					self.scan_sat.pilot.value)
				self.tuner.tune(transponder)
				self.transponder = transponder
			elif self.tuning_type.value == "predefined_transponder":
				tps = nimmanager.getTransponders(satpos)
				if len(tps) > self.preDefTransponders.index:
					tp = tps[self.preDefTransponders.index]
					transponder = (tp[1] / 1000, tp[2] / 1000,
						tp[3], tp[4], 2, satpos, tp[5], tp[6], tp[8], tp[9])
					self.tuner.tune(transponder)
					self.transponder = transponder
Пример #11
0
    def getMisTransponders(self, pos):
        tlist = []

        def isMultistreamTP(tp):
            # since we are using Gold sequences there is no need to check the PLS Mode
            return tp[5] == eDVBFrontendParametersSatellite.System_DVB_S2 and (
                tp[10] > eDVBFrontendParametersSatellite.No_Stream_Id_Filter or
                tp[12] > eDVBFrontendParametersSatellite.PLS_Default_Gold_Code)

        for tp in [
                tp for tp in nimmanager.getTransponders(pos)
                if isMultistreamTP(tp)
        ]:
            if tp[0] == 0:
                parm = eDVBFrontendParametersSatellite()
                parm.frequency = tp[1]
                parm.symbol_rate = tp[2]
                parm.polarisation = tp[3]
                parm.fec = tp[4]
                parm.inversion = tp[7]
                parm.orbital_position = pos
                parm.system = tp[5]
                parm.modulation = tp[6]
                parm.rolloff = tp[8]
                parm.pilot = tp[9]
                parm.is_id = tp[10]
                parm.pls_mode = tp[11]
                parm.pls_code = tp[12]
                if hasattr(parm, "t2mi_plp_id") and len(tp) > 13:
                    parm.t2mi_plp_id = tp[13]
                    if hasattr(parm, "t2mi_pid") and len(tp) > 14:
                        parm.t2mi_pid = tp[14]
                tlist.append(parm)
        return tlist
Пример #12
0
	def updateTransponders(self):
		if len(self.tuning.sat.choices):
			transponderlist = nimmanager.getTransponders(int(self.tuning.sat.value))
			tps = []
			for transponder in transponderlist:
				tps.append(self.transponderToString(transponder, scale = 1000))
			self.tuning.transponder = ConfigSelection(choices = tps)
Пример #13
0
	def retune(self, configElement): # satellite
		if not nimmanager.nim_slots[int(self.satfinder_scan_nims.value)].isCompatible("DVB-S"):
			return self.retuneTerr(configElement)
		if not self.tuning_sat.value:
			return
		satpos = int(self.tuning_sat.value)
		if self.tuning_type.value == "single_transponder":
			if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
				fec = self.scan_sat.fec_s2.value
			else:
				fec = self.scan_sat.fec.value
			transponder = (
				self.scan_sat.frequency.value,
				self.scan_sat.symbolrate.value,
				self.scan_sat.polarization.value,
				fec,
				self.scan_sat.inversion.value,
				satpos,
				self.scan_sat.system.value,
				self.scan_sat.modulation.value,
				self.scan_sat.rolloff.value,
				self.scan_sat.pilot.value)
			if self.initcomplete:
				self.tuner.tune(transponder)
			self.transponder = transponder
		elif self.tuning_type.value == "predefined_transponder":
			tps = nimmanager.getTransponders(satpos)
			if len(tps) > self.preDefTransponders.index:
				tp = tps[self.preDefTransponders.index]
				transponder = (tp[1] / 1000, tp[2] / 1000,
					tp[3], tp[4], 2, satpos, tp[5], tp[6], tp[8], tp[9])
				if self.initcomplete:
					self.tuner.tune(transponder)
				self.transponder = transponder
Пример #14
0
	def retune(self, configElement):
		returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
		satpos = int(self.tuning_sat.getValue())
		if self.tuning_type.getValue() == "manual_transponder":
			if self.scan_sat.system.getValue() == eDVBFrontendParametersSatellite.System_DVB_S2:
				fec = self.scan_sat.fec_s2.getValue()
			else:
				fec = self.scan_sat.fec.getValue()
			returnvalue = (
				self.scan_sat.frequency.getValue(),
				self.scan_sat.symbolrate.getValue(),
				self.scan_sat.polarization.getValue(),
				fec,
				self.scan_sat.inversion.getValue(),
				satpos,
				self.scan_sat.system.getValue(),
				self.scan_sat.modulation.getValue(),
				self.scan_sat.rolloff.getValue(),
				self.scan_sat.pilot.getValue())
			self.tune(returnvalue)
		elif self.tuning_type.getValue() == "predefined_transponder":
			tps = nimmanager.getTransponders(satpos)
			l = len(tps)
			if l > self.tuning_transponder.index:
				transponder = tps[self.tuning_transponder.index]
				returnvalue = (transponder[1] / 1000, transponder[2] / 1000,
					transponder[3], transponder[4], 2, satpos, transponder[5], transponder[6], transponder[8], transponder[9])
				self.tune(returnvalue)
Пример #15
0
	def updateTransponders(self):
		if len(self.tuning.sat.choices):
			transponderlist = nimmanager.getTransponders(int(self.tuning.sat.value))
			tps = []
			for transponder in transponderlist:
				tps.append(self.transponderToString(transponder, scale = 1000))
			self.tuning.transponder = ConfigSelection(choices = tps)
Пример #16
0
 def keyGo(self):
     returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
     satpos = int(tuning.sat.getValue())
     if tuning.type.getValue() == "manual_transponder":
         if self.scan_sat.system.getValue(
         ) == eDVBFrontendParametersSatellite.System_DVB_S2:
             fec = self.scan_sat.fec_s2.getValue()
         else:
             fec = self.scan_sat.fec.getValue()
         returnvalue = (self.scan_sat.frequency.getValue(),
                        self.scan_sat.symbolrate.getValue(),
                        self.scan_sat.polarization.getValue(), fec,
                        self.scan_sat.inversion.getValue(), satpos,
                        self.scan_sat.system.getValue(),
                        self.scan_sat.modulation.getValue(),
                        self.scan_sat.rolloff.getValue(),
                        self.scan_sat.pilot.getValue())
     elif tuning.type.getValue() == "predefined_transponder":
         transponder = nimmanager.getTransponders(satpos)[
             tuning.transponder.index]
         returnvalue = (transponder[1] / 1000, transponder[2] / 1000,
                        transponder[3], transponder[4], 2, satpos,
                        transponder[5], transponder[6], transponder[8],
                        transponder[9])
     self.close(returnvalue)
Пример #17
0
 def retuneSat(self, configElement):  #satellite
     if not self.tuning_sat.value:
         return
     if self.initcomplete:
         satpos = int(self.tuning_sat.value)
         if self.tuning_type.value == "single_transponder":
             if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
                 fec = self.scan_sat.fec_s2.value
             else:
                 fec = self.scan_sat.fec.value
             transponder = (self.scan_sat.frequency.value,
                            self.scan_sat.symbolrate.value,
                            self.scan_sat.polarization.value, fec,
                            self.scan_sat.inversion.value, satpos,
                            self.scan_sat.system.value,
                            self.scan_sat.modulation.value,
                            self.scan_sat.rolloff.value,
                            self.scan_sat.pilot.value,
                            self.scan_sat.is_id.value,
                            self.scan_sat.pls_mode.value,
                            self.scan_sat.pls_code.value)
             self.tuner.tune(transponder)
             self.transponder = transponder
         elif self.tuning_type.value == "predefined_transponder":
             tps = nimmanager.getTransponders(satpos)
             if len(tps) > self.preDefTransponders.index:
                 tp = tps[self.preDefTransponders.index]
                 transponder = (tp[1] / 1000, tp[2] / 1000, tp[3], tp[4], 2,
                                satpos, tp[5], tp[6], tp[8], tp[9], tp[10],
                                tp[11], tp[12])
                 self.tuner.tune(transponder)
                 self.transponder = transponder
Пример #18
0
 def retune(self, configElement):  # satellite
     if not nimmanager.nim_slots[int(
             self.satfinder_scan_nims.value)].isCompatible("DVB-S"):
         return self.retuneTerr(configElement)
     if not self.tuning_sat.value:
         return
     satpos = int(self.tuning_sat.value)
     if self.tuning_type.value == "manual_transponder":
         if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
             fec = self.scan_sat.fec_s2.value
         else:
             fec = self.scan_sat.fec.value
         transponder = (self.scan_sat.frequency.value,
                        self.scan_sat.symbolrate.value,
                        self.scan_sat.polarization.value, fec,
                        self.scan_sat.inversion.value, satpos,
                        self.scan_sat.system.value,
                        self.scan_sat.modulation.value,
                        self.scan_sat.rolloff.value,
                        self.scan_sat.pilot.value)
         if self.initcomplete:
             self.tuner.tune(transponder)
         self.transponder = transponder
     elif self.tuning_type.value == "predefined_transponder":
         #if self.preDefTransponders is None:
         #	self.updatePreDefTransponders()
         tps = nimmanager.getTransponders(satpos)
         l = len(tps)
         if l > self.preDefTransponders.index:
             tp = tps[self.preDefTransponders.index]
             transponder = (tp[1] / 1000, tp[2] / 1000, tp[3], tp[4], 2,
                            satpos, tp[5], tp[6], tp[8], tp[9])
             if self.initcomplete:
                 self.tuner.tune(transponder)
             self.transponder = transponder
Пример #19
0
	def retune(self, configElement):
		returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
		if not self.tuning_sat.value:
			return
		satpos = int(self.tuning_sat.value)
		if self.tuning_type.value == "manual_transponder":
			if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
				fec = self.scan_sat.fec_s2.value
			else:
				fec = self.scan_sat.fec.value
			returnvalue = (
				self.scan_sat.frequency.value,
				self.scan_sat.symbolrate.value,
				self.scan_sat.polarization.value,
				fec,
				self.scan_sat.inversion.value,
				satpos,
				self.scan_sat.system.value,
				self.scan_sat.modulation.value,
				self.scan_sat.rolloff.value,
				self.scan_sat.pilot.value,
				self.scan_sat.is_id.value,
				self.scan_sat.pls_mode.value,
				self.scan_sat.pls_code.value)
			self.tune(returnvalue)
		elif self.tuning_type.value == "predefined_transponder":
			tps = nimmanager.getTransponders(satpos)
			l = len(tps)
			if l > self.preDefTransponders.index:
				transponder = tps[self.preDefTransponders.index]
				returnvalue = (transponder[1] / 1000, transponder[2] / 1000,
					transponder[3], transponder[4], 2, satpos, transponder[5], transponder[6], transponder[8], transponder[9], transponder[10], transponder[11], transponder[12])
				self.tune(returnvalue)
Пример #20
0
    def keyGo(self):
        returnvalue = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 3, 0)
        satpos = int(self.tuning.sat.value)
        nim = nimmanager.nim_slots[self.feid]
        if self.tuning.type.value == "manual_transponder":
            system = self.scan_sat.system.value
            modulation = self.scan_sat.modulation.value
            if nim.isCompatible("DVB-S2X"):
                system = self.scan_sat.system_dvbs2x.value
                modulation = self.scan_sat.modulation_dvbs2x.value

            if system == eDVBFrontendParametersSatellite.System_DVB_S:
                fec = self.scan_sat.fec.value
            elif system == eDVBFrontendParametersSatellite.System_DVB_S2:
                fec = self.scan_sat.fec_s2.value
            elif system == eDVBFrontendParametersSatellite.System_DVB_S2X:
                if modulation == eDVBFrontendParametersSatellite.Modulation_QPSK:
                    fec = self.scan_sat.fec_s2x_qpsk.value
                elif modulation == eDVBFrontendParametersSatellite.Modulation_8PSK:
                    fec = self.scan_sat.fec_s2x_8psk.value
                elif modulation == eDVBFrontendParametersSatellite.Modulation_8APSK:
                    fec = self.scan_sat.fec_s2x_8apsk.value
                elif modulation == eDVBFrontendParametersSatellite.Modulation_16APSK:
                    fec = self.scan_sat.fec_s2x_16apsk.value
                elif modulation == eDVBFrontendParametersSatellite.Modulation_32APSK:
                    fec = self.scan_sat.fec_s2x_32apsk.value
            else:
                fec = self.scan_sat.fec.value

            is_id = -1
            pls_mode = eDVBFrontendParametersSatellite.PLS_Unknown
            pls_code = 0
            if self.scan_sat.is_id_bool.value:
                is_id = self.scan_sat.is_id.value
                pls_mode = self.scan_sat.pls_mode.value
                if pls_mode == eDVBFrontendParametersSatellite.PLS_Unknown:
                    pls_code = 0
                else:
                    pls_code = self.scan_sat.pls_code.value

            returnvalue = (self.scan_sat.frequency.value,
                           self.scan_sat.symbolrate.value,
                           self.scan_sat.polarization.value, fec,
                           self.scan_sat.inversion.value, satpos, system,
                           modulation, self.scan_sat.rolloff.value,
                           self.scan_sat.pilot.value, is_id, pls_mode,
                           pls_code)
        elif self.tuning.type.value == "predefined_transponder":
            transponder = nimmanager.getTransponders(satpos)[
                self.tuning.transponder.index]
            returnvalue = (transponder[1] / 1000, transponder[2] / 1000,
                           transponder[3], transponder[4], 2, satpos,
                           transponder[5], transponder[6], transponder[8],
                           transponder[9], transponder[10], transponder[11],
                           transponder[12])
        self.close(returnvalue)
Пример #21
0
	def createTranspondersList(self, orbpos):
		list = []
		index = 0
		tps = nimmanager.getTransponders(orbpos)
		for x in tps:
			if x[0] == 0:	#SAT
				s = str(x[1]/1000) + " " + self.PolToStr(x[3]) + " / " + str(x[2]/1000) + " / " + self.FecToStr(x[4])
				list.append((s, str(index)))
				index += 1
		return list
Пример #22
0
 def readTransponderList(self):
     for sat in nimmanager.getSatListForNim(self.feid):
         for transponder in nimmanager.getTransponders(sat[0]):
             mytransponder = (transponder[1] / 1000, transponder[2] / 1000,
                              transponder[3], transponder[4],
                              transponder[7], sat[0], transponder[5],
                              transponder[6], transponder[8],
                              transponder[9], transponder[10],
                              transponder[11], transponder[12])
             self.analyseTransponder(mytransponder)
Пример #23
0
def obterTransponder(sat):
    from Components.NimManager import nimmanager
    tmp=[]
    
    tps = nimmanager.getTransponders(sat)
    for tp in tps:        
        freq=tp[1]
        freq=str(int(freq)/1000)
        tmp.append((freq,freq))
    
    return tmp
Пример #24
0
 def createTranspondersList(self, orbpos):
     list = []
     index = 0
     tps = nimmanager.getTransponders(orbpos)
     for x in tps:
         if x[0] == 0:  #SAT
             s = str(x[1] / 1000) + " " + self.PolToStr(x[3]) + " / " + str(
                 x[2] / 1000) + " / " + self.FecToStr(x[4])
             list.append((s, str(index)))
             index += 1
     return list
 def readTransponderList(self):
     for sat in nimmanager.getSatListForNim(self.feid):
         for transponder in nimmanager.getTransponders(sat[0]):
             #print transponder
             mytransponder = (transponder[1] / 1000, transponder[2] / 1000,
                              transponder[3], transponder[4],
                              transponder[7], sat[0], transponder[5],
                              transponder[6], transponder[8],
                              transponder[9], transponder[10],
                              transponder[11])
             self.analyseTransponder(mytransponder)
Пример #26
0
	def updateTranspondersList(self, orbpos):
		if orbpos is not None:
			index = 0
			list = []
			tps = nimmanager.getTransponders(orbpos)
			for x in tps:
				if x[0] == 0:	#SAT
					s = str(x[1]/1000) + " " + self.PolToStr(x[3]) + " / " + str(x[2]/1000) + " / " + self.FecToStr(x[4])
					list.append((str(index), s))
					index += 1
			self.scan_transponders = ConfigSelection(choices = list, default = "0")
			self.scan_transponders.addNotifier(self.retune, initial_call = False)
Пример #27
0
    def updateSats(self):
        orb_pos = self.tuning_sat.orbital_position
        if orb_pos is not None:
            transponderlist = nimmanager.getTransponders(orb_pos)
            list = []
            default = None
            index = 0
            for x in transponderlist:
                if x[3] == 0:
                    pol = "H"
                elif x[3] == 1:
                    pol = "V"
                elif x[3] == 2:
                    pol = "CL"
                elif x[3] == 3:
                    pol = "CR"
                else:
                    pol = "??"
                if x[4] == 0:
                    fec = "FEC Auto"
                elif x[4] == 1:
                    fec = "FEC 1/2"
                elif x[4] == 2:
                    fec = "FEC 2/3"
                elif x[4] == 3:
                    fec = "FEC 3/4"
                elif x[4] == 4:
                    fec = "FEC 5/6"
                elif x[4] == 5:
                    fec = "FEC 7/8"
                elif x[4] == 6:
                    fec = "FEC 8/9"
                elif x[4] == 7:
                    fec = "FEC 3/5"
                elif x[4] == 8:
                    fec = "FEC 4/5"
                elif x[4] == 9:
                    fec = "FEC 9/10"
                elif x[4] == 15:
                    fec = "FEC None"
                else:
                    fec = "FEC Unknown"
                e = "%d %s %d %s" % ((x[1] / 1000), pol, (x[2] / 1000), fec)

                if default is None:
                    default = str(index)
                list.append((str(index), e))
                index += 1
            self.tuning_transponder = ConfigSelection(choices=list,
                                                      default=default)
            self.tuning_transponder.addNotifier(self.retune,
                                                initial_call=False)
Пример #28
0
 def updateTranspondersList(self, orbpos):
     if orbpos is not None:
         index = 0
         list = []
         tps = nimmanager.getTransponders(orbpos)
         for x in tps:
             if x[0] == 0:  #SAT
                 s = str(x[1] / 1000) + " " + self.PolToStr(
                     x[3]) + " / " + str(
                         x[2] / 1000) + " / " + self.FecToStr(x[4])
                 list.append((str(index), s))
                 index += 1
         self.scan_transponders = ConfigSelection(choices=list, default="0")
         self.scan_transponders.addNotifier(self.retune, initial_call=False)
Пример #29
0
	def updateSats(self):
		orb_pos = self.tuning_sat.orbital_position
		if orb_pos is not None:
			transponderlist = nimmanager.getTransponders(orb_pos)
			list = []
			default = None
			index = 0
			for x in transponderlist:
				if x[3] == 0:
					pol = "H"
				elif x[3] == 1:
					pol = "V"
				elif x[3] == 2:
					pol = "CL"
				elif x[3] == 3:
					pol = "CR"
				else:
					pol = "??"
				if x[4] == 0:
					fec = "FEC Auto"
				elif x[4] == 1:
					fec = "FEC 1/2"
				elif x[4] == 2:
					fec = "FEC 2/3"
				elif x[4] == 3:
					fec = "FEC 3/4"
				elif x[4] == 4:
					fec = "FEC 5/6"
				elif x[4] == 5:
					fec = "FEC 7/8"
				elif x[4] == 6:
					fec = "FEC 8/9"
				elif x[4] == 7:
					fec = "FEC 3/5"
				elif x[4] == 8:
					fec = "FEC 4/5"
				elif x[4] == 9:
					fec = "FEC 9/10"
				elif x[4] == 15:
					fec = "FEC None"
				else:
					fec = "FEC Unknown"
				e = "%d %s %d %s" % ((x[1] / 1000), pol, (x[2] / 1000), fec)

				if default is None:
					default = str(index)
				list.append((str(index), e))
				index += 1
			self.tuning_transponder = ConfigSelection(choices = list, default = default)
			self.tuning_transponder.addNotifier(self.retune, initial_call = False)
Пример #30
0
def getInitialTransponderList(tlist, pos):
	list = nimmanager.getTransponders(pos)
	for x in list:
		if x[0] == 0:		#SAT
			parm = eDVBFrontendParametersSatellite()
			parm.frequency = x[1]
			parm.symbol_rate = x[2]
			parm.polarisation = x[3]
			parm.fec = x[4]
			parm.inversion = x[7]
			parm.orbital_position = pos
			parm.system = x[5]
			parm.modulation = x[6]
			parm.rolloff = x[8]
			parm.pilot = x[9]
			tlist.append(parm)
Пример #31
0
 def getInitialTransponderList(self, tlist, pos):
     list = nimmanager.getTransponders(pos)
     for x in list:
         if x[0] == 0:  #SAT
             parm = eDVBFrontendParametersSatellite()
             parm.frequency = x[1]
             parm.symbol_rate = x[2]
             parm.polarisation = x[3]
             parm.fec = x[4]
             parm.inversion = x[7]
             parm.orbital_position = pos
             parm.system = x[5]
             parm.modulation = x[6]
             parm.rolloff = x[8]
             parm.pilot = x[9]
             tlist.append(parm)
Пример #32
0
	def predefinedTranspondersList(self, orbpos):
		if orbpos is not None:
			list = []
			default = None
			i = 0
			tps = nimmanager.getTransponders(orbpos)
			for tp in tps:
				if tp[0] == 0:
					polarization = (tp[3] == 0 and "H") or (tp[3] == 1 and "V") or (tp[3] == 2 and "L") or (tp[3] == 3 and "R") or "??"
					fec = (tp[4] == 0 and "Auto") or (tp[4] == 1 and "1/2") or (tp[4] == 2 and "2/3") or (tp[4] == 3 and "3/4") or \
						(tp[4] == 4 and "5/6") or (tp[4] == 5 and "7/8") or (tp[4] == 6 and "8/9") or (tp[4] == 7 and "3/5") or \
						(tp[4] == 8 and "4/5") or (tp[4] == 9 and "9/10") or (tp[4] == 15 and "None") or "??"
					params = str(tp[1]/1000) + " " + polarization + " " + str(tp[2]/1000) + " " + fec
					if default is None:
						default = str(i)
					list.append((str(i), params))
					i += 1
			self.preDefTransponders = ConfigSelection(choices = list, default = default)
Пример #33
0
	def predefinedTranspondersList(self, orbpos):
		default = None
		if orbpos is not None:
			list = []
			if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
				fec = self.scan_sat.fec_s2.value
			else:
				fec = self.scan_sat.fec.value
			compare = [0, self.scan_sat.frequency.value, self.scan_sat.symbolrate.value, self.scan_sat.polarization.value, fec]
			i = 0
			tps = nimmanager.getTransponders(orbpos)
			for tp in tps:
				if tp[0] == 0:
					if default is None and self.compareTransponders(tp, compare):
						default = str(i)
					list.append((str(i), self.humanReadableTransponder(tp)))
					i += 1
			self.preDefTransponders = ConfigSelection(choices = list, default = default)
		return default
Пример #34
0
 def updateTransponders(self):
     if len(tuning.sat.choices):
         transponderlist = nimmanager.getTransponders(
             int(tuning.sat.getValue()))
         tps = []
         cnt = 0
         for x in transponderlist:
             if x[3] == 0:
                 pol = "H"
             elif x[3] == 1:
                 pol = "V"
             elif x[3] == 2:
                 pol = "CL"
             elif x[3] == 3:
                 pol = "CR"
             else:
                 pol = "??"
             if x[4] == 0:
                 fec = "FEC Auto"
             elif x[4] == 1:
                 fec = "FEC 1/2"
             elif x[4] == 2:
                 fec = "FEC 2/3"
             elif x[4] == 3:
                 fec = "FEC 3/4"
             elif x[4] == 4:
                 fec = "FEC 5/6"
             elif x[4] == 5:
                 fec = "FEC 7/8"
             elif x[4] == 6:
                 fec = "FEC 8/9"
             elif x[4] == 7:
                 fec = "FEC 3/5"
             elif x[4] == 8:
                 fec = "FEC 4/5"
             elif x[4] == 9:
                 fec = "FEC 9/10"
             elif x[4] == 15:
                 fec = "FEC None"
             else:
                 fec = "FEC Unknown"
             tps.append(str(x[1]) + "," + str(x[2]) + "," + pol + "," + fec)
         tuning.transponder = ConfigSelection(choices=tps)
Пример #35
0
	def updateTransponders(self):
		if len(tuning.sat.choices):
			transponderlist = nimmanager.getTransponders(int(tuning.sat.value))
			tps = []
			cnt=0
			for x in transponderlist:
				if x[3] == 0:
					pol = "H"
				elif x[3] == 1:
					pol = "V"
				elif x[3] == 2:
					pol = "CL"
				elif x[3] == 3:
					pol = "CR"
				else:
					pol = "??"
				if x[4] == 0:
					fec = "FEC Auto"
				elif x[4] == 1:
					fec = "FEC 1/2"
				elif x[4] == 2:
					fec = "FEC 2/3"
				elif x[4] == 3:
					fec = "FEC 3/4"
				elif x[4] == 4:
					fec = "FEC 5/6"
				elif x[4] == 5:
					fec = "FEC 7/8"
				elif x[4] == 6:
					fec = "FEC 8/9"
				elif x[4] == 7:
					fec = "FEC 3/5"
				elif x[4] == 8:
					fec = "FEC 4/5"
				elif x[4] == 9:
					fec = "FEC 9/10"
				elif x[4] == 15:
					fec = "FEC None"
				else:
					fec = "FEC Unknown"
				tps.append(str(x[1]) + "," + str(x[2]) + "," + pol + "," + fec)
			tuning.transponder = ConfigSelection(choices=tps)
Пример #36
0
    def retuneSat(self):  #satellite
        if not self.tuning_sat.value:
            return
        satpos = int(self.tuning_sat.value)
        if self.tuning_type.value == "single_transponder":
            if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
                fec = self.scan_sat.fec_s2.value
            else:
                fec = self.scan_sat.fec.value

            if self.scan_sat.t2mi_pid.value > 0 and self.scan_sat.t2mi_plp.value >= 0:
                t2mi_plp_id = (self.scan_sat.t2mi_pid.value <<
                               16) | self.scan_sat.t2mi_plp.value
            else:
                t2mi_plp_id = eDVBFrontendParametersSatellite.No_T2MI_PLP_Id

            transponder = (self.scan_sat.frequency.floatint,
                           self.scan_sat.symbolrate.value,
                           self.scan_sat.polarization.value, fec,
                           self.scan_sat.inversion.value, satpos,
                           self.scan_sat.system.value,
                           self.scan_sat.modulation.value,
                           self.scan_sat.rolloff.value,
                           self.scan_sat.pilot.value,
                           self.scan_sat.is_id.value,
                           self.scan_sat.pls_mode.value,
                           self.scan_sat.pls_code.value, t2mi_plp_id)
            if self.initcomplete:
                self.tuner.tune(transponder)
            self.transponder = transponder
        elif self.tuning_type.value == "predefined_transponder":
            tps = nimmanager.getTransponders(
                satpos, int(self.satfinder_scan_nims.value))
            if len(tps) > self.preDefTransponders.index:
                tp = tps[self.preDefTransponders.index]
                transponder = (tp[1], tp[2] / 1000, tp[3], tp[4], 2, satpos,
                               tp[5], tp[6], tp[8], tp[9], tp[10], tp[11],
                               tp[12], tp[13])
                if self.initcomplete:
                    self.tuner.tune(transponder)
                self.transponder = transponder
Пример #37
0
	def getInitialTransponderProviderList(self, tlist, pos, providers=None):
		list = nimmanager.getTransponders(pos)
		for x in list:
			pol = x[3]
			if x[3] == 2:
				pol = 0
			if x[3] == 3:
				pol = 1
			if x[0] == 0 and providers is not None and (x[1], pol) in providers:
				parm = eDVBFrontendParametersSatellite()
				parm.frequency = x[1]
				parm.symbol_rate = x[2]
				parm.polarisation = x[3]
				parm.fec = x[4]
				parm.inversion = x[7]
				parm.orbital_position = pos
				parm.system = x[5]
				parm.modulation = x[6]
				parm.rolloff = x[8]
				parm.pilot = x[9]
				tlist.append(parm)
Пример #38
0
 def getInitialTransponderProviderList(self, tlist, pos, providers=None):
     list = nimmanager.getTransponders(pos)
     for x in list:
         pol = x[3]
         if x[3] == 2:
             pol = 0
         if x[3] == 3:
             pol = 1
         if x[0] == 0 and providers is not None and (x[1],
                                                     pol) in providers:
             parm = eDVBFrontendParametersSatellite()
             parm.frequency = x[1]
             parm.symbol_rate = x[2]
             parm.polarisation = x[3]
             parm.fec = x[4]
             parm.inversion = x[7]
             parm.orbital_position = pos
             parm.system = x[5]
             parm.modulation = x[6]
             parm.rolloff = x[8]
             parm.pilot = x[9]
             tlist.append(parm)
Пример #39
0
	def startDishMovingIfRotorSat(self):
		orb_pos = self.getOrbPos()
		self.feid = int(self.scan_nims.value)
		rotorSatsForNim = nimmanager.getRotorSatListForNim(self.feid)
		if len(rotorSatsForNim) < 1:
			self.releaseFrontend() # stop dish if moving due to previous call
			return False
		rotorSat = False
		for sat in rotorSatsForNim:
			if sat[0] == orb_pos:
				rotorSat = True
				break
		if not rotorSat:
			self.releaseFrontend() # stop dish if moving due to previous call
			return False
		tps = nimmanager.getTransponders(orb_pos)
		if len(tps) < 1:
			return False
		# freq, sr, pol, fec, inv, orb, sys, mod, roll, pilot 
		transponder = (tps[0][1] / 1000, tps[0][2] / 1000, tps[0][3], tps[0][4], 2, orb_pos, tps[0][5], tps[0][6], tps[0][8], tps[0][9])
		if not self.prepareFrontend():
			return False
		self.tuner.tune(transponder)
		return True
Пример #40
0
	def startDishMovingIfRotorSat(self):
		orb_pos = self.getOrbPos()
		self.feid = int(self.scan_nims.value)
		rotorSatsForNim = nimmanager.getRotorSatListForNim(self.feid)
		if len(rotorSatsForNim) < 1:
			self.releaseFrontend() # stop dish if moving due to previous call
			return False
		rotorSat = False
		for sat in rotorSatsForNim:
			if sat[0] == orb_pos:
				rotorSat = True
				break
		if not rotorSat:
			self.releaseFrontend() # stop dish if moving due to previous call
			return False
		tps = nimmanager.getTransponders(orb_pos)
		if len(tps) < 1:
			return False
		# freq, sr, pol, fec, inv, orb, sys, mod, roll, pilot 
		transponder = (tps[0][1] / 1000, tps[0][2] / 1000, tps[0][3], tps[0][4], 2, orb_pos, tps[0][5], tps[0][6], tps[0][8], tps[0][9])
		if not self.prepareFrontend():
			return False
		self.tuner.tune(transponder)
		return True
Пример #41
0
	def createConfig(self, foo):
		self.tuning_type = ConfigSelection(default = "predefined_transponder", choices = [("single_transponder", _("User defined transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.orbital_position = 192
		if self.frontendData and self.frontendData.has_key('orbital_position'):
			self.orbital_position = self.frontendData['orbital_position']
		ScanSetup.createConfig(self, self.frontendData)

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

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

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

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

		if self.frontendData:
			ttype = self.frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S" and self.predefinedTranspondersList(self.getSelectedSatIndex(self.feid)) is None and len(nimmanager.getTransponders(self.getSelectedSatIndex(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-T" and self.predefinedTerrTranspondersList() is None and len(nimmanager.getTranspondersTerrestrial(nimmanager.getTerrestrialDescription(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-C" and self.predefinedCabTranspondersList() is None and len(nimmanager.getTranspondersCable(self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
Пример #42
0
class Satfinder(ScanSetup, ServiceScan):
    def __init__(self, session):
        self.initcomplete = False
        service = session and session.nav.getCurrentService()
        feinfo = service and service.frontendInfo()
        self.frontendData = feinfo and feinfo.getAll(True)
        del feinfo
        del service

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

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

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

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

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

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

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

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

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

                nim = nimmanager.nim_slots[self.feid]

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

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

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

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

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

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

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

        if self.frontendData:
            ttype = self.frontendData.get("tuner_type", "UNKNOWN")
            if ttype == "DVB-S" and self.predefinedTranspondersList(
                    self.getSelectedSatIndex(self.feid)) is None and len(
                        nimmanager.getTransponders(
                            self.getSelectedSatIndex(self.feid))) > 0:
                self.tuning_type.value = "single_transponder"
            elif ttype == "DVB-T" and self.predefinedTerrTranspondersList(
            ) is None and len(
                    nimmanager.getTranspondersTerrestrial(
                        nimmanager.getTerrestrialDescription(self.feid))) > 0:
                self.tuning_type.value = "single_transponder"
            elif ttype == "DVB-C" and self.predefinedCabTranspondersList(
            ) is None and len(nimmanager.getTranspondersCable(self.feid)) > 0:
                self.tuning_type.value = "single_transponder"
            elif ttype == "ATSC" and self.predefinedATSCTranspondersList(
            ) is None and len(nimmanager.getTranspondersATSC(self.feid)) > 0:
                self.tuning_type.value = "single_transponder"
Пример #43
0
    def keyGo(self):
        if self.scan_nims.value == "":
            return
        self.tuneTimer.stop()
        self.deInitFrontend()
        index_to_scan = int(self.scan_nims.value)
        self.feid = index_to_scan
        tlist = []
        flags = None
        startScan = True
        removeAll = True
        self.prev_ref = True
        if self.scan_nims == []:
            self.session.open(
                MessageBox,
                _("No tuner is enabled!\nPlease setup your tuner settings before you start a service scan."
                  ), MessageBox.TYPE_ERROR)
            return

        nim = nimmanager.nim_slots[index_to_scan]
        if not nim.isCompatible("DVB-S"): return
        #if self.scan_type.value == "single_transponder":
        if self.scan_type.value.find("_transponder") != -1:
            assert len(self.satList) > index_to_scan
            assert len(self.scan_satselection) > index_to_scan

            nimsats = self.satList[index_to_scan]
            selsatidx = self.scan_satselection[index_to_scan].index

            if len(nimsats):
                orbpos = nimsats[selsatidx][0]
                if self.scan_type.value == "single_transponder":
                    if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
                        fec = self.scan_sat.fec.value
                    else:
                        fec = self.scan_sat.fec_s2.value
                    self.addSatTransponder(tlist,
                                           self.scan_sat.frequency.value,
                                           self.scan_sat.symbolrate.value,
                                           self.scan_sat.polarization.value,
                                           fec, self.scan_sat.inversion.value,
                                           orbpos, self.scan_sat.system.value,
                                           self.scan_sat.modulation.value,
                                           self.scan_sat.rolloff.value,
                                           self.scan_sat.pilot.value)
                elif self.scan_type.value == "predefined_transponder":
                    tps = nimmanager.getTransponders(orbpos)
                    if len(tps) > self.scan_transponders.index:
                        x = tps[self.scan_transponders.index]
                        self.addSatTransponder(tlist, x[1] / 1000, x[2] / 1000,
                                               x[3], x[4], x[7], orbpos, x[5],
                                               x[6], x[8], x[9])
            removeAll = False
        elif self.scan_type.value == "single_satellite":
            sat = self.satList[index_to_scan][
                self.scan_satselection[index_to_scan].index]
            self.getInitialTransponderList(tlist, sat[0])
        elif self.scan_type.value.find("multisat") != -1:
            SatList = nimmanager.getSatListForNim(index_to_scan)
            for x in self.multiscanlist:
                if x[1].value:
                    print "   " + str(x[0])
                    self.getInitialTransponderList(tlist, x[0])

        flags = self.scan_networkScan.value and eComponentScan.scanNetworkSearch or 0

        tmp = self.scan_clearallservices.value
        if tmp == "yes":
            flags |= eComponentScan.scanRemoveServices
        elif tmp == "yes_hold_feeds":
            flags |= eComponentScan.scanRemoveServices
            flags |= eComponentScan.scanDontRemoveFeeds

        if tmp != "no" and not removeAll:
            flags |= eComponentScan.scanDontRemoveUnscanned

        if self.scan_onlyfree.value:
            flags |= eComponentScan.scanOnlyFree

        for x in self["config"].list:
            x[1].save()

        if startScan:
            self.startScan(tlist, flags, index_to_scan)
Пример #44
0
    def keyGo(self):
        if self.scan_nims.value == "":
            return
        self.tuneTimer.stop()
        self.deInitFrontend()
        index_to_scan = int(self.scan_nims.value)
        self.feid = index_to_scan
        tlist = []
        flags = None
        startScan = True
        removeAll = True
        self.prev_ref = True
        if self.scan_nims == []:
            self.session.open(
                MessageBox,
                _("No tuner is enabled!\nPlease setup your tuner settings before you start a service scan."),
                MessageBox.TYPE_ERROR,
            )
            return

        nim = nimmanager.nim_slots[index_to_scan]
        if not nim.isCompatible("DVB-S"):
            return
        # if self.scan_type.value == "single_transponder":
        if self.scan_type.value.find("_transponder") != -1:
            assert len(self.satList) > index_to_scan
            assert len(self.scan_satselection) > index_to_scan

            nimsats = self.satList[index_to_scan]
            selsatidx = self.scan_satselection[index_to_scan].index

            if len(nimsats):
                orbpos = nimsats[selsatidx][0]
                if self.scan_type.value == "single_transponder":
                    if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
                        fec = self.scan_sat.fec.value
                    else:
                        fec = self.scan_sat.fec_s2.value
                    self.addSatTransponder(
                        tlist,
                        self.scan_sat.frequency.value,
                        self.scan_sat.symbolrate.value,
                        self.scan_sat.polarization.value,
                        fec,
                        self.scan_sat.inversion.value,
                        orbpos,
                        self.scan_sat.system.value,
                        self.scan_sat.modulation.value,
                        self.scan_sat.rolloff.value,
                        self.scan_sat.pilot.value,
                    )
                elif self.scan_type.value == "predefined_transponder":
                    tps = nimmanager.getTransponders(orbpos)
                    if len(tps) > self.scan_transponders.index:
                        x = tps[self.scan_transponders.index]
                        self.addSatTransponder(
                            tlist, x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], orbpos, x[5], x[6], x[8], x[9]
                        )
            removeAll = False
        elif self.scan_type.value == "single_satellite":
            sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
            self.getInitialTransponderList(tlist, sat[0])
        elif self.scan_type.value.find("multisat") != -1:
            SatList = nimmanager.getSatListForNim(index_to_scan)
            for x in self.multiscanlist:
                if x[1].value:
                    print "   " + str(x[0])
                    self.getInitialTransponderList(tlist, x[0])

        flags = self.scan_networkScan.value and eComponentScan.scanNetworkSearch or 0

        tmp = self.scan_clearallservices.value
        if tmp == "yes":
            flags |= eComponentScan.scanRemoveServices
        elif tmp == "yes_hold_feeds":
            flags |= eComponentScan.scanRemoveServices
            flags |= eComponentScan.scanDontRemoveFeeds

        if tmp != "no" and not removeAll:
            flags |= eComponentScan.scanDontRemoveUnscanned

        if self.scan_onlyfree.value:
            flags |= eComponentScan.scanOnlyFree

        for x in self["config"].list:
            x[1].save()

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

                nim = nimmanager.nim_slots[self.feid]

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

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

        nim = nimmanager.nim_slots[index_to_scan]
        if not nim.isCompatible("DVB-S"):
            return

        nimsats = self.satList[index_to_scan]
        selsatidx = self.scan_satselection[index_to_scan].index
        if self.scan_type.value == "single_transponder":
            if len(nimsats):
                orbpos = nimsats[selsatidx][0]
                if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
                    fec = self.scan_sat.fec.value
                else:
                    fec = self.scan_sat.fec_s2.value
                tpslist.append(
                    (
                        self.scan_sat.frequency.value,
                        self.scan_sat.symbolrate.value,
                        self.scan_sat.polarization.value,
                        fec,
                        self.scan_sat.inversion.value,
                        orbpos,
                        self.scan_sat.system.value,
                        self.scan_sat.modulation.value,
                        self.scan_sat.rolloff.value,
                        self.scan_sat.pilot.value,
                    )
                )
        elif self.scan_type.value == "predefined_transponder":
            if len(nimsats):
                orbpos = nimsats[selsatidx][0]
                index = self.scan_transponders.index
                if configElement and configElement._value == str(orbpos):
                    index = 0
                tps = nimmanager.getTransponders(orbpos)
                if len(tps) > index:
                    x = tps[index]
                    tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], orbpos, x[5], x[6], x[8], x[9]))
                    # else:
                    # 	status_text = "tpslist for %d empty! %d" % (sat[0], index)
        elif self.scan_type.value == "single_satellite":
            if len(nimsats):
                multi_tune = True
                orbpos = nimsats[selsatidx][0]
                tps = nimmanager.getTransponders(orbpos)
                for x in tps:
                    if x[0] == 0:  # SAT
                        tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], orbpos, x[5], x[6], x[8], x[9]))
        elif self.scan_type.value == "multisat":
            if len(self.multiscanlist):
                for sat in self.multiscanlist:
                    if sat[1].value or len(tpslist) == 0:
                        if len(tpslist):
                            del tpslist[:]
                        tps = nimmanager.getTransponders(sat[0])
                        for x in tps:
                            if x[0] == 0:  # SAT
                                tpslist.append(
                                    (x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], sat[0], x[5], x[6], x[8], x[9])
                                )
                        if sat[1].value:
                            multi_tune = True
                            break
            else:
                status_text = "multiscanlist empty!"
                SatList = nimmanager.getSatListForNim(index_to_scan)
                for sat in SatList:
                    tps = nimmanager.getTransponders(sat[0])
                    for x in tps:
                        if x[0] == 0:  # SAT
                            tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], sat[0], x[5], x[6], x[8], x[9]))
                    if len(tpslist):
                        break

        self.tpslist = tpslist
        if len(self.tpslist):
            status_text = (
                self.OrbToStr(self.tpslist[self.tpslist_idx][5])
                + ": "
                + str(self.tpslist[self.tpslist_idx][0])
                + " "
                + self.PolToStr(self.tpslist[self.tpslist_idx][2])
            )
            self.tune(self.tpslist[self.tpslist_idx])
            if multi_tune:
                self.tuneTimer.start(100, True)
        self["status"].setText(status_text)
Пример #47
0
	def keyGoCheckTimeshiftCallback(self, answer):
		if not answer or self.scan_nims.value == "":
			return
		tlist = []
		flags = None
		startScan = True
		removeAll = True
		index_to_scan = int(self.scan_nims.value)

		if self.scan_nims == [ ]:
			self.session.open(MessageBox, _("No tuner is enabled!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR)
			return
		nim = nimmanager.nim_slots[index_to_scan]
		print "nim", nim.slot
		if nim.isCompatible("DVB-S"):
			print "is compatible with DVB-S"
			if self.scan_type.value == "single_transponder":
				# these lists are generated for each tuner, so this has work.
				assert len(self.satList) > index_to_scan
				assert len(self.scan_satselection) > index_to_scan

				nimsats = self.satList[index_to_scan]
				selsatidx = self.scan_satselection[index_to_scan].index

				# however, the satList itself could be empty. in that case, "index" is 0 (for "None").
				if len(nimsats):
					orbpos = nimsats[selsatidx][0]
					if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
						fec = self.scan_sat.fec.value
					else:
						fec = self.scan_sat.fec_s2.value
					print "add sat transponder"
					self.addSatTransponder(tlist, self.scan_sat.frequency.value,
								self.scan_sat.symbolrate.value,
								self.scan_sat.polarization.value,
								fec,
								self.scan_sat.inversion.value,
								orbpos,
								self.scan_sat.system.value,
								self.scan_sat.modulation.value,
								self.scan_sat.rolloff.value,
								self.scan_sat.pilot.value)
				removeAll = False
			elif self.scan_type.value == "predefined_transponder":
				nimsats = self.satList[index_to_scan]
				selsatidx = self.scan_satselection[index_to_scan].index
				if len(nimsats):
					orbpos = nimsats[selsatidx][0]
					tps = nimmanager.getTransponders(orbpos)
					if len(tps) and len(tps) > self.preDefTransponders.index:
						tp = tps[self.preDefTransponders.index]
						self.addSatTransponder(tlist, tp[1] / 1000, tp[2] / 1000, tp[3], tp[4], tp[7], orbpos, tp[5], tp[6], tp[8], tp[9])
				removeAll = False
			elif self.scan_type.value == "single_satellite":
				sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
				getInitialTransponderList(tlist, sat[0])
			elif "multisat" in self.scan_type.value:
				SatList = nimmanager.getSatListForNim(index_to_scan)
				for x in self.multiscanlist:
					if x[1].value:
						print "   " + str(x[0])
						getInitialTransponderList(tlist, x[0])

		elif nim.isCompatible("DVB-C"):
			if self.scan_typecable.value == "single_transponder":
				self.addCabTransponder(tlist, self.scan_cab.frequency.value,
											  self.scan_cab.symbolrate.value,
											  self.scan_cab.modulation.value,
											  self.scan_cab.fec.value,
											  self.scan_cab.inversion.value)
				removeAll = False
			elif self.scan_typecable.value == "complete":
				if config.Nims[index_to_scan].cable.scan_type.value == "provider":
					getInitialCableTransponderList(tlist, index_to_scan)
				else:
					startScan = False

		elif nim.isCompatible("DVB-T"):
			if self.scan_typeterrestrial.value == "single_transponder":
				if self.scan_input_as.value == "channel":
					frequency = channelnumbers.channel2frequency(self.scan_ter.channel.value, self.ter_tnumber)
				else:
					frequency = self.scan_ter.frequency.value * 1000
				self.addTerTransponder(tlist,
						frequency,
						inversion = self.scan_ter.inversion.value,
						bandwidth = self.scan_ter.bandwidth.value,
						fechigh = self.scan_ter.fechigh.value,
						feclow = self.scan_ter.feclow.value,
						modulation = self.scan_ter.modulation.value,
						transmission = self.scan_ter.transmission.value,
						guard = self.scan_ter.guard.value,
						hierarchy = self.scan_ter.hierarchy.value,
						system = self.scan_ter.system.value,
						plpid = self.scan_ter.plp_id.value)
				removeAll = False
			elif self.scan_typeterrestrial.value == "complete":
				getInitialTerrestrialTransponderList(tlist, nimmanager.getTerrestrialDescription(index_to_scan))

		flags = self.scan_networkScan.value and eComponentScan.scanNetworkSearch or 0

		tmp = self.scan_clearallservices.value
		if tmp == "yes":
			flags |= eComponentScan.scanRemoveServices
		elif tmp == "yes_hold_feeds":
			flags |= eComponentScan.scanRemoveServices
			flags |= eComponentScan.scanDontRemoveFeeds

		if tmp != "no" and not removeAll:
			flags |= eComponentScan.scanDontRemoveUnscanned

		if self.scan_onlyfree.value:
			flags |= eComponentScan.scanOnlyFree

		for x in self["config"].list:
			x[1].save()

		if startScan:
			self.startScan(tlist, flags, index_to_scan, self.networkid)
		else:
			self.flags = flags
			self.feid = index_to_scan
			self.tlist = []
			self.startCableTransponderSearch(self.feid)
Пример #48
0
    def retune(self, configElement):
        if configElement is None:
            self.tpslist = []
        self.tuneTimer.stop()
        if self.scan_nims == []: return
        if self.scan_nims.value == "": return
        self.tpslist_idx = 0
        tpslist = []
        status_text = ""
        multi_tune = False
        index_to_scan = int(self.scan_nims.value)
        if len(self.satList) <= index_to_scan: return
        if len(self.scan_satselection) <= index_to_scan: return

        nim = nimmanager.nim_slots[index_to_scan]
        if not nim.isCompatible("DVB-S"): return
        nimsats = self.satList[index_to_scan]
        selsatidx = self.scan_satselection[index_to_scan].index
        if self.scan_type.value == "single_transponder":
            if len(nimsats):
                orbpos = nimsats[selsatidx][0]
                if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
                    fec = self.scan_sat.fec.value
                else:
                    fec = self.scan_sat.fec_s2.value
                tpslist.append(
                    (self.scan_sat.frequency.value,
                     self.scan_sat.symbolrate.value,
                     self.scan_sat.polarization.value, fec,
                     self.scan_sat.inversion.value, orbpos,
                     self.scan_sat.system.value,
                     self.scan_sat.modulation.value,
                     self.scan_sat.rolloff.value, self.scan_sat.pilot.value))
        elif self.scan_type.value == "predefined_transponder":
            if len(nimsats):
                orbpos = nimsats[selsatidx][0]
                index = self.scan_transponders.index
                if configElement and configElement._value == str(orbpos):
                    index = 0
                tps = nimmanager.getTransponders(orbpos)
                if len(tps) > index:
                    x = tps[index]
                    tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7],
                                    orbpos, x[5], x[6], x[8], x[9]))
                #else:
                #	status_text = "tpslist for %d empty! %d" % (sat[0], index)
        elif self.scan_type.value == "single_satellite":
            if len(nimsats):
                multi_tune = True
                orbpos = nimsats[selsatidx][0]
                tps = nimmanager.getTransponders(orbpos)
                for x in tps:
                    if x[0] == 0:  #SAT
                        tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4],
                                        x[7], orbpos, x[5], x[6], x[8], x[9]))
        elif self.scan_type.value == "multisat":
            if len(self.multiscanlist):
                for sat in self.multiscanlist:
                    if sat[1].value or len(tpslist) == 0:
                        if len(tpslist):
                            del tpslist[:]
                        tps = nimmanager.getTransponders(sat[0])
                        for x in tps:
                            if x[0] == 0:  #SAT
                                tpslist.append(
                                    (x[1] / 1000, x[2] / 1000, x[3], x[4],
                                     x[7], sat[0], x[5], x[6], x[8], x[9]))
                        if sat[1].value:
                            multi_tune = True
                            break
            else:
                status_text = _("multiscanlist empty!")
                SatList = nimmanager.getSatListForNim(index_to_scan)
                for sat in SatList:
                    tps = nimmanager.getTransponders(sat[0])
                    for x in tps:
                        if x[0] == 0:  #SAT
                            tpslist.append(
                                (x[1] / 1000, x[2] / 1000, x[3], x[4], x[7],
                                 sat[0], x[5], x[6], x[8], x[9]))
                    if len(tpslist): break
        elif self.scan_type.value == "provider":
            if self.provider_list is not None:
                if self.provider_list.value == "none":
                    status_text = _("not selected provider!")
                else:
                    orbpos = 0
                    providerList = None
                    if self.provider_list.value == "ntv":
                        orbpos = 360
                        providerList = NTVPLUS
                    elif self.provider_list.value == "tricolor":
                        orbpos = 360
                        providerList = TRIKOLOR
                    elif self.provider_list.value == "lybid":
                        orbpos = 360
                        providerList = LYBID
                    elif self.provider_list.value == "xtra":
                        orbpos = 3560
                        providerList = XTRA
                    elif self.provider_list.value == "aktiv":
                        orbpos = 600
                        providerList = AKTIV
                    elif self.provider_list.value == "raduga":
                        orbpos = 750
                        providerList = RADUGA
                    elif self.provider_list.value == "kontinent":
                        orbpos = 850
                        providerList = KONTINENT
                    if orbpos > 0 and providerList is not None:
                        SatList = nimmanager.getSatListForNim(index_to_scan)
                        for sat in SatList:
                            if sat[0] == orbpos:
                                tps = nimmanager.getTransponders(orbpos)
                                for x in tps:
                                    pol = x[3]
                                    if x[3] == 2:
                                        pol = 0
                                    if x[3] == 3:
                                        pol = 1
                                    #print "(%s, %s)" % (x[1], x[3])
                                    if (x[1], pol) in providerList:
                                        tpslist.append(
                                            (x[1] / 1000, x[2] / 1000, x[3],
                                             x[4], x[7], sat[0], x[5], x[6],
                                             x[8], x[9]))
                                    if len(tpslist):
                                        multi_tune = True

        self.tpslist = tpslist
        if len(self.tpslist):
            status_text = self.OrbToStr(
                self.tpslist[self.tpslist_idx][5]) + ": " + str(
                    self.tpslist[self.tpslist_idx][0]) + " " + self.PolToStr(
                        self.tpslist[self.tpslist_idx][2])
            self.tune(self.tpslist[self.tpslist_idx])
            if multi_tune:
                self.tuneTimer.start(100, True)
        self["status"].setText(status_text)
Пример #49
0
class Satfinder(ScanSetup, ServiceScan):
	"""Inherits StaticText [key_red] and [key_green] properties from ScanSetup"""

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

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

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

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

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

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

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

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

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

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

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

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

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

			nim = nimmanager.nim_slots[self.feid]

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

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

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

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

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

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

		if self.frontendData:
			ttype = self.frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S" and self.predefinedTranspondersList(self.getSelectedSatIndex(self.feid)) is None and len(nimmanager.getTransponders(self.getSelectedSatIndex(self.feid), self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-T" and self.predefinedTerrTranspondersList() is None and len(nimmanager.getTranspondersTerrestrial(nimmanager.getTerrestrialDescription(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-C" and self.predefinedCabTranspondersList() is None and len(nimmanager.getTranspondersCable(self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "ATSC" and self.predefinedATSCTranspondersList() is None and len(nimmanager.getTranspondersATSC(self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
Пример #50
0
    def retune(self, configElement):
        self.tuneTimer.stop()
        if self.scan_nims == []: return
        if self.scan_nims.value == "": return
        self.tpslist_idx = 0
        tpslist = []
        status_text = ""
        multi_tune = False
        index_to_scan = int(self.scan_nims.value)
        if len(self.satList) <= index_to_scan: return
        if len(self.scan_satselection) <= index_to_scan: return

        nim = nimmanager.nim_slots[index_to_scan]
        if not nim.isCompatible("DVB-S"): return

        nimsats = self.satList[index_to_scan]
        selsatidx = self.scan_satselection[index_to_scan].index
        if self.scan_type.value == "single_transponder":
            if len(nimsats):
                orbpos = nimsats[selsatidx][0]
                if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
                    fec = self.scan_sat.fec.value
                else:
                    fec = self.scan_sat.fec_s2.value
                tpslist.append(
                    (self.scan_sat.frequency.value,
                     self.scan_sat.symbolrate.value,
                     self.scan_sat.polarization.value, fec,
                     self.scan_sat.inversion.value, orbpos,
                     self.scan_sat.system.value,
                     self.scan_sat.modulation.value,
                     self.scan_sat.rolloff.value, self.scan_sat.pilot.value))
        elif self.scan_type.value == "predefined_transponder":
            if len(nimsats):
                orbpos = nimsats[selsatidx][0]
                index = self.scan_transponders.index
                if configElement and configElement._value == str(orbpos):
                    index = 0
                tps = nimmanager.getTransponders(orbpos)
                if len(tps) > index:
                    x = tps[index]
                    tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7],
                                    orbpos, x[5], x[6], x[8], x[9]))
                #else:
                #	status_text = "tpslist for %d empty! %d" % (sat[0], index)
        elif self.scan_type.value == "single_satellite":
            if len(nimsats):
                multi_tune = True
                orbpos = nimsats[selsatidx][0]
                tps = nimmanager.getTransponders(orbpos)
                for x in tps:
                    if x[0] == 0:  #SAT
                        tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4],
                                        x[7], orbpos, x[5], x[6], x[8], x[9]))
        elif self.scan_type.value == "multisat":
            if len(self.multiscanlist):
                for sat in self.multiscanlist:
                    if sat[1].value or len(tpslist) == 0:
                        if len(tpslist):
                            del tpslist[:]
                        tps = nimmanager.getTransponders(sat[0])
                        for x in tps:
                            if x[0] == 0:  #SAT
                                tpslist.append(
                                    (x[1] / 1000, x[2] / 1000, x[3], x[4],
                                     x[7], sat[0], x[5], x[6], x[8], x[9]))
                        if sat[1].value:
                            multi_tune = True
                            break
            else:
                status_text = "multiscanlist empty!"
                SatList = nimmanager.getSatListForNim(index_to_scan)
                for sat in SatList:
                    tps = nimmanager.getTransponders(sat[0])
                    for x in tps:
                        if x[0] == 0:  #SAT
                            tpslist.append(
                                (x[1] / 1000, x[2] / 1000, x[3], x[4], x[7],
                                 sat[0], x[5], x[6], x[8], x[9]))
                    if len(tpslist): break

        self.tpslist = tpslist
        if len(self.tpslist):
            status_text = self.OrbToStr(
                self.tpslist[self.tpslist_idx][5]) + ": " + str(
                    self.tpslist[self.tpslist_idx][0]) + " " + self.PolToStr(
                        self.tpslist[self.tpslist_idx][2])
            self.tune(self.tpslist[self.tpslist_idx])
            if multi_tune:
                self.tuneTimer.start(100, True)
        self["status"].setText(status_text)
Пример #51
0
	def createConfig(self, foo):
		self.tuning_type = ConfigSelection(default = "predefined_transponder", choices = [("single_transponder", _("User defined transponder")), ("predefined_transponder", _("Predefined transponder"))])
		self.orbital_position = 192
		if self.frontendData and self.frontendData.has_key('orbital_position'):
			self.orbital_position = self.frontendData['orbital_position']
		ScanSetup.createConfig(self, self.frontendData)

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

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

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

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

		if self.frontendData:
			ttype = self.frontendData.get("tuner_type", "UNKNOWN")
			if ttype == "DVB-S" and self.predefinedTranspondersList(self.getSelectedSatIndex(self.feid)) is None and len(nimmanager.getTransponders(self.getSelectedSatIndex(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-T" and self.predefinedTerrTranspondersList() is None and len(nimmanager.getTranspondersTerrestrial(nimmanager.getTerrestrialDescription(self.feid))) > 0:
				self.tuning_type.value = "single_transponder"
			elif ttype == "DVB-C" and self.predefinedCabTranspondersList() is None and len(nimmanager.getTranspondersCable(self.feid)) > 0:
				self.tuning_type.value = "single_transponder"
Пример #52
0
	def createSetup(self):
		self.list = []
		self.satfinderTunerEntry = getConfigListEntry(_("Tuner"), self.satfinder_scan_nims)
		self.list.append(self.satfinderTunerEntry)
		if nimmanager.nim_slots[int(self.satfinder_scan_nims.value)].isCompatible("DVB-S"):
			self.tuning_sat = self.scan_satselection[self.getSelectedSatIndex(self.feid)]
			self.satEntry = getConfigListEntry(_('Satellite'), self.tuning_sat)
			self.list.append(self.satEntry)
			self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
			if len(nimmanager.getTransponders(int(self.tuning_sat.value))) < 1: # Only offer 'predefined transponder' if some transponders exist
				self.tuning_type.value = "single_transponder"
			else:
				self.list.append(self.typeOfTuningEntry)

			nim = nimmanager.nim_slots[self.feid]

			if self.tuning_type.value == "single_transponder":
				if nim.isCompatible("DVB-S2"):
					self.systemEntry = getConfigListEntry(_('System'), self.scan_sat.system)
					self.list.append(self.systemEntry)
				else:
					# downgrade to dvb-s, in case a -s2 config was active
					self.scan_sat.system.value = eDVBFrontendParametersSatellite.System_DVB_S
				self.list.append(getConfigListEntry(_('Frequency'), self.scan_sat.frequency))
				self.list.append(getConfigListEntry(_('Polarization'), self.scan_sat.polarization))
				self.list.append(getConfigListEntry(_('Symbol rate'), self.scan_sat.symbolrate))
				self.list.append(getConfigListEntry(_('Inversion'), self.scan_sat.inversion))
				if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
					self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec))
				elif self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
					self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec_s2))
					self.modulationEntry = getConfigListEntry(_('Modulation'), self.scan_sat.modulation)
					self.list.append(self.modulationEntry)
					self.list.append(getConfigListEntry(_('Roll-off'), self.scan_sat.rolloff))
					self.list.append(getConfigListEntry(_('Pilot'), self.scan_sat.pilot))
					self.list.append(getConfigListEntry(_('Input Stream ID'), self.scan_sat.is_id))
					self.list.append(getConfigListEntry(_("PLS Mode"), self.scan_sat.pls_mode))
					self.list.append(getConfigListEntry(_('PLS Code'), self.scan_sat.pls_code))
			elif self.tuning_type.value == "predefined_transponder":
				self.updatePreDefTransponders()
				self.list.append(getConfigListEntry(_("Transponder"), self.preDefTransponders))
		elif nimmanager.nim_slots[int(self.satfinder_scan_nims.value)].isCompatible("DVB-C"):
			self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
			if config.Nims[self.feid].cable.scan_type.value != "provider" or len(nimmanager.getTranspondersCable(int(self.satfinder_scan_nims.value))) < 1: # only show 'predefined transponder' if in provider mode and transponders exist
				self.tuning_type.value = "single_transponder"
			else:
				self.list.append(self.typeOfTuningEntry)
			if self.tuning_type.value == "single_transponder":
				self.list.append(getConfigListEntry(_("Frequency"), self.scan_cab.frequency))
				self.list.append(getConfigListEntry(_("Inversion"), self.scan_cab.inversion))
				self.list.append(getConfigListEntry(_("Symbol rate"), self.scan_cab.symbolrate))
				self.list.append(getConfigListEntry(_("Modulation"), self.scan_cab.modulation))
				self.list.append(getConfigListEntry(_("FEC"), self.scan_cab.fec))
			elif self.tuning_type.value == "predefined_transponder":
				self.scan_nims.value = self.satfinder_scan_nims.value
				self.predefinedCabTranspondersList()
				self.list.append(getConfigListEntry(_('Transponder'), self.CableTransponders))
		elif nimmanager.nim_slots[int(self.satfinder_scan_nims.value)].isCompatible("DVB-T"):
			self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
			region = nimmanager.getTerrestrialDescription(int(self.satfinder_scan_nims.value))
			if len(nimmanager.getTranspondersTerrestrial(region)) < 1: # Only offer 'predefined transponder' if some transponders exist
				self.tuning_type.value = "single_transponder"
			else:
				self.list.append(self.typeOfTuningEntry)
			if self.tuning_type.value == "single_transponder":
				if nimmanager.nim_slots[int(self.satfinder_scan_nims.value)].isCompatible("DVB-T2"):
					self.systemEntryTerr = getConfigListEntry(_('System'), self.scan_ter.system)
					self.list.append(self.systemEntryTerr)
				else:
					self.scan_ter.system.value = eDVBFrontendParametersTerrestrial.System_DVB_T
				self.typeOfInputEntry = getConfigListEntry(_("Use frequency or channel"), self.scan_input_as)
				if self.ter_channel_input:
					self.list.append(self.typeOfInputEntry)
				else:
					self.scan_input_as.value = self.scan_input_as.choices[0]
				if self.ter_channel_input and self.scan_input_as.value == "channel":
					channel = getChannelNumber(self.scan_ter.frequency.value*1000, self.ter_tnumber)
					if channel:
						self.scan_ter.channel.value = int(channel.replace("+","").replace("-",""))
					self.list.append(getConfigListEntry(_("Channel"), self.scan_ter.channel))
				else:
					prev_val = self.scan_ter.frequency.value
					self.scan_ter.frequency.value = channel2frequency(self.scan_ter.channel.value, self.ter_tnumber)/1000
					if self.scan_ter.frequency.value == 474000:
						self.scan_ter.frequency.value = prev_val
					self.list.append(getConfigListEntry(_("Frequency"), self.scan_ter.frequency))
				self.list.append(getConfigListEntry(_("Inversion"), self.scan_ter.inversion))
				self.list.append(getConfigListEntry(_("Bandwidth"), self.scan_ter.bandwidth))
				self.list.append(getConfigListEntry(_("Code rate HP"), self.scan_ter.fechigh))
				self.list.append(getConfigListEntry(_("Code rate LP"), self.scan_ter.feclow))
				self.list.append(getConfigListEntry(_("Modulation"), self.scan_ter.modulation))
				self.list.append(getConfigListEntry(_("Transmission mode"), self.scan_ter.transmission))
				self.list.append(getConfigListEntry(_("Guard interval"), self.scan_ter.guard))
				self.list.append(getConfigListEntry(_("Hierarchy info"), self.scan_ter.hierarchy))
				if self.scan_ter.system.value == eDVBFrontendParametersTerrestrial.System_DVB_T2:
					self.list.append(getConfigListEntry(_('PLP ID'), self.scan_ter.plp_id))
			elif self.tuning_type.value == "predefined_transponder":
				self.scan_nims.value = self.satfinder_scan_nims.value
				self.predefinedTerrTranspondersList()
				self.list.append(getConfigListEntry(_('Transponder'), self.TerrestrialTransponders))
		self.retune(None)
		self["config"].list = self.list
		self["config"].l.setList(self.list)
Пример #53
0
	def retune(self, configElement):
		if configElement is None:
			self.tpslist = [ ]
		self.tuneTimer.stop()
		if self.scan_nims == [ ]: return
		if self.scan_nims.value == "": return
		self.tpslist_idx = 0
		tpslist = [ ]
		status_text = ""
		multi_tune = False
		index_to_scan = int(self.scan_nims.value)
		if len(self.satList) <= index_to_scan: return
		if len(self.scan_satselection) <= index_to_scan: return

		nim = nimmanager.nim_slots[index_to_scan]
		if not nim.isCompatible("DVB-S"): return
		nimsats = self.satList[index_to_scan]
		selsatidx = self.scan_satselection[index_to_scan].index
		if self.scan_type.value == "single_transponder":
			if len(nimsats):
				orbpos = nimsats[selsatidx][0]
				if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
					fec = self.scan_sat.fec.value
				else:
					fec = self.scan_sat.fec_s2.value
				tpslist.append((self.scan_sat.frequency.value,
						self.scan_sat.symbolrate.value,
						self.scan_sat.polarization.value,
						fec,
						self.scan_sat.inversion.value,
						orbpos,
						self.scan_sat.system.value,
						self.scan_sat.modulation.value,
						self.scan_sat.rolloff.value,
						self.scan_sat.pilot.value))
		elif self.scan_type.value == "predefined_transponder":
			if len(nimsats):
				orbpos = nimsats[selsatidx][0]
				index = self.scan_transponders.index
				if configElement and configElement._value == str(orbpos):
					index = 0
				tps = nimmanager.getTransponders(orbpos)
				if len(tps) > index:
					x = tps[index]
					tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], orbpos, x[5], x[6], x[8], x[9]))
				#else:
				#	status_text = "tpslist for %d empty! %d" % (sat[0], index)
		elif self.scan_type.value == "single_satellite":
			if len(nimsats):
				multi_tune = True
				orbpos = nimsats[selsatidx][0]
				tps = nimmanager.getTransponders(orbpos)
				for x in tps:
					if x[0] == 0:	#SAT
						tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], orbpos, x[5], x[6], x[8], x[9]))
		elif self.scan_type.value == "multisat":
			if len(self.multiscanlist):
				for sat in self.multiscanlist:
					if sat[1].value or len(tpslist) == 0:
						if len(tpslist):
							del tpslist[:]
						tps = nimmanager.getTransponders(sat[0])
						for x in tps:
							if x[0] == 0:	#SAT
								tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], sat[0], x[5], x[6], x[8], x[9]))
						if sat[1].value:
							multi_tune = True
							break
			else:
				status_text = _("multiscanlist empty!")
				SatList = nimmanager.getSatListForNim(index_to_scan)
				for sat in SatList:
					tps = nimmanager.getTransponders(sat[0])
					for x in tps:
						if x[0] == 0:	#SAT
							tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], sat[0], x[5], x[6], x[8], x[9]))
					if len(tpslist): break
		elif self.scan_type.value == "provider":
			if self.provider_list is not None:
				if self.provider_list.value == "none":
					status_text = _("not selected provider!")
				else:
					orbpos = 0
					providerList = None
					if self.provider_list.value == "ntv":
						orbpos = 360
						providerList = NTVPLUS
					elif self.provider_list.value == "tricolor":
						orbpos = 360
						providerList = TRIKOLOR
					elif self.provider_list.value == "lybid":
						orbpos = 360
						providerList = LYBID
					elif self.provider_list.value == "xtra":
						orbpos = 3560
						providerList = XTRA
					elif self.provider_list.value == "aktiv":
						orbpos = 600
						providerList = AKTIV
					elif self.provider_list.value == "raduga":
						orbpos = 750
						providerList = RADUGA
					elif self.provider_list.value == "kontinent":
						orbpos = 850 
						providerList = KONTINENT
					if orbpos > 0 and providerList is not None:
						SatList = nimmanager.getSatListForNim(index_to_scan)
						for sat in SatList:
							if sat[0] == orbpos:
								tps = nimmanager.getTransponders(orbpos)
								for x in tps:
									pol = x[3]
									if x[3] == 2:
										pol = 0
									if x[3] == 3:
										pol = 1
									#print "(%s, %s)" % (x[1], x[3])
									if (x[1], pol) in providerList:
										tpslist.append((x[1] / 1000, x[2] / 1000, x[3], x[4], x[7], sat[0], x[5], x[6], x[8], x[9]))
									if len(tpslist):
										multi_tune = True

		self.tpslist = tpslist
		if len(self.tpslist):
			status_text = self.OrbToStr(self.tpslist[self.tpslist_idx][5]) + ": " + str(self.tpslist[self.tpslist_idx][0]) + " " + self.PolToStr(self.tpslist[self.tpslist_idx][2])
			self.tune(self.tpslist[self.tpslist_idx])
			if multi_tune:
				self.tuneTimer.start(100, True)
		self["status"].setText(status_text)
Пример #54
0
def getTransponderList(feid):
	transponderlist = {}
	for sat in nimmanager.getSatListForNim(feid):
		transponderlist[sat[0]] = nimmanager.getTransponders(sat[0])
	return transponderlist