-from enigma import eTimer, eDVBSatelliteEquipmentControl, eDVBResourceManager, eDVBDiseqcCommand, eDVBResourceManagerPtr, iDVBChannelPtr, iDVBFrontendPtr, iDVBFrontend, eDVBFrontendParametersSatellite, eDVBFrontendParameters
+from enigma import eTimer, eDVBResourceManager,\
+ eDVBFrontendParametersSatellite, eDVBFrontendParameters
+
from Screens.Screen import Screen
from Screens.ScanSetup import ScanSetup
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.Label import Label
-from Components.ConfigList import ConfigList
from Components.TunerInfo import TunerInfo
from Components.ActionMap import ActionMap
from Components.NimManager import nimmanager, getConfigSatlist
from Components.MenuList import MenuList
-from Components.config import ConfigSelection, ConfigSatlist, getConfigListEntry
+from Components.config import ConfigSelection, getConfigListEntry
class Tuner:
def __init__(self, frontend):
</screen>"""
def openFrontend(self):
- res_mgr = eDVBResourceManagerPtr()
- if eDVBResourceManager.getInstance(res_mgr) == 0:
- self.raw_channel = iDVBChannelPtr()
- if res_mgr.allocateRawChannel(self.raw_channel, self.feid) == 0:
- self.frontend = iDVBFrontendPtr()
- if self.raw_channel.getFrontend(self.frontend) == 0:
+ res_mgr = eDVBResourceManager.getInstance()
+ if res_mgr:
+ self.raw_channel = res_mgr.allocateRawChannel(self.feid)
+ if self.raw_channel:
+ self.frontend = self.raw_channel.getFrontend()
+ if self.frontend:
return True
else:
print "getFrontend failed"
print "getResourceManager instance failed"
return False
- def getFrontend(self):
- return self.frontend
-
def __init__(self, session, feid):
self.initcomplete = False
self.feid = feid
self.oldref = None
+ self.frontendStatus = { }
if not self.openFrontend():
self.oldref = session.nav.getCurrentlyPlayingServiceReference()
del session.pip
if not self.openFrontend():
self.frontend = None # in normal case this should not happen
- self.getFrontend = None
-
+
ScanSetup.__init__(self, session)
self.tuner = Tuner(self.frontend)
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["introduction"].setText("")
-
+
self.statusTimer = eTimer()
self.statusTimer.timeout.get().append(self.updateStatus)
self.statusTimer.start(50, False)
-
self.initcomplete = True
- self.session = session
def updateStatus(self):
+ if self.frontend:
+ self.frontend.getFrontendStatus(self.frontendStatus)
+ else:
+ self.frontendStatus.clear()
self["snr_percentage"].update()
self["agc_percentage"].update()
self["ber_value"].update()
def __init__(self, session):
Screen.__init__(self, session)
- nimlist = nimmanager.getNimListOfType(nimmanager.nimType["DVB-S"])
+ nimlist = nimmanager.getNimListOfType("DVB-S")
nimMenuList = []
for x in nimlist:
- nimMenuList.append((_("NIM ") + (["A", "B", "C", "D"][x]) + ": " + nimmanager.getNimName(x) + " (" + nimmanager.getNimTypeName(x) + ")", x))
-
+ nimMenuList.append((nimmanager.nim_slots[x].friendly_full_description, x))
+
self["nimlist"] = MenuList(nimMenuList)
self["actions"] = ActionMap(["OkCancelActions"],
}, -1)
def okbuttonClick(self):
- selection = self["nimlist"].getCurrent()
- self.session.open(Satfinder, selection[1])
+ selection = self["nimlist"].getCurrent()[1]
+ self.session.open(Satfinder, selection)
def SatfinderMain(session, **kwargs):
- nimList = nimmanager.getNimListOfType(nimmanager.nimType["DVB-S"])
+ nimList = nimmanager.getNimListOfType("DVB-S")
if len(nimList) == 0:
session.open(MessageBox, _("No satellite frontend found!!"), MessageBox.TYPE_ERROR)
else:
return []
def Plugins(**kwargs):
- return PluginDescriptor(name=_("Satfinder"), description="Helps setting up your dish", where = PluginDescriptor.WHERE_SETUP, fnc=SatfinderStart)
+ if (nimmanager.hasNimType("DVB-T")):
+ return PluginDescriptor(name=_("Satfinder"), description="Helps setting up your dish", where = PluginDescriptor.WHERE_SETUP, fnc=SatfinderStart)
+ else:
+ return []