本文整理汇总了Python中Tools.Transponder.ConvertToHumanReadable类的典型用法代码示例。如果您正苦于以下问题:Python ConvertToHumanReadable类的具体用法?Python ConvertToHumanReadable怎么用?Python ConvertToHumanReadable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConvertToHumanReadable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getFEData
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 []
示例2: getText
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 ""
示例3: information
def information(self):
if self.type == TYPE_SERVICE_INFO:
if self.session.nav.getCurrentlyPlayingServiceReference():
name = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference()).getServiceName()
refstr = self.session.nav.getCurrentlyPlayingServiceReference().toString()
else:
name = _("N/A")
refstr = _("N/A")
aspect = self.getServiceInfoValue(iServiceInformation.sAspect)
if aspect in ( 1, 2, 5, 6, 9, 0xA, 0xD, 0xE ):
aspect = _("4:3")
else:
aspect = _("16:9")
width = self.info and self.info.getInfo(iServiceInformation.sVideoWidth) or -1
height = self.info and self.info.getInfo(iServiceInformation.sVideoHeight) or -1
if width != -1 and height != -1:
Labels = ( (_("Name"), name, TYPE_TEXT),
(_("Provider"), self.getServiceInfoValue(iServiceInformation.sProvider), TYPE_TEXT),
(_("Aspect ratio"), aspect, TYPE_TEXT),
(_("Resolution"), "%dx%d" %(width, height), TYPE_TEXT),
(_("Namespace"), self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8),
(_("Service reference"), refstr, TYPE_TEXT))
else:
Labels = ( (_("Name"), name, TYPE_TEXT),
(_("Provider"), self.getServiceInfoValue(iServiceInformation.sProvider), TYPE_TEXT),
(_("Aspect ratio"), aspect, TYPE_TEXT),
(_("Namespace"), self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8),
(_("Service reference"), refstr, TYPE_TEXT))
self.fillList(Labels)
else:
if self.transponder_info:
tp_info = ConvertToHumanReadable(self.transponder_info)
conv = { "tuner_type" : _("Type"),
"system" : _("System"),
"modulation" : _("Modulation"),
"orbital_position" : _("Orbital position"),
"frequency" : _("Frequency"),
"symbol_rate" : _("Symbol rate"),
"bandwidth" : _("Bandwidth"),
"polarization" : _("Polarization"),
"inversion" : _("Inversion"),
"pilot" : _("Pilot"),
"rolloff" : _("Roll-off"),
"fec_inner" : _("FEC"),
"code_rate_lp" : _("Code rate LP"),
"code_rate_hp" : _("Code rate HP"),
"constellation" : _("Constellation"),
"transmission_mode" : _("Transmission mode"),
"guard_interval" : _("Guard interval"),
"hierarchy_information" : _("Hierarchy info"),
"plp_id" : _("Stream Id"),
"is_id" : _("Stream Id"),
"pls_mode" : _("PLS Mode"),
"pls_code" : _("PLS Code")}
Labels = [(conv[i], tp_info[i], TYPE_VALUE_DEC) for i in tp_info.keys()]
self.fillList(Labels)
示例4: getFEData
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 [ ]
示例5: getFEData
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_DEC),
(_("Symbol rate"), frontendData["symbol_rate"], TYPE_VALUE_DEC),
(_("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))
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),
(_("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_DEC),
(_("Inversion"), frontendData["inversion"], TYPE_TEXT))
return [ ]
示例6: information
def information(self):
if self.type is TYPE_SERVICE_INFO:
if self.session.nav.getCurrentlyPlayingServiceOrGroup():
name = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference()).getServiceName()
refstr = self.session.nav.getCurrentlyPlayingServiceReference().toString()
else:
name = _("N/A")
refstr = _("N/A")
aspect = "-"
videocodec = "-"
resolution = "-"
if self.info:
videocodec = ("MPEG2", "MPEG4", "MPEG1", "MPEG4-II", "VC1", "VC1-SM", "-" )[self.info and self.info.getInfo(iServiceInformation.sVideoType)]
width = self.info.getInfo(iServiceInformation.sVideoWidth)
height = self.info.getInfo(iServiceInformation.sVideoHeight)
if width > 0 and height > 0:
resolution = "%dx%d " % (width,height)
resolution += str((self.info.getInfo(iServiceInformation.sFrameRate) + 500) / 1000)
aspect = self.getServiceInfoValue(iServiceInformation.sAspect)
if aspect in ( 1, 2, 5, 6, 9, 0xA, 0xD, 0xE ):
aspect = "4:3"
else:
aspect = "16:9"
Labels = ( (_("Name"), name, TYPE_TEXT),
(_("Provider"), self.getServiceInfoValue(iServiceInformation.sProvider), TYPE_TEXT),
(_("Videoformat"), aspect, TYPE_TEXT),
(_("Videosize"), resolution, TYPE_TEXT),
(_("Videocodec"), videocodec, TYPE_TEXT),
(_("Namespace"), self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8),
(_("Service reference"), refstr, TYPE_TEXT))
self.fillList(Labels)
else:
if self.transponder_info:
tp_info = ConvertToHumanReadable(self.transponder_info)
conv = { "tuner_type" : _("Transponder type"),
"system" : _("System"),
"modulation" : _("Modulation"),
"orbital_position" : _("Orbital position"),
"frequency" : _("Frequency"),
"symbol_rate" : _("Symbol rate"),
"bandwidth" : _("Bandwidth"),
"polarization" : _("Polarization"),
"inversion" : _("Inversion"),
"pilot" : _("Pilot"),
"rolloff" : _("Roll-off"),
"is_id" : _("Input Stream ID"),
"pls_mode" : _("PLS Mode"),
"pls_code" : _("PLS Code"),
"fec_inner" : _("FEC"),
"code_rate_lp" : _("Coderate LP"),
"code_rate_hp" : _("Coderate HP"),
"constellation" : _("Constellation"),
"transmission_mode" : _("Transmission mode"),
"guard_interval" : _("Guard interval"),
"hierarchy_information": _("Hierarchy information"),
"plp_id" : _("PLP ID") }
Labels = [(conv[i], tp_info[i], i == "orbital_position" and TYPE_VALUE_ORBIT_DEC or TYPE_VALUE_DEC) for i in tp_info.keys() if i in conv]
self.fillList(Labels)
示例7: tuningChangedTo
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")))
示例8: updateStatus
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)
示例9: getFEData
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 [ ]
示例10: getFEData
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 [ ]
示例11: getFEData
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 [ ]
示例12: getFEData
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 []
示例13: updateStatus
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()
示例14: getFEData
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 [ ]
示例15: getTunerInfo
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 ""