from enigma import eTimer, eDVBSatelliteEquipmentControl, eDVBResourceManager, \
- eDVBDiseqcCommand, eDVBFrontendParametersSatellite, eDVBFrontendParameters
+ eDVBDiseqcCommand, eDVBFrontendParametersSatellite, eDVBFrontendParameters,\
+ iDVBFrontend
from Screens.Screen import Screen
from Screens.ScanSetup import ScanSetup
del session.pip
if not self.openFrontend():
self.frontend = None # in normal case this should not happen
- self.getFrontend = None
-
+
+ self.frontendStatus = { }
+
self.diseqc = Diseqc(self.frontend)
self.tuner = Tuner(self.frontend)
self.tuner.tune((0,0,0,0,0,0))
self["agc"] = Label()
self["ber"] = Label()
self["lock"] = Label()
- self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, frontendfkt = self.getFrontend)
- self["agc_percentage"] = TunerInfo(TunerInfo.AGC_PERCENTAGE, frontendfkt = self.getFrontend)
- self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE, frontendfkt = self.getFrontend)
- self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR, frontendfkt = self.getFrontend)
- self["agc_bar"] = TunerInfo(TunerInfo.AGC_BAR, frontendfkt = self.getFrontend)
- self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR, frontendfkt = self.getFrontend)
- self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE, frontendfkt = self.getFrontend)
+ self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, statusDict = self.frontendStatus)
+ self["agc_percentage"] = TunerInfo(TunerInfo.AGC_PERCENTAGE, statusDict = self.frontendStatus)
+ self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE, statusDict = self.frontendStatus)
+ self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR, statusDict = self.frontendStatus)
+ self["agc_bar"] = TunerInfo(TunerInfo.AGC_BAR, statusDict = self.frontendStatus)
+ self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR, statusDict = self.frontendStatus)
+ self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE, statusDict = self.frontendStatus)
self["frequency"] = Label()
self["symbolrate"] = Label()
else:
self.restartPrevService(False)
- def getFrontend(self):
- return self.frontend
-
def openFrontend(self):
res_mgr = eDVBResourceManager.getInstance()
if res_mgr:
self.tuner.retune()
def updateStatus(self):
+ if self.frontend:
+ self.frontend.getFrontendStatus(self.frontendStatus)
self["snr_percentage"].update()
self["agc_percentage"].update()
self["ber_value"].update()
self["ber_bar"].update()
self["lock_state"].update()
transponderdata = self.tuner.getTransponderData()
- self["frequency_value"].setText(str(transponderdata["frequency"]))
- self["symbolrate_value"].setText(str(transponderdata["symbol_rate"]))
- self["fec_value"].setText(str(transponderdata["fec_inner"]))
- if transponderdata["tuner_locked"] == 1 and self.isMoving and self.stopOnLock:
+ 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
print "diseqc command:",
print string
cmd.setCommandString(string)
+ self.frontend.setTone(iDVBFrontend.toneOff)
+ sleep(0.015) # wait 15msec after disable tone
self.frontend.sendDiseqc(cmd)
if string == 'e03160': #positioner stop
sleep(0.05)
self.frontend.tune(self.lastparm)
def getTransponderData(self):
+ ret = { }
if self.frontend:
- return self.frontend.readTransponderData(True)
- return None
+ self.frontend.getTransponderData(ret, True)
+ return ret
tuning = None
nimlist = nimmanager.getNimListOfType(nimmanager.nimType["DVB-S"])
nimMenuList = []
for x in nimlist:
- nimMenuList.append((_("NIM ") + (["A", "B", "C", "D"][x]) + ": " + nimmanager.getNimName(x) + " (" + nimmanager.getNimTypeName(x) + ")", x))
+ n = nimmanager.nim_slots[x]
+ nimMenuList.append((n.friendly_full_name, x))
self["nimlist"] = MenuList(nimMenuList)
self.session.open(PositionerSetup, selection[1])
def PositionerMain(session, **kwargs):
- nimList = nimmanager.getNimListOfType(nimmanager.nimType["DVB-S"])
+ nimList = nimmanager.getNimListOfType("DVB-S")
if len(nimList) == 0:
session.open(MessageBox, _("No positioner capable frontend found."), MessageBox.TYPE_ERROR)
else:
else:
session.open(MessageBox, _("No tuner is configured for use with a diseqc positioner!"), MessageBox.TYPE_ERROR)
-def PositionerSetupStart(menuid):
+def PositionerSetupStart(menuid, **kwargs):
if menuid == "scan":
- return [(_("Positioner setup"), PositionerMain)]
+ return [(_("Positioner setup"), PositionerMain, "positioner_setup", None)]
else:
return []
def Plugins(**kwargs):
- return PluginDescriptor(name=_("Positioner setup"), description="Setup your positioner", where = PluginDescriptor.WHERE_SETUP, fnc=PositionerSetupStart)
+ if (nimmanager.hasNimType("DVB-S")):
+ return PluginDescriptor(name=_("Positioner setup"), description="Setup your positioner", where = PluginDescriptor.WHERE_MENU, fnc=PositionerSetupStart)
+ else:
+ return []