def updateStatus(self): if self.frontend: self.frontendStatus.clear() self.frontend.getFrontendStatus(self.frontendStatus) self["snr_db"].update() self["snr_percentage"].update() self["ber_value"].update() self["snr_bar"].update() self["ber_bar"].update() self["lock_state"].update() tpdata = self.tuner.getTransponderData() if tpdata: transponderdata = ConvertToHumanReadable(tpdata, "DVB-S") self["frequency_value"].setText( str(transponderdata.get("frequency"))) self["symbolrate_value"].setText( str(transponderdata.get("symbol_rate"))) self["fec_value"].setText(str(transponderdata.get("fec_inner"))) if self.frontendStatus.get( "tuner_locked", 0) == 1 and self.isMoving and self.stopOnLock: self.diseqccommand("stop") self.isMoving = False self.stopOnLock = False self.updateColors(self.getCurrentConfigPath()) self.statusTimer.start(50, True)
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) return []
def getText(self): service = self.source.service info = service and service.info() if not info: return "" if self.type == self.XRES: return self.getServiceInfoString(info, iServiceInformation.sVideoWidth) elif self.type == self.YRES: return self.getServiceInfoString(info, iServiceInformation.sVideoHeight) elif self.type == self.APID: return self.getServiceInfoString(info, iServiceInformation.sAudioPID) elif self.type == self.VPID: return self.getServiceInfoString(info, iServiceInformation.sVideoPID) elif self.type == self.PCRPID: return self.getServiceInfoString(info, iServiceInformation.sPCRPID) elif self.type == self.PMTPID: return self.getServiceInfoString(info, iServiceInformation.sPMTPID) elif self.type == self.TXTPID: return self.getServiceInfoString(info, iServiceInformation.sTXTPID) elif self.type == self.TSID: return self.getServiceInfoString(info, iServiceInformation.sTSID) elif self.type == self.ONID: return self.getServiceInfoString(info, iServiceInformation.sONID) elif self.type == self.SID: return self.getServiceInfoString(info, iServiceInformation.sSID) elif self.type == self.FRAMERATE: return self.getServiceInfoString(info, iServiceInformation.sFrameRate, lambda x: "%d fps" % ((x+500)/1000)) elif self.type == self.TRANSFERBPS: return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: "%d kB/s" % (x/1024)) elif self.type == self.HAS_HBBTV: return info.getInfoString(iServiceInformation.sHBBTVUrl) elif self.type == self.FREQ_INFO: feinfo = service.frontendInfo() if feinfo is None: return "" feraw = feinfo.getAll(False) if feraw is None: return "" fedata = ConvertToHumanReadable(feraw) if fedata is None: return "" frequency = fedata.get("frequency") if frequency: frequency = str(frequency / 1000) sr_txt = "Sr:" polarization = fedata.get("polarization_abbreviation") if polarization is None: polarization = "" symbolrate = str(int(fedata.get("symbol_rate", 0) / 1000)) if symbolrate == "0": sr_txt = "" symbolrate = "" fec = fedata.get("fec_inner") if fec is None: fec = "" out = "Freq: %s %s %s %s %s" % (frequency, polarization, sr_txt, symbolrate, fec) return out return ""
def getText(self): service = self.source.service info = service and service.info() if not info: return "" if self.type == self.XRES: return self.getServiceInfoString(info, iServiceInformation.sVideoWidth) elif self.type == self.YRES: return self.getServiceInfoString(info, iServiceInformation.sVideoHeight) elif self.type == self.APID: return self.getServiceInfoString(info, iServiceInformation.sAudioPID) elif self.type == self.VPID: return self.getServiceInfoString(info, iServiceInformation.sVideoPID) elif self.type == self.PCRPID: return self.getServiceInfoString(info, iServiceInformation.sPCRPID) elif self.type == self.PMTPID: return self.getServiceInfoString(info, iServiceInformation.sPMTPID) elif self.type == self.TXTPID: return self.getServiceInfoString(info, iServiceInformation.sTXTPID) elif self.type == self.TSID: return self.getServiceInfoString(info, iServiceInformation.sTSID) elif self.type == self.ONID: return self.getServiceInfoString(info, iServiceInformation.sONID) elif self.type == self.SID: return self.getServiceInfoString(info, iServiceInformation.sSID) elif self.type == self.FRAMERATE: return self.getServiceInfoString(info, iServiceInformation.sFrameRate, lambda x: "%d fps" % ((x+500)/1000)) elif self.type == self.TRANSFERBPS: return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: "%d kB/s" % (x/1024)) elif self.type == self.FREQ_INFO: feinfo = service.frontendInfo() if feinfo is None: return "" feraw = feinfo.getAll(False) if feraw is None: return "" fedata = ConvertToHumanReadable(feraw) if fedata is None: return "" frequency = fedata.get("frequency") if frequency: frequency = str(frequency / 1000) sr_txt = "Sr:" polarization = fedata.get("polarization_abbreviation") if polarization is None: polarization = "" symbolrate = str(int(fedata.get("symbol_rate", 0) / 1000)) if symbolrate == "0": sr_txt = "" symbolrate = "" fec = fedata.get("fec_inner") if fec is None: fec = "" out = "Freq: %s %s %s %s %s" % (frequency, polarization, sr_txt, symbolrate, fec) return out return ""
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": data = ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) if frontendData["system"] == "DVB-S2": data += ((_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT), (_("Input Stream ID"), frontendData["is_id"], TYPE_VALUE_DEC), (_("PLS Mode"), frontendData["pls_mode"], TYPE_TEXT), (_("PLS Code"), frontendData["pls_code"], TYPE_VALUE_DEC)) return data elif frontendDataOrg["tuner_type"] == "DVB-C": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T" and frontendData["system"] == "DVB-T2": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["constellation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"]/1000, TYPE_VALUE_DEC), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("FEC"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("PLP ID"), frontendData["plp_id"], TYPE_VALUE_DEC)) elif frontendDataOrg["tuner_type"] == "DVB-T" and frontendData["system"] == "DVB-T": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["constellation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"]/1000, TYPE_VALUE_DEC), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("FEC HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("FEC LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) return [ ]
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": if frontendData["frequency"] > 11699999 : band = "High" else: band = "Low" return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_BITRATE), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Band"), band, TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT), (_("Input Stream ID"), frontendData.get("is_id", 0), TYPE_VALUE_DEC), (_("PLS Mode"), frontendData.get("pls_mode", None), TYPE_TEXT), (_("PLS Code"), frontendData.get("pls_code", 0), TYPE_VALUE_DEC)) elif frontendDataOrg["tuner_type"] == "DVB-C": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ_FLOAT), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_BITRATE), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ_FLOAT), (_("Channel"), getChannelNumber(frontendData["frequency"], frontendData["tuner_number"]), TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ_FLOAT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) return [ ]
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": if frontendData["frequency"] > 11699999 : band = "High" else: band = "Low" return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_BITRATE), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Band"), band, TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT), (_("Input Stream ID"), frontendData.get("is_id", 0), TYPE_VALUE_DEC), (_("PLS Mode"), frontendData.get("pls_mode", None), TYPE_TEXT), (_("PLS Code"), frontendData.get("pls_code", 0), TYPE_VALUE_DEC)) elif frontendDataOrg["tuner_type"] == "DVB-C": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ_FLOAT), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_BITRATE), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ_FLOAT), (_("Channel"), getChannelNumber(frontendData["frequency"], frontendData["tuner_number"]), TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ_FLOAT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) return [ ]
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": return ( (_("NIM"), chr(ord("A") + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT), ) elif frontendDataOrg["tuner_type"] == "DVB-C": return ( (_("NIM"), chr(ord("A") + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), ) elif frontendDataOrg["tuner_type"] == "DVB-T": channel = ( channelnumbers.getChannelNumber(frontendDataOrg["frequency"], frontendDataOrg["tuner_number"]) if channelnumbers.supportedChannels(frontendDataOrg["tuner_number"]) else None ) return ( (_("NIM"), chr(ord("A") + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Channel"), channel, TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT), ) return []
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if self.transponder_info: tuner = (_("Type"), frontendData["tuner_type"], TYPE_TEXT) else: tuner = (_("NIM & Type"), chr(ord('A') + frontendData["tuner_number"]) + " - " + frontendData["tuner_type"], TYPE_TEXT) if frontendDataOrg["tuner_type"] == "DVB-S": return (tuner, (_("System & Modulation"), frontendData["system"] + " " + frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency & Polarization"), "%s MHz" % (frontendData["frequency"] / 1000) + " - " + frontendData["polarization"], TYPE_TEXT), (_("Symbol rate & FEC"), "%s KSymb/s" % (frontendData["symbol_rate"] / 1000) + " - " + frontendData["fec_inner"], TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), frontendData["inversion"] + " - " + str(frontendData.get("pilot", None)) + " - " + str(frontendData.get("rolloff", None)), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return (tuner, (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_FREQ_FLOAT), (_("Symbol rate & FEC"), "%s KSymb/s" % (frontendData["symbol_rate"] / 1000) + " - " + frontendData["fec_inner"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return (tuner, (_("Frequency & Channel"), "%.3f MHz" % ((frontendData["frequency"] / 1000) / 1000.0) + " - Ch. " + getChannelNumber(frontendData["frequency"], frontendData["tuner_number"]), TYPE_TEXT), (_("Inversion & Bandwidth"), frontendData["inversion"] + " - " + str(frontendData["bandwidth"]), TYPE_TEXT), (_("Code R. LP-HP & Guard Int."), frontendData["code_rate_lp"] + " - " + frontendData["code_rate_hp"] + " - " + frontendData["guard_interval"], TYPE_TEXT), (_("Constellation & FFT mode"), frontendData["constellation"] + " - " + frontendData["transmission_mode"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return (tuner, (_("System & Modulation"), frontendData["system"] + " " + frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"] / 1000, TYPE_VALUE_FREQ_FLOAT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) return []
def tuningChangedTo(self, tp): def setLowRateAdapterCount(symbolrate): # change the measurement time and update interval in case of low symbol rate, # since more time is needed for the front end in that case. # It is an heuristic determination without any pretence. For symbol rates # of 5000 the interval is multiplied by 3 until 15000 which is seen # as a high symbol rate. Linear interpolation elsewhere. return max(int(round((3 - 1) * (symbolrate - 15000) / (5000 - 15000) + 1)), 1) self.symbolrate = tp[1] self.polarisation = tp[2] self.MAX_LOW_RATE_ADAPTER_COUNT = setLowRateAdapterCount(self.symbolrate) transponderdata = ConvertToHumanReadable(self.tuner.getTransponderData(), "DVB-S") self["frequency_value"].setText(str(transponderdata.get("frequency"))) self["symbolrate_value"].setText(str(transponderdata.get("symbol_rate"))) self["fec_value"].setText(str(transponderdata.get("fec_inner"))) self["polarisation"].setText(str(transponderdata.get("polarization")))
def tuningChangedTo(self, tp): def setLowRateAdapterCount(symbolrate): # change the measurement time and update interval in case of low symbol rate, # since more time is needed for the front end in that case. # It is an heuristic determination without any pretence. For symbol rates # of 5000 the interval is multiplied by 3 until 15000 which is seen # as a high symbol rate. Linear interpolation elsewhere. return max(int(round((3 - 1) * (symbolrate - 15000) / (5000 - 15000) + 1)), 1) self.symbolrate = tp[1] self.polarisation = tp[2] self.MAX_LOW_RATE_ADAPTER_COUNT = setLowRateAdapterCount(self.symbolrate) transponderdata = ConvertToHumanReadable(self.tuner.getTransponderData(), "DVB-S") self["frequency_value"].setText(str(transponderdata.get("frequency"))) self["symbolrate_value"].setText(str(transponderdata.get("symbol_rate"))) self["fec_value"].setText(str(transponderdata.get("fec_inner"))) self["polarisation"].setText(str(transponderdata.get("polarization")))
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if self.transponder_info: tuner = (_("Type"), frontendData["tuner_type"], TYPE_TEXT) else: tuner = (_("NIM & Type"), chr(ord('A') + frontendData["tuner_number"]) + " - " + frontendData["tuner_type"], TYPE_TEXT) if frontendDataOrg["tuner_type"] == "DVB-S": if frontendData.get("is_id", -1) > -1: # multistream return (tuner, (_("System & Modulation"), "%s %s" % (frontendData["system"], frontendData["modulation"]), TYPE_TEXT), (_("Orbital position"), "%s" % frontendData["orbital_position"], TYPE_TEXT), (_("Frequency & Polarization"), "%s - %s" % (frontendData.get("frequency", 0), frontendData["polarization"]), TYPE_TEXT), (_("Symbol rate & FEC"), "%s - %s" % (frontendData.get("symbol_rate", 0), frontendData["fec_inner"]), TYPE_TEXT), (_("Input Stream ID"), "%s" % (frontendData.get("is_id", -1)), TYPE_TEXT), (_("PLS Mode & PLS Code"), "%s - %s" % (frontendData["pls_mode"], frontendData["pls_code"]), TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), "%s - %s - %s" % (frontendData["inversion"], frontendData.get("pilot", None), str(frontendData.get("rolloff", None))), TYPE_TEXT)) else: # not multistream return (tuner, (_("System & Modulation"), "%s %s" % (frontendData["system"], frontendData["modulation"]), TYPE_TEXT), (_("Orbital position"), "%s" % frontendData["orbital_position"], TYPE_TEXT), (_("Frequency & Polarization"), "%s - %s" % (frontendData.get("frequency", 0), frontendData["polarization"]), TYPE_TEXT), (_("Symbol rate & FEC"), "%s - %s" % (frontendData.get("symbol_rate", 0), frontendData["fec_inner"]), TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), "%s - %s - %s" % (frontendData["inversion"], frontendData.get("pilot", None), str(frontendData.get("rolloff", None))), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return (tuner, (_("Modulation"),"%s" % frontendData["modulation"], TYPE_TEXT), (_("Frequency"), "%s" % frontendData.get("frequency", 0), TYPE_TEXT), (_("Symbol rate & FEC"), "%s - %s" % (frontendData.get("symbol_rate", 0), frontendData["fec_inner"]), TYPE_TEXT), (_("Inversion"), "%s" % frontendData["inversion"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return (tuner, (_("Frequency & Channel"), "%s - Ch. %s" % (frontendData.get("frequency", 0), getChannelNumber(frontendData["frequency"], frontendData["tuner_number"])), TYPE_TEXT), (_("Inversion & Bandwidth"), "%s - %s" % (frontendData["inversion"], frontendData["bandwidth"]), TYPE_TEXT), (_("Code R. LP-HP & Guard Int"), "%s - %s - %s" % (frontendData["code_rate_lp"], frontendData["code_rate_hp"], frontendData["guard_interval"]), TYPE_TEXT), (_("Constellation & FFT mode"), "%s - %s" % (frontendData["constellation"], frontendData["transmission_mode"]), TYPE_TEXT), (_("Hierarchy info"), "%s" % frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return (tuner, (_("System & Modulation"), "%s - %s" % (frontendData["system"], frontendData["modulation"]), TYPE_TEXT), (_("Frequency"), "%s" % frontendData.get("frequency", 0), TYPE_TEXT), (_("Inversion"), "%s" % frontendData["inversion"], TYPE_TEXT)) return []
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if self.transponder_info: tuner = (_("Type"), frontendData["tuner_type"], TYPE_TEXT) else: tuner = (_("NIM & Type"), chr(ord('A') + frontendData["tuner_number"]) + " - " + frontendData["tuner_type"], TYPE_TEXT) if frontendDataOrg["tuner_type"] == "DVB-S": if frontendData.get("is_id", -1) > -1: # multistream return (tuner, (_("System & Modulation"), "%s %s" % (frontendData["system"], frontendData["modulation"]), TYPE_TEXT), (_("Orbital position"), "%s" % frontendData["orbital_position"], TYPE_TEXT), (_("Frequency & Polarization"), "%s - %s" % (frontendData.get("frequency", 0), frontendData["polarization"]), TYPE_TEXT), (_("Symbol rate & FEC"), "%s - %s" % (frontendData.get("symbol_rate", 0), frontendData["fec_inner"]), TYPE_TEXT), (_("Input Stream ID"), "%s" % (frontendData.get("is_id", -1)), TYPE_TEXT), (_("PLS Mode & PLS Code"), "%s - %s" % (frontendData["pls_mode"], frontendData["pls_code"]), TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), "%s - %s - %s" % (frontendData["inversion"], frontendData.get("pilot", None), str(frontendData.get("rolloff", None))), TYPE_TEXT)) else: # not multistream return (tuner, (_("System & Modulation"), "%s %s" % (frontendData["system"], frontendData["modulation"]), TYPE_TEXT), (_("Orbital position"), "%s" % frontendData["orbital_position"], TYPE_TEXT), (_("Frequency & Polarization"), "%s - %s" % (frontendData.get("frequency", 0), frontendData["polarization"]), TYPE_TEXT), (_("Symbol rate & FEC"), "%s - %s" % (frontendData.get("symbol_rate", 0), frontendData["fec_inner"]), TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), "%s - %s - %s" % (frontendData["inversion"], frontendData.get("pilot", None), str(frontendData.get("rolloff", None))), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return (tuner, (_("Modulation"),"%s" % frontendData["modulation"], TYPE_TEXT), (_("Frequency"), "%s" % frontendData.get("frequency", 0), TYPE_TEXT), (_("Symbol rate & FEC"), "%s - %s" % (frontendData.get("symbol_rate", 0), frontendData["fec_inner"]), TYPE_TEXT), (_("Inversion"), "%s" % frontendData["inversion"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return (tuner, (_("Frequency & Channel"), "%s - Ch. %s" % (frontendData.get("frequency", 0), getChannelNumber(frontendData["frequency"], frontendData["tuner_number"])), TYPE_TEXT), (_("Inversion & Bandwidth"), "%s - %s" % (frontendData["inversion"], frontendData["bandwidth"]), TYPE_TEXT), (_("Code R. LP-HP & Guard Int"), "%s - %s - %s" % (frontendData["code_rate_lp"], frontendData["code_rate_hp"], frontendData["guard_interval"]), TYPE_TEXT), (_("Constellation & FFT mode"), "%s - %s" % (frontendData["constellation"], frontendData["transmission_mode"]), TYPE_TEXT), (_("Hierarchy info"), "%s" % frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return (tuner, (_("System & Modulation"), "%s - %s" % (frontendData["system"], frontendData["modulation"]), TYPE_TEXT), (_("Frequency"), "%s" % frontendData.get("frequency", 0), TYPE_TEXT), (_("Inversion"), "%s" % frontendData["inversion"], TYPE_TEXT)) return []
def updateStatus(self): if self.frontend: self.frontend.getFrontendStatus(self.frontendStatus) self["snr_db"].update() self["snr_percentage"].update() self["ber_value"].update() self["snr_bar"].update() self["ber_bar"].update() self["lock_state"].update() transponderdata = ConvertToHumanReadable(self.tuner.getTransponderData(), "DVB-S") self["frequency_value"].setText(str(transponderdata.get("frequency"))) self["symbolrate_value"].setText(str(transponderdata.get("symbol_rate"))) self["fec_value"].setText(str(transponderdata.get("fec_inner"))) if self.frontendStatus.get("tuner_locked", 0) == 1 and self.isMoving and self.stopOnLock: self.diseqccommand("stop") self.isMoving = False self.stopOnLock = False self.updateColors(self.getCurrentConfigPath()) self.statusTimer.start(50, True)
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": t2mi = lambda x: None if x == -1 else str(x) return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData.get("frequency", 0), TYPE_VALUE_FREQ_FLOAT), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT), (_("Input Stream ID"), frontendData.get("is_id", 0), TYPE_VALUE_DEC), (_("PLS Mode"), frontendData.get("pls_mode", None), TYPE_TEXT), (_("PLS Code"), frontendData.get("pls_code", 0), TYPE_VALUE_DEC), (_("T2MI PLP ID"), t2mi(frontendData.get("t2mi_plp_id", -1)), TYPE_TEXT), (_("T2MI PID"), None if frontendData.get("t2mi_plp_id", -1) == -1 else str(frontendData.get("t2mi_pid", eDVBFrontendParametersSatellite.T2MI_Default_Pid)), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": channel = channelnumbers.getChannelNumber(frontendDataOrg["frequency"], frontendDataOrg["tuner_number"]) if channelnumbers.supportedChannels(frontendDataOrg["tuner_number"]) else None return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Channel"), channel, TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) return []
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": return ((_("NIM"), ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H')[frontendData["tuner_number"]], TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return ((_("NIM"), ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H')[frontendData["tuner_number"]], TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": data = ((_("NIM"), ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H')[frontendData["tuner_number"]], TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) if frontendData.has_key("plp_id"): data += ((_("PLP ID"), frontendData["plp_id"], TYPE_VALUE_DEC), ) return data return [ ]
def updateStatus(self): self.statusTimer.start(self.UPDATE_INTERVAL, True) if self.frontend: self.frontend.getFrontendStatus(self.frontendStatus) self["snr_db"].update() self["snr_percentage"].update() self["ber_value"].update() self["snr_bar"].update() self["ber_bar"].update() self["lock_state"].update() transponderdata = ConvertToHumanReadable(self.tuner.getTransponderData(), "DVB-S") self["frequency_value"].setText(str(transponderdata.get("frequency") / 1000)) self["symbolrate_value"].setText(str(transponderdata.get("symbol_rate") / 1000)) self["fec_value"].setText(str(transponderdata.get("fec_inner"))) self["polarisation"].setText(str(transponderdata.get("polarization"))) if self.statusMsgBlinking: self.statusMsgBlinkCount += 1 if self.statusMsgBlinkCount == self.statusMsgBlinkRate: self.statusMsgBlinkCount = 0 self["status_bar"].visible = not self["status_bar"].visible if self.statusMsgTimeoutTicks > 0: self.statusMsgTimeoutTicks -= 1 if self.statusMsgTimeoutTicks == 0: self["status_bar"].setText("") self.statusMsgBlinking = False self["status_bar"].visible = True if self.isLocked() and self.isMoving and self.stopOnLock: self.stopMoving() self.updateColors(self.getCurrentConfigPath()) if self.collectingStatistics: self.snr_percentage += self["snr_percentage"].getValue(TunerInfo.SNR) self.lock_count += self["lock_state"].getValue(TunerInfo.LOCK) self.stat_count += 1 if self.stat_count == self.max_count: self.collectingStatistics = False count = float(self.stat_count) self.lock_count /= count self.snr_percentage *= 100.0 / 0x10000 / count self.dataAvailable.set()
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg['tuner_type'] == 'DVB-S': return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('System'), frontendData['system'], TYPE_TEXT), (_('Modulation'), frontendData['modulation'], TYPE_TEXT), (_('Orbital position'), frontendData['orbital_position'], TYPE_VALUE_DEC), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Symbol rate'), frontendData['symbol_rate'], TYPE_VALUE_DEC), (_('Polarization'), frontendData['polarization'], TYPE_TEXT), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('FEC'), frontendData['fec_inner'], TYPE_TEXT), (_('Pilot'), frontendData.get('pilot', None), TYPE_TEXT), (_('Roll-off'), frontendData.get('rolloff', None), TYPE_TEXT)) if frontendDataOrg['tuner_type'] == 'DVB-C': return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('Modulation'), frontendData['modulation'], TYPE_TEXT), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Symbol rate'), frontendData['symbol_rate'], TYPE_VALUE_DEC), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('FEC'), frontendData['fec_inner'], TYPE_TEXT)) if frontendDataOrg['tuner_type'] == 'DVB-T': channel = getChannelNumber(frontendDataOrg['frequency'], frontendDataOrg['tuner_number']) if supportedChannels(frontendDataOrg['tuner_number']) else None return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Channel'), getChannelNumber(frontendData['frequency'], frontendData['tuner_number']), TYPE_VALUE_DEC), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('Bandwidth'), frontendData['bandwidth'], TYPE_VALUE_DEC), (_('Code rate LP'), frontendData['code_rate_lp'], TYPE_TEXT), (_('Code rate HP'), frontendData['code_rate_hp'], TYPE_TEXT), (_('Constellation'), frontendData['constellation'], TYPE_TEXT), (_('Transmission mode'), frontendData['transmission_mode'], TYPE_TEXT), (_('Guard interval'), frontendData['guard_interval'], TYPE_TEXT), (_('Hierarchy info'), frontendData['hierarchy_information'], TYPE_TEXT)) return []
def getTunerInfo(self, service): tunerinfo = "" info = (service and service.info()) Ret_Text = "" xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) if info: try: Ret_Text = str(xresol) + "x" + str(yresol) transponderData = ConvertToHumanReadable(info.getInfoObject(iServiceInformation.sTransponderData)) tunerType = transponderData.get("tuner_type") symbolRate = transponderData.get("symbol_rate", "") frequency = transponderData.get("frequency", "") polarization = transponderData.get("polarization", "").replace(_("Horizontal"), "H").replace(_("Vertical"), "V").replace(_("Circular left"), "CL").replace(_("Circular right"), "CR") fec = transponderData.get("fec_inner", "") if (tunerType == _("Satellite")): frequency = (str((int(frequency) / 1000)) + " MHz") symbolRate = (str((int(symbolRate) / 1000))) tunerinfo = (((((((Ret_Text + " ") + frequency + " ") + polarization) + " ") + fec) + " ") + symbolRate) return tunerinfo except: return ""
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) tunerType = frontendDataOrg["tuner_type"] if tunerType == feSatellite: return ((_("NIM"), ('A', 'B', 'C', 'D')[frontendData["slot_number"]], TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT)) elif tunerType == feCable: return ((_("NIM"), ('A', 'B', 'C', 'D')[frontendData["slot_number"]], TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif tunerType == feTerrestrial: return ((_("NIM"), ('A', 'B', 'C', 'D')[frontendData["slot_number"]], TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) return [ ]
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": t2mi = lambda x: None if x == -1 else str(x) return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT), (_("Input Stream ID"), frontendData.get("is_id", 0), TYPE_VALUE_DEC), (_("PLS Mode"), frontendData.get("pls_mode", None), TYPE_TEXT), (_("PLS Code"), frontendData.get("pls_code", 0), TYPE_VALUE_DEC), (_("T2MI PLP ID"), t2mi(frontendData.get("t2mi_plp_id", -1)), TYPE_TEXT), (_("T2MI PID"), None if frontendData.get("t2mi_plp_id", -1) == -1 else str(frontendData.get("t2mi_pid", eDVBFrontendParametersSatellite.T2MI_Default_Pid)), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": channel = channelnumbers.getChannelNumber(frontendDataOrg["frequency"], frontendDataOrg["tuner_number"]) if channelnumbers.supportedChannels(frontendDataOrg["tuner_number"]) else None return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Channel"), channel, TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) return [ ]
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": return (("NIM", ('A', 'B', 'C', 'D')[frontendData["tuner_number"]], TYPE_TEXT), ("Type", frontendData["system"], TYPE_TEXT), ("Modulation", frontendData["modulation"], TYPE_TEXT), ("Orbital position", frontendData["orbital_position"], TYPE_VALUE_DEC), ("Frequency", frontendData["frequency"], TYPE_VALUE_DEC), ("Symbolrate", frontendData["symbol_rate"], TYPE_VALUE_DEC), ("Polarization", frontendData["polarization"], TYPE_TEXT), ("Inversion", frontendData["inversion"], TYPE_TEXT), ("FEC inner", frontendData["fec_inner"], TYPE_TEXT), ("Pilot", frontendData.get("pilot", None), TYPE_TEXT), ("Rolloff", frontendData.get("rolloff", None), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return (("NIM", ('A', 'B', 'C', 'D')[frontendData["tuner_number"]], TYPE_TEXT), ("Type", frontendData["tuner_type"], TYPE_TEXT), ("Frequency", frontendData["frequency"], TYPE_VALUE_DEC), ("Symbolrate", frontendData["symbol_rate"], TYPE_VALUE_DEC), ("Modulation", frontendData["modulation"], TYPE_TEXT), ("Inversion", frontendData["inversion"], TYPE_TEXT), ("FEC inner", frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return (("NIM", ('A', 'B', 'C', 'D')[frontendData["tuner_number"]], TYPE_TEXT), ("Type", frontendData["tuner_type"], TYPE_TEXT), ("Frequency", frontendData["frequency"], TYPE_VALUE_DEC), ("Inversion", frontendData["inversion"], TYPE_TEXT), ("Bandwidth", frontendData["bandwidth"], TYPE_VALUE_DEC), ("CodeRateLP", frontendData["code_rate_lp"], TYPE_TEXT), ("CodeRateHP", frontendData["code_rate_hp"], TYPE_TEXT), ("Constellation", frontendData["constellation"], TYPE_TEXT), ("Transmission Mode", frontendData["transmission_mode"], TYPE_TEXT), ("Guard Interval", frontendData["guard_interval"], TYPE_TEXT), ("Hierarchy Inform.", frontendData["hierarchy_information"], TYPE_TEXT)) return [ ]
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) tunerType = frontendDataOrg["tuner_type"] inputName = nimmanager.getNimSlotInputName(frontendData["slot_number"]) if tunerType == feSatellite: return ((_("NIM"), inputName, TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT), (_("Stream Id"), frontendData.get("is_id", None), TYPE_VALUE_DEC), (_("PLS Mode"), frontendData.get("pls_mode", None), TYPE_TEXT), (_("PLS Code"), frontendData.get("pls_code", None), TYPE_VALUE_DEC)) elif tunerType == feCable: return ((_("NIM"), inputName, TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif tunerType == feTerrestrial: return ((_("NIM"), inputName, TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Code rate LP"), frontendData.get("code_rate_lp", None), TYPE_TEXT), (_("Code rate HP"), frontendData.get("code_rate_hp", None), TYPE_TEXT), (_("Hierarchy info"), frontendData.get("hierarchy_information", None), TYPE_TEXT), (_("FEC"), frontendData.get("fec_inner", None), TYPE_TEXT), (_("PLP ID"), frontendData.get("plp_id", None), TYPE_VALUE_DEC), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT)) return [ ]
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if self.transponder_info: tuner = (_("Type"), frontendData["tuner_type"], TYPE_TEXT) else: tuner = (_("NIM & Type"), chr(ord('A') + frontendData["tuner_number"]) + " - " + frontendData["tuner_type"], TYPE_TEXT) if frontendDataOrg["tuner_type"] == "DVB-S": if frontendData.get("is_id", -1) > -1: # multistream return (tuner, (_("System & Modulation"), "%s %s" % (frontendData["system"], frontendData["modulation"]), TYPE_TEXT), (_("Orbital position"), "%s" % frontendData["orbital_position"], TYPE_TEXT), (_("Frequency & Polarization"), "%s - %s" % (frontendData.get("frequency", 0), frontendData["polarization"]), TYPE_TEXT), (_("Symbol rate & FEC"), "%s - %s" % (frontendData.get("symbol_rate", 0), frontendData["fec_inner"]), TYPE_TEXT), (_("Input Stream ID"), "%s" % (frontendData.get("is_id", -1)), TYPE_TEXT), (_("PLS Mode & PLS Code"), "%s - %s" % (frontendData["pls_mode"], frontendData["pls_code"]), TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), "%s - %s - %s" % (frontendData["inversion"], frontendData.get("pilot", None), str(frontendData.get("rolloff", None))), TYPE_TEXT)) else: # not multistream return (tuner, (_("System & Modulation"), "%s %s" % (frontendData["system"], frontendData["modulation"]), TYPE_TEXT), (_("Orbital position"), "%s" % frontendData["orbital_position"], TYPE_TEXT), (_("Frequency & Polarization"), "%s - %s" % (frontendData.get("frequency", 0), frontendData["polarization"]), TYPE_TEXT), (_("Symbol rate & FEC"), "%s - %s" % (frontendData.get("symbol_rate", 0), frontendData["fec_inner"]), TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), "%s - %s - %s" % (frontendData["inversion"], frontendData.get("pilot", None), str(frontendData.get("rolloff", None))), TYPE_TEXT))
def changed(self, what): self.moveTimerText.stop() if self.instance: if (what[0] == self.CHANGED_CLEAR): self.text = "" else: service = self.source.service info = eServiceCenter.getInstance().info(service) if (info and service): tp = info.getInfoObject( service, iServiceInformation.sTransponderData) tpinfo = ConvertToHumanReadable(tp) refstr = self.source.service.toString() curref = refstr.replace("%3a", ":") streamtype = streamurl = freq = ch = pol = sys = mod = const = fec = sr = orbpos = isid = plsmode = plscode = plpid = t2mi_id = t2mi_pid = "" try: if curref.startswith("1:7:"): curref = "" if "%3a/" in refstr or ":/" in refstr: strurl = refstr.split(":") streamurl = strurl[10].replace("%3a", ":") if refstr.startswith("1:0:2"): streamtype = "Radio" elif not curref.startswith( "1:0:") and "%3a/" in refstr: streamtype = "Stream" elif curref.startswith("1:0:") and "%3a/" in refstr: if "0.0.0.0:" in curref or "127.0.0.1:" in curref or "localhost:" in curref: streamtype = "TS Relay" else: streamtype = "TS Stream" elif curref.startswith("1:134:"): streamtype = "Alternative" else: streamurl = streamtype = "" if "channel" in tpinfo: try: ch = (str(tpinfo.get("channel")) + "/") except: ch = "" if "system" in tp: try: sys = (str(tpinfo.get("system"))) if "DVB-S" in sys: freq = (str(int(tp["frequency"]) / 1000)) elif "DVB-C" in sys: freq = (str(int(tp["frequency"]) / 1000) + " Mhz") elif "DVB-T" in sys or "ATSC" in sys: freq = ( str(int(tp["frequency"]) / 1000000) + " Mhz") else: freq = "" except: sys = "" if "plp_id" in tp and "DVB-T2" in sys: try: plpid = (str(tpinfo.get("plp_id", 0))) plpid = ("PLP ID:") + plpid except: plpid = "" if "t2mi_plp_id" in tp and "DVB-S2" in sys: try: t2mi_id = (str(tpinfo.get("t2mi_plp_id", -1))) t2mi_pid = (str(tpinfo.get("t2mi_pid"))) if t2mi_id == "-1" or t2mi_id == "None" or t2mi_pid == "0" or t2mi_id > "255": t2mi_id = "" t2mi_pid = "" else: t2mi_id = sp("T2MI PLP") + t2mi_id if t2mi_pid == "None": t2mi_pid = "" else: t2mi_pid = sp("PID") + t2mi_pid except: t2mi_id = "" if "modulation" in tp: try: mod = (str(tpinfo.get("modulation"))) except: mod = "" if "polarization" in tp: try: pol = { eDVBFrontendParametersSatellite.Polarisation_Horizontal: "H", eDVBFrontendParametersSatellite.Polarisation_Vertical: "V", eDVBFrontendParametersSatellite.Polarisation_CircularLeft: "L", eDVBFrontendParametersSatellite.Polarisation_CircularRight: "R" }[tp["polarization"]] except: pol = "" if "constellation" in tp: try: const = (str(tpinfo.get("constellation"))) except: const = "" if "fec_inner" in tp: try: fec = (str(tpinfo.get("fec_inner"))) except: fec = "" if "symbol_rate" in tp: sr = (str(int(tp["symbol_rate"]) / 1000)) if "orbital_position" in tp: orbpos = (int(tp["orbital_position"])) if orbpos > 1800: orbpos = (str( (float(3600 - orbpos)) / 10.0) + "°W") else: orbpos = (str((float(orbpos)) / 10.0) + "°E") if "is_id" in tp or "pls_code" in tp or "pls_mode" in tp: isid = str(tpinfo.get("is_id", 0)) plscode = str(tpinfo.get("pls_code", 0)) plsmode = str(tpinfo.get("pls_mode", None)) if plsmode == "None" or plsmode == "Unknown" or ( plsmode is not "None" and plscode == "0"): plsmode = "" if isid == "None" or isid == "-1" or isid == "0": isid = "" else: isid = ("IS:") + isid if plscode == "None" or plscode == "-1" or plscode == "0": plscode = "" if (plscode == "0" and plsmode == "Gold") or ( plscode == "1" and plsmode == "Root"): plscode = plsmode = "" except: pass self.text = sp(streamtype) + sp(streamurl) + sp( orbpos) + ch + sp(freq) + sp(pol) + sp(sys) + sp( mod) + sp(plpid) + sp(sr) + sp(fec) + sp( const) + sp(isid) + sp(plsmode) + sp( plscode) + sp(t2mi_id) + t2mi_pid text_width = self.instance.calculateSize().width() if (self.instance and (text_width > self.sizeX)): self.x = len(self.text.decode("utf8")) self.idx = 0 self.backtext = self.text self.status = "start" self.moveTimerText = eTimer() self.moveTimerText.timeout.get().append( self.moveTimerTextRun) self.moveTimerText.start(2000)
class ServiceName2(Converter, object): NAME = 0 NUMBER = 1 BOUQUET = 2 PROVIDER = 3 REFERENCE = 4 ORBPOS = 5 TPRDATA = 6 SATELLITE = 7 ALLREF = 8 FORMAT = 9 def __init__(self, type): Converter.__init__(self, type) if type == "Name" or not len(str(type)): self.type = self.NAME elif type == "Number": self.type = self.NUMBER elif type == "Bouquet": self.type = self.BOUQUET elif type == "Provider": self.type = self.PROVIDER elif type == "Reference": self.type = self.REFERENCE elif type == "OrbitalPos": self.type = self.ORBPOS elif type == "TpansponderInfo": self.type = self.TPRDATA elif type == "Satellite": self.type = self.SATELLITE elif type == "AllRef": self.type = self.ALLREF else: self.type = self.FORMAT self.sfmt = type[:] try: if (self.type == 1 or (self.type == 9 and '%n' in self.sfmt)) and correctChannelNumber: ChannelNumberClasses.append(self.forceChanged) except: pass self.refstr = self.isStream = self.ref = self.info = self.what = self.tpdata = None self.Timer = eTimer() self.Timer.callback.append(self.neededChange) self.IPTVcontrol = self.isAdditionalService(type=0) self.AlternativeControl = self.isAdditionalService(type=1) def isAdditionalService(self, type=0): def searchService(serviceHandler, bouquet): istype = False servicelist = serviceHandler.list(bouquet) if not servicelist is None: while True: s = servicelist.getNext() if not s.valid(): break if not (s.flags & (eServiceReference.isMarker | eServiceReference.isDirectory)): if type: if s.flags & eServiceReference.isGroup: istype = True return istype else: if '%3a//' in s.toString().lower(): istype = True return istype return istype isService = False serviceHandler = eServiceCenter.getInstance() if not config.usage.multibouquet.value: service_types_tv = '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 22) || (type == 25) || (type == 134) || (type == 195)' rootstr = '%s FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet' % ( service_types_tv) else: rootstr = '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.tv" ORDER BY bouquet' bouquet = eServiceReference(rootstr) if not config.usage.multibouquet.value: isService = searchService(serviceHandler, bouquet) else: bouquetlist = serviceHandler.list(bouquet) if not bouquetlist is None: while True: bouquet = bouquetlist.getNext() if not bouquet.valid(): break if bouquet.flags & eServiceReference.isDirectory: isService = searchService(serviceHandler, bouquet) if isService: break return isService def getServiceNumber(self, ref): def searchHelper(serviceHandler, num, bouquet): servicelist = serviceHandler.list(bouquet) if not servicelist is None: while True: s = servicelist.getNext() if not s.valid(): break if not (s.flags & (eServiceReference.isMarker | eServiceReference.isDirectory)): num += 1 if s == ref: return s, num return None, num if isinstance(ref, eServiceReference): isRadioService = ref.getData(0) in (2, 10) lastpath = isRadioService and config.radio.lastroot.value or config.tv.lastroot.value if 'FROM BOUQUET' not in lastpath: if 'FROM PROVIDERS' in lastpath: return 'P', 'Provider' if 'FROM SATELLITES' in lastpath: return 'S', 'Satellites' if ') ORDER BY name' in lastpath: return 'A', 'All Services' return 0, 'N/A' try: acount = config.plugins.NumberZapExt.enable.value and config.plugins.NumberZapExt.acount.value or config.usage.alternative_number_mode.value except: acount = False rootstr = '' for x in lastpath.split(';'): if x != '': rootstr = x serviceHandler = eServiceCenter.getInstance() if acount is True or not config.usage.multibouquet.value: bouquet = eServiceReference(rootstr) service, number = searchHelper(serviceHandler, 0, bouquet) else: if isRadioService: bqrootstr = '1:7:2:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.radio" ORDER BY bouquet' else: bqrootstr = '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.tv" ORDER BY bouquet' number = 0 cur = eServiceReference(rootstr) bouquet = eServiceReference(bqrootstr) bouquetlist = serviceHandler.list(bouquet) if not bouquetlist is None: while True: bouquet = bouquetlist.getNext() if not bouquet.valid(): break if bouquet.flags & eServiceReference.isDirectory: service, number = searchHelper( serviceHandler, number, bouquet) if not service is None and cur == bouquet: break if not service is None: info = serviceHandler.info(bouquet) name = info and info.getName(bouquet) or '' return number, name return 0, '' def getProviderName(self, ref): if isinstance(ref, eServiceReference): from Screens.ChannelSelection import service_types_radio, service_types_tv typestr = ref.getData(0) in ( 2, 10) and service_types_radio or service_types_tv pos = typestr.rfind(':') rootstr = '%s (channelID == %08x%04x%04x) && %s FROM PROVIDERS ORDER BY name' % ( typestr[:pos + 1], ref.getUnsignedData(4), ref.getUnsignedData(2), ref.getUnsignedData(3), typestr[pos + 1:]) provider_root = eServiceReference(rootstr) serviceHandler = eServiceCenter.getInstance() providerlist = serviceHandler.list(provider_root) if not providerlist is None: while True: provider = providerlist.getNext() if not provider.valid(): break if provider.flags & eServiceReference.isDirectory: servicelist = serviceHandler.list(provider) if not servicelist is None: while True: service = servicelist.getNext() if not service.valid(): break if service == ref: info = serviceHandler.info(provider) return info and info.getName( provider) or "Unknown" return "" def getTransponderInfo(self, info, ref, fmt): result = "" if self.tpdata is None: if ref: self.tpdata = ref and info.getInfoObject( ref, iServiceInformation.sTransponderData) else: self.tpdata = info.getInfoObject( iServiceInformation.sTransponderData) self.fedata = ConvertToHumanReadable(self.tpdata) if not isinstance(self.tpdata, dict): self.tpdata = None return result if self.isStream: type = 'IPTV' else: type = self.tpdata.get('tuner_type', '') if not fmt or fmt == 'T': if type == 'DVB-C': fmt = [ "t ", "F ", "Y ", "i ", "f ", "M" ] #(type frequency symbol_rate inversion fec modulation) elif type == 'DVB-T': if ref: fmt = [ "O ", "F ", "h ", "m ", "g ", "c", "k " ] #(orbital_position code_rate_hp transmission_mode guard_interval constellation) else: fmt = [ "t ", "F ", "h ", "m ", "g ", "c", "k " ] #(type frequency code_rate_hp transmission_mode guard_interval constellation) elif type == 'IPTV': return _("Streaming") else: fmt = [ "O ", "F", "p ", "Y ", "f" ] #(orbital_position frequency polarization symbol_rate fec) for line in fmt: f = line[:1] if f == 't': # %t - tuner_type (dvb-s/s2/c/t) if type == 'DVB-S': result += _("Satellite") elif type == 'DVB-C': result += _("Cable") elif type == 'DVB-T': result += _("Terrestrial") elif type == 'IPTV': result += _("Stream-tv") else: result += 'N/A' elif f == 's': # %s - system (dvb-s/s2/c/t) if type == 'DVB-S': x = self.tpdata.get('system', 0) result += x in range(2) and { 0: 'DVB-S', 1: 'DVB-S2' }[x] or '' elif type == 'DVB-C': x = self.tpdata.get('system', 0) result += x in range(2) and { 0: 'DVB-C', 1: 'DVB-C2' }[x] or '' elif type == 'DVB-T': x = self.tpdata.get('system', 0) result += x in range(2) and { 0: 'DVB-T', 1: 'DVB-T2' }[x] or '' else: result += type elif f == 'F': # %F - frequency (dvb-s/s2/c/t) in KHz if type == 'DVB-S': result += '%d' % round( self.tpdata.get('frequency', 0) / 1000.0) elif type in ('DVB-T', 'DVB-C'): result += '%d MHz' % round( self.tpdata.get('frequency', 0) / 1000000.0) elif f == 'k': # %k ch number t2 if type == 'DVB-T': result += self.fedata.get("channel") or '' elif f == 'f': # %f - fec_inner (dvb-s/s2/c/t) if type in ('DVB-S', 'DVB-C'): x = self.tpdata.get('fec_inner', 15) result += x in range(10) + [15] and { 0: 'Auto', 1: '1/2', 2: '2/3', 3: '3/4', 4: '5/6', 5: '7/8', 6: '8/9', 7: '3/5', 8: '4/5', 9: '9/10', 15: 'None' }[x] or '' elif type == 'DVB-T': x = self.tpdata.get('code_rate_lp', 5) result += x in range(6) and { 0: '1/2', 1: '2/3', 2: '3/4', 3: '5/6', 4: '7/8', 5: 'Auto' }[x] or '' elif f == 'i': # %i - inversion (dvb-s/s2/c/t) if type in ('DVB-S', 'DVB-C', 'DVB-T'): x = self.tpdata.get('inversion', 2) result += x in range(3) and { 0: 'On', 1: 'Off', 2: 'Auto' }[x] or '' elif f == 'O': # %O - orbital_position (dvb-s/s2) if type == 'DVB-S': x = self.tpdata.get('orbital_position', 0) result += x > 1800 and "%d.%d°W" % ( (3600 - x) / 10, (3600 - x) % 10) or "%d.%d°E" % (x / 10, x % 10) elif type == 'DVB-T': x = self.tpdata.get('system', 0) result += x in range(2) and { 0: 'DVB-T', 1: 'DVB-T2' }[x] or '' elif type == 'DVB-C': result += 'DVB-C' elif type == 'Iptv': result += 'Stream' elif f == 'M': # %M - modulation (dvb-s/s2/c) x = self.tpdata.get('modulation', 1) if type == 'DVB-S': result += x in range(4) and { 0: 'Auto', 1: 'QPSK', 2: '8PSK', 3: 'QAM16' }[x] or '' elif type == 'DVB-C': result += x in range(6) and { 0: 'Auto', 1: 'QAM16', 2: 'QAM32', 3: 'QAM64', 4: 'QAM128', 5: 'QAM256' }[x] or '' elif f == 'p': # %p - polarization (dvb-s/s2) if type == 'DVB-S': x = self.tpdata.get('polarization', 0) result += x in range(4) and { 0: 'H', 1: 'V', 2: 'L', 3: 'R' }[x] or '?' elif f == 'Y': # %Y - symbol_rate (dvb-s/s2/c) if type in ('DVB-S', 'DVB-C'): result += '%d' % (self.tpdata.get('symbol_rate', 0) / 1000) elif f == 'r': # %r - rolloff (dvb-s2) if not self.isStream: x = self.tpdata.get('rolloff') if not x is None: result += x in range(3) and { 0: '0.35', 1: '0.25', 2: '0.20' }[x] or '' elif f == 'o': # %o - pilot (dvb-s2) if not self.isStream: x = self.tpdata.get('pilot') if not x is None: result += x in range(3) and { 0: 'Off', 1: 'On', 2: 'Auto' }[x] or '' elif f == 'c': # %c - constellation (dvb-t) if type == 'DVB-T': x = self.tpdata.get('constellation', 3) result += x in range(4) and { 0: 'QPSK', 1: 'QAM16', 2: 'QAM64', 3: 'Auto' }[x] or '' elif f == 'l': # %l - code_rate_lp (dvb-t) if type == 'DVB-T': x = self.tpdata.get('code_rate_lp', 5) result += x in range(6) and { 0: '1/2', 1: '2/3', 2: '3/4', 3: '5/6', 4: '7/8', 5: 'Auto' }[x] or '' elif f == 'h': # %h - code_rate_hp (dvb-t) if type == 'DVB-T': x = self.tpdata.get('code_rate_hp', 5) result += x in range(6) and { 0: '1/2', 1: '2/3', 2: '3/4', 3: '5/6', 4: '7/8', 5: 'Auto' }[x] or '' elif f == 'm': # %m - transmission_mode (dvb-t) if type == 'DVB-T': x = self.tpdata.get('transmission_mode', 2) result += x in range(3) and { 0: '2k', 1: '8k', 2: 'Auto' }[x] or '' elif f == 'g': # %g - guard_interval (dvb-t) if type == 'DVB-T': x = self.tpdata.get('guard_interval', 4) result += x in range(5) and { 0: '1/32', 1: '1/16', 2: '1/8', 3: '1/4', 4: 'Auto' }[x] or '' elif f == 'b': # %b - bandwidth (dvb-t) if type == 'DVB-T': x = self.tpdata.get('bandwidth', 1) result += x in range(4) and { 0: '8 MHz', 1: '7 MHz', 2: '6 MHz', 3: 'Auto' }[x] or '' elif f == 'e': # %e - hierarchy_information (dvb-t) if type == 'DVB-T': x = self.tpdata.get('hierarchy_information', 4) result += x in range(5) and { 0: 'None', 1: '1', 2: '2', 3: '4', 4: 'Auto' }[x] or '' result += line[1:] return result def getSatelliteName(self, ref): if isinstance(ref, eServiceReference): orbpos = ref.getUnsignedData(4) >> 16 if orbpos == 0xFFFF: #Cable return _("Cable") elif orbpos == 0xEEEE: #Terrestrial # return _("Terrestrial") try: nimfile = open('/proc/bus/nim_sockets') except IOError: return current_slot = None for line in nimfile: if not line: break line = line.strip() if line.startswith('NIM Socket'): parts = line.split(' ') current_slot = int(parts[2][:-1]) from Components.NimManager import nimmanager return str(nimmanager.getTerrestrialDescription(current_slot)) else: #Satellite orbpos = ref.getData(4) >> 16 if orbpos < 0: orbpos += 3600 try: from Components.NimManager import nimmanager return str(nimmanager.getSatDescription(orbpos)) except: dir = ref.flags & (eServiceReference.isDirectory | eServiceReference.isMarker) if not dir: refString = ref.toString().lower() if refString.startswith('-1'): return '' elif refString.startswith('1:134:'): return _("Alternative") elif refString.startswith('4097:'): return _("Internet") else: return orbpos > 1800 and "%d.%d°W" % ( (3600 - orbpos) / 10, (3600 - orbpos) % 10) or "%d.%d°E" % (orbpos / 10, orbpos % 10) return "" def getIPTVProvider(self, refstr): iptv_prov = '/etc/enigma2/iptvprov.list' if os.path.isfile(iptv_prov): with open(iptv_prov, "r") as f: for d in f.readlines(): if d.split(',')[0] in refstr: return d.split(',')[1].strip() elif '4097' in refstr or '5001' in refstr or '5002' in refstr: return "StreamTV" return "" def getPlayingref(self, ref): playingref = None if NavigationInstance.instance: playingref = NavigationInstance.instance.getCurrentlyPlayingServiceReference( ) if not playingref: playingref = eServiceReference() return playingref def resolveAlternate(self, ref): nref = getBestPlayableServiceReference(ref, self.getPlayingref(ref)) if not nref: nref = getBestPlayableServiceReference(ref, eServiceReference(), True) return nref def getReferenceType(self, refstr, ref): if ref is None: if NavigationInstance.instance: playref = NavigationInstance.instance.getCurrentlyPlayingServiceReference( ) if playref: refstr = playref.toString() or '' prefix = '' if refstr.startswith('4097:'): prefix += "GStreamer " if '%3a//' in refstr: sref = ' '.join(refstr.split(':')[10:]) refstr = prefix + sref else: sref = ':'.join(refstr.split(':')[:10]) refstr = prefix + sref else: if refstr != '': prefix = '' if refstr.startswith("1:7:"): if 'FROM BOUQUET' in refstr: prefix += "Bouquet " elif '(provider == ' in refstr: prefix += "Provider " elif '(satellitePosition == ' in refstr: prefix += "Satellit " elif '(channelID == ' in refstr: prefix += "Current tr " elif refstr.startswith('1:134:'): prefix += "Alter " elif refstr.startswith('1:64:'): prefix += "Marker " elif refstr.startswith('4097:'): prefix += "GStreamer " if self.isStream: if self.refstr: if '%3a//' in self.refstr: sref = ' '.join(self.refstr.split(':')[10:]) else: sref = ':'.join(self.refstr.split(':')[:10]) else: sref = ' '.join(refstr.split(':')[10:]) return prefix + sref else: if self.refstr: sref = ':'.join(self.refstr.split(':')[:10]) else: sref = ':'.join(refstr.split(':')[:10]) return prefix + sref return refstr @cached def getText(self): service = self.source.service if isinstance(service, iPlayableServicePtr): info = service and service.info() ref = None else: # reference info = service and self.source.info ref = service if not info: return "" refname = 'ServiceName2.ref' searchpath = [ '/etc/enigma2/', '/usr/lib/enigma2/python/Components/Converter/' ] if ref: refstr = ref.toString() else: refstr = info.getInfoString(iServiceInformation.sServiceref) if refstr is None: refstr = '' if self.AlternativeControl: if ref and refstr.startswith('1:134:') and self.ref is None: nref = self.resolveAlternate(ref) if nref: self.ref = nref self.info = eServiceCenter.getInstance().info(self.ref) self.refstr = self.ref.toString() if not self.info: return "" if self.IPTVcontrol: if '%3a//' in refstr or (self.refstr and '%3a//' in self.refstr ) or refstr.startswith('4097:'): self.isStream = True if self.type == self.NAME: name = ref and (info.getName(ref) or 'N/A') or (info.getName() or 'N/A') prefix = '' if self.ref: prefix = " (alter)" name += prefix return name.replace('\xc2\x86', '').replace('\xc2\x87', '') elif self.type == self.NUMBER: try: service = self.source.serviceref num = service and service.getChannelNum() or None except: num = None if num: return str(num) else: num, bouq = self.getServiceNumber(ref or eServiceReference( info.getInfoString(iServiceInformation.sServiceref))) return num and str(num) or '' elif self.type == self.BOUQUET: num, bouq = self.getServiceNumber(ref or eServiceReference( info.getInfoString(iServiceInformation.sServiceref))) return bouq elif self.type == self.PROVIDER: tmpprov = tmpref = refpath = '' if self.isStream: if self.refstr: tmpprov = self.getIPTVProvider(self.refstr) tmpprov = self.getIPTVProvider(refstr) else: if self.ref: tmpprov = self.getProviderName(self.ref) if ref: tmpprov = self.getProviderName(ref) else: tmpprov = info.getInfoString( iServiceInformation.sProvider) or '' if '' is tmpprov or 'Unknown' in tmpprov: if self.refstr: tmpref = self.refstr else: tmpref = refstr for i in range(len(searchpath)): if os.path.isfile('%s%s' % (searchpath[i], refname)): refpath = '%s%s' % (searchpath[i], refname) if not '' is refpath: tmpref = ':'.join(tmpref.split(':')[:10]) reffile = open(refpath, 'r').read() if not reffile.endswith('\r\n\r\n'): reffile = '%s\r\n' % reffile for line in reffile.splitlines(True): if line.startswith(tmpref): tmpprov = line.strip('\r').strip('\n').split( ':')[-1].strip() return tmpprov return tmpprov elif self.type == self.REFERENCE: if self.refstr: return self.refstr return refstr elif self.type == self.ORBPOS: if self.isStream: return "Stream" else: if self.ref and self.info: return self.getTransponderInfo(self.info, self.ref, 'O') return self.getTransponderInfo(info, ref, 'O') elif self.type == self.TPRDATA: if self.isStream: return "Streaming" else: if self.ref and self.info: return self.getTransponderInfo(self.info, self.ref, 'T') return self.getTransponderInfo(info, ref, 'T') elif self.type == self.SATELLITE: if self.isStream: return "Internet" else: if self.ref: return self.getSatelliteName(self.ref) #test# return self.getSatelliteName(ref or eServiceReference( info.getInfoString(iServiceInformation.sServiceref))) elif self.type == self.ALLREF: tmpref = self.getReferenceType(refstr, ref) if 'Bouquet' in tmpref or 'Satellit' in tmpref or 'Provider' in tmpref: return ' ' elif '%3a' in tmpref: return ':'.join(refstr.split(':')[:10]) return tmpref elif self.type == self.FORMAT: num = bouq = '' tmp = self.sfmt[:].split("%") if tmp: ret = tmp[0] tmp.remove(ret) else: return "" for line in tmp: f = line[:1] if f == 'N': # %N - Name name = ref and (info.getName(ref) or 'N/A') or (info.getName() or 'N/A') postfix = '' if self.ref: postfix = " (alter)" name += postfix ret += name.replace('\xc2\x86', '').replace('\xc2\x87', '') elif f == 'n': # %n - Number try: service = self.source.serviceref num = service and service.getChannelNum() or None except: num = None if num: ret += str(num) else: num, bouq = self.getServiceNumber( ref or eServiceReference( info.getInfoString( iServiceInformation.sServiceref))) ret += num and str(num) or '' elif f == 'B': # %B - Bouquet num, bouq = self.getServiceNumber(ref or eServiceReference( info.getInfoString(iServiceInformation.sServiceref))) ret += bouq elif f == 'P': # %P - Provider tmpprov = tmpref = refpath = '' if self.isStream: if self.refstr: tmpprov = self.getIPTVProvider(self.refstr) tmpprov = self.getIPTVProvider(refstr) else: if self.ref: tmpprov = self.getProviderName(self.ref) if ref: tmpprov = self.getProviderName(ref) else: tmpprov = info.getInfoString( iServiceInformation.sProvider) or '' if '' is tmpprov or 'Unknown' in tmpprov: if self.refstr: tmpref = self.refstr else: tmpref = refstr for i in range(len(searchpath)): if os.path.isfile('%s%s' % (searchpath[i], refname)): refpath = '%s%s' % (searchpath[i], refname) if not '' is refpath: tmpref = ':'.join(tmpref.split(':')[:10]) reffile = open(refpath, 'r').read() if not reffile.endswith('\r\n\r\n'): reffile = '%s\r\n' % reffile for line in reffile.splitlines(True): if line.startswith(tmpref): tmpprov = line.strip('\r').strip( '\n').split(':')[-1].strip() ret += tmpprov elif f == 'R': # %R - Reference if self.refstr: ret += self.refstr else: ret += refstr elif f == 'S': # %S - Satellite if self.isStream: ret += _("Stream:") + " " + refstr.replace( "%3a", ":").rsplit( "://", 1)[1].split("/")[0].split(":")[0] else: if self.ref: ret += self.getSatelliteName(self.ref) else: ret += self.getSatelliteName( ref or eServiceReference( info.getInfoString( iServiceInformation.sServiceref)) ).replace( "Europe, Middle East, Africa: DVB-T/T2 Frequencies", "EMEA").split(" ")[0].strip() elif f == 'A': # %A - AllRef tmpref = self.getReferenceType(refstr, ref) if 'Bouquet' in tmpref or 'Satellit' in tmpref or 'Provider' in tmpref: ret += ' ' elif '%3a' in tmpref: ret += ':'.join(refstr.split(':')[:10]) else: ret += tmpref elif f in 'TtsFfiOMpYrokclhmgbe': if self.ref: ret += self.getTransponderInfo(self.info, self.ref, f) else: ret += self.getTransponderInfo(info, ref, f) ret += line[1:] return '%s' % ' '.join((ret.replace('N/A', '').strip()).split()) text = property(getText) def neededChange(self): if self.what: Converter.changed(self, self.what) self.what = None def forceChanged(self, what): if what == True: self.refstr = self.isStream = self.ref = self.info = self.tpdata = None Converter.changed(self, (self.CHANGED_ALL, )) self.what = None def changed(self, what): if what[0] != self.CHANGED_SPECIFIC or what[1] in ( iPlayableService.evStart, ): self.refstr = self.isStream = self.ref = self.info = self.tpdata = None if self.type in (self.NUMBER,self.BOUQUET) or \ (self.type == self.FORMAT and ('%n' in self.sfmt or '%B' in self.sfmt)): self.what = what self.Timer.start(200, True) else: Converter.changed(self, what)
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if self.transponder_info: tuner = (_("Type"), frontendData["tuner_type"], TYPE_TEXT) else: tuner = (_("NIM & Type"), chr(ord('A') + frontendData["tuner_number"]) + " - " + frontendData["tuner_type"], TYPE_TEXT) if frontendDataOrg["tuner_type"] == "DVB-S": issy = lambda x: 0 if x == -1 else x t2mi = lambda x: None if x == -1 else str(x) return (tuner, (_("System & Modulation"), frontendData["system"] + " " + frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency & Polarization"), "%s MHz" % (frontendData.get("frequency", 0) / 1000) + " - " + frontendData["polarization"], TYPE_TEXT), (_("Symbol rate & FEC"), "%s KSymb/s" % (frontendData.get("symbol_rate", 0) / 1000) + " - " + frontendData["fec_inner"], TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), frontendData["inversion"] + " - " + str(frontendData.get("pilot", None)) + " - " + str(frontendData.get("rolloff", None)), TYPE_TEXT), (_("Input Stream ID"), issy(frontendData.get("is_id", 0)), TYPE_VALUE_DEC), (_("PLS Mode"), frontendData.get("pls_mode", None), TYPE_TEXT), (_("PLS Code"), frontendData.get("pls_code", 0), TYPE_VALUE_DEC), (_("T2MI PLP ID"), t2mi(frontendData.get("t2mi_plp_id", -1)), TYPE_TEXT), (_("T2MI PID"), None if frontendData.get("t2mi_plp_id", -1) == -1 else str(frontendData.get("t2mi_pid", eDVBFrontendParametersSatellite.T2MI_Default_Pid)), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return (tuner, (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData.get("frequency", 0), TYPE_VALUE_FREQ_FLOAT), (_("Symbol rate & FEC"), "%s KSymb/s" % (frontendData.get("symbol_rate", 0) / 1000) + " - " + frontendData["fec_inner"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return (tuner, (_("Frequency & Channel"), "%.3f MHz" % ((frontendData.get("frequency", 0) / 1000) / 1000.0) + " - " + frontendData["channel"], TYPE_TEXT), (_("Inversion & Bandwidth"), frontendData["inversion"] + " - " + str(frontendData["bandwidth"]), TYPE_TEXT), (_("Code R. LP-HP & Guard Int."), frontendData["code_rate_lp"] + " - " + frontendData["code_rate_hp"] + " - " + frontendData["guard_interval"], TYPE_TEXT), (_("Constellation & FFT mode"), frontendData["constellation"] + " - " + frontendData["transmission_mode"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return (tuner, (_("System & Modulation"), frontendData["system"] + " " + frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData.get("frequency", 0) / 1000, TYPE_VALUE_FREQ_FLOAT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) return []
def getText(self): service = self.source.service try: info = service and service.info() except: try: info = eServiceCenter.getInstance().info(service) except: pass if not info: return '' else: Ret_Text = '' Sec_Text = '' Res_Text = '' showCryptoInfo = False if self.type == self.SMART_INFO_H or self.type == self.SERVICE_INFO or self.type == self.CRYPTO_INFO or self.type == self.FREQUENCY_INFO: sep = ' ' sep2 = ' - ' elif self.type == self.SMART_INFO_V: sep = '\n' sep2 = '\n' else: return '' if self.type == self.FREQUENCY_INFO: try: feinfo = service and service.frontendInfo() prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = feinfo and feinfo.getAll(True) except: try: frontendDataOrg = info.getInfoObject(service, iServiceInformation.sTransponderData) prvd = info.getInfoString(service, iServiceInformation.sProvider) except: pass if frontendDataOrg is not None: frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg.get('tuner_type') == 'DVB-S' or frontendDataOrg.get('tuner_type') == 'DVB-C': frequency = str(frontendData.get('frequency') / 1000) + ' MHz' symbolrate = str(frontendData.get('symbol_rate') / 1000) fec_inner = frontendData.get('fec_inner') if frontendDataOrg.get('tuner_type') == 'DVB-S': Ret_Text += sep + frontendData.get('system') orbital_pos = int(frontendDataOrg['orbital_position']) if orbital_pos > 1800: if orbital_pos == 3590: orb_pos = 'Thor/Intelsat' elif orbital_pos == 3560: orb_pos = 'Amos (4' elif orbital_pos == 3550: orb_pos = 'Atlantic Bird' elif orbital_pos == 3530: orb_pos = 'Nilesat/Atlantic Bird' elif orbital_pos == 3520: orb_pos = 'Atlantic Bird' elif orbital_pos == 3475: orb_pos = 'Atlantic Bird' elif orbital_pos == 3460: orb_pos = 'Express' elif orbital_pos == 3450: orb_pos = 'Telstar' elif orbital_pos == 3420: orb_pos = 'Intelsat' elif orbital_pos == 3380: orb_pos = 'Nss' elif orbital_pos == 3355: orb_pos = 'Intelsat' elif orbital_pos == 3325: orb_pos = 'Intelsat' elif orbital_pos == 3300: orb_pos = 'Hispasat' elif orbital_pos == 3285: orb_pos = 'Intelsat' elif orbital_pos == 3170: orb_pos = 'Intelsat' elif orbital_pos == 3150: orb_pos = 'Intelsat' elif orbital_pos == 3070: orb_pos = 'Intelsat' elif orbital_pos == 3045: orb_pos = 'Intelsat' elif orbital_pos == 3020: orb_pos = 'Intelsat 9' elif orbital_pos == 2990: orb_pos = 'Amazonas' elif orbital_pos == 2900: orb_pos = 'Star One' elif orbital_pos == 2880: orb_pos = 'AMC 6 (72' elif orbital_pos == 2875: orb_pos = 'Echostar 6' elif orbital_pos == 2860: orb_pos = 'Horizons' elif orbital_pos == 2810: orb_pos = 'AMC5' elif orbital_pos == 2780: orb_pos = 'NIMIQ 4' elif orbital_pos == 2690: orb_pos = 'NIMIQ 1' elif orbital_pos == 3592: orb_pos = 'Thor/Intelsat' elif orbital_pos == 2985: orb_pos = 'Echostar 3,12' elif orbital_pos == 2830: orb_pos = 'Echostar 8' elif orbital_pos == 2630: orb_pos = 'Galaxy 19' elif orbital_pos == 2500: orb_pos = 'Echostar 10,11' elif orbital_pos == 2502: orb_pos = 'DirectTV 5' elif orbital_pos == 2410: orb_pos = 'Echostar 7 Anik F3' elif orbital_pos == 2391: orb_pos = 'Galaxy 23' elif orbital_pos == 2390: orb_pos = 'Echostar 9' elif orbital_pos == 2412: orb_pos = 'DirectTV 7S' elif orbital_pos == 2310: orb_pos = 'Galaxy 27' elif orbital_pos == 2311: orb_pos = 'Ciel 2' elif orbital_pos == 2120: orb_pos = 'Echostar 2' else: orb_pos = str(float(3600 - orbital_pos) / 10.0) + 'W' elif orbital_pos > 0: if orbital_pos == 192: orb_pos = 'Astra 1F' elif orbital_pos == 130: orb_pos = 'Hot Bird 6,7A,8' elif orbital_pos == 235: orb_pos = 'Astra 1E' elif orbital_pos == 1100: orb_pos = 'BSat 1A,2A' elif orbital_pos == 1101: orb_pos = 'N-Sat 110' elif orbital_pos == 1131: orb_pos = 'KoreaSat 5' elif orbital_pos == 1440: orb_pos = 'SuperBird 7,C2' elif orbital_pos == 1006: orb_pos = 'AsiaSat 2' elif orbital_pos == 1030: orb_pos = 'Express A2' elif orbital_pos == 1056: orb_pos = 'Asiasat 3S' elif orbital_pos == 1082: orb_pos = 'NSS 11' elif orbital_pos == 881: orb_pos = 'ST1' elif orbital_pos == 900: orb_pos = 'Yamal 201' elif orbital_pos == 917: orb_pos = 'Mesat' elif orbital_pos == 950: orb_pos = 'Insat 4B' elif orbital_pos == 951: orb_pos = 'NSS 6' elif orbital_pos == 765: orb_pos = 'Telestar' elif orbital_pos == 785: orb_pos = 'ThaiCom 5' elif orbital_pos == 800: orb_pos = 'Express' elif orbital_pos == 830: orb_pos = 'Insat 4A' elif orbital_pos == 850: orb_pos = 'Intelsat 709' elif orbital_pos == 750: orb_pos = 'Abs' elif orbital_pos == 720: orb_pos = 'Intelsat' elif orbital_pos == 705: orb_pos = 'Eutelsat W5' elif orbital_pos == 685: orb_pos = 'Intelsat' elif orbital_pos == 620: orb_pos = 'Intelsat 902' elif orbital_pos == 600: orb_pos = 'Intelsat 904' elif orbital_pos == 570: orb_pos = 'Nss' elif orbital_pos == 530: orb_pos = 'Express AM22' elif orbital_pos == 480: orb_pos = 'Eutelsat 2F2' elif orbital_pos == 450: orb_pos = 'Intelsat' elif orbital_pos == 420: orb_pos = 'Turksat 2A' elif orbital_pos == 400: orb_pos = 'Express AM1' elif orbital_pos == 390: orb_pos = 'Hellas Sat 2' elif orbital_pos == 380: orb_pos = 'Paksat 1' elif orbital_pos == 360: orb_pos = 'Eutelsat Sesat' elif orbital_pos == 335: orb_pos = 'Astra 1M' elif orbital_pos == 330: orb_pos = 'Eurobird 3' elif orbital_pos == 328: orb_pos = 'Galaxy 11' elif orbital_pos == 315: orb_pos = 'Astra 5A' elif orbital_pos == 310: orb_pos = 'Turksat' elif orbital_pos == 305: orb_pos = 'Arabsat' elif orbital_pos == 285: orb_pos = 'Eurobird 1' elif orbital_pos == 284: orb_pos = 'Eurobird/Astra' elif orbital_pos == 282: orb_pos = 'Eurobird/Astra' elif orbital_pos == 1220: orb_pos = 'AsiaSat' elif orbital_pos == 1380: orb_pos = 'Telstar 18' elif orbital_pos == 260: orb_pos = 'Badr 3/4' elif orbital_pos == 255: orb_pos = 'Eurobird 2' elif orbital_pos == 215: orb_pos = 'Eutelsat' elif orbital_pos == 216: orb_pos = 'Eutelsat W6' elif orbital_pos == 210: orb_pos = 'AfriStar 1' elif orbital_pos == 160: orb_pos = 'Eutelsat W2' elif orbital_pos == 100: orb_pos = 'Eutelsat W1' elif orbital_pos == 90: orb_pos = 'Eurobird 9' elif orbital_pos == 70: orb_pos = 'Eutelsat W3A' elif orbital_pos == 50: orb_pos = 'Sirius 4' elif orbital_pos == 48: orb_pos = 'Sirius 4' elif orbital_pos == 30: orb_pos = 'Telecom 2' else: orb_pos = str(float(orbital_pos) / 10.0) + 'E' Ret_Text += sep + orb_pos + '\n' Ret_Text += frequency + sep + frontendData.get('polarization_abbreviation') Ret_Text += sep + symbolrate Ret_Text += sep + frontendData.get('modulation') + '-' + fec_inner else: Ret_Text += sep + 'DVB-C ' + frequency + ' MHz' + sep + fec_inner + sep + symbolrate elif frontendData.get('tuner_type') == 'DVB-T': frequency = str(frontendData.get('frequency') / 1000) + ' MHz' Ret_Text = 'Frequency: ' + frequency if self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.SERVICE_INFO: xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) feinfo = service and service.frontendInfo() prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = feinfo and feinfo.getAll(True) if frontendDataOrg is not None: frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg.get('tuner_type') == 'DVB-S' or frontendDataOrg.get('tuner_type') == 'DVB-C': frequency = str(frontendData.get('frequency') / 1000) symbolrate = str(frontendData.get('symbol_rate') / 1000) fec_inner = frontendData.get('fec_inner') if frontendDataOrg.get('tuner_type') == 'DVB-S': Ret_Text += sep + frontendData.get('system') Ret_Text += sep + frequency + frontendData.get('polarization_abbreviation') Ret_Text += sep + symbolrate Ret_Text += sep + fec_inner + ' ' + frontendData.get('modulation') orbital_pos = int(frontendDataOrg['orbital_position']) if orbital_pos > 1800: orb_pos = str(float(3600 - orbital_pos) / 10.0) + 'W' elif orbital_pos > 0: orb_pos = str(float(orbital_pos) / 10.0) + 'E' Ret_Text += sep + orb_pos else: Ret_Text += sep + 'DVB-C ' + frequency + ' MHz' + sep + fec_inner + sep + symbolrate elif frontendDataOrg.get('tuner_type') == 'DVB-T': frequency = str(frontendData.get('frequency') / 1000) Ret_Text += sep + 'DVB-T' + sep + 'Frequency:' + sep + frequency + ' MHz' if feinfo is not None and xresol > 0: Res_Text += ('MPEG2 ', 'MPEG4 ', 'MPEG1 ', 'MPEG4-II ', 'VC1 ', 'VC1-SM ', '')[info.getInfo(iServiceInformation.sVideoType)] Res_Text += str(xresol) + 'x' + str(yresol) Res_Text += ('i', 'p', '')[info.getInfo(iServiceInformation.sProgressive)] Res_Text += str((info.getInfo(iServiceInformation.sFrameRate) + 500) / 1000) if self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.CRYPTO_INFO: decCI = '0' Sec_Text = '' if info.getInfo(iServiceInformation.sIsCrypted) == 1: data = self.ecmdata.getEcmData() if not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = data[0] + '\n' decCI = data[1] provid = data[2] pid = data[3] if decCI != '0': decCIfull = '%04x' % int(decCI, 16) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int(decCI, 16) <= int(idline[1], 16): decCIfull = idline[2] + ':' + decCIfull break Sec_Text += decCIfull if provid != '0': Sec_Text += ':%04x' % int(provid, 16) else: Sec_Text += ':' if pid != '0': Sec_Text += ':%04x:%04x' % (info.getInfo(iServiceInformation.sSID), int(pid, 16)) elif not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = 'FTA' res = '' searchIDs = info.getInfoObject(iServiceInformation.sCAIDs) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int(decCI, 16) <= int(idline[1], 16): color = '\\c0000??00' else: color = '\\c007?7?7?' try: for oneID in searchIDs: if oneID >= int(idline[0], 16) and oneID <= int(idline[1], 16): color = '\\c00????00' except: pass res += color + idline[3] + ' ' if self.type != self.CRYPTO_INFO: Ret_Text += '\n' Ret_Text += res + '\\c00?????? ' + Sec_Text if Res_Text != '': if showCryptoInfo: Ret_Text += sep + Res_Text else: Ret_Text += '\n' + Res_Text return Ret_Text
def getText(self): service = self.source.service info = service and service.info() if not info: return "" Ret_Text = "" Sec_Text = "" xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) feinfo = (service and service.frontendInfo()) if (self.type == self.SMART_INFO_H): # HORIZONTAL sep = " " sep2 = " - " elif (self.type == self.SMART_INFO_V): # VERTIKAL sep = "\n" sep2 = "\n" else: return "" # unsupported orientation prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = (feinfo and feinfo.getAll(True)) if (frontendDataOrg is not None): frontendData = ConvertToHumanReadable(frontendDataOrg) if ((frontendDataOrg.get("tuner_type") == "DVB-S") or (frontendDataOrg.get("tuner_type") == "DVB-C")): frequency = (str((frontendData.get("frequency") / 1000))) symbolrate = (str((frontendData.get("symbol_rate") / 1000))) fec_inner = frontendData.get("fec_inner") if (frontendDataOrg.get("tuner_type") == "DVB-S"): Ret_Text += sep + frontendData.get("system") Ret_Text += sep + frequency + frontendData.get( "polarization")[:1] Ret_Text += sep + symbolrate Ret_Text += sep + frontendData.get( "modulation") + "-" + fec_inner orbital_pos = int(frontendData["orbital_position"]) if orbital_pos > 1800: orb_pos = str((float(3600 - orbital_pos)) / 10.0) + "W" elif orbital_pos > 0: orb_pos = str((float(orbital_pos)) / 10.0) + "E" Ret_Text += sep + orb_pos else: Ret_Text += sep + "DVB-C " + frequency + " MHz" + sep + fec_inner + sep + symbolrate elif (frontendDataOrg.get("tuner_type") == "DVB-T"): frequency = (str((frontendData.get("frequency") / 1000))) Ret_Text += sep + "DVB-T" + sep + "Frequency:" + sep + frequency + " MHz" if (feinfo is not None) and (xresol > 0): if (yresol > 580): Ret_Text += sep + "HD " else: Ret_Text += sep + "SD " Ret_Text += str(xresol) + "x" + str(yresol) if (info.getInfo(iServiceInformation.sIsCrypted) == 1): try: ecm = open(ECM_INFO, 'rb').readlines() ecminfo = {} for line in ecm: d = line.split(':', 1) if len(d) > 1: ecminfo[d[0].strip()] = d[1].strip() using = ecminfo.get('using', '') if using: # CCcam if using == 'fta': Sec_Text = _("FTA") elif using == 'emu': Sec_Text = "EMU (%ss)" % (ecminfo.get('ecm time', '?')) else: hops = ecminfo.get('hops', None) if hops and hops != '0': hops = ' @' + hops else: hops = '' Sec_Text = ecminfo.get( 'address', '?') + hops + " (%ss)" % ecminfo.get( 'ecm time', '?') else: decode = ecminfo.get('decode', None) if decode: # gbox (untested) if ecminfo['decode'] == 'Network': cardid = 'id:' + ecminfo.get('prov', '') try: share = open('/tmp/share.info', 'rb').readlines() for line in share: if cardid in line: Sec_Text = line.strip() break else: Sec_Text = cardid except: Sec_Text = decode else: Sec_Text = decode else: source = ecminfo.get('source', '') if source: # MGcam eEnc = "" eCaid = "" eSrc = "" eTime = "" for line in ecm: line = line.strip() if line.find('ECM') != -1: line = line.split(' ') eEnc = line[1] eCaid = line[5][2:-1] continue if line.find('source') != -1: line = line.split(' ') eSrc = line[4][:-1] continue if line.find('msec') != -1: line = line.split(' ') eTime = line[0] continue Sec_Text = "(%s %s %.3f @ %s)" % (eEnc, eCaid, (float(eTime) / 1000), eSrc) else: reader = ecminfo.get('reader', '') if reader: #Oscam hops = ecminfo.get('hops', None) if hops and hops != '0': hops = ' @' + hops else: hops = '' Sec_Text = reader + hops + " (%ss)" % ecminfo.get( 'ecm time', '?') else: Sec_Text = "" pid = ecminfo.get('pid', None) decCI = ecminfo.get('caid', None) decCIfull = "" if decCI != "": for idline in self.idnames: try: if decCI.upper() >= idline[0].upper( ) and decCI.upper() <= idline[1].upper(): decCIfull = idline[2] + ":" + decCI break except: pass Sec_Text += sep + decCIfull + sep + "pid:" + pid res = "" try: searchIDs = (info.getInfoObject( iServiceInformation.sCAIDs)) for idline in self.idnames: color = "\c007?7?7?" for oneID in searchIDs: if (oneID >= int(idline[0], 16)) and (oneID <= int( idline[1], 16)): color = "\c00????00" if oneID == int(decCI, 16): color = "\c0000??00" break res += color + idline[3] + " " except: pass Ret_Text += "\n" + res + "\c00?????? " + Sec_Text except: Ret_Text += "\n\c007?7?7?S V I Nd Co Cw B N" + "\c00?????? No expert cryptinfo available" pass else: Ret_Text += "\n\c007?7?7?S V I Nd Co Cw B N" + "\c00?????? FTA" return Ret_Text
def __start(self): if self.my_timer_active == 1: self.my_timer.stop() self.my_timer_active = 0 self['ecm_info'].setText('') self['netcard_info'].setText('') self['nfreq_info'].setText('') self['orbital_pos'].setText('') self['beta_emm'].hide() self['beta_ecm'].hide() self['irdeto_emm'].hide() self['irdeto_ecm'].hide() self['nagra_emm'].hide() self['nagra_ecm'].hide() self['seca_emm'].hide() self['seca_ecm'].hide() self['td_emm'].hide() self['td_ecm'].hide() self['via_emm'].hide() self['via_ecm'].hide() self['biss_emm'].hide() self['biss_ecm'].hide() self['bul_emm'].hide() self['bul_ecm'].hide() self['conax_emm'].hide() self['conax_ecm'].hide() self['cw_emm'].hide() self['cw_ecm'].hide() self['dre_emm'].hide() self['dre_ecm'].hide() self['nds_emm'].hide() self['nds_ecm'].hide() self['pv_emm'].hide() self['pv_ecm'].hide() self['button_fta'].show() self['button_card'].hide() self['button_emu'].hide() self['button_cex'].hide() self['button_spider'].hide() self.currentCam = 'Common Interface' if fileExists('/etc/CurrentBhCamName'): f = open('/etc/CurrentBhCamName', 'r') for line in f.readlines(): line = line.replace('\n', '') line = line.strip() if len(line) > 3: self.currentCam = line f.close() self['cam_info'].setText(self.currentCam) ret = 'Black Hole' all = ['Avalon', 'Chaos', 'Ghost'] f = open('/proc/mounts', 'r') for line in f.readlines(): if line.find('/usr ') != -1: for a in all: if line.find(a) != -1: ret = a break f.close() self['Universe'].setText(_('In %s Universe') % ret) self.VideoSize = ' ' isCrypt = False service = self.session.nav.getCurrentService() myinfo = service and service.info() if myinfo is not None: isCrypt = myinfo.getInfo(iServiceInformation.sIsCrypted) == 1 feinfo = service.frontendInfo() frontendData = feinfo and feinfo.getAll(True) if frontendData is not None: ttype = frontendData.get('tuner_type', 'UNKNOWN') if ttype == 'DVB-S': fedata = ConvertToHumanReadable(frontendData) sr = str(int(frontendData.get('symbol_rate', 0) / 1000)) freq = str(int(frontendData.get('frequency', 0) / 1000)) pol = { 0: 'H', 1: 'V', 2: 'CL', 3: 'CR', 4: None }[frontendData.get('polarization', 'HORIZONTAL')] fec = fedata.get('fec_inner', ' ') self['nfreq_info'].setText('Freq: ' + freq + ' ' + pol + ' Sr: ' + sr + ' ' + fec) orbital = fedata['orbital_position'] self['orbital_pos'].setText(orbital) elif ttype == 'DVB-T': fedata = ConvertToHumanReadable(frontendData) freq = str(int(frontendData.get('frequency', 0) / 1000)) band = fedata.get('bandwidth', ' ') orbital = fedata.get('tuner_type') self['orbital_pos'].setText(orbital) self['nfreq_info'].setText('Freq: ' + freq + ', Band: ' + band) elif ttype == 'DVB-C': fedata = ConvertToHumanReadable(frontendData) sr = str(int(frontendData.get('symbol_rate', 0) / 1000)) freq = str(int(frontendData.get('frequency', 0) / 1)) qam = fedata.get('modulation') orbital = fedata.get('tuner_type') self['orbital_pos'].setText(orbital) self['nfreq_info'].setText('Freq: ' + freq + ', ' + qam + ', Sr: ' + sr) if isCrypt == True: self['button_fta'].hide() Caids = myinfo.getInfoObject(iServiceInformation.sCAIDs) for caid in Caids: caidname = self.parse_caid_txt(caid) self.show_emm(caidname) self.my_timer_count = 0 self.__updateEmuInfo() return
def __start(self): if self.my_timer_active == 1: self.my_timer.stop() self.my_timer_active = 0 self["ecm_info"].setText("") self["netcard_info"].setText("") self["nfreq_info"].setText("") self["orbital_pos"].setText("") self["beta_emm"].hide() self["beta_ecm"].hide() self["irdeto_emm"].hide() self["irdeto_ecm"].hide() self["seca_emm"].hide() self["seca_ecm"].hide() self["via_emm"].hide() self["via_ecm"].hide() self["nagra_emm"].hide() self["nagra_ecm"].hide() self["cw_emm"].hide() self["cw_ecm"].hide() self["nds_emm"].hide() self["nds_ecm"].hide() self["conax_emm"].hide() self["conax_ecm"].hide() self["button_fta"].show() self["button_card"].hide() self["button_emu"].hide() self["button_spider"].hide() self.currentCam = "Common Interface" if fileExists("/etc/CurrentBhCamName"): f = open("/etc/CurrentBhCamName",'r') for line in f.readlines(): line = line.replace('\n', '') line = line.strip() if len(line) > 3: self.currentCam = line f.close() self["cam_info"].setText(self.currentCam) ret = "Black Hole" all = ["Avalon", "Chaos", "Ghost"] f = open("/proc/mounts",'r') for line in f.readlines(): if line.find('/usr ') != -1: for a in all: if line.find(a) != -1: ret = a break f.close() self["Universe"].setText(_("In %s universe") % (ret)) self.VideoSize = " " isCrypt = False service = self.session.nav.getCurrentService() myinfo = service and service.info() if myinfo is not None: isCrypt = myinfo.getInfo(iServiceInformation.sIsCrypted) == 1 feinfo = service.frontendInfo() frontendData = feinfo and feinfo.getAll(True) if frontendData is not None: ttype = frontendData.get("tuner_type", "UNKNOWN") if ttype == "DVB-S": fedata = ConvertToHumanReadable(frontendData) sr = str(int(frontendData.get("symbol_rate", 0) / 1000)) freq = str(int(frontendData.get("frequency", 0) / 1000)) pol = {0: "H", 1: "V", 2: "CL", 3: "CR", 4: None}[frontendData.get("polarization", "HORIZONTAL")] fec = fedata.get("fec_inner", " ") self["nfreq_info"].setText( "Freq: " + freq + " " + pol + " Sr: " + sr + " " + fec ) orbital = fedata["orbital_position"] self["orbital_pos"].setText(orbital) elif ttype == "DVB-T": fedata = ConvertToHumanReadable(frontendData) freq = str(int(frontendData.get("frequency", 0) / 1000)) band = fedata.get("bandwidth", " ") self["nfreq_info"].setText( "Freq: " + freq + " Band: " + band) if isCrypt == True: self["button_fta"].hide() Caids = myinfo.getInfoObject(iServiceInformation.sCAIDs) for caid in Caids: caidname = self.parse_caid_txt(caid) self.show_emm(caidname) self.my_timer_count = 0 self.__updateEmuInfo()
def getText(self): service = self.source.service info = service and service.info() if not info: return '' if self.type == self.XRES: return self._getVideoWidthStr(info) if self.type == self.YRES: return self._getVideoHeightStr(info) if self.type == self.APID: return self.getServiceInfoString(info, iServiceInformation.sAudioPID) if self.type == self.VPID: return self.getServiceInfoString(info, iServiceInformation.sVideoPID) if self.type == self.PCRPID: return self.getServiceInfoString(info, iServiceInformation.sPCRPID) if self.type == self.PMTPID: return self.getServiceInfoString(info, iServiceInformation.sPMTPID) if self.type == self.TXTPID: return self.getServiceInfoString(info, iServiceInformation.sTXTPID) if self.type == self.TSID: return self.getServiceInfoString(info, iServiceInformation.sTSID) if self.type == self.ONID: return self.getServiceInfoString(info, iServiceInformation.sONID) if self.type == self.SID: return self.getServiceInfoHexString(info, iServiceInformation.sSID) if self.type == self.FRAMERATE: video_rate = None if path.exists('/proc/stb/vmpeg/0/framerate'): f = open('/proc/stb/vmpeg/0/framerate', 'r') try: video_rate = int(f.read()) except: pass f.close() if not video_rate: try: video_rate = int( self.getServiceInfoString( info, iServiceInformation.sFrameRate)) except: return 'N/A fps' return (video_rate, lambda x: '%d fps' % ((x + 500) / 1000)) if self.type == self.PROGRESSIVE: return self._getProgressiveStr(info) if self.type == self.TRANSFERBPS: return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: '%d kB/s' % (x / 1024)) if self.type == self.HAS_HBBTV: return info.getInfoString(iServiceInformation.sHBBTVUrl) if self.type == self.VIDEO_PARAMS: yres = info.getInfo(iServiceInformation.sVideoHeight) frame_rate = info.getInfo(iServiceInformation.sFrameRate) progressive = info.getInfo(iServiceInformation.sProgressive) print 'yres', yres, 'frame_rate', frame_rate, 'progressive', progressive if not progressive: frame_rate *= 2 frame_rate = (frame_rate + 500) / 1000 return '%d%s%d' % (yres, 'p' if progressive else 'i', frame_rate) if self.type == self.FREQ_INFO: feinfo = service.frontendInfo() if feinfo is None: return '' feraw = feinfo.getAll(False) if feraw is None: return '' fedata = ConvertToHumanReadable(feraw) if fedata is None: return '' frequency = fedata.get('frequency') sr_txt = 'Sr:' polarization = fedata.get('polarization_abbreviation') if polarization is None: polarization = '' symbolrate = str(int(fedata.get('symbol_rate', 0))) if symbolrate == '0': sr_txt = '' symbolrate = '' fec = fedata.get('fec_inner') if fec is None: fec = '' out = 'Freq: %s %s %s %s %s' % (frequency, polarization, sr_txt, symbolrate, fec) return out if self.type == self.VIDEO_INFO: if self._isHDMIIn(info): return '' progressive = self._getProgressiveStr(info) fieldrate = self._getFrameRate(info) if fieldrate > 0: if progressive == 'i': fieldrate *= 2 fieldrate = '%dHz' % ((fieldrate + 500) / 1000, ) else: fieldrate = '' return '%sx%s%s %s' % (self._getVideoWidthStr(info), self._getVideoHeightStr(info), progressive, fieldrate) return ''
def __start(self): if self.my_timer_active == 1: self.my_timer.stop() self.my_timer_active = 0 self["ecm_info"].setText("") self["netcard_info"].setText("") self["nfreq_info"].setText("") self["orbital_pos"].setText("") self["beta_emm"].hide() self["beta_ecm"].hide() self["irdeto_emm"].hide() self["irdeto_ecm"].hide() self["seca_emm"].hide() self["seca_ecm"].hide() self["via_emm"].hide() self["via_ecm"].hide() self["nagra_emm"].hide() self["nagra_ecm"].hide() self["cw_emm"].hide() self["cw_ecm"].hide() self["nds_emm"].hide() self["nds_ecm"].hide() self["conax_emm"].hide() self["conax_ecm"].hide() self["button_fta"].show() self["button_card"].hide() self["button_emu"].hide() self["button_spider"].hide() self.currentCam = "Common Interface" if fileExists("/etc/CurrentBhCamName"): f = open("/etc/CurrentBhCamName", 'r') for line in f.readlines(): line = line.replace('\n', '') line = line.strip() if len(line) > 3: self.currentCam = line f.close() self["cam_info"].setText(self.currentCam) ret = "Black Hole" all = ["Avalon", "Chaos", "Ghost"] f = open("/proc/mounts", 'r') for line in f.readlines(): if line.find('/usr ') != -1: for a in all: if line.find(a) != -1: ret = a break f.close() self["Universe"].setText(_("In %s universe") % (ret)) self.VideoSize = " " isCrypt = False service = self.session.nav.getCurrentService() myinfo = service and service.info() if myinfo is not None: isCrypt = myinfo.getInfo(iServiceInformation.sIsCrypted) == 1 feinfo = service.frontendInfo() frontendData = feinfo and feinfo.getAll(True) if frontendData is not None: ttype = frontendData.get("tuner_type", "UNKNOWN") if ttype == "DVB-S": fedata = ConvertToHumanReadable(frontendData) sr = str(int(frontendData.get("symbol_rate", 0) / 1000)) freq = str(int(frontendData.get("frequency", 0) / 1000)) pol = { 0: "H", 1: "V", 2: "CL", 3: "CR", 4: None }[frontendData.get("polarization", "HORIZONTAL")] fec = fedata.get("fec_inner", " ") self["nfreq_info"].setText("Freq: " + freq + " " + pol + " Sr: " + sr + " " + fec) orbital = fedata["orbital_position"] self["orbital_pos"].setText(orbital) elif ttype == "DVB-T": fedata = ConvertToHumanReadable(frontendData) freq = str(int(frontendData.get("frequency", 0) / 1000)) band = fedata.get("bandwidth", " ") self["nfreq_info"].setText("Freq: " + freq + " Band: " + band) if isCrypt == True: self["button_fta"].hide() Caids = myinfo.getInfoObject(iServiceInformation.sCAIDs) for caid in Caids: caidname = self.parse_caid_txt(caid) self.show_emm(caidname) self.my_timer_count = 0 self.__updateEmuInfo()
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if self.transponder_info: tuner = (_("Type"), frontendData["tuner_type"], TYPE_TEXT) else: tuner = (_("NIM & Type"), chr(ord('A') + frontendData["tuner_number"]) + " - " + frontendData["tuner_type"], TYPE_TEXT) if frontendDataOrg["tuner_type"] == "DVB-S": issy = lambda x: 0 if x == -1 else x t2mi = lambda x: None if x == -1 else str(x) return (tuner, (_("System & Modulation"), frontendData["system"] + " " + frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency & Polarization"), "%s MHz" % (frontendData.get("frequency", 0) / 1000) + " - " + frontendData["polarization"], TYPE_TEXT), (_("Symbol rate & FEC"), "%s KSymb/s" % (frontendData.get("symbol_rate", 0) / 1000) + " - " + frontendData["fec_inner"], TYPE_TEXT), (_("Inversion, Pilot & Roll-off"), frontendData["inversion"] + " - " + str(frontendData.get("pilot", None)) + " - " + str(frontendData.get("rolloff", None)), TYPE_TEXT), (_("Input Stream ID"), issy(frontendData.get("is_id", 0)), TYPE_VALUE_DEC), (_("PLS Mode"), frontendData.get("pls_mode", None), TYPE_TEXT), (_("PLS Code"), frontendData.get("pls_code", 0), TYPE_VALUE_DEC), (_("T2MI PLP ID"), t2mi(frontendData.get("t2mi_plp_id", -1)), TYPE_TEXT), (_("T2MI PID"), None if frontendData.get("t2mi_plp_id", -1) == -1 else str( frontendData.get( "t2mi_pid", eDVBFrontendParametersSatellite. T2MI_Default_Pid)), TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-C": return (tuner, (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData.get("frequency", 0), TYPE_VALUE_FREQ_FLOAT), (_("Symbol rate & FEC"), "%s KSymb/s" % (frontendData.get("symbol_rate", 0) / 1000) + " - " + frontendData["fec_inner"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": return (tuner, (_("Frequency & Channel"), "%.3f MHz" % ((frontendData.get("frequency", 0) / 1000) / 1000.0) + " - " + frontendData["channel"], TYPE_TEXT), (_("Inversion & Bandwidth"), frontendData["inversion"] + " - " + str(frontendData["bandwidth"]), TYPE_TEXT), (_("Code R. LP-HP & Guard Int."), frontendData["code_rate_lp"] + " - " + frontendData["code_rate_hp"] + " - " + frontendData["guard_interval"], TYPE_TEXT), (_("Constellation & FFT mode"), frontendData["constellation"] + " - " + frontendData["transmission_mode"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "ATSC": return (tuner, (_("System & Modulation"), frontendData["system"] + " " + frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData.get("frequency", 0) / 1000, TYPE_VALUE_FREQ_FLOAT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT)) return []
def getText(self): service = self.source.service info = service and service.info() if not info: return "" Ret_Text = "" Sec_Text = "" Res_Text = "" showCryptoInfo = False if (self.type == self.SMART_INFO_H or self.type == self.SERVICE_INFO or self.type == self.CRYPTO_INFO): # HORIZONTAL sep = " " sep2 = " - " elif (self.type == self.SMART_INFO_V): # VERTIKAL sep = "\n" sep2 = "\n" else: return "" # unsupported orientation if (self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.SERVICE_INFO): xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) feinfo = (service and service.frontendInfo()) prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = (feinfo and feinfo.getAll(False)) if (frontendDataOrg is not None): frontendData = ConvertToHumanReadable(frontendDataOrg) if ((frontendDataOrg.get("tuner_type") == "DVB-S") or (frontendDataOrg.get("tuner_type") == "DVB-C")): frequency = (str((frontendData.get("frequency") / 1000))) symbolrate = (str((frontendData.get("symbol_rate") / 1000))) fec_inner = frontendData.get("fec_inner") if (frontendDataOrg.get("tuner_type") == "DVB-S"): Ret_Text += sep + frontendData.get("system") Ret_Text += sep + frequency + frontendData.get("polarization_abbreviation") Ret_Text += sep + symbolrate Ret_Text += sep + fec_inner + " " + frontendData.get("modulation") orbital_pos = int(frontendDataOrg["orbital_position"]) if orbital_pos > 1800: orb_pos = str((float(3600 - orbital_pos)) / 10.0) + "W" elif orbital_pos > 0: orb_pos = str((float(orbital_pos)) / 10.0) + "E" Ret_Text += sep + orb_pos else: Ret_Text += sep + "DVB-C " + frequency + " MHz" + sep + fec_inner + sep + symbolrate elif (frontendDataOrg.get("tuner_type") == "DVB-T"): frequency = (str((frontendData.get("frequency") / 1000))) Ret_Text += sep + "DVB-T" + sep + "Frequency:" + sep + frequency + " MHz" if (feinfo is not None) and (xresol > 0): Res_Text += ("MPEG2 ", "MPEG4 ", "MPEG1 ", "MPEG4-II ", "VC1 ", "VC1-SM ", "")[info.getInfo(iServiceInformation.sVideoType)] Res_Text += str(xresol) + "x" + str(yresol) Res_Text += ("i", "p", "")[info.getInfo(iServiceInformation.sProgressive)] Res_Text += str((info.getInfo(iServiceInformation.sFrameRate) + 500) / 1000) if (self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.CRYPTO_INFO): decCI = "0" Sec_Text = "" if (info.getInfo(iServiceInformation.sIsCrypted) == 1): data = self.ecmdata.getEcmData() if not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = data[0] + "\n" decCI = data[1] provid = data[2] pid = data[3] if decCI != '0': decCIfull = "%04x" % int(decCI, 16) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int(decCI, 16) <= int(idline[1], 16): decCIfull = idline[2] + ":" + decCIfull break Sec_Text += decCIfull if provid != '0': Sec_Text += ":%04x" % int(provid, 16) else: Sec_Text += ":" if pid != '0': Sec_Text += ":%04x:%04x" % (info.getInfo(iServiceInformation.sSID),int(pid, 16)) elif not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = "FTA" res = "" searchIDs = (info.getInfoObject(iServiceInformation.sCAIDs)) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int(decCI, 16) <= int(idline[1], 16): color="\c0000??00" else: color = "\c007?7?7?" try: for oneID in searchIDs: if oneID >= int(idline[0], 16) and oneID <= int(idline[1], 16): color="\c00????00" except: pass res += color + idline[3] + " " if (self.type != self.CRYPTO_INFO): Ret_Text += "\n" Ret_Text += res + "\c00?????? " + Sec_Text if Res_Text != "": if showCryptoInfo: Ret_Text += sep + Res_Text else: Ret_Text += "\n" + Res_Text return Ret_Text
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg["tuner_type"] == "DVB-S": data = ((_("NIM"), chr(ord('A') + int(frontendData["tuner_number"])), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Orbital position"), frontendData["orbital_position"], TYPE_VALUE_DEC), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Polarization"), frontendData["polarization"], TYPE_TEXT), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT), (_("Pilot"), frontendData.get("pilot", None), TYPE_TEXT), (_("Roll-off"), frontendData.get("rolloff", None), TYPE_TEXT)) if nimmanager.isSupportMultistream( int(frontendData["tuner_number"])): data += ((_("Input Stream ID"), frontendData.get("is_id", 0), TYPE_VALUE_DEC), (_("PLS Mode"), frontendData.get("pls_mode", None), TYPE_TEXT), (_("PLS Code"), frontendData.get("pls_code", 0), TYPE_VALUE_DEC)) return data elif frontendDataOrg["tuner_type"] == "DVB-C": return ((_("NIM"), chr(ord('A') + int(frontendData["tuner_number"])), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("Modulation"), frontendData["modulation"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("FEC"), frontendData["fec_inner"], TYPE_TEXT)) elif frontendDataOrg["tuner_type"] == "DVB-T": data = ((_("NIM"), chr(ord('A') + int(frontendData["tuner_number"])), TYPE_TEXT), (_("Type"), frontendData["tuner_type"], TYPE_TEXT), (_("System"), frontendData["system"], TYPE_TEXT), (_("Frequency"), frontendData["frequency"], TYPE_VALUE_DEC), (_("Inversion"), frontendData["inversion"], TYPE_TEXT), (_("Bandwidth"), frontendData["bandwidth"], TYPE_VALUE_DEC), (_("Code rate LP"), frontendData["code_rate_lp"], TYPE_TEXT), (_("Code rate HP"), frontendData["code_rate_hp"], TYPE_TEXT), (_("Constellation"), frontendData["constellation"], TYPE_TEXT), (_("Transmission mode"), frontendData["transmission_mode"], TYPE_TEXT), (_("Guard interval"), frontendData["guard_interval"], TYPE_TEXT), (_("Hierarchy info"), frontendData["hierarchy_information"], TYPE_TEXT)) if frontendData.has_key("plp_id"): data += ((_("PLP ID"), frontendData["plp_id"], TYPE_VALUE_DEC), ) return data return []
def getText(self): service = self.source.service try: info = service and service.info() except: try: info = eServiceCenter.getInstance().info(service) except: pass if not info: return "" Ret_Text = "" Sec_Text = "" Res_Text = "" showCryptoInfo = False if (self.type == self.SMART_INFO_H or self.type == self.SERVICE_INFO or self.type == self.CRYPTO_INFO or self.type == self.FREQUENCY_INFO): # HORIZONTAL sep = " " sep2 = " - " elif (self.type == self.SMART_INFO_V): # VERTIKAL sep = "\n" sep2 = "\n" else: return "" # unsupported orientation if (self.type == self.FREQUENCY_INFO): try: feinfo = (service and service.frontendInfo()) prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = (feinfo and feinfo.getAll(True)) except: try: frontendDataOrg = info.getInfoObject(service, iServiceInformation.sTransponderData) prvd = info.getInfoString(service, iServiceInformation.sProvider) except: pass if (frontendDataOrg is not None): frontendData = ConvertToHumanReadable(frontendDataOrg) if ((frontendDataOrg.get("tuner_type") == "DVB-S") or (frontendDataOrg.get("tuner_type") == "DVB-C")): frequency = (str((frontendData.get("frequency") / 1000)) + " MHz") symbolrate = (str((frontendData.get("symbol_rate") / 1000))) fec_inner = frontendData.get("fec_inner") if (frontendDataOrg.get("tuner_type") == "DVB-S"): Ret_Text += sep + frontendData.get("system") orbital_pos = int(frontendDataOrg["orbital_position"]) if orbital_pos > 1800: if orbital_pos == 3590: orb_pos = 'Thor/Intelsat' elif orbital_pos == 3560: orb_pos = 'Amos (4' elif orbital_pos == 3550: orb_pos = 'Atlantic Bird' elif orbital_pos == 3530: orb_pos = 'Nilesat/Atlantic Bird' elif orbital_pos == 3520: orb_pos = 'Atlantic Bird' elif orbital_pos == 3475: orb_pos = 'Atlantic Bird' elif orbital_pos == 3460: orb_pos = 'Express' elif orbital_pos == 3450: orb_pos = 'Telstar' elif orbital_pos == 3420: orb_pos = 'Intelsat' elif orbital_pos == 3380: orb_pos = 'Nss' elif orbital_pos == 3355: orb_pos = 'Intelsat' elif orbital_pos == 3325: orb_pos = 'Intelsat' elif orbital_pos == 3300: orb_pos = 'Hispasat' elif orbital_pos == 3285: orb_pos = 'Intelsat' elif orbital_pos == 3170: orb_pos = 'Intelsat' elif orbital_pos == 3150: orb_pos = 'Intelsat' elif orbital_pos == 3070: orb_pos = 'Intelsat' elif orbital_pos == 3045: orb_pos = 'Intelsat' elif orbital_pos == 3020: orb_pos = 'Intelsat 9' elif orbital_pos == 2990: orb_pos = 'Amazonas' elif orbital_pos == 2900: orb_pos = 'Star One' elif orbital_pos == 2880: orb_pos = 'AMC 6 (72' elif orbital_pos == 2875: orb_pos = 'Echostar 6' elif orbital_pos == 2860: orb_pos = 'Horizons' elif orbital_pos == 2810: orb_pos = 'AMC5' elif orbital_pos == 2780: orb_pos = 'NIMIQ 4' elif orbital_pos == 2690: orb_pos = 'NIMIQ 1' elif orbital_pos == 3592: orb_pos = 'Thor/Intelsat' elif orbital_pos == 2985: orb_pos = 'Echostar 3,12' elif orbital_pos == 2830: orb_pos = 'Echostar 8' elif orbital_pos == 2630: orb_pos = 'Galaxy 19' elif orbital_pos == 2500: orb_pos = 'Echostar 10,11' elif orbital_pos == 2502: orb_pos = 'DirectTV 5' elif orbital_pos == 2410: orb_pos = 'Echostar 7 Anik F3' elif orbital_pos == 2391: orb_pos = 'Galaxy 23' elif orbital_pos == 2390: orb_pos = 'Echostar 9' elif orbital_pos == 2412: orb_pos = 'DirectTV 7S' elif orbital_pos == 2310: orb_pos = 'Galaxy 27' elif orbital_pos == 2311: orb_pos = 'Ciel 2' elif orbital_pos == 2120: orb_pos = 'Echostar 2' else: orb_pos = str((float(3600 - orbital_pos))/10.0) + "W" elif orbital_pos > 0: if orbital_pos == 192: orb_pos = 'Astra 1F' elif orbital_pos == 130: orb_pos = 'Hot Bird 6,7A,8' elif orbital_pos == 235: orb_pos = 'Astra 1E' elif orbital_pos == 1100: orb_pos = 'BSat 1A,2A' elif orbital_pos == 1101: orb_pos = 'N-Sat 110' elif orbital_pos == 1131: orb_pos = 'KoreaSat 5' elif orbital_pos == 1440: orb_pos = 'SuperBird 7,C2' elif orbital_pos == 1006: orb_pos = 'AsiaSat 2' elif orbital_pos == 1030: orb_pos = 'Express A2' elif orbital_pos == 1056: orb_pos = 'Asiasat 3S' elif orbital_pos == 1082: orb_pos = 'NSS 11' elif orbital_pos == 881: orb_pos = 'ST1' elif orbital_pos == 900: orb_pos = 'Yamal 201' elif orbital_pos == 917: orb_pos = 'Mesat' elif orbital_pos == 950: orb_pos = 'Insat 4B' elif orbital_pos == 951: orb_pos = 'NSS 6' elif orbital_pos == 765: orb_pos = 'Telestar' elif orbital_pos == 785: orb_pos = 'ThaiCom 5' elif orbital_pos == 800: orb_pos = 'Express' elif orbital_pos == 830: orb_pos = 'Insat 4A' elif orbital_pos == 850: orb_pos = 'Intelsat 709' elif orbital_pos == 750: orb_pos = 'Abs' elif orbital_pos == 720: orb_pos = 'Intelsat' elif orbital_pos == 705: orb_pos = 'Eutelsat W5' elif orbital_pos == 685: orb_pos = 'Intelsat' elif orbital_pos == 620: orb_pos = 'Intelsat 902' elif orbital_pos == 600: orb_pos = 'Intelsat 904' elif orbital_pos == 570: orb_pos = 'Nss' elif orbital_pos == 530: orb_pos = 'Express AM22' elif orbital_pos == 480: orb_pos = 'Eutelsat 2F2' elif orbital_pos == 450: orb_pos = 'Intelsat' elif orbital_pos == 420: orb_pos = 'Turksat 2A' elif orbital_pos == 400: orb_pos = 'Express AM1' elif orbital_pos == 390: orb_pos = 'Hellas Sat 2' elif orbital_pos == 380: orb_pos = 'Paksat 1' elif orbital_pos == 360: orb_pos = 'Eutelsat Sesat' elif orbital_pos == 335: orb_pos = 'Astra 1M' elif orbital_pos == 330: orb_pos = 'Eurobird 3' elif orbital_pos == 328: orb_pos = 'Galaxy 11' elif orbital_pos == 315: orb_pos = 'Astra 5A' elif orbital_pos == 310: orb_pos = 'Turksat' elif orbital_pos == 305: orb_pos = 'Arabsat' elif orbital_pos == 285: orb_pos = 'Eurobird 1' elif orbital_pos == 284: orb_pos = 'Eurobird/Astra' elif orbital_pos == 282: orb_pos = 'Eurobird/Astra' elif orbital_pos == 1220: orb_pos = 'AsiaSat' elif orbital_pos == 1380: orb_pos = 'Telstar 18' elif orbital_pos == 260: orb_pos = 'Badr 3/4' elif orbital_pos == 255: orb_pos = 'Eurobird 2' elif orbital_pos == 215: orb_pos = 'Eutelsat' elif orbital_pos == 216: orb_pos = 'Eutelsat W6' elif orbital_pos == 210: orb_pos = 'AfriStar 1' elif orbital_pos == 160: orb_pos = 'Eutelsat W2' elif orbital_pos == 100: orb_pos = 'Eutelsat W1' elif orbital_pos == 90: orb_pos = 'Eurobird 9' elif orbital_pos == 70: orb_pos = 'Eutelsat W3A' elif orbital_pos == 50: orb_pos = 'Sirius 4' elif orbital_pos == 48: orb_pos = 'Sirius 4' elif orbital_pos == 30: orb_pos = 'Telecom 2' else: orb_pos = str((float(orbital_pos))/10.0) + "E" Ret_Text += sep + orb_pos + "\n" Ret_Text += frequency + sep + frontendData.get("polarization_abbreviation") Ret_Text += sep + symbolrate Ret_Text += sep + frontendData.get("modulation") + "-" + fec_inner else: Ret_Text += sep + "DVB-C " + frequency + " MHz" + sep + fec_inner + sep + symbolrate elif (frontendData.get("tuner_type") == "DVB-T"): frequency = (str((frontendData.get("frequency") / 1000)) + " MHz") Ret_Text = "Frequency: " + frequency if (self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.SERVICE_INFO): xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) feinfo = (service and service.frontendInfo()) prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = (feinfo and feinfo.getAll(True)) if (frontendDataOrg is not None): frontendData = ConvertToHumanReadable(frontendDataOrg) if ((frontendDataOrg.get("tuner_type") == "DVB-S") or (frontendDataOrg.get("tuner_type") == "DVB-C")): frequency = (str((frontendData.get("frequency") / 1000))) symbolrate = (str((frontendData.get("symbol_rate") / 1000))) fec_inner = frontendData.get("fec_inner") if (frontendDataOrg.get("tuner_type") == "DVB-S"): Ret_Text += sep + frontendData.get("system") Ret_Text += sep + frequency + frontendData.get("polarization_abbreviation") Ret_Text += sep + symbolrate Ret_Text += sep + fec_inner + " " + frontendData.get("modulation") orbital_pos = int(frontendDataOrg["orbital_position"]) if orbital_pos > 1800: orb_pos = str((float(3600 - orbital_pos)) / 10.0) + "W" elif orbital_pos > 0: orb_pos = str((float(orbital_pos)) / 10.0) + "E" Ret_Text += sep + orb_pos else: Ret_Text += sep + "DVB-C " + frequency + " MHz" + sep + fec_inner + sep + symbolrate elif (frontendDataOrg.get("tuner_type") == "DVB-T"): frequency = (str((frontendData.get("frequency") / 1000))) Ret_Text += sep + "DVB-T" + sep + "Frequency:" + sep + frequency + " MHz" if (feinfo is not None) and (xresol > 0): Res_Text += ("MPEG2 ", "MPEG4 ", "MPEG1 ", "MPEG4-II ", "VC1 ", "VC1-SM ", "")[info.getInfo(iServiceInformation.sVideoType)] Res_Text += str(xresol) + "x" + str(yresol) Res_Text += ("i", "p", "")[info.getInfo(iServiceInformation.sProgressive)] Res_Text += str((info.getInfo(iServiceInformation.sFrameRate) + 500) / 1000) if (self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.CRYPTO_INFO): decCI = "0" Sec_Text = "" if (info.getInfo(iServiceInformation.sIsCrypted) == 1): data = self.ecmdata.getEcmData() if not config.usage.show_cryptoinfo.getValue(): showCryptoInfo = True Sec_Text = data[0] + "\n" decCI = data[1] provid = data[2] pid = data[3] if decCI != '0': decCIfull = "%04x" % int(decCI, 16) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int(decCI, 16) <= int(idline[1], 16): decCIfull = idline[2] + ":" + decCIfull break Sec_Text += decCIfull if provid != '0': Sec_Text += ":%04x" % int(provid, 16) else: Sec_Text += ":" if pid != '0': Sec_Text += ":%04x:%04x" % (info.getInfo(iServiceInformation.sSID),int(pid, 16)) elif not config.usage.show_cryptoinfo.getValue(): showCryptoInfo = True Sec_Text = "FTA" res = "" searchIDs = (info.getInfoObject(iServiceInformation.sCAIDs)) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int(decCI, 16) <= int(idline[1], 16): color="\c0000??00" else: color = "\c007?7?7?" try: for oneID in searchIDs: if oneID >= int(idline[0], 16) and oneID <= int(idline[1], 16): color="\c00????00" except: pass res += color + idline[3] + " " if (self.type != self.CRYPTO_INFO): Ret_Text += "\n" Ret_Text += res + "\c00?????? " + Sec_Text if Res_Text != "": if showCryptoInfo: Ret_Text += sep + Res_Text else: Ret_Text += "\n" + Res_Text return Ret_Text
def getText(self): service = self.source.service info = service and service.info() if not info: return "" if self.type == self.XRES: return self._getVideoWidthStr(info) elif self.type == self.YRES: return self._getVideoHeightStr(info) elif self.type == self.APID: return self.getServiceInfoString(info, iServiceInformation.sAudioPID) elif self.type == self.VPID: return self.getServiceInfoString(info, iServiceInformation.sVideoPID) elif self.type == self.PCRPID: return self.getServiceInfoString(info, iServiceInformation.sPCRPID) elif self.type == self.PMTPID: return self.getServiceInfoString(info, iServiceInformation.sPMTPID) elif self.type == self.TXTPID: return self.getServiceInfoString(info, iServiceInformation.sTXTPID) elif self.type == self.TSID: return self.getServiceInfoString(info, iServiceInformation.sTSID) elif self.type == self.ONID: return self.getServiceInfoString(info, iServiceInformation.sONID) elif self.type == self.SID: return self.getServiceInfoString(info, iServiceInformation.sSID) elif self.type == self.FRAMERATE: video_rate = None if path.exists("/proc/stb/vmpeg/0/framerate"): f = open("/proc/stb/vmpeg/0/framerate", "r") try: video_rate = int(f.read()) except: pass f.close() if not video_rate: try: video_rate = int( self.getServiceInfoString( info, iServiceInformation.sFrameRate)) except: return "N/A fps" return video_rate, lambda x: "%d fps" % ((x + 500) / 1000) elif self.type == self.PROGRESSIVE: return self._getProgressiveStr(info) elif self.type == self.TRANSFERBPS: return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: "%d kB/s" % (x / 1024)) elif self.type == self.HAS_HBBTV: return info.getInfoString(iServiceInformation.sHBBTVUrl) elif self.type == self.FREQ_INFO: feinfo = service.frontendInfo() if feinfo is None: return "" feraw = feinfo.getAll(False) if feraw is None: return "" fedata = ConvertToHumanReadable(feraw) if fedata is None: return "" frequency = fedata.get("frequency") sr_txt = "Sr:" polarization = fedata.get("polarization_abbreviation") if polarization is None: polarization = "" symbolrate = str(int(fedata.get("symbol_rate", 0))) if symbolrate == "0": sr_txt = "" symbolrate = "" fec = fedata.get("fec_inner") if fec is None: fec = "" out = "Freq: %s %s %s %s %s" % (frequency, polarization, sr_txt, symbolrate, fec) return out elif self.type == self.VIDEO_INFO: progressive = self._getProgressiveStr(info) fieldrate = self._getFrameRate(info) if fieldrate > 0: if progressive == 'i': fieldrate *= 2 fieldrate = "%dHz" % ((fieldrate + 500) / 1000, ) else: fieldrate = "" return "%sx%s%s %s" % (self._getVideoWidthStr(info), self._getVideoHeightStr(info), progressive, fieldrate) return ""
def getText(self): service = self.source.service try: info = service and service.info() except: try: info = eServiceCenter.getInstance().info(service) except: pass if not info: return "" Ret_Text = "" Sec_Text = "" Res_Text = "" showCryptoInfo = False if (self.type == self.SMART_INFO_H or self.type == self.SERVICE_INFO or self.type == self.CRYPTO_INFO or self.type == self.FREQUENCY_INFO): # HORIZONTAL sep = " " sep2 = " - " elif (self.type == self.SMART_INFO_V): # VERTIKAL sep = "\n" sep2 = "\n" else: return "" # unsupported orientation if (self.type == self.FREQUENCY_INFO): try: feinfo = (service and service.frontendInfo()) prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = (feinfo and feinfo.getAll(True)) except: try: frontendDataOrg = info.getInfoObject( service, iServiceInformation.sTransponderData) prvd = info.getInfoString(service, iServiceInformation.sProvider) except: pass if (frontendDataOrg is not None): frontendData = ConvertToHumanReadable(frontendDataOrg) if ((frontendDataOrg.get("tuner_type") == "DVB-S") or (frontendDataOrg.get("tuner_type") == "DVB-C")): frequency = (str( (frontendData.get("frequency") / 1000)) + " MHz") symbolrate = (str( (frontendData.get("symbol_rate") / 1000))) fec_inner = frontendData.get("fec_inner") if (frontendDataOrg.get("tuner_type") == "DVB-S"): Ret_Text += sep + frontendData.get("system") orbital_pos = int(frontendDataOrg["orbital_position"]) if orbital_pos > 1800: if orbital_pos == 3590: orb_pos = 'Thor/Intelsat' elif orbital_pos == 3560: orb_pos = 'Amos (4' elif orbital_pos == 3550: orb_pos = 'Atlantic Bird' elif orbital_pos == 3530: orb_pos = 'Nilesat/Atlantic Bird' elif orbital_pos == 3520: orb_pos = 'Atlantic Bird' elif orbital_pos == 3475: orb_pos = 'Atlantic Bird' elif orbital_pos == 3460: orb_pos = 'Express' elif orbital_pos == 3450: orb_pos = 'Telstar' elif orbital_pos == 3420: orb_pos = 'Intelsat' elif orbital_pos == 3380: orb_pos = 'Nss' elif orbital_pos == 3355: orb_pos = 'Intelsat' elif orbital_pos == 3325: orb_pos = 'Intelsat' elif orbital_pos == 3300: orb_pos = 'Hispasat' elif orbital_pos == 3285: orb_pos = 'Intelsat' elif orbital_pos == 3170: orb_pos = 'Intelsat' elif orbital_pos == 3150: orb_pos = 'Intelsat' elif orbital_pos == 3070: orb_pos = 'Intelsat' elif orbital_pos == 3045: orb_pos = 'Intelsat' elif orbital_pos == 3020: orb_pos = 'Intelsat 9' elif orbital_pos == 2990: orb_pos = 'Amazonas' elif orbital_pos == 2900: orb_pos = 'Star One' elif orbital_pos == 2880: orb_pos = 'AMC 6 (72' elif orbital_pos == 2875: orb_pos = 'Echostar 6' elif orbital_pos == 2860: orb_pos = 'Horizons' elif orbital_pos == 2810: orb_pos = 'AMC5' elif orbital_pos == 2780: orb_pos = 'NIMIQ 4' elif orbital_pos == 2690: orb_pos = 'NIMIQ 1' elif orbital_pos == 3592: orb_pos = 'Thor/Intelsat' elif orbital_pos == 2985: orb_pos = 'Echostar 3,12' elif orbital_pos == 2830: orb_pos = 'Echostar 8' elif orbital_pos == 2630: orb_pos = 'Galaxy 19' elif orbital_pos == 2500: orb_pos = 'Echostar 10,11' elif orbital_pos == 2502: orb_pos = 'DirectTV 5' elif orbital_pos == 2410: orb_pos = 'Echostar 7 Anik F3' elif orbital_pos == 2391: orb_pos = 'Galaxy 23' elif orbital_pos == 2390: orb_pos = 'Echostar 9' elif orbital_pos == 2412: orb_pos = 'DirectTV 7S' elif orbital_pos == 2310: orb_pos = 'Galaxy 27' elif orbital_pos == 2311: orb_pos = 'Ciel 2' elif orbital_pos == 2120: orb_pos = 'Echostar 2' else: orb_pos = str( (float(3600 - orbital_pos)) / 10.0) + "W" elif orbital_pos > 0: if orbital_pos == 192: orb_pos = 'Astra 1F' elif orbital_pos == 130: orb_pos = 'Hot Bird 6,7A,8' elif orbital_pos == 235: orb_pos = 'Astra 1E' elif orbital_pos == 1100: orb_pos = 'BSat 1A,2A' elif orbital_pos == 1101: orb_pos = 'N-Sat 110' elif orbital_pos == 1131: orb_pos = 'KoreaSat 5' elif orbital_pos == 1440: orb_pos = 'SuperBird 7,C2' elif orbital_pos == 1006: orb_pos = 'AsiaSat 2' elif orbital_pos == 1030: orb_pos = 'Express A2' elif orbital_pos == 1056: orb_pos = 'Asiasat 3S' elif orbital_pos == 1082: orb_pos = 'NSS 11' elif orbital_pos == 881: orb_pos = 'ST1' elif orbital_pos == 900: orb_pos = 'Yamal 201' elif orbital_pos == 917: orb_pos = 'Mesat' elif orbital_pos == 950: orb_pos = 'Insat 4B' elif orbital_pos == 951: orb_pos = 'NSS 6' elif orbital_pos == 765: orb_pos = 'Telestar' elif orbital_pos == 785: orb_pos = 'ThaiCom 5' elif orbital_pos == 800: orb_pos = 'Express' elif orbital_pos == 830: orb_pos = 'Insat 4A' elif orbital_pos == 850: orb_pos = 'Intelsat 709' elif orbital_pos == 750: orb_pos = 'Abs' elif orbital_pos == 720: orb_pos = 'Intelsat' elif orbital_pos == 705: orb_pos = 'Eutelsat W5' elif orbital_pos == 685: orb_pos = 'Intelsat' elif orbital_pos == 620: orb_pos = 'Intelsat 902' elif orbital_pos == 600: orb_pos = 'Intelsat 904' elif orbital_pos == 570: orb_pos = 'Nss' elif orbital_pos == 530: orb_pos = 'Express AM22' elif orbital_pos == 480: orb_pos = 'Eutelsat 2F2' elif orbital_pos == 450: orb_pos = 'Intelsat' elif orbital_pos == 420: orb_pos = 'Turksat 2A' elif orbital_pos == 400: orb_pos = 'Express AM1' elif orbital_pos == 390: orb_pos = 'Hellas Sat 2' elif orbital_pos == 380: orb_pos = 'Paksat 1' elif orbital_pos == 360: orb_pos = 'Eutelsat Sesat' elif orbital_pos == 335: orb_pos = 'Astra 1M' elif orbital_pos == 330: orb_pos = 'Eurobird 3' elif orbital_pos == 328: orb_pos = 'Galaxy 11' elif orbital_pos == 315: orb_pos = 'Astra 5A' elif orbital_pos == 310: orb_pos = 'Turksat' elif orbital_pos == 305: orb_pos = 'Arabsat' elif orbital_pos == 285: orb_pos = 'Eurobird 1' elif orbital_pos == 284: orb_pos = 'Eurobird/Astra' elif orbital_pos == 282: orb_pos = 'Eurobird/Astra' elif orbital_pos == 1220: orb_pos = 'AsiaSat' elif orbital_pos == 1380: orb_pos = 'Telstar 18' elif orbital_pos == 260: orb_pos = 'Badr 3/4' elif orbital_pos == 255: orb_pos = 'Eurobird 2' elif orbital_pos == 215: orb_pos = 'Eutelsat' elif orbital_pos == 216: orb_pos = 'Eutelsat W6' elif orbital_pos == 210: orb_pos = 'AfriStar 1' elif orbital_pos == 160: orb_pos = 'Eutelsat W2' elif orbital_pos == 100: orb_pos = 'Eutelsat W1' elif orbital_pos == 90: orb_pos = 'Eurobird 9' elif orbital_pos == 70: orb_pos = 'Eutelsat W3A' elif orbital_pos == 50: orb_pos = 'Sirius 4' elif orbital_pos == 48: orb_pos = 'Sirius 4' elif orbital_pos == 30: orb_pos = 'Telecom 2' else: orb_pos = str( (float(orbital_pos)) / 10.0) + "E" Ret_Text += sep + orb_pos + "\n" Ret_Text += frequency + sep + frontendData.get( "polarization_abbreviation") Ret_Text += sep + symbolrate Ret_Text += sep + frontendData.get( "modulation") + "-" + fec_inner else: Ret_Text += sep + "DVB-C " + frequency + " MHz" + sep + fec_inner + sep + symbolrate elif (frontendData.get("tuner_type") == "DVB-T"): frequency = (str( (frontendData.get("frequency") / 1000)) + " MHz") Ret_Text = "Frequency: " + frequency if (self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.SERVICE_INFO): xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) feinfo = (service and service.frontendInfo()) prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = (feinfo and feinfo.getAll(True)) if (frontendDataOrg is not None): frontendData = ConvertToHumanReadable(frontendDataOrg) if ((frontendDataOrg.get("tuner_type") == "DVB-S") or (frontendDataOrg.get("tuner_type") == "DVB-C")): frequency = (str((frontendData.get("frequency") / 1000))) symbolrate = (str( (frontendData.get("symbol_rate") / 1000))) fec_inner = frontendData.get("fec_inner") if (frontendDataOrg.get("tuner_type") == "DVB-S"): Ret_Text += sep + frontendData.get("system") Ret_Text += sep + frequency + frontendData.get( "polarization_abbreviation") Ret_Text += sep + symbolrate Ret_Text += sep + fec_inner + " " + frontendData.get( "modulation") orbital_pos = int(frontendDataOrg["orbital_position"]) if orbital_pos > 1800: orb_pos = str( (float(3600 - orbital_pos)) / 10.0) + "W" elif orbital_pos > 0: orb_pos = str((float(orbital_pos)) / 10.0) + "E" Ret_Text += sep + orb_pos else: Ret_Text += sep + "DVB-C " + frequency + " MHz" + sep + fec_inner + sep + symbolrate elif (frontendDataOrg.get("tuner_type") == "DVB-T"): frequency = (str((frontendData.get("frequency") / 1000))) Ret_Text += sep + "DVB-T" + sep + "Frequency:" + sep + frequency + " MHz" if (feinfo is not None) and (xresol > 0): Res_Text += ("MPEG2", "MPEG4 H.264", "MPEG1", "MPEG4-VC", "VC1", "VC1-SM", "HEVC H.265", "")[info.getInfo(iServiceInformation.sVideoType)] Res_Text += str(xresol) + "x" + str(yresol) Res_Text += ("i", "p", "")[info.getInfo( iServiceInformation.sProgressive)] Res_Text += str( (info.getInfo(iServiceInformation.sFrameRate) + 500) / 1000) if (self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.CRYPTO_INFO): decCI = "0" Sec_Text = "" if (info.getInfo(iServiceInformation.sIsCrypted) == 1): data = self.ecmdata.getEcmData() if not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = data[0] + "\n" decCI = data[1] provid = data[2] pid = data[3] if decCI != '0': decCIfull = "%04x" % int(decCI, 16) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int( decCI, 16) <= int(idline[1], 16): decCIfull = idline[2] + ":" + decCIfull break Sec_Text += decCIfull if provid != '0': Sec_Text += ":%04x" % int(provid, 16) else: Sec_Text += ":" if pid != '0': Sec_Text += ":%04x:%04x" % (info.getInfo( iServiceInformation.sSID), int(pid, 16)) elif not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = "FTA" res = "" searchIDs = (info.getInfoObject(iServiceInformation.sCAIDs)) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int( decCI, 16) <= int(idline[1], 16): color = "\c0000??00" else: color = "\c007?7?7?" try: for oneID in searchIDs: if oneID >= int(idline[0], 16) and oneID <= int( idline[1], 16): color = "\c00????00" except: pass res += color + idline[3] + " " if (self.type != self.CRYPTO_INFO): Ret_Text += "\n" Ret_Text += res + "\c00?????? " + Sec_Text if Res_Text != "": if showCryptoInfo: Ret_Text += sep + Res_Text else: Ret_Text += "\n" + Res_Text return Ret_Text
def getText(self): service = self.source.service info = service and service.info() if not info: return "" if self.type == self.XRES: video_width = None if path.exists("/proc/stb/vmpeg/0/xres"): f = open("/proc/stb/vmpeg/0/xres", "r") video_width = int(f.read(),16) f.close() if not video_width: video_width = self.getServiceInfoString(info, iServiceInformation.sVideoWidth) return "%d" % video_width elif self.type == self.YRES: video_height = None if path.exists("/proc/stb/vmpeg/0/yres"): f = open("/proc/stb/vmpeg/0/yres", "r") video_height = int(f.read(),16) f.close() if not video_height: video_height = self.getServiceInfoString(info, iServiceInformation.sVideoHeight) return "%d" % video_height elif self.type == self.APID: return self.getServiceInfoString(info, iServiceInformation.sAudioPID) elif self.type == self.VPID: return self.getServiceInfoString(info, iServiceInformation.sVideoPID) elif self.type == self.PCRPID: return self.getServiceInfoString(info, iServiceInformation.sPCRPID) elif self.type == self.PMTPID: return self.getServiceInfoString(info, iServiceInformation.sPMTPID) elif self.type == self.TXTPID: return self.getServiceInfoString(info, iServiceInformation.sTXTPID) elif self.type == self.TSID: return self.getServiceInfoString(info, iServiceInformation.sTSID) elif self.type == self.ONID: return self.getServiceInfoString(info, iServiceInformation.sONID) elif self.type == self.SID: return self.getServiceInfoString(info, iServiceInformation.sSID) elif self.type == self.FRAMERATE: video_rate = None if path.exists("/proc/stb/vmpeg/0/framerate"): f = open("/proc/stb/vmpeg/0/framerate", "r") video_rate = int(f.read()) f.close() if not video_rate: video_rate = self.getServiceInfoString(info, iServiceInformation.sFrameRate) return video_rate, lambda x: "%d fps" % ((x+500)/1000) elif self.type == self.TRANSFERBPS: return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: "%d kB/s" % (x/1024)) elif self.type == self.HAS_HBBTV: return info.getInfoString(iServiceInformation.sHBBTVUrl) elif self.type == self.FREQ_INFO: feinfo = service.frontendInfo() if feinfo is None: return "" feraw = feinfo.getAll(False) if feraw is None: return "" fedata = ConvertToHumanReadable(feraw) if fedata is None: return "" frequency = fedata.get("frequency") sr_txt = "Sr:" polarization = fedata.get("polarization_abbreviation") if polarization is None: polarization = "" symbolrate = str(int(fedata.get("symbol_rate", 0))) if symbolrate == "0": sr_txt = "" symbolrate = "" fec = fedata.get("fec_inner") if fec is None: fec = "" out = "Freq: %s %s %s %s %s" % (frequency, polarization, sr_txt, symbolrate, fec) return out return ""
def getText(self): service = self.source.service try: info = service and service.info() except: try: info = eServiceCenter.getInstance().info(service) except: pass if not info: return '' else: Ret_Text = '' Sec_Text = '' Res_Text = '' showCryptoInfo = False if self.type == self.SMART_INFO_H or self.type == self.SERVICE_INFO or self.type == self.CRYPTO_INFO or self.type == self.FREQUENCY_INFO: sep = ' ' sep2 = ' - ' elif self.type == self.SMART_INFO_V: sep = '\n' sep2 = '\n' else: return '' if self.type == self.FREQUENCY_INFO: try: feinfo = service and service.frontendInfo() prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = feinfo and feinfo.getAll(True) except: try: frontendDataOrg = info.getInfoObject( service, iServiceInformation.sTransponderData) prvd = info.getInfoString( service, iServiceInformation.sProvider) except: pass if frontendDataOrg is not None: frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg.get( 'tuner_type') == 'DVB-S' or frontendDataOrg.get( 'tuner_type') == 'DVB-C': frequency = str( frontendData.get('frequency') / 1000) + ' MHz' symbolrate = str( frontendData.get('symbol_rate') / 1000) fec_inner = frontendData.get('fec_inner') if frontendDataOrg.get('tuner_type') == 'DVB-S': Ret_Text += sep + frontendData.get('system') orbital_pos = int( frontendDataOrg['orbital_position']) if orbital_pos > 1800: if orbital_pos == 3590: orb_pos = 'Thor/Intelsat' elif orbital_pos == 3560: orb_pos = 'Amos (4' elif orbital_pos == 3550: orb_pos = 'Atlantic Bird' elif orbital_pos == 3530: orb_pos = 'Nilesat/Atlantic Bird' elif orbital_pos == 3520: orb_pos = 'Atlantic Bird' elif orbital_pos == 3475: orb_pos = 'Atlantic Bird' elif orbital_pos == 3460: orb_pos = 'Express' elif orbital_pos == 3450: orb_pos = 'Telstar' elif orbital_pos == 3420: orb_pos = 'Intelsat' elif orbital_pos == 3380: orb_pos = 'Nss' elif orbital_pos == 3355: orb_pos = 'Intelsat' elif orbital_pos == 3325: orb_pos = 'Intelsat' elif orbital_pos == 3300: orb_pos = 'Hispasat' elif orbital_pos == 3285: orb_pos = 'Intelsat' elif orbital_pos == 3170: orb_pos = 'Intelsat' elif orbital_pos == 3150: orb_pos = 'Intelsat' elif orbital_pos == 3070: orb_pos = 'Intelsat' elif orbital_pos == 3045: orb_pos = 'Intelsat' elif orbital_pos == 3020: orb_pos = 'Intelsat 9' elif orbital_pos == 2990: orb_pos = 'Amazonas' elif orbital_pos == 2900: orb_pos = 'Star One' elif orbital_pos == 2880: orb_pos = 'AMC 6 (72' elif orbital_pos == 2875: orb_pos = 'Echostar 6' elif orbital_pos == 2860: orb_pos = 'Horizons' elif orbital_pos == 2810: orb_pos = 'AMC5' elif orbital_pos == 2780: orb_pos = 'NIMIQ 4' elif orbital_pos == 2690: orb_pos = 'NIMIQ 1' elif orbital_pos == 3592: orb_pos = 'Thor/Intelsat' elif orbital_pos == 2985: orb_pos = 'Echostar 3,12' elif orbital_pos == 2830: orb_pos = 'Echostar 8' elif orbital_pos == 2630: orb_pos = 'Galaxy 19' elif orbital_pos == 2500: orb_pos = 'Echostar 10,11' elif orbital_pos == 2502: orb_pos = 'DirectTV 5' elif orbital_pos == 2410: orb_pos = 'Echostar 7 Anik F3' elif orbital_pos == 2391: orb_pos = 'Galaxy 23' elif orbital_pos == 2390: orb_pos = 'Echostar 9' elif orbital_pos == 2412: orb_pos = 'DirectTV 7S' elif orbital_pos == 2310: orb_pos = 'Galaxy 27' elif orbital_pos == 2311: orb_pos = 'Ciel 2' elif orbital_pos == 2120: orb_pos = 'Echostar 2' else: orb_pos = str( float(3600 - orbital_pos) / 10.0) + 'W' elif orbital_pos > 0: if orbital_pos == 192: orb_pos = 'Astra 1F' elif orbital_pos == 130: orb_pos = 'Hot Bird 6,7A,8' elif orbital_pos == 235: orb_pos = 'Astra 1E' elif orbital_pos == 1100: orb_pos = 'BSat 1A,2A' elif orbital_pos == 1101: orb_pos = 'N-Sat 110' elif orbital_pos == 1131: orb_pos = 'KoreaSat 5' elif orbital_pos == 1440: orb_pos = 'SuperBird 7,C2' elif orbital_pos == 1006: orb_pos = 'AsiaSat 2' elif orbital_pos == 1030: orb_pos = 'Express A2' elif orbital_pos == 1056: orb_pos = 'Asiasat 3S' elif orbital_pos == 1082: orb_pos = 'NSS 11' elif orbital_pos == 881: orb_pos = 'ST1' elif orbital_pos == 900: orb_pos = 'Yamal 201' elif orbital_pos == 917: orb_pos = 'Mesat' elif orbital_pos == 950: orb_pos = 'Insat 4B' elif orbital_pos == 951: orb_pos = 'NSS 6' elif orbital_pos == 765: orb_pos = 'Telestar' elif orbital_pos == 785: orb_pos = 'ThaiCom 5' elif orbital_pos == 800: orb_pos = 'Express' elif orbital_pos == 830: orb_pos = 'Insat 4A' elif orbital_pos == 850: orb_pos = 'Intelsat 709' elif orbital_pos == 750: orb_pos = 'Abs' elif orbital_pos == 720: orb_pos = 'Intelsat' elif orbital_pos == 705: orb_pos = 'Eutelsat W5' elif orbital_pos == 685: orb_pos = 'Intelsat' elif orbital_pos == 620: orb_pos = 'Intelsat 902' elif orbital_pos == 600: orb_pos = 'Intelsat 904' elif orbital_pos == 570: orb_pos = 'Nss' elif orbital_pos == 530: orb_pos = 'Express AM22' elif orbital_pos == 480: orb_pos = 'Eutelsat 2F2' elif orbital_pos == 450: orb_pos = 'Intelsat' elif orbital_pos == 420: orb_pos = 'Turksat 2A' elif orbital_pos == 400: orb_pos = 'Express AM1' elif orbital_pos == 390: orb_pos = 'Hellas Sat 2' elif orbital_pos == 380: orb_pos = 'Paksat 1' elif orbital_pos == 360: orb_pos = 'Eutelsat Sesat' elif orbital_pos == 335: orb_pos = 'Astra 1M' elif orbital_pos == 330: orb_pos = 'Eurobird 3' elif orbital_pos == 328: orb_pos = 'Galaxy 11' elif orbital_pos == 315: orb_pos = 'Astra 5A' elif orbital_pos == 310: orb_pos = 'Turksat' elif orbital_pos == 305: orb_pos = 'Arabsat' elif orbital_pos == 285: orb_pos = 'Eurobird 1' elif orbital_pos == 284: orb_pos = 'Eurobird/Astra' elif orbital_pos == 282: orb_pos = 'Eurobird/Astra' elif orbital_pos == 1220: orb_pos = 'AsiaSat' elif orbital_pos == 1380: orb_pos = 'Telstar 18' elif orbital_pos == 260: orb_pos = 'Badr 3/4' elif orbital_pos == 255: orb_pos = 'Eurobird 2' elif orbital_pos == 215: orb_pos = 'Eutelsat' elif orbital_pos == 216: orb_pos = 'Eutelsat W6' elif orbital_pos == 210: orb_pos = 'AfriStar 1' elif orbital_pos == 160: orb_pos = 'Eutelsat W2' elif orbital_pos == 100: orb_pos = 'Eutelsat W1' elif orbital_pos == 90: orb_pos = 'Eurobird 9' elif orbital_pos == 70: orb_pos = 'Eutelsat W3A' elif orbital_pos == 50: orb_pos = 'Sirius 4' elif orbital_pos == 48: orb_pos = 'Sirius 4' elif orbital_pos == 30: orb_pos = 'Telecom 2' else: orb_pos = str( float(orbital_pos) / 10.0) + 'E' Ret_Text += sep + orb_pos + '\n' Ret_Text += frequency + sep + frontendData.get( 'polarization_abbreviation') Ret_Text += sep + symbolrate Ret_Text += sep + frontendData.get( 'modulation') + '-' + fec_inner else: Ret_Text += sep + 'DVB-C ' + frequency + ' MHz' + sep + fec_inner + sep + symbolrate elif frontendData.get('tuner_type') == 'DVB-T': frequency = str( frontendData.get('frequency') / 1000) + ' MHz' Ret_Text = 'Frequency: ' + frequency if self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.SERVICE_INFO: xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) feinfo = service and service.frontendInfo() prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = feinfo and feinfo.getAll(True) if frontendDataOrg is not None: frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg.get( 'tuner_type') == 'DVB-S' or frontendDataOrg.get( 'tuner_type') == 'DVB-C': frequency = str(frontendData.get('frequency') / 1000) symbolrate = str( frontendData.get('symbol_rate') / 1000) fec_inner = frontendData.get('fec_inner') if frontendDataOrg.get('tuner_type') == 'DVB-S': Ret_Text += sep + frontendData.get('system') Ret_Text += sep + frequency + frontendData.get( 'polarization_abbreviation') Ret_Text += sep + symbolrate Ret_Text += sep + fec_inner + ' ' + frontendData.get( 'modulation') orbital_pos = int( frontendDataOrg['orbital_position']) if orbital_pos > 1800: orb_pos = str( float(3600 - orbital_pos) / 10.0) + 'W' elif orbital_pos > 0: orb_pos = str(float(orbital_pos) / 10.0) + 'E' Ret_Text += sep + orb_pos else: Ret_Text += sep + 'DVB-C ' + frequency + ' MHz' + sep + fec_inner + sep + symbolrate elif frontendDataOrg.get('tuner_type') == 'DVB-T': frequency = str(frontendData.get('frequency') / 1000) Ret_Text += sep + 'DVB-T' + sep + 'Frequency:' + sep + frequency + ' MHz' if feinfo is not None and xresol > 0: Res_Text += ('MPEG2 ', 'MPEG4 ', 'MPEG1 ', 'MPEG4-II ', 'VC1 ', 'VC1-SM ', '')[info.getInfo( iServiceInformation.sVideoType)] Res_Text += str(xresol) + 'x' + str(yresol) Res_Text += ('i', 'p', '')[info.getInfo( iServiceInformation.sProgressive)] Res_Text += str( (info.getInfo(iServiceInformation.sFrameRate) + 500) / 1000) if self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.CRYPTO_INFO: decCI = '0' Sec_Text = '' if info.getInfo(iServiceInformation.sIsCrypted) == 1: data = self.ecmdata.getEcmData() if not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = data[0] + '\n' decCI = data[1] provid = data[2] pid = data[3] if decCI != '0': decCIfull = '%04x' % int(decCI, 16) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int( decCI, 16) <= int(idline[1], 16): decCIfull = idline[2] + ':' + decCIfull break Sec_Text += decCIfull if provid != '0': Sec_Text += ':%04x' % int(provid, 16) else: Sec_Text += ':' if pid != '0': Sec_Text += ':%04x:%04x' % (info.getInfo( iServiceInformation.sSID), int(pid, 16)) elif not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = 'FTA' res = '' searchIDs = info.getInfoObject(iServiceInformation.sCAIDs) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int( decCI, 16) <= int(idline[1], 16): color = '\\c0000??00' else: color = '\\c007?7?7?' try: for oneID in searchIDs: if oneID >= int(idline[0], 16) and oneID <= int( idline[1], 16): color = '\\c00????00' except: pass res += color + idline[3] + ' ' if self.type != self.CRYPTO_INFO: Ret_Text += '\n' Ret_Text += res + '\\c00?????? ' + Sec_Text if Res_Text != '': if showCryptoInfo: Ret_Text += sep + Res_Text else: Ret_Text += '\n' + Res_Text return Ret_Text
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg['tuner_type'] == 'DVB-S': return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('System'), frontendData['system'], TYPE_TEXT), (_('Modulation'), frontendData['modulation'], TYPE_TEXT), (_('Orbital position'), frontendData['orbital_position'], TYPE_VALUE_DEC), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Symbol rate'), frontendData['symbol_rate'], TYPE_VALUE_DEC), (_('Polarization'), frontendData['polarization'], TYPE_TEXT), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('FEC'), frontendData['fec_inner'], TYPE_TEXT), (_('Pilot'), frontendData.get('pilot', None), TYPE_TEXT), (_('Roll-off'), frontendData.get('rolloff', None), TYPE_TEXT)) if frontendDataOrg['tuner_type'] == 'DVB-C': return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('Modulation'), frontendData['modulation'], TYPE_TEXT), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Symbol rate'), frontendData['symbol_rate'], TYPE_VALUE_DEC), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('FEC'), frontendData['fec_inner'], TYPE_TEXT)) if frontendDataOrg['tuner_type'] == 'DVB-T': channel = channelnumbers.getChannelNumber( frontendDataOrg['frequency'], frontendDataOrg['tuner_number'] ) if channelnumbers.supportedChannels( frontendDataOrg['tuner_number']) else None return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Channel'), channel, TYPE_VALUE_DEC), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('Bandwidth'), frontendData['bandwidth'], TYPE_VALUE_DEC), (_('Code rate LP'), frontendData['code_rate_lp'], TYPE_TEXT), (_('Code rate HP'), frontendData['code_rate_hp'], TYPE_TEXT), (_('Constellation'), frontendData['constellation'], TYPE_TEXT), (_('Transmission mode'), frontendData['transmission_mode'], TYPE_TEXT), (_('Guard interval'), frontendData['guard_interval'], TYPE_TEXT), (_('Hierarchy info'), frontendData['hierarchy_information'], TYPE_TEXT)) return []
def getText(self): service = self.source.service info = service and service.info() if not info: return "" Ret_Text = "" Sec_Text = "" Res_Text = "" showCryptoInfo = False if (self.type == self.SMART_INFO_H or self.type == self.SERVICE_INFO or self.type == self.CRYPTO_INFO): # HORIZONTAL sep = " " sep2 = " - " elif (self.type == self.SMART_INFO_V): # VERTIKAL sep = "\n" sep2 = "\n" else: return "" # unsupported orientation if (self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.SERVICE_INFO): xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) feinfo = (service and service.frontendInfo()) prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = (feinfo and feinfo.getAll(False)) if (frontendDataOrg is not None): frontendData = ConvertToHumanReadable(frontendDataOrg) if ((frontendDataOrg.get("tuner_type") == "DVB-S") or (frontendDataOrg.get("tuner_type") == "DVB-C")): frequency = (str((frontendData.get("frequency") / 1000))) symbolrate = (str((frontendData.get("symbol_rate") / 1000))) fec_inner = frontendData.get("fec_inner") if (frontendDataOrg.get("tuner_type") == "DVB-S"): Ret_Text += sep + frontendData.get("system") Ret_Text += sep + frequency + frontendData.get("polarization_abbreviation") Ret_Text += sep + symbolrate Ret_Text += sep + fec_inner + " " + frontendData.get("modulation") orbital_pos = int(frontendDataOrg["orbital_position"]) if orbital_pos > 1800: orb_pos = str((float(3600 - orbital_pos)) / 10.0) + "W" elif orbital_pos > 0: orb_pos = str((float(orbital_pos)) / 10.0) + "E" Ret_Text += sep + orb_pos else: Ret_Text += sep + "DVB-C " + frequency + " MHz" + sep + fec_inner + sep + symbolrate elif (frontendDataOrg.get("tuner_type") == "DVB-T"): frequency = (str((frontendData.get("frequency") / 1000))) Ret_Text += sep + "DVB-T" + sep + "Frequency:" + sep + frequency + " MHz" if (feinfo is not None) and (xresol > 0): Res_Text += ("MPEG2 ", "MPEG4 ", "MPEG1 ", "MPEG4-II ", "VC1 ", "VC1-SM ", "")[info.getInfo(iServiceInformation.sVideoType)] Res_Text += str(xresol) + "x" + str(yresol) Res_Text += ("i", "p", "")[info.getInfo(iServiceInformation.sProgressive)] Res_Text += str((info.getInfo(iServiceInformation.sFrameRate) + 500) / 1000) if (self.type == self.SMART_INFO_H or self.type == self.SMART_INFO_V or self.type == self.CRYPTO_INFO): decCI = "0" Sec_Text = "" if (info.getInfo(iServiceInformation.sIsCrypted) == 1): data = self.ecmdata.getEcmData() if not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = data[0] + "\n" decCI = data[1] provid = data[2] pid = data[3] if decCI != '0': decCIfull = "%04x" % int(decCI, 16) for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int(decCI, 16) <= int(idline[1], 16): decCIfull = idline[2] + ":" + decCIfull break Sec_Text += decCIfull if provid != '0': Sec_Text += ":%04x" % int(provid, 16) else: Sec_Text += ":" if pid != '0': Sec_Text += ":%04x:%04x" % (info.getInfo(iServiceInformation.sSID),int(pid, 16)) elif not config.usage.show_cryptoinfo.value: showCryptoInfo = True Sec_Text = "FTA" res = "" try: searchIDs = (info.getInfoObject(iServiceInformation.sCAIDs)) except: searchIDs = 0 pass for idline in self.idnames: if int(decCI, 16) >= int(idline[0], 16) and int(decCI, 16) <= int(idline[1], 16): color="\c0000??00" else: color = "\c007?7?7?" try: for oneID in searchIDs: if oneID >= int(idline[0], 16) and oneID <= int(idline[1], 16): color="\c00????00" except: pass res += color + idline[3] + " " if (self.type != self.CRYPTO_INFO): Ret_Text += "\n" Ret_Text += res + "\c00?????? " + Sec_Text if Res_Text != "": if showCryptoInfo: Ret_Text += sep + Res_Text else: Ret_Text += "\n" + Res_Text return Ret_Text
def getText(self): service = self.source.service info = service and service.info() if not info: return "" Ret_Text = "" Sec_Text = "" xresol = info.getInfo(iServiceInformation.sVideoWidth) yresol = info.getInfo(iServiceInformation.sVideoHeight) feinfo = (service and service.frontendInfo()) if (self.type == self.SMART_INFO_H): # HORIZONTAL sep = " " sep2 = " - " elif (self.type == self.SMART_INFO_V): # VERTIKAL sep = "\n" sep2 = "\n" else: return "" # unsupported orientation prvd = info.getInfoString(iServiceInformation.sProvider) Ret_Text = self.short(prvd) frontendDataOrg = (feinfo and feinfo.getAll(True)) if (frontendDataOrg is not None): frontendData = ConvertToHumanReadable(frontendDataOrg) if ((frontendDataOrg.get("tuner_type") == "DVB-S") or (frontendDataOrg.get("tuner_type") == "DVB-C")): frequency = (str((frontendData.get("frequency") / 1000))) symbolrate = (str((frontendData.get("symbol_rate") / 1000))) fec_inner = frontendData.get("fec_inner") if (frontendDataOrg.get("tuner_type") == "DVB-S"): Ret_Text += sep + frontendData.get("system") Ret_Text += sep + frequency + frontendData.get("polarization")[:1] Ret_Text += sep + symbolrate Ret_Text += sep + frontendData.get("modulation") + "-" + fec_inner orbital_pos = int(frontendData["orbital_position"]) if orbital_pos > 1800: orb_pos = str((float(3600 - orbital_pos)) / 10.0) + "W" elif orbital_pos > 0: orb_pos = str((float(orbital_pos)) / 10.0) + "E" Ret_Text += sep + orb_pos else: Ret_Text += sep + "DVB-C " + frequency + " MHz" + sep + fec_inner + sep + symbolrate elif (frontendDataOrg.get("tuner_type") == "DVB-T"): frequency = (str((frontendData.get("frequency") / 1000))) Ret_Text += sep + "DVB-T" + sep + "Frequency:" + sep + frequency + " MHz" if (feinfo is not None) and (xresol > 0): if (yresol > 580): Ret_Text += sep + "HD " else: Ret_Text += sep + "SD " Ret_Text += str(xresol) + "x" + str(yresol) if (info.getInfo(iServiceInformation.sIsCrypted) == 1): try: ecm = open(ECM_INFO, 'rb').readlines() ecminfo = {} for line in ecm: d = line.split(':', 1) if len(d) > 1: ecminfo[d[0].strip()] = d[1].strip() using = ecminfo.get('using', '') if using: # CCcam if using == 'fta': Sec_Text = _("FTA") elif using == 'emu': Sec_Text = "EMU (%ss)" % (ecminfo.get('ecm time', '?')) else: hops = ecminfo.get('hops', None) if hops and hops != '0': hops = ' @' + hops else: hops = '' Sec_Text = ecminfo.get('address', '?') + hops + " (%ss)" % ecminfo.get('ecm time', '?') else: decode = ecminfo.get('decode', None) if decode: # gbox (untested) if ecminfo['decode'] == 'Network': cardid = 'id:' + ecminfo.get('prov', '') try: share = open('/tmp/share.info', 'rb').readlines() for line in share: if cardid in line: Sec_Text = line.strip() break else: Sec_Text = cardid except: Sec_Text = decode else: Sec_Text = decode else: source = ecminfo.get('source', '') if source: # MGcam eEnc = "" eCaid = "" eSrc = "" eTime = "" for line in ecm: line = line.strip() if line.find('ECM') != -1: line = line.split(' ') eEnc = line[1] eCaid = line[5][2:-1] continue if line.find('source') != -1: line = line.split(' ') eSrc = line[4][:-1] continue if line.find('msec') != -1: line = line.split(' ') eTime = line[0] continue Sec_Text = "(%s %s %.3f @ %s)" % (eEnc,eCaid,(float(eTime)/1000),eSrc) else: reader = ecminfo.get('reader', '') if reader: #Oscam hops = ecminfo.get('hops', None) if hops and hops != '0': hops = ' @' + hops else: hops = '' Sec_Text = reader + hops + " (%ss)" % ecminfo.get('ecm time', '?') else: Sec_Text = "" pid = ecminfo.get('pid', None) decCI = ecminfo.get('caid', None) decCIfull="" if decCI != "": for idline in self.idnames: try: if decCI.upper() >= idline[0].upper() and decCI.upper() <= idline[1].upper(): decCIfull = idline[2] + ":" + decCI break except: pass Sec_Text += sep + decCIfull + sep + "pid:" + pid res = "" try: searchIDs = (info.getInfoObject(iServiceInformation.sCAIDs)) for idline in self.idnames: color = "\c007?7?7?" for oneID in searchIDs: if (oneID >= int(idline[0], 16)) and (oneID <= int(idline[1], 16)): color="\c00????00" if oneID == int(decCI,16): color="\c0000??00" break res += color + idline[3] + " " except: pass Ret_Text += "\n" + res + "\c00?????? " + Sec_Text except: Ret_Text += "\n\c007?7?7?S V I Nd Co Cw B N" + "\c00?????? No expert cryptinfo available" pass else: Ret_Text += "\n\c007?7?7?S V I Nd Co Cw B N" + "\c00?????? FTA" return Ret_Text
def __start(self): if self.my_timer_active == 1: self.my_timer.stop() self.my_timer_active = 0 self['ecm_info'].setText('') self['netcard_info'].setText('') self['nfreq_info'].setText('') self['orbital_pos'].setText('') self['beta_emm'].hide() self['beta_ecm'].hide() self['irdeto_emm'].hide() self['irdeto_ecm'].hide() self['seca_emm'].hide() self['seca_ecm'].hide() self['via_emm'].hide() self['via_ecm'].hide() self['nagra_emm'].hide() self['nagra_ecm'].hide() self['cw_emm'].hide() self['cw_ecm'].hide() self['nds_emm'].hide() self['nds_ecm'].hide() self['conax_emm'].hide() self['conax_ecm'].hide() self['biss_emm'].hide() self['biss_ecm'].hide() self['bul_emm'].hide() self['bul_ecm'].hide() self['dre_emm'].hide() self['dre_ecm'].hide() self['pv_emm'].hide() self['pv_ecm'].hide() self['button_fta'].show() self['button_card'].hide() self['button_emu'].hide() self['button_cex'].hide() self['button_spider'].hide() self.currentCam = 'Common Interface' if fileExists('/etc/CurrentBhCamName'): f = open('/etc/CurrentBhCamName', 'r') for line in f.readlines(): line = line.replace('\n', '') line = line.strip() if len(line) > 3: self.currentCam = line f.close() self['cam_info'].setText(self.currentCam) ret = 'Black Hole' all = ['Avalon', 'Chaos', 'Ghost'] f = open('/proc/mounts', 'r') for line in f.readlines(): if line.find('/usr ') != -1: for a in all: if line.find(a) != -1: ret = a break f.close() self['Universe'].setText(_('In %s Universe') % ret) self.VideoSize = ' ' isCrypt = False service = self.session.nav.getCurrentService() myinfo = service and service.info() if myinfo is not None: isCrypt = myinfo.getInfo(iServiceInformation.sIsCrypted) == 1 feinfo = service.frontendInfo() frontendData = feinfo and feinfo.getAll(True) if frontendData is not None: ttype = frontendData.get('tuner_type', 'UNKNOWN') if ttype == 'DVB-S': fedata = ConvertToHumanReadable(frontendData) sr = str(int(frontendData.get('symbol_rate', 0) / 1000)) freq = str(int(frontendData.get('frequency', 0) / 1000)) pol = {0: 'H', 1: 'V', 2: 'CL', 3: 'CR', 4: None}[frontendData.get('polarization', 'HORIZONTAL')] fec = fedata.get('fec_inner', ' ') self['nfreq_info'].setText('Freq: ' + freq + ' ' + pol + ' Sr: ' + sr + ' ' + fec) orbital = fedata['orbital_position'] self['orbital_pos'].setText(orbital) elif ttype == 'DVB-T': fedata = ConvertToHumanReadable(frontendData) freq = str(int(frontendData.get('frequency', 0) / 1000)) band = fedata.get('bandwidth', ' ') orbital = fedata.get('tuner_type') self['orbital_pos'].setText(orbital) self['nfreq_info'].setText('Freq: ' + freq + ', Band: ' + band) elif ttype == 'DVB-C': fedata = ConvertToHumanReadable(frontendData) sr = str(int(frontendData.get('symbol_rate', 0) / 1000)) freq = str(int(frontendData.get('frequency', 0) / 1)) qam = fedata.get('modulation') orbital = fedata.get('tuner_type') self['orbital_pos'].setText(orbital) self['nfreq_info'].setText('Freq: ' + freq + ', ' + qam + ', Sr: ' + sr) if isCrypt == True: self['button_fta'].hide() Caids = myinfo.getInfoObject(iServiceInformation.sCAIDs) for caid in Caids: caidname = self.parse_caid_txt(caid) self.show_emm(caidname) self.my_timer_count = 0 self.__updateEmuInfo()
def getFEData(self, frontendDataOrg): if frontendDataOrg and len(frontendDataOrg): frontendData = ConvertToHumanReadable(frontendDataOrg) if frontendDataOrg['tuner_type'] == 'DVB-S': t2mi = lambda x: (None if x == -1 else str(x)) return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('System'), frontendData['system'], TYPE_TEXT), (_('Modulation'), frontendData['modulation'], TYPE_TEXT), (_('Orbital position'), frontendData['orbital_position'], TYPE_VALUE_DEC), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Symbol rate'), frontendData['symbol_rate'], TYPE_VALUE_DEC), (_('Polarization'), frontendData['polarization'], TYPE_TEXT), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('FEC'), frontendData['fec_inner'], TYPE_TEXT), (_('Pilot'), frontendData.get('pilot', None), TYPE_TEXT), (_('Roll-off'), frontendData.get('rolloff', None), TYPE_TEXT), (_('Input Stream ID'), frontendData.get('is_id', 0), TYPE_VALUE_DEC), (_('PLS Mode'), frontendData.get('pls_mode', None), TYPE_TEXT), (_('PLS Code'), frontendData.get('pls_code', 0), TYPE_VALUE_DEC), (_('T2MI PLP ID'), t2mi(frontendData.get('t2mi_plp_id', -1)), TYPE_TEXT), (_('T2MI PID'), None if frontendData.get('t2mi_plp_id', -1) == -1 else str( frontendData.get( 't2mi_pid', eDVBFrontendParametersSatellite. T2MI_Default_Pid)), TYPE_TEXT)) if frontendDataOrg['tuner_type'] == 'DVB-C': return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('Modulation'), frontendData['modulation'], TYPE_TEXT), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Symbol rate'), frontendData['symbol_rate'], TYPE_VALUE_DEC), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('FEC'), frontendData['fec_inner'], TYPE_TEXT)) if frontendDataOrg['tuner_type'] == 'DVB-T': channel = channelnumbers.getChannelNumber( frontendDataOrg['frequency'], frontendDataOrg['tuner_number'] ) if channelnumbers.supportedChannels( frontendDataOrg['tuner_number']) else None return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Channel'), channel, TYPE_VALUE_DEC), (_('Inversion'), frontendData['inversion'], TYPE_TEXT), (_('Bandwidth'), frontendData['bandwidth'], TYPE_VALUE_DEC), (_('Code rate LP'), frontendData['code_rate_lp'], TYPE_TEXT), (_('Code rate HP'), frontendData['code_rate_hp'], TYPE_TEXT), (_('Constellation'), frontendData['constellation'], TYPE_TEXT), (_('Transmission mode'), frontendData['transmission_mode'], TYPE_TEXT), (_('Guard interval'), frontendData['guard_interval'], TYPE_TEXT), (_('Hierarchy info'), frontendData['hierarchy_information'], TYPE_TEXT)) if frontendDataOrg['tuner_type'] == 'ATSC': return ((_('NIM'), chr(ord('A') + frontendData['tuner_number']), TYPE_TEXT), (_('Type'), frontendData['tuner_type'], TYPE_TEXT), (_('System'), frontendData['system'], TYPE_TEXT), (_('Modulation'), frontendData['modulation'], TYPE_TEXT), (_('Frequency'), frontendData['frequency'], TYPE_VALUE_DEC), (_('Inversion'), frontendData['inversion'], TYPE_TEXT)) return []
def getText(self): service = self.source.service info = service and service.info() if not info: return "" if self.type == self.XRES: return self._getVideoWidthStr(info) elif self.type == self.YRES: return self._getVideoHeightStr(info) elif self.type == self.APID: return self.getServiceInfoString(info, iServiceInformation.sAudioPID) elif self.type == self.VPID: return self.getServiceInfoString(info, iServiceInformation.sVideoPID) elif self.type == self.PCRPID: return self.getServiceInfoString(info, iServiceInformation.sPCRPID) elif self.type == self.PMTPID: return self.getServiceInfoString(info, iServiceInformation.sPMTPID) elif self.type == self.TXTPID: return self.getServiceInfoString(info, iServiceInformation.sTXTPID) elif self.type == self.TSID: return self.getServiceInfoString(info, iServiceInformation.sTSID) elif self.type == self.ONID: return self.getServiceInfoString(info, iServiceInformation.sONID) elif self.type == self.SID: return self.getServiceInfoString(info, iServiceInformation.sSID) elif self.type == self.FRAMERATE: return self._getFrameRateStr(info, convert=lambda x: "%d fps" % ((x + 500) / 1000)) elif self.type == self.PROGRESSIVE: return self._getProgressiveStr(info) elif self.type == self.TRANSFERBPS: return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: "%d kB/s" % (x / 1024)) elif self.type == self.HAS_HBBTV: return info.getInfoString(iServiceInformation.sHBBTVUrl) elif self.type == self.FREQ_INFO: feinfo = service.frontendInfo() if feinfo is None: return "" feraw = feinfo.getAll(False) if feraw is None: return "" fedata = ConvertToHumanReadable(feraw) if fedata is None: return "" frequency = fedata.get("frequency") sr_txt = "Sr:" polarization = fedata.get("polarization_abbreviation") if polarization is None: polarization = "" symbolrate = str(int(fedata.get("symbol_rate", 0))) if symbolrate == "0": sr_txt = "" symbolrate = "" fec = fedata.get("fec_inner") if fec is None: fec = "" out = "Freq: %s %s %s %s %s" % (frequency, polarization, sr_txt, symbolrate, fec) return out elif self.type == self.VIDEO_INFO: progressive = self._getProgressiveStr(info) fieldrate = self._getFrameRate(info) if fieldrate > 0: if progressive == 'i': fieldrate *= 2 fieldrate = "%dHz" % ((fieldrate + 500) / 1000,) else: fieldrate = "" return "%sx%s%s %s" % (self._getVideoWidthStr(info), self._getVideoHeightStr(info), progressive, fieldrate) return ""
def changed(self, what): if self.instance: if (what[0] == self.CHANGED_CLEAR): self.text = " " else: service = self.source.service info = eServiceCenter.getInstance().info(service) if (info and service): tp = info.getInfoObject( service, iServiceInformation.sTransponderData) tpinfo = ConvertToHumanReadable(tp) refstr = str(self.source.service.toString()) curref = refstr.replace("%3a", ":") streamtype = streamurl = freq = terra = ch = pol = sys = mod = const = fec = sr = orbpos = "" try: if curref.startswith("1:7:"): curref = "" if "%3a/" in refstr or ":/" in refstr: strurl = refstr.split(":") streamurl = strurl[10].replace("%3a", ":") if refstr.startswith("1:0:2"): streamtype = "Radio" elif not curref.startswith( "1:0:") and "%3a/" in refstr: streamtype = "Stream" elif curref.startswith("1:0:") and "%3a/" in refstr: if "0.0.0.0:" in curref or "127.0.0.1:" in curref or "localhost:" in curref: streamtype = "TS Relay" else: streamtype = "TS Stream" elif curref.startswith("1:134:"): streamtype = "Alternative" else: streamurl = streamtype = "" if "channel" in tpinfo: try: ch = (str(tpinfo.get("channel")) + "/") except: ch = " " if "system" in tp: try: sys = (str(tpinfo.get("system")) + " ") if "DVB-S" in sys or "DVB-C" in sys: freq = (str(int(tp["frequency"]) / 1000) + " ") elif "DVB-T" in sys or "ATSC" in sys: terra = ( str(int(tp["frequency"]) / 1000000) + " Mhz ") else: freq = terra = " " except: sys = " N/A " if "modulation" in tp: try: mod = (str(tpinfo.get("modulation")) + " ") except: mod = " " if "polarization" in tp: try: pol = { eDVBFrontendParametersSatellite.Polarisation_Horizontal: "H ", eDVBFrontendParametersSatellite.Polarisation_Vertical: "V ", eDVBFrontendParametersSatellite.Polarisation_CircularLeft: "L ", eDVBFrontendParametersSatellite.Polarisation_CircularRight: "R " }[tp["polarization"]] except: pol = " N/A " if "constellation" in tp: try: const = (str(tpinfo.get("constellation")) + " ") except: const = " " if "fec_inner" in tp: try: fec = (str(tpinfo.get("fec_inner")) + " ") except: fec = " N/A " if "symbol_rate" in tp: sr = (str(int(tp["symbol_rate"]) / 1000) + " ") if "orbital_position" in tp: orbpos = (int(tp["orbital_position"])) if orbpos > 1800: orbpos = (str( (float(3600 - orbpos)) / 10.0) + "°W ") else: orbpos = (str((float(orbpos)) / 10.0) + "°E ") except: pass self.text = (streamtype + " " + streamurl + orbpos + ch + freq + terra + pol + sys + mod + sr + fec + const)