Example #1
0
	def canMultiDescramble(self, ref, timer_state=None):
		if self.CI_MULTIDESCRAMBLE is None:
			no_ci = SystemInfo["CommonInterface"]
			if no_ci > 0:
				self.CI_MULTIDESCRAMBLE = False
				for ci in range(no_ci):
					appname = eDVBCI_UI.getInstance().getAppName(ci)
					if appname in self.CI_MULTIDESCRAMBLE_MODULES:
						self.CI_MULTIDESCRAMBLE = True
		elif self.CI_MULTIDESCRAMBLE == False:
			return False
		ref = self.resolveAlternate(ref, timer_state)
		if ref and self.CI_ASSIGNMENT_LIST is not None and len(self.CI_ASSIGNMENT_LIST):
			for x in self.CI_ASSIGNMENT_LIST:
				if ref.toString() in x[1][0]:
					appname = eDVBCI_UI.getInstance().getAppName(x[0])
					if appname in self.CI_MULTIDESCRAMBLE_MODULES:
						return True
			for x in self.CI_ASSIGNMENT_LIST:
				f_providers = x[1][1]
				if len(f_providers):
					providers = []
					for prov in f_providers:
						providers.append(prov[0])
					provider_services_refs = self.getProivderServices(providers)
					if ref in provider_services_refs:
						appname = eDVBCI_UI.getInstance().getAppName(x[0])
						if appname in self.CI_MULTIDESCRAMBLE_MODULES:
							return True
		return False
Example #2
0
	def __init__(self, session, args = 0):

		Screen.__init__(self, session)

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
			{
				"ok": self.greenPressed,
				"cancel": self.close
			}, -1)

		NUM_CI=eDVBCIInterfaces.getInstance().getNumOfSlots()

		print "[CI_Wizzard] FOUND %d CI Slots " % NUM_CI

		self.dlg = None
		self.state = { }
		self.list = [ ]
		if NUM_CI > 0:
			for slot in range(NUM_CI):
				state = eDVBCI_UI.getInstance().getState(slot)
				if state != -1:
					if  state == 1:
						appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
					elif state == 2:
						appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
					self.list.append( (appname, ConfigNothing(), 0, slot) )
		else:
			self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["CiList"] = menuList
		self.onShown.append(self.setWindowTitle)
Example #3
0
    def updateState(self, slot):
        state = eDVBCI_UI.getInstance().getState(slot)
        self.state[slot] = state
        slotidx = 0
        while len(self.list[slotidx]) < 3 or self.list[slotidx][3] != slot:
            slotidx += 1

        slotidx += 1
        slotidx += 1
        if state == 0:
            self.list[slotidx] = (_('no module found'),
             ConfigNothing(),
             2,
             slot)
        elif state == 1:
            self.list[slotidx] = (_('init module'),
             ConfigNothing(),
             2,
             slot)
        elif state == 2:
            appname = eDVBCI_UI.getInstance().getAppName(slot)
            self.list[slotidx] = (appname,
             ConfigNothing(),
             2,
             slot)
        lst = self['entries']
        lst.list = self.list
        lst.l.setList(self.list)
Example #4
0
	def __init__(self):
		self.session = None
		self.ci = { }
		self.dlgs = { }
		self.auto_close = False
		eDVBCI_UI.getInstance().ciStateChanged.get().append(self.ciStateChanged)
		if getBoxType() in ('vuzero'):
			SystemInfo["CommonInterface"] = False
		else:
			SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots() > 0
		try:
			file = open("/proc/stb/tsmux/ci0_tsclk", "r")
			file.close()
			SystemInfo["CommonInterfaceSupportsHighBitrates"] = True
		except:
			SystemInfo["CommonInterfaceSupportsHighBitrates"] = False
		try:
			file = open("/proc/stb/tsmux/rmx_delay", "r")
			file.close()
			SystemInfo["CommonInterfaceCIDelay"] = True
		except:
			SystemInfo["CommonInterfaceCIDelay"] = False
		try:
			file = open("/proc/stb/tsmux/ci0_relevant_pids_routing", "r")
			file.close()
			SystemInfo["RelevantPidsRoutingSupport"] = True
		except:
			SystemInfo["RelevantPidsRoutingSupport"] = False
Example #5
0
File: Ci.py Project: OpenLD/enigma2
	def __init__(self):
		self.session = None
		self.auto_close = False
		self.ci = { }
		self.dlgs = { }
		eDVBCI_UI.getInstance().ciStateChanged.get().append(self.ciStateChanged)
		SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots() > 0
		SystemInfo["CommonInterfaceSupportsHighBitrates"] = fileCheck("/proc/stb/tsmux/ci0_tsclk")
		SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
Example #6
0
	def cam_state(self):
		if self.camstep == 1:
			slot = 0
			state = eDVBCI_UI.getInstance().getState(slot)
			print '-1-stat',state
			if state > 0:
				self.camstep=2
				self.camtimer.start(100,True)
			else:
				self.session.nav.stopService()
				self.session.open( MessageBox, _("NO_CAM1_NOT_INSERTED"), MessageBox.TYPE_ERROR)
				self.rlist[self["testlist"].getCurrent()[1]]="fail"
				self.tunemsgtimer.stop()
#				self.rlist[index]="fail"
#				self["resultlist"].updateList(self.rlist)
		elif self.camstep == 2:
			slot = 0
			appname = eDVBCI_UI.getInstance().getAppName(slot)
			print 'appname',appname
			if appname is None:
				self.session.nav.stopService()
				self.session.open( MessageBox, _("NO_GET_APPNAME"), MessageBox.TYPE_ERROR)
				self.rlist[self["testlist"].getCurrent()[1]]="fail"
				self.tunemsgtimer.stop()				
			else:
				self.camstep=3
				self.camtimer.start(100,True)		
		elif self.camstep==3:
			slot = 1
			state = eDVBCI_UI.getInstance().getState(slot)
			print '-2-stat',state
			if state > 0:
				self.camstep=4
				self.camtimer.start(100,True)
			else:
				self.session.nav.stopService()
				self.session.open( MessageBox, _("NO_CAM2_NOT_INSERTED"), MessageBox.TYPE_ERROR)
				self.rlist[self["testlist"].getCurrent()[1]]="fail"
				self.tunemsgtimer.stop()				
#				self.rlist[index]="fail"
#				self["resultlist"].updateList(self.rlist)
		elif self.camstep == 4:
			slot = 1
			appname = eDVBCI_UI.getInstance().getAppName(slot)
			print 'appname',appname
			if appname is None:
				self.session.nav.stopService()
				self.session.open( MessageBox, _("NO_GET_APPNAME"), MessageBox.TYPE_ERROR)
				self.rlist[self["testlist"].getCurrent()[1]]="fail"
				self.tunemsgtimer.stop()				
			else:
				self.setSource()
				self.camstep = 5
				self.session.open( MessageBox, _("CAM OK!"), MessageBox.TYPE_INFO,2)
Example #7
0
	def okbuttonClick(self):
		cur = self["entries"].getCurrent()
		if cur and len(cur) > 2:
			action = cur[2]
			slot = cur[3]
			if action == 0:		#reset
				eDVBCI_UI.getInstance().setReset(slot)
			elif action == 1:		#init
				eDVBCI_UI.getInstance().setInit(slot)
			elif self.state[slot] == 2:
				self.dlg = self.session.openWithCallback(self.dlgClosed, MMIDialog, slot, action)
Example #8
0
	def __init__(self):
		self.session = None
		self.ci = { }
		self.dlgs = { }
		eDVBCI_UI.getInstance().ciStateChanged.get().append(self.ciStateChanged)
		SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots() > 0
		try:
			file = open("/proc/stb/tsmux/ci0_tsclk", "r")
			file.close()
			SystemInfo["CommonInterfaceSupportsHighBitrates"] = True
		except:
			SystemInfo["CommonInterfaceSupportsHighBitrates"] = False
Example #9
0
	def __init__(self, session, args = 0):
		self.skin = CIselectMainMenu.skin
		Screen.__init__(self, session)
		#--->
		#---<
		#+++>
		appname = ""
		#+++<	
		
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Config"))

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
			{
				"green": self.greenPressed,
				"red": self.redPressed,
				"yellow": self.yellowPressed,
				"ok": self.greenPressed,
				"cancel": self.cancel
			}, -1)

		NUM_CI=eDVBCIInterfaces.getInstance().getNumOfSlots()

		print "[CI_Wizzard] FOUND %d CI Slots " % NUM_CI

		self.dlg = None
		self.state = { }
		self.list = [ ]
		if NUM_CI > 0:
			for slot in range(NUM_CI):
				state = eDVBCI_UI.getInstance().getState(slot)
				#--->
				#-if state == 0:
				#---<
				#+++>
				if state == 0 or state == -1:
				#+++<	
					appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
				elif state == 1:	
					appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
				elif state == 2:
					appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
				self.list.append( (appname, ConfigNothing(), 0, slot) )
		else:
			self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["CiList"] = menuList
		self.onShown.append(self.setWindowTitle)
Example #10
0
 def appendEntries(self, slot, state):
     self.state[slot] = state
     self.list.append((_('Reset'),
      ConfigNothing(),
      0,
      slot))
     self.list.append((_('Init'),
      ConfigNothing(),
      1,
      slot))
     if self.state[slot] == 0:
         self.list.append((_('no module found'),
          ConfigNothing(),
          2,
          slot))
     elif self.state[slot] == 1:
         self.list.append((_('init module'),
          ConfigNothing(),
          2,
          slot))
     elif self.state[slot] == 2:
         appname = eDVBCI_UI.getInstance().getAppName(slot)
         self.list.append((appname,
          ConfigNothing(),
          2,
          slot))
     self.list.append(getConfigListEntry(_('Multiple service support'), config.ci[slot].canDescrambleMultipleServices))
     if SystemInfo['CommonInterfaceSupportsHighBitrates']:
         self.list.append(getConfigListEntry(_('High bitrate support'), config.ci[slot].canHandleHighBitrates))
Example #11
0
    def cancel(self):
        for slot in range(MAX_NUM_CI):
            state = eDVBCI_UI.getInstance().getState(slot)
            if state != -1:
                CiHandler.unregisterCIMessageHandler(slot)

        self.close()
Example #12
0
 def __init__(self, session, slotid, action, handler = eDVBCI_UI.getInstance(), wait_text = _('wait for ci...')):
     Screen.__init__(self, session)
     print 'MMIDialog with action' + str(action)
     self.mmiclosed = False
     self.tag = None
     self.slotid = slotid
     self.timer = eTimer()
     self.timer.callback.append(self.keyCancel)
     self['title'] = Label('')
     self['subtitle'] = Label('')
     self['bottom'] = Label('')
     self['entries'] = ConfigList([])
     self['actions'] = NumberActionMap(['SetupActions'], {'ok': self.okbuttonClick,
      'cancel': self.keyCancel,
      'left': self.keyLeft,
      'right': self.keyRight,
      '1': self.keyNumberGlobal,
      '2': self.keyNumberGlobal,
      '3': self.keyNumberGlobal,
      '4': self.keyNumberGlobal,
      '5': self.keyNumberGlobal,
      '6': self.keyNumberGlobal,
      '7': self.keyNumberGlobal,
      '8': self.keyNumberGlobal,
      '9': self.keyNumberGlobal,
      '0': self.keyNumberGlobal}, -1)
     self.action = action
     self.handler = handler
     self.wait_text = wait_text
     if action == 2:
         handler.startMMI(self.slotid)
         self.showWait()
     elif action == 3:
         self.showScreen()
     return
Example #13
0
	def appendEntries(self, slot, state):
		self.state[slot] = state
		self.list.append((_("Reset"), ConfigNothing(), 0, slot))
		self.list.append((_("Init"), ConfigNothing(), 1, slot))

		if self.state[slot] == 0: #no module
			self["key_blue"].hide()
			self["pixmap_blue"].hide()
			self.list.append((_("no module found"), ConfigNothing(), 2, slot))
		elif self.state[slot] == 1: #module in init
			self["key_blue"].show()
			self["pixmap_blue"].show()
			self.list.append((_("init module"), ConfigNothing(), 2, slot))
		elif self.state[slot] == 2: #module ready
			self["key_blue"].show()
			self["pixmap_blue"].show()
			appname = eDVBCI_UI.getInstance().getAppName(slot)
			self.list.append((appname, ConfigNothing(), 2, slot))
		self.list.append(getConfigListEntry(_("Set pin code persistent"), config.ci[slot].use_static_pin))
		self.list.append((_("Enter persistent PIN code"), ConfigNothing(), 5, slot))
		self.list.append((_("Reset persistent PIN code"), ConfigNothing(), 6, slot))
		self.list.append(getConfigListEntry(_("Show CI messages"), config.ci[slot].show_ci_messages))
		self.list.append(getConfigListEntry(_("Multiple service support"), config.ci[slot].canDescrambleMultipleServices))
		if SystemInfo["CI%dSupportsHighBitrates" % slot]:
			self.list.append(getConfigListEntry(_("High bitrate support"), config.ci[slot].canHandleHighBitrates))
		if SystemInfo["CI%dRelevantPidsRoutingSupport" % slot]:
			self.list.append(getConfigListEntry(_("Relevant PIDs routing"), config.ci[slot].relevantPidsRouting))
		if SystemInfo["CommonInterfaceCIDelay"]:
			self.list.append(getConfigListEntry(_("DVB CI Delay"), config.cimisc.dvbCiDelay))
Example #14
0
File: Ci.py Project: OpenLD/enigma2
	def ciStateChanged(self, slot):
		if slot in self.ci:
			self.ci[slot](slot)
		else:
			handler = eDVBCI_UI.getInstance()
			if slot in self.dlgs:
				self.dlgs[slot].ciStateChanged()
			elif handler.availableMMI(slot) == 1:
				if self.session:
					show_ui = False
					if config.ci[slot].show_ci_messages.value:
						show_ui = True
					screen_data = handler.getMMIScreen(slot)
					if config.ci[slot].use_static_pin.value:
						if screen_data is not None and len(screen_data):
							ci_tag = screen_data[0][0]
							if ci_tag == 'ENQ' and len(screen_data) >= 2 and screen_data[1][0] == 'PIN':
								if str(config.ci[slot].static_pin.value) == "0":
									show_ui = True
								else:
									answer = str(config.ci[slot].static_pin.value)
									length = len(answer)
									while length < config.ci[slot].static_pin.getLength():
										answer = '0' + answer
										length+=1
									handler.answerEnq(slot, answer)
									show_ui = False
									self.auto_close = True
							elif ci_tag == 'CLOSE' and self.auto_close:
								show_ui = False
								self.auto_close = False
					if show_ui and not forceNotShowCiMessages and not Screens.Standby.inStandby:
						self.dlgs[slot] = self.session.openWithCallback(self.dlgClosed, MMIDialog, slot, 3, screen_data = screen_data)
Example #15
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions"],
			{
				"left": self.keyLeft,
				"right": self.keyLeft,
				"ok": self.okbuttonClick,
				"cancel": self.cancel
			},-1)

		self.dlg = None
		self.state = { }
		self.list = [ ]

		for slot in range(MAX_NUM_CI):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state != -1:
				self.appendEntries(slot, state)
				CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["entries"] = menuList
		self["entries"].onSelectionChanged.append(self.selectionChanged)
		self["text"] = Label(_("Slot %d")%(1))
Example #16
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions", "ColorActions"],
			{
				"blue": self.CIAssignment,
				"left": self.keyLeft,
				"right": self.keyLeft,
				"ok": self.okbuttonClick,
				"cancel": self.cancel
			},-1)

		self.dlg = None
		self.state = { }
		self.list = [ ]
		self["key_blue"] = Label(_("CI assignment"))
		self["key_blue"].hide()
		self["pixmap_blue"] = Pixmap()
		self["pixmap_blue"].hide()

		for slot in range(SystemInfo["CommonInterface"]):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state != -1:
				self.appendEntries(slot, state)
				CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["entries"] = menuList
		self["entries"].onSelectionChanged.append(self.selectionChanged)
		self["text"] = Label(_("Slot %d")%(1))
		self.onLayoutFinish.append(self.layoutFinished)
Example #17
0
	def updateEntries(self):
		self.list = []
		self.entryData = []
		for slot in self.slots:
			self.addToList((_("Reset"), ConfigNothing()), 0, slot)
			self.addToList((_("Init"), ConfigNothing()), 1, slot)

			if self.state[slot] == 0:                       #no module
				self.addToList((_("no module found"), ConfigNothing()), 2, slot)
			elif self.state[slot] == 1:             #module in init
				self.addToList((_("init module"), ConfigNothing()), 2, slot)
			elif self.state[slot] == 2:             #module ready
				#get appname
				appname = eDVBCI_UI.getInstance().getAppName(slot)
				self.addToList((appname, ConfigNothing()), 2, slot)

			self.addToList(getConfigListEntry(_("Set pin code persistent"), config.ci[slot].use_static_pin), -1, slot)
			self.addToList(( _("Enter persistent PIN code"), ConfigNothing()), 5, slot)
			self.addToList(( _("Reset persistent PIN code"), ConfigNothing()), 6, slot)
			self.addToList(getConfigListEntry(_("Show CI messages"), config.ci[slot].show_ci_messages), -1, slot)
			self.addToList(getConfigListEntry(_("Multiple service support"), config.ci[slot].canDescrambleMultipleServices), -1, slot)

			if SystemInfo["CommonInterfaceSupportsHighBitrates"]:
				self.addToList(self.HighBitrateEntry[slot], -1, slot)
			if SystemInfo["RelevantPidsRoutingSupport"]:
				self.addToList(self.RelevantPidsRoutingEntry[slot], -1, slot)

		self["entries"].list = self.list
		self["entries"].l.setList(self.list)
		if self.selectionChanged not in self["entries"].onSelectionChanged:
			self["entries"].onSelectionChanged.append(self.selectionChanged)
Example #18
0
	def __init__(self):
		Renderer.__init__(self)
		VariableText.__init__(self)
		self.eDVBCIUIInstance = eDVBCI_UI.getInstance()
		self.eDVBCIUIInstance and self.eDVBCIUIInstance.ciStateChanged.get().append(self.ciModuleStateChanged)
		self.NUM_CI = eDVBCIInterfaces.getInstance() and eDVBCIInterfaces.getInstance().getNumOfSlots()
		self.text = ""
		self.allVisible = False
def isModule():
	NUM_CI = eDVBCIInterfaces.getInstance() and eDVBCIInterfaces.getInstance().getNumOfSlots()
	if NUM_CI and NUM_CI > 0:
		for slot in range(NUM_CI):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state > 0:
				return True
	return False
Example #20
0
File: Ci.py Project: OpenLD/enigma2
	def okbuttonClick(self):
		cur = self["entries"].getCurrent()
		if cur and len(cur) > 2:
			action = cur[2]
			slot = cur[3]
			if action == 0: #reset
				eDVBCI_UI.getInstance().setReset(slot)
			elif action == 1: #init
				eDVBCI_UI.getInstance().setInit(slot)
			elif action == 5:
				self.session.openWithCallback(self.cancelCB, PermanentPinEntry, config.ci[slot].static_pin, _("Smartcard PIN"))
			elif action == 6:
				config.ci[slot].static_pin.value = 0
				config.ci[slot].static_pin.save()
				self.session.openWithCallback(self.cancelCB, MessageBox, _("The saved PIN was cleared."), MessageBox.TYPE_INFO)
			elif self.state[slot] == 2:
				self.dlg = self.session.openWithCallback(self.dlgClosed, MMIDialog, slot, action)
Example #21
0
File: Ci.py Project: R0T13Z/enigma2
	def ciStateChanged(self, slot):
		if self.dlg:
			self.dlg.ciStateChanged()
		else:
			state = eDVBCI_UI.getInstance().getState(slot)
			if self.state[slot] != state:
				self.state[slot] = state
				self.updateState(slot)
Example #22
0
	def getCIState(self):
		for slot in (0, 1):
			if os.path.exists("/dev/ci%d" % slot):
				state = eDVBCI_UI.getInstance().getState(slot)
				if state == 1:
					self["ci%d_s" % slot].setText(_(" Getting..."))
					self["ci%d_s" % slot].setForegroundColorNum(0)
				elif state == 2:		#module ready
					self["ci%d_s" % slot].setText(_(" %s" % eDVBCI_UI.getInstance().getAppName(slot)))
					self["ci%d_s" % slot].setForegroundColorNum(1)
					eDVBCI_UI.getInstance().stopMMI(slot)
				else:
					self["ci%d_s" % slot].setText(_(" N/A"))
					self["ci%d_s" % slot].setForegroundColorNum(0)
			else:
				self["ci%d_i" % slot].hide()
				self["ci%d_s" % slot].hide()
Example #23
0
def isModule():
	NUM_CI = SystemInfo["CommonInterface"]
	if NUM_CI and NUM_CI > 0:
		for slot in range(NUM_CI):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state > 0:
				return True
	return False
Example #24
0
	def __init__(self, session, args = 0):

		Screen.__init__(self, session)

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Edit"))

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
			{
				"green": self.greenPressed,
				"red": self.close,
				"ok": self.greenPressed,
				"cancel": self.close
			}, -1)

		if getBoxType() in ('zgemmah9combo'):
			NUM_CI = 1
		else:
			NUM_CI = eDVBCIInterfaces.getInstance() and eDVBCIInterfaces.getInstance().getNumOfSlots()

		print "[CI_Wizzard] FOUND %d CI Slots " % NUM_CI

		self.dlg = None
		self.state = { }
		self.list = [ ]
		if  NUM_CI and NUM_CI > 0:
			for slot in range(NUM_CI):
				state = eDVBCI_UI.getInstance().getState(slot)
				if state != -1:
					appname = _("Slot %d") %(slot+1) + " - " + _("unknown error")
					if state == 0:
						appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
					elif state == 1:
						appname = _("Slot %d") %(slot+1) + " - " + _("init modules")

					elif state == 2:
						appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
					self.list.append( (appname, ConfigNothing(), 0, slot) )
		else:
			self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )
		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["CiList"] = menuList
		self.onShown.append(self.setWindowTitle)
Example #25
0
	def ciStateChanged(self, slot):
		if slot in self.ci:
			self.ci[slot](slot)
		else:
			if slot in self.dlgs:
				self.dlgs[slot].ciStateChanged()
			elif eDVBCI_UI.getInstance().availableMMI(slot) == 1:
				if self.session and not config.usage.hide_ci_messages.value:
					self.dlgs[slot] = self.session.openWithCallback(self.dlgClosed, MMIDialog, slot, 3)
Example #26
0
	def ciStateChanged(self, slot):
		if self.dlg:
			self.dlg.ciStateChanged()
		else:
			state = eDVBCI_UI.getInstance().getState(slot)
			if self.state[slot] != state:
				#print "something happens"
				self.state[slot] = state
				self.updateEntries()
	def getSlotname(self, state, slot):
		name = ""
		if state == 0:
			name = _("Slot %d") %(slot+1) + " - " + _("no module found")
		elif state == 1:
			name = _("Slot %d") %(slot+1) + " - " + _("init modules")
		elif state == 2:
			name = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot).upper()
		return name
	def getFilename(self, state, slot):
		name = ""
		if state == 0:
			name =  _("no module found")
		elif state == 1:
			name = _("init modules")
		elif state == 2:
			name = eDVBCI_UI.getInstance().getAppName(slot).upper()
		return name
Example #29
0
    def __init__(self):
        self.session = None
        self.ci = {}
        self.dlgs = {}
        self.auto_close = False
        eDVBCI_UI.getInstance().ciStateChanged.get().append(self.ciStateChanged)
        if getBoxType() in ('vuzero', 'mbmicro'):
            SystemInfo['CommonInterface'] = False
        else:
            SystemInfo['CommonInterface'] = eDVBCIInterfaces.getInstance().getNumOfSlots() > 0
        try:
            file = open('/proc/stb/tsmux/ci0_tsclk', 'r')
            file.close()
            SystemInfo['CommonInterfaceSupportsHighBitrates'] = True
        except:
            SystemInfo['CommonInterfaceSupportsHighBitrates'] = False

        return
Example #30
0
	def ciStateChanged(self, slot):
		if slot in self.ci:
			self.ci[slot](slot)
		else:
			if slot in self.dlgs:
				self.dlgs[slot].ciStateChanged()
			elif eDVBCI_UI.getInstance().availableMMI(slot) == 1:
				if self.session:
					self.dlgs[slot] = self.session.openWithCallback(self.dlgClosed, MMIDialog, slot, 3)
Example #31
0
 def okbuttonClick(self):
     cur = self["entries"].getCurrent()
     if cur and len(cur) > 2:
         action = cur[2]
         slot = cur[3]
         if action == 0:  #reset
             eDVBCI_UI.getInstance().setReset(slot)
         elif action == 1:  #init
             eDVBCI_UI.getInstance().setInit(slot)
         elif action == 5:
             self.session.openWithCallback(self.cancelCB, PermanentPinEntry,
                                           config.ci[slot].static_pin,
                                           _("Smartcard PIN"))
         elif action == 6:
             config.ci[slot].static_pin.value = 0
             config.ci[slot].static_pin.save()
             self.session.openWithCallback(self.cancelCB, MessageBox,
                                           _("The saved PIN was cleared."),
                                           MessageBox.TYPE_INFO)
         elif self.state[slot] == 2:
             self.dlg = self.session.openWithCallback(
                 self.dlgClosed, MMIDialog, slot, action)
Example #32
0
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Edit"))
		self["actions"] = ActionMap(["ColorActions","SetupActions"],
			{
				"green": self.greenPressed,
				"red": self.close,
				"ok": self.greenPressed,
				"cancel": self.close
			}, -1)

		NUM_CI = SystemInfo["CommonInterface"]

		print("[CommonInterfaceAssignment] CI_Wizzard FOUND %d CI Slots " % NUM_CI)

		self.dlg = None
		self.state = { }
		self.list = [ ]
		if  NUM_CI and NUM_CI > 0:
			for slot in range(NUM_CI):
				state = eDVBCI_UI.getInstance().getState(slot)
				if state != -1:
					appname = _("Slot %d") %(slot+1) + " - " + _("unknown error")
					if state == 0:
						appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
					elif state == 1:
						appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
					elif state == 2:
						appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
					self.list.append( (appname, ConfigNothing(), 0, slot) )
		else:
			self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["CiList"] = menuList
		self.onShown.append(self.setWindowTitle)
Example #33
0
	def __init__(self):
		self.session = None
		self.ci = { }
		self.dlgs = { }
		self.auto_close = False
		eDVBCI_UI.getInstance().ciStateChanged.get().append(self.ciStateChanged)
		if getBoxType() in ('vuzero'):
			SystemInfo["CommonInterface"] = False
		else:
			SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots() > 0
		try:
			file = open("/proc/stb/tsmux/ci0_tsclk", "r")
			file.close()
			SystemInfo["CommonInterfaceSupportsHighBitrates"] = True
		except:
			SystemInfo["CommonInterfaceSupportsHighBitrates"] = False
		try:
			file = open("/proc/stb/tsmux/rmx_delay", "r")
			file.close()
			SystemInfo["CommonInterfaceCIDelay"] = True
		except:
			SystemInfo["CommonInterfaceCIDelay"] = False
Example #34
0
 def __init__(self):
     Renderer.__init__(self)
     VariableText.__init__(self)
     self.eDVBCIUIInstance = eDVBCI_UI.getInstance()
     self.eDVBCIUIInstance and self.eDVBCIUIInstance.ciStateChanged.get(
     ).append(self.ciModuleStateChanged)
     self.text = ""
     self.allVisible = False
     self.no_visible_state1 = "ciplushelper" in popen("top -n 1").read()
     self.colors = parameters.get(
         "CiModuleControlColors",
         (0x007F7F7F, 0x00FFFF00, 0x00FFFF00, 0x00FF2525)
     )  # "state 0 (no module) gray", "state 1 (init module) yellow", "state 2 (module ready) green", "state -1 (error) red"
Example #35
0
	def updateState(self, slot):
		state = eDVBCI_UI.getInstance().getState(slot)
		self.state[slot] = state

		slotidx = 0
		while len(self.list[slotidx]) < 3 or self.list[slotidx][3] != slot:
			slotidx += 1

		slotidx += 1  # do not change Reset
		slotidx += 1  # do not change Init

		if state == 0:  # no module
			self.list[slotidx] = (_("no module found"), ConfigNothing(), 2, slot)
		elif state == 1:  # module in init
			self.list[slotidx] = (_("init module"), ConfigNothing(), 2, slot)
		elif state == 2:  # module ready
			appname = eDVBCI_UI.getInstance().getAppName(slot)
			self.list[slotidx] = (appname, ConfigNothing(), 2, slot)

		lst = self["entries"]
		lst.list = self.list
		lst.l.setList(self.list)
Example #36
0
    def initialUpdate(self):
        for slot in range(SystemInfo["CommonInterface"]):
            state = eDVBCI_UI.getInstance().getState(slot)
            if state != -1:
                self.slots.append(slot)
                self.state[slot] = state
                self.createEntries(slot)
                CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

        self.slots.sort()
        self.updateEntries()
        if self.slots:
            self["text"].setText(_("Slot %d") % (int(self.slots[0]) + 1))
Example #37
0
 def ciStateChanged(self, slot):
     if slot in self.ci:
         self.ci[slot](slot)
     else:
         if slot in self.dlgs:
             self.dlgs[slot].ciStateChanged()
         elif eDVBCI_UI.getInstance().availableMMI(slot) == 1:
             if self.session and not config.usage.hide_ci_messages.value:
                 try:
                     self.dlgs[slot] = self.session.openWithCallback(
                         self.dlgClosed, MMIDialog, slot, 3)
                 except:
                     pass
Example #38
0
    def __init__(self, session, args = 0):
        Screen.__init__(self, session)
        self['key_red'] = StaticText(_('Close'))
        self['key_green'] = StaticText(_('Edit'))
        self['actions'] = ActionMap(['ColorActions', 'SetupActions'], {'green': self.greenPressed,
         'red': self.close,
         'ok': self.greenPressed,
         'cancel': self.close}, -1)
        NUM_CI = eDVBCIInterfaces.getInstance().getNumOfSlots()
        print '[CI_Wizzard] FOUND %d CI Slots ' % NUM_CI
        self.dlg = None
        self.state = {}
        self.list = []
        if NUM_CI > 0:
            for slot in range(NUM_CI):
                state = eDVBCI_UI.getInstance().getState(slot)
                if state == 0:
                    appname = _('Slot %d') % (slot + 1) + ' - ' + _('no module found')
                elif state == 1:
                    appname = _('Slot %d') % (slot + 1) + ' - ' + _('init modules')
                elif state == 2:
                    appname = _('Slot %d') % (slot + 1) + ' - ' + eDVBCI_UI.getInstance().getAppName(slot)
                else:
                    appname = _('Slot %d') % (slot + 1) + ' - ' + 'Unknown state %d' % state
                self.list.append((appname,
                 ConfigNothing(),
                 0,
                 slot))

        else:
            self.list.append((_('no CI slots found'),
             ConfigNothing(),
             1,
             -1))
        menuList = ConfigList(self.list)
        menuList.list = self.list
        menuList.l.setList(self.list)
        self['CiList'] = menuList
        self.onShown.append(self.setWindowTitle)
Example #39
0
	def __init__(self, session, slotid, action, handler = eDVBCI_UI.getInstance(), wait_text = "wait for ci...", screen_data = None ):
		Screen.__init__(self, session)

		print "MMIDialog with action" + str(action)

		self.mmiclosed = False
		self.tag = None
		self.slotid = slotid

		self.timer = eTimer()
		self.timer.callback.append(self.keyCancel)

		#else the skins fails
		self["title"] = Label("")
		self["subtitle"] = Label("")
		self["bottom"] = Label("")
		self["entries"] = ConfigList([ ])

		self["actions"] = NumberActionMap(["SetupActions", "MenuActions"],
			{
				"ok": self.okbuttonClick,
				"cancel": self.keyCancel,
				"menu": self.forceExit,
				#for PIN
				"left": self.keyLeft,
				"right": self.keyRight,
				"1": self.keyNumberGlobal,
				"2": self.keyNumberGlobal,
				"3": self.keyNumberGlobal,
				"4": self.keyNumberGlobal,
				"5": self.keyNumberGlobal,
				"6": self.keyNumberGlobal,
				"7": self.keyNumberGlobal,
				"8": self.keyNumberGlobal,
				"9": self.keyNumberGlobal,
				"0": self.keyNumberGlobal
			}, -1)

		self.action = action

		self.handler = handler
		self.wait_text = _(wait_text)
		self.screen_data = screen_data

		self.is_pin_list = -1

		if action == 2:		#start MMI
			handler.startMMI(self.slotid)
			self.showWait()
		elif action == 3:		#mmi already there (called from infobar)
			self.showScreen()
Example #40
0
 def __init__(self):
     self.session = None
     self.ci = {}
     self.dlgs = {}
     self.ciStateChanged_conn = eDVBCI_UI.getInstance(
     ).ciStateChanged.connect(self.ciStateChanged)
     SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance(
     ).getNumOfSlots() > 0
     try:
         file = open("/proc/stb/tsmux/ci0_tsclk", "r")
         file.close()
         SystemInfo["CommonInterfaceSupportsHighBitrates"] = True
     except:
         SystemInfo["CommonInterfaceSupportsHighBitrates"] = False
Example #41
0
    def onTimer(self):
        try:
            state = eDVBCI_UI.getInstance().getState(0)
            if state == 0:
                self.timer.stop()
            elif state == 1:
                self.timer.startLongTimer(2)
            elif state == 2:
                self.ciCaids = eDVBCIInterfaces.getInstance().readCICaIds(0)
                if not self.ciCaids:
                    self.timer.startLongTimer(2)
                    return
                service = self.session.nav.getCurrentService()
                info = service and service.info()
                if service is None:
                    self.timer.startLongTimer(2)
                    return
                info = service and service.info()
                if not info:
                    self.timer.startLongTimer(2)
                    return
                serviceCaids = info.getInfoObject(iServiceInformation.sCAIDs)
                for serviceCaid in serviceCaids:
                    for ciCaid in self.ciCaids:
                        if ciCaid == serviceCaid:
                            eDVBCI_UI.getInstance().setClockRate(
                                0, eDVBCI_UI.rateHigh)
                            self.timer.stop()
                            return

                self.timer.startLongTimer(2)
            else:
                self.timer.startLongTimer(2)
        except:
            self.timer.startLongTimer(2)

        return
Example #42
0
 def okbuttonClick(self):
     cur = self["entries"].getCurrent()
     if cur:
         idx = self["entries"].getCurrentIndex()
         entryData = self.entryData[idx]
         action = entryData[0]
         slot = entryData[1]
         if action == 0:  #reset
             try:
                 os.system('rm -f /etc/enigma2/ci_auth_slot_' + str(slot) +
                           '.bin')
             except:
                 print("slotfile not found")
                 print("action1:", action)
                 eDVBCI_UI.getInstance().setReset(slot)
         elif action == 1:  #init
             eDVBCI_UI.getInstance().setInit(slot)
         elif action == 3:  #fix
             self.session.open(ciplusfix)
         elif action == 5:
             self.session.openWithCallback(self.cancelCB, PermanentPinEntry,
                                           config.ci[slot].static_pin,
                                           _("Smartcard PIN"))
         elif action == 6:
             config.ci[slot].static_pin.value = 0
             config.ci[slot].static_pin.save()
             self.session.openWithCallback(self.cancelCB, MessageBox,
                                           _("The saved PIN was cleared."),
                                           MessageBox.TYPE_INFO)
         elif self.state[slot] == 2:
             self.dlg = self.session.openWithCallback(
                 self.dlgClosed, MMIDialog, slot, action)
         elif self.state[slot] == 3:
             self.session.open(MessageBox,
                               _("Please remove Ci+ Modul and click ok!"),
                               MessageBox.TYPE_INFO)
             self.session.open(ciplusfix)
Example #43
0
    def appendEntries(self, slot, state):
        self.state[slot] = state
        self.list.append((_("Reset"), ConfigNothing(), 0, slot))
        self.list.append((_("Init"), ConfigNothing(), 1, slot))

        if self.state[slot] == 0:  #no module
            self.list.append((_("no module found"), ConfigNothing(), 2, slot))
        elif self.state[slot] == 1:  #module in init
            self.list.append((_("init module"), ConfigNothing(), 2, slot))
        elif self.state[slot] == 2:  #module ready
            appname = eDVBCI_UI.getInstance().getAppName(slot)
            self.list.append((appname, ConfigNothing(), 2, slot))
        self.list.append(
            getConfigListEntry(_("Set pin code persistent"),
                               config.ci[slot].use_static_pin))
        self.list.append(
            (_("Enter persistent PIN code"), ConfigNothing(), 5, slot))
        self.list.append(
            (_("Reset persistent PIN code"), ConfigNothing(), 6, slot))
        self.list.append(
            getConfigListEntry(_("Show CI messages"),
                               config.ci[slot].show_ci_messages))
        self.list.append(
            getConfigListEntry(_("Multiple service support"),
                               config.ci[slot].canDescrambleMultipleServices))
        if SystemInfo["CI%dSupportsHighBitrates" % slot]:
            self.list.append(
                getConfigListEntry(_("High bitrate support"),
                                   config.ci[slot].canHandleHighBitrates))
        if SystemInfo["CI%dRelevantPidsRoutingSupport" % slot]:
            self.list.append(
                getConfigListEntry(_("Relevant PIDs routing"),
                                   config.ci[slot].relevantPidsRouting))
        if SystemInfo["CommonInterfaceCIDelay"]:
            self.list.append(
                getConfigListEntry(_("DVB CI Delay"),
                                   config.cimisc.dvbCiDelay))
        if SystemInfo["HaveCISSL"]:
            self.list.append(
                getConfigListEntry(
                    _("CI Operation Mode"), config.cimisc.civersion,
                    _("Choose the CI protocol operation mode for standard CI or CI Plus."
                      )))
        else:
            self.list.append(
                getConfigListEntry(
                    _("CI Operation Mode"), config.cimisc.civersion,
                    _("Your hardware can detect CI mode itself or works only in legacy mode."
                      )))
Example #44
0
    def __init__(self, session, args=0):

        Screen.__init__(self, session)

        self["actions"] = ActionMap(["ColorActions", "SetupActions"], {
            "ok": self.greenPressed,
            "cancel": self.close
        }, -1)

        NUM_CI = eDVBCIInterfaces.getInstance().getNumOfSlots()

        print "[CI_Wizzard] FOUND %d CI Slots " % NUM_CI

        self.dlg = None
        self.state = {}
        self.list = []
        if NUM_CI > 0:
            for slot in range(NUM_CI):
                state = eDVBCI_UI.getInstance().getState(slot)
                if state != -1:
                    if state == 1:
                        appname = _("Slot %d") % (slot + 1) + " - " + _(
                            "init modules")
                    elif state == 2:
                        appname = _("Slot %d") % (
                            slot + 1) + " - " + eDVBCI_UI.getInstance(
                            ).getAppName(slot)
                    self.list.append((appname, ConfigNothing(), 0, slot))
        else:
            self.list.append((_("no CI slots found"), ConfigNothing(), 1, -1))

        menuList = ConfigList(self.list)
        menuList.list = self.list
        menuList.l.setList(self.list)
        self["CiList"] = menuList
        self.onShown.append(self.setWindowTitle)
Example #45
0
 def okbuttonClick(self):
     cur = self['entries'].getCurrent()
     if cur:
         idx = self['entries'].getCurrentIndex()
         entryData = self.entryData[idx]
         action = entryData[0]
         slot = entryData[1]
         if action == 0:
             eDVBCI_UI.getInstance().setReset(slot)
         elif action == 1:
             eDVBCI_UI.getInstance().setInit(slot)
         elif action == 5:
             self.session.openWithCallback(self.cancelCB, PermanentPinEntry,
                                           config.ci[slot].static_pin,
                                           _('Smartcard PIN'))
         elif action == 6:
             config.ci[slot].static_pin.value = 0
             config.ci[slot].static_pin.save()
             self.session.openWithCallback(self.cancelCB, MessageBox,
                                           _('The saved PIN was cleared.'),
                                           MessageBox.TYPE_INFO)
         elif action == 2 and self.state[slot] == 2:
             self.dlg = self.session.openWithCallback(
                 self.dlgClosed, MMIDialog, slot, action)
Example #46
0
	def canMultiDescramble(self, ci):
		if self.CI_MULTIDESCRAMBLE is None:
			NUM_CI = SystemInfo["CommonInterface"]
			if NUM_CI and NUM_CI > 0:
				self.CI_MULTIDESCRAMBLE = []
				for slot in range(NUM_CI):
					appname = eDVBCI_UI.getInstance().getAppName(slot)
					multipleServices = config.ci[slot].canDescrambleMultipleServices.value
					if self.CI_INIT_NOTIFIER is None:
						config.ci[slot].canDescrambleMultipleServices.addNotifier(self.forceUpdateMultiDescramble, initial_call=False, immediate_feedback=False)
					if multipleServices == "yes" or (appname in self.CI_MULTIDESCRAMBLE_MODULES and multipleServices == "auto"):
						self.CI_MULTIDESCRAMBLE.append(str(slot))
				self.CI_INIT_NOTIFIER = True
		else:
			return self.CI_MULTIDESCRAMBLE and ci in self.CI_MULTIDESCRAMBLE
Example #47
0
 def ciStateChanged(self, slot):
     if slot in self.ci:
         self.ci[slot](slot)
     else:
         handler = eDVBCI_UI.getInstance()
         if slot in self.dlgs:
             self.dlgs[slot].ciStateChanged()
         elif handler.availableMMI(slot) == 1:
             if self.session:
                 show_ui = False
                 if config.ci[
                         slot].show_ci_messages.value and config.misc.firstrun.value == 0:
                     show_ui = True
                 screen_data = handler.getMMIScreen(slot)
                 if config.ci[slot].use_static_pin.value:
                     if screen_data is not None and len(screen_data):
                         ci_tag = screen_data[0][0]
                         if ci_tag == 'ENQ' and len(
                                 screen_data
                         ) >= 2 and screen_data[1][0] == 'PIN':
                             if str(config.ci[slot].static_pin.value
                                    ) == "0":
                                 show_ui = True
                             else:
                                 answer = str(
                                     config.ci[slot].static_pin.value)
                                 length = len(answer)
                                 while length < config.ci[
                                         slot].static_pin.getLength():
                                     answer = '0' + answer
                                     length += 1
                                 handler.answerEnq(slot, answer)
                                 show_ui = False
                                 self.auto_close = True
                         elif ci_tag == 'CLOSE' and self.auto_close:
                             show_ui = False
                             self.auto_close = False
                 if show_ui and not forceNotShowCiMessages and not Screens.Standby.inStandby:
                     try:
                         self.dlgs[slot] = self.session.openWithCallback(
                             self.dlgClosed,
                             MMIDialog,
                             slot,
                             3,
                             screen_data=screen_data)
                     except:
                         pass
Example #48
0
	def appendEntries(self, slot, state):
		self.state[slot] = state
		self.list.append( (_("Reset"), ConfigNothing(), 0, slot) )
		self.list.append( (_("Init"), ConfigNothing(), 1, slot) )

		if self.state[slot] == 0:			#no module
			self.list.append( (_("no module found"), ConfigNothing(), 2, slot) )
		elif self.state[slot] == 1:		#module in init
			self.list.append( (_("init module"), ConfigNothing(), 2, slot) )
		elif self.state[slot] == 2:		#module ready
			#get appname
			appname = eDVBCI_UI.getInstance().getAppName(slot)
			self.list.append( (appname, ConfigNothing(), 2, slot) )

		self.list.append(getConfigListEntry(_("Multiple service support"), config.ci[slot].canDescrambleMultipleServices))
		if SystemInfo["CommonInterfaceSupportsHighBitrates"]:
			self.list.append(getConfigListEntry(_("High bitrate support"), config.ci[slot].canHandleHighBitrates))
Example #49
0
    def __init__(self, session, menu_path=""):
        Screen.__init__(self, session)
        screentitle = _("Common interface")
        if config.usage.show_menupath.value == 'large':
            menu_path += screentitle
            title = menu_path
            self["menu_path_compressed"] = StaticText("")
        elif config.usage.show_menupath.value == 'small':
            title = screentitle
            self["menu_path_compressed"] = StaticText(
                menu_path +
                " >" if not menu_path.endswith(' / ') else menu_path[:-3] +
                " >" or "")
        else:
            title = screentitle
            self["menu_path_compressed"] = StaticText("")
        Screen.setTitle(self, title)

        self["key_red"] = Label(_("Exit"))

        self["actions"] = ActionMap(
            ["SetupActions", "OkCancelActions", "CiSelectionActions"], {
                "left": self.keyLeft,
                "right": self.keyLeft,
                "ok": self.okbuttonClick,
                "red": self.cancel,
                "cancel": self.cancel
            }, -1)

        self.dlg = None
        self.state = {}
        self.list = []

        for slot in range(MAX_NUM_CI):
            state = eDVBCI_UI.getInstance().getState(slot)
            if state != -1:
                self.appendEntries(slot, state)
                CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

        menuList = ConfigList(self.list)
        menuList.list = self.list
        menuList.l.setList(self.list)
        self["entries"] = menuList
        self["entries"].onSelectionChanged.append(self.selectionChanged)
        self["text"] = Label(_("Slot %d") % (1))
        self.onLayoutFinish.append(self.layoutFinished)
Example #50
0
    def updateEntries(self):
        self.list = []
        self.entryData = []
        for slot in self.slots:
            self.addToList(
                getConfigListEntry(_("CI %s enabled" % slot),
                                   config.ci[slot].enabled), -1, slot)
            if self.state[slot] == 3:  # module disabled by the user
                continue
            self.addToList((_("Reset"), ConfigNothing()), 0, slot)
            self.addToList((_("Init"), ConfigNothing()), 1, slot)

            if self.state[slot] == 0:  #no module
                self.addToList((_("no module found"), ConfigNothing()), 2,
                               slot)
            elif self.state[slot] == 1:  #module in init
                self.addToList((_("init module"), ConfigNothing()), 2, slot)
            elif self.state[slot] == 2:  #module ready
                #get appname
                appname = eDVBCI_UI.getInstance().getAppName(slot)
                self.addToList((appname, ConfigNothing()), 2, slot)

            self.addToList(
                getConfigListEntry(_("Set pin code persistent"),
                                   config.ci[slot].use_static_pin), -1, slot)
            self.addToList((_("Enter persistent PIN code"), ConfigNothing()),
                           5, slot)
            self.addToList((_("Reset persistent PIN code"), ConfigNothing()),
                           6, slot)
            self.addToList(
                getConfigListEntry(_("Show CI messages"),
                                   config.ci[slot].show_ci_messages), -1, slot)
            self.addToList(
                getConfigListEntry(
                    _("Multiple service support"),
                    config.ci[slot].canDescrambleMultipleServices), -1, slot)

            if BoxInfo.getItem("CommonInterfaceSupportsHighBitrates"):
                self.addToList(self.HighBitrateEntry[slot], -1, slot)
            if BoxInfo.getItem("RelevantPidsRoutingSupport"):
                self.addToList(self.RelevantPidsRoutingEntry[slot], -1, slot)

        self["entries"].list = self.list
        self["entries"].l.setList(self.list)
        if self.selectionChanged not in self["entries"].onSelectionChanged:
            self["entries"].onSelectionChanged.append(self.selectionChanged)
Example #51
0
 def changed(self, what):
     self.poll_interval = 1000
     self.poll_enabled = True
     if self.instance:
         pngname = ''
         if what[0] != self.CHANGED_CLEAR:
             service = self.source.service
             if service:
                 NUM_CI = \
                     eDVBCIInterfaces.getInstance().getNumOfSlots()
                 if NUM_CI > 0:
                     state = \
                         eDVBCI_UI.getInstance().getState(self.slot)
                     if state != -1:
                         if state == 0:
                             text = 'nomodule'
                         elif state == 1:
                             text = 'initmodule'
                         elif state == 2:
                             text = 'ready'
                     else:
                         text = 'nomodule'
                 else:
                     text = 'nomodule'
                 pngname = self.nameCache.get(text, '')
                 if pngname == '':
                     pngname = self.findPicon(text)
                     if pngname != '':
                         self.nameCache[text] = pngname
         if pngname == '':  # no picon for service found
             pngname = self.nameCache.get('default', '')
             if pngname == '':  # no default yet in cache..
                 pngname = self.findPicon('picon_default')
                 if pngname == '':
                     tmp = resolveFilename(SCOPE_CURRENT_SKIN,
                                           'picon_default.png')
                     if fileExists(tmp):
                         pngname = tmp
                     else:
                         pngname = resolveFilename(
                             SCOPE_SKIN_IMAGE,
                             'skin_default/picon_default.png')
                 self.nameCache['default'] = pngname
         if self.pngname != pngname:
             self.instance.setPixmapFromFile(pngname)
             self.pngname = pngname
Example #52
0
 def __init__(self,
              session,
              slotid,
              action,
              handler=eDVBCI_UI.getInstance(),
              wait_text='wait for ci...',
              screen_data=None):
     Screen.__init__(self, session)
     print 'MMIDialog with action' + str(action)
     self.mmiclosed = False
     self.tag = None
     self.slotid = slotid
     self.timer = eTimer()
     self.timer.callback.append(self.keyCancel)
     self['title'] = Label('')
     self['subtitle'] = Label('')
     self['bottom'] = Label('')
     self['entries'] = ConfigList([])
     self['actions'] = NumberActionMap(
         ['SetupActions'], {
             'ok': self.okbuttonClick,
             'cancel': self.keyCancel,
             'left': self.keyLeft,
             'right': self.keyRight,
             '1': self.keyNumberGlobal,
             '2': self.keyNumberGlobal,
             '3': self.keyNumberGlobal,
             '4': self.keyNumberGlobal,
             '5': self.keyNumberGlobal,
             '6': self.keyNumberGlobal,
             '7': self.keyNumberGlobal,
             '8': self.keyNumberGlobal,
             '9': self.keyNumberGlobal,
             '0': self.keyNumberGlobal
         }, -1)
     self.action = action
     self.handler = handler
     self.wait_text = _(wait_text)
     self.screen_data = screen_data
     self.is_pin_list = -1
     if action == 2:
         handler.startMMI(self.slotid)
         self.showWait()
     elif action == 3:
         self.showScreen()
Example #53
0
 def appendEntries(self, slot, state):
     self.state[slot] = state
     self.list.append((_('Reset'), ConfigNothing(), 0, slot))
     self.list.append((_('Init'), ConfigNothing(), 1, slot))
     if self.state[slot] == 0:
         self.list.append((_('no module found'), ConfigNothing(), 2, slot))
     elif self.state[slot] == 1:
         self.list.append((_('init module'), ConfigNothing(), 2, slot))
     elif self.state[slot] == 2:
         appname = eDVBCI_UI.getInstance().getAppName(slot)
         self.list.append((appname, ConfigNothing(), 2, slot))
     self.list.append(
         getConfigListEntry(_('Multiple service support'),
                            config.ci[slot].canDescrambleMultipleServices))
     if SystemInfo['CommonInterfaceSupportsHighBitrates']:
         self.list.append(
             getConfigListEntry(_('High bitrate support'),
                                config.ci[slot].canHandleHighBitrates))
Example #54
0
 def changed(self, what):
     self.poll_interval = 1000
     self.poll_enabled = True
     if self.instance:
         pngname = ''
         if what[0] != self.CHANGED_CLEAR:
             service = self.source.service
             if service:
                 NUM_CI = eDVBCIInterfaces.getInstance().getNumOfSlots()
                 if NUM_CI > 0:
                     state = eDVBCI_UI.getInstance().getState(self.slot)
                     if state != -1:
                         if state == 0:
                             text = "nomodule"
                         elif state == 1:
                             text = "initmodule"
                         elif state == 2:
                             text = "ready"
                     else:
                         text = "nomodule"
                 else:
                     text = "nomodule"
                 pngname = self.nameCache.get(text, "")
                 if pngname == "":
                     pngname = self.findPicon(text)
                     if pngname != "":
                         self.nameCache[text] = pngname
         if pngname == "":  # no picon for service found
             pngname = self.nameCache.get("default", "")
             if pngname == "":  # no default yet in cache..
                 pngname = self.findPicon("picon_default")
                 if pngname == "":
                     tmp = resolveFilename(SCOPE_CURRENT_SKIN,
                                           "picon_default.png")
                     if fileExists(tmp):
                         pngname = tmp
                     else:
                         pngname = resolveFilename(
                             SCOPE_SKIN_IMAGE,
                             "skin_default/picon_default.png")
                 self.nameCache["default"] = pngname
         if self.pngname != pngname:
             self.instance.setPixmapFromFile(pngname)
             self.pngname = pngname
Example #55
0
    def appendEntries(self, slot, state):
        self.state[slot] = state
        if self.slot > 1:
            self.list.append(
                ("**************************", ConfigNothing(), 3, slot))
        self.list.append((_("Reset"), ConfigNothing(), 0, slot))
        self.list.append((_("Init"), ConfigNothing(), 1, slot))

        if self.state[slot] == 0:  #no module
            self.list.append((_("no module found"), ConfigNothing(), 2, slot))
        elif self.state[slot] == 1:  #module in init
            self.list.append((_("init module"), ConfigNothing(), 2, slot))
        elif self.state[slot] == 2:  #module ready
            appname = eDVBCI_UI.getInstance().getAppName(slot)
            self.list.append((appname, ConfigNothing(), 2, slot))
        self.list.append(
            getConfigListEntry(_("Set persistent PIN code"),
                               config.ci[slot].use_static_pin, 3, slot))
        self.list.append(
            (_("Enter persistent PIN code"), ConfigNothing(), 5, slot))
        self.list.append(
            (_("Reset persistent PIN code"), ConfigNothing(), 6, slot))
        self.list.append(
            getConfigListEntry(_("Show CI messages"),
                               config.ci[slot].show_ci_messages, 3, slot))
        self.list.append(
            getConfigListEntry(_("Multiple service support"),
                               config.ci[slot].canDescrambleMultipleServices,
                               3, slot))
        if SystemInfo["CI%dSupportsHighBitrates" % slot]:
            self.list.append(
                getConfigListEntry(_("High bitrate support"),
                                   config.ci[slot].canHandleHighBitrates, 3,
                                   slot))
        if SystemInfo["CI%dRelevantPidsRoutingSupport" % slot]:
            self.list.append(
                getConfigListEntry(_("PID Filtering"),
                                   config.ci[slot].relevantPidsRouting, 3,
                                   slot))
        if SystemInfo["CommonInterfaceCIDelay"]:
            self.list.append(
                getConfigListEntry(_("DVB CI Delay"), config.cimisc.dvbCiDelay,
                                   3, slot))
Example #56
0
    def updateEntries(self):
        self.list = []
        self.entryData = []
        for slot in self.slots:
            self.addToList((_('Reset'), ConfigNothing()), 0, slot)
            self.addToList((_('Init'), ConfigNothing()), 1, slot)
            if self.state[slot] == 0:
                self.addToList((_('no module found'), ConfigNothing()), 2,
                               slot)
            elif self.state[slot] == 1:
                self.addToList((_('init module'), ConfigNothing()), 2, slot)
            elif self.state[slot] == 2:
                appname = eDVBCI_UI.getInstance().getAppName(slot)
                self.addToList((appname, ConfigNothing()), 2, slot)
            self.addToList(
                getConfigListEntry(_('Set pin code persistent'),
                                   config.ci[slot].use_static_pin), -1, slot)
            self.addToList((_('Enter persistent PIN code'), ConfigNothing()),
                           5, slot)
            self.addToList((_('Reset persistent PIN code'), ConfigNothing()),
                           6, slot)
            self.addToList(
                getConfigListEntry(_('Show CI messages'),
                                   config.ci[slot].show_ci_messages), -1, slot)
            self.addToList(
                getConfigListEntry(
                    _('Multiple service support'),
                    config.ci[slot].canDescrambleMultipleServices), -1, slot)
            if SystemInfo['CommonInterfaceSupportsHighBitrates']:
                self.addToList(self.HighBitrateEntry[slot], -1, slot)
            if SystemInfo['RelevantPidsRoutingSupport']:
                self.addToList(self.RelevantPidsRoutingEntry[slot], -1, slot)

        self['entries'].list = self.list
        self['entries'].l.setList(self.list)
        if self.selectionChanged not in self['entries'].onSelectionChanged:
            self['entries'].onSelectionChanged.append(self.selectionChanged)
    def getText(self):
        name = ""
        service = self.source.service
        if service:
            NUM_CI = eDVBCIInterfaces.getInstance().getNumOfSlots()
            if NUM_CI > 0:
                self.control = True
            else:
                self.control = False
        else:
            self.control = False

        if self.type == self.NAME1:
            if self.control:
                state = eDVBCI_UI.getInstance().getState(0)
                if state != -1:
                    name = self.getFilename(state, 0)
                else:
                    name = _("no module found")
            else:
                name = _("no module found")
            return name
        elif self.type == self.NAME2:
            if self.control:
                state = eDVBCI_UI.getInstance().getState(1)
                if state != -1:
                    name = self.getFilename(state, 1)
                else:
                    name = _("no module found")
            else:
                name = _("no module found")
            return name

        elif self.type == self.SLOT1:
            if self.control:
                state = eDVBCI_UI.getInstance().getState(0)
                if state != -1:
                    name = self.getSlotname(state, 0)
                else:
                    name = _("Slot %d") % (1) + " - " + _("no module found")
            else:
                name = _("Slot %d") % (1) + " - " + _("no module found")
            return name
        elif self.type == self.SLOT2:
            if self.control:
                state = eDVBCI_UI.getInstance().getState(1)
                if state != -1:
                    name = self.getSlotname(state, 1)
                else:
                    name = _("Slot %d") % (2) + " - " + _("no module found")
            else:
                name = _("Slot %d") % (2) + " - " + _("no module found")
            return name

        elif self.type == self.PICON1:
            if self.control:
                state = eDVBCI_UI.getInstance().getState(0)
                if state != -1:
                    name = self.getPiconname(state, 1)
                else:
                    name = "NOMODULE_SLOT1"
            else:
                name = "NOMODULE_SLOT1"
            return name
        elif self.type == self.PICON2:
            if self.control:
                state = eDVBCI_UI.getInstance().getState(1)
                if state != -1:
                    name = self.getPiconname(state, 2)
                else:
                    name = "NOMODULE_SLOT2"
            else:
                name = "NOMODULE_SLOT2"
            return name
        return ""
Example #58
0
 def cancel(self):
     for slot in range(MAX_NUM_CI):
         state = eDVBCI_UI.getInstance().getState(slot)
         if state != -1:
             CiHandler.unregisterCIMessageHandler(slot)
     self.close()
Example #59
0
def setCIBitrate(configElement):
    eDVBCI_UI.getInstance().setClockRate(
        configElement.slotid, eDVBCI_UI.rateNormal
        if configElement.value == "no" else eDVBCI_UI.rateHigh)
Example #60
0
 def cancel(self):
     for slot in range(SystemInfo["CommonInterface"]):
         state = eDVBCI_UI.getInstance().getState(slot)
         if state != -1:
             CiHandler.unregisterCIMessageHandler(slot)
     self.close()