예제 #1
0
    def __init__(self, session, scanList):
        Screen.__init__(self, session)

        self.scanList = scanList

        if hasattr(session, 'infobar'):
            self.currentInfobar = session.infobar
            self.currentServiceList = self.currentInfobar.servicelist
            if self.session.pipshown and self.currentServiceList:
                if self.currentServiceList.dopipzap:
                    self.currentServiceList.togglePipzap()
                del self.session.pip
                self.session.pipshown = False
        else:
            self.currentInfobar = None

        self.session.nav.stopService()

        self["scan_progress"] = ProgressBar()
        self["scan_state"] = Label(_("scan state"))
        self["network"] = Label()
        self["transponder"] = Label()

        self["pass"] = Label("")
        self["servicelist"] = FIFOList(len=10)
        self["FrontendInfo"] = FrontendInfo()

        self["actions"] = ActionMap(["OkCancelActions"], {
            "ok": self.ok,
            "cancel": self.cancel
        })

        self.onFirstExecBegin.append(self.doServiceScan)
예제 #2
0
 def __init__(self, session, scanList):
     Screen.__init__(self, session)
     self['Title'] = Label(_('Scanning...'))
     self.scanList = scanList
     if hasattr(session, 'infobar'):
         self.currentInfobar = Screens.InfoBar.InfoBar.instance
         if self.currentInfobar:
             self.currentServiceList = self.currentInfobar.servicelist
             if self.session.pipshown and self.currentServiceList:
                 if self.currentServiceList.dopipzap:
                     self.currentServiceList.togglePipzap()
                 if hasattr(self.session, 'pip'):
                     del self.session.pip
                 self.session.pipshown = False
     else:
         self.currentInfobar = None
     self.session.nav.stopService()
     self['scan_progress'] = ProgressBar()
     self['scan_state'] = Label(_('scan state'))
     self['network'] = Label()
     self['transponder'] = Label()
     self['pass'] = Label('')
     self['servicelist'] = FIFOList()
     self['FrontendInfo'] = FrontendInfo()
     self['key_red'] = Label(_('Cancel'))
     self['key_green'] = Label(_('OK'))
     self['actions'] = ActionMap(['SetupActions', 'MenuActions'], {'ok': self.ok,
      'save': self.ok,
      'cancel': self.cancel,
      'menu': self.doCloseRecursive}, -2)
     self.setTitle(_('Service scan'))
     self.onFirstExecBegin.append(self.doServiceScan)
     return
예제 #3
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["CurrentService"] = CurrentService(session.nav)
		self["Event_Now"] = EventInfo(session.nav, EventInfo.NOW)
		self["Event_Next"] = EventInfo(session.nav, EventInfo.NEXT)
		self["FrontendStatus"] = FrontendStatus(service_source=session.nav.getCurrentService)
		self["FrontendInfo"] = FrontendInfo(navcore=session.nav)
		self["VideoPicture"] = Source()
		self["TunerInfo"] = TunerInfo()
		self["RecordState"] = RecordState(session)
		self["Standby"] = Boolean(fixed=False)

		from Components.SystemInfo import SystemInfo

		nr_leds = SystemInfo.get("NumFrontpanelLEDs", 0)

		if nr_leds > 0:
			combine = Combine(func=lambda s: {(False, False): 0, (False, True): 1, (True, False): 2, (True, True): 3}[(s[0].boolean, s[1].boolean)])
			combine.connect(self["Standby"])
			combine.connect(self["RecordState"])

			if nr_leds == 1:
				FrontpanelLed(which=0, boolean=False, patterns=[PATTERN_OFF, PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK]).connect(combine)
			elif nr_leds == 2:
				FrontpanelLed(which=0, boolean=False, get_patterns=True).connect(combine)
				FrontpanelLed(which=1, boolean=False, get_patterns=True).connect(combine)
    def __init__(self, session):
        Screen.__init__(self, session)
        self["CurrentService"] = CurrentService(session.nav)
        self["Event_Now"] = EventInfo(session.nav, EventInfo.NOW)
        self["Event_Next"] = EventInfo(session.nav, EventInfo.NEXT)
        self["FrontendStatus"] = FrontendStatus(
            service_source=session.nav.getCurrentService)
        self["FrontendInfo"] = FrontendInfo(navcore=session.nav)
        self["VideoPicture"] = Source()
        self["TunerInfo"] = TunerInfo()
        self["RecordState"] = RecordState(session)
        self["Standby"] = Boolean(fixed=False)
        self["HddSleepingState"] = HddState(session)

        from Components.SystemInfo import SystemInfo

        combine = Combine(func=lambda s: {
            (False, False): 0,
            (False, True): 1,
            (True, False): 2,
            (True, True): 3
        }[(s[0].boolean, s[1].boolean)])
        combine.connect(self["Standby"])
        combine.connect(self["RecordState"])
        combine.connect(self["HddSleepingState"])

        #                      |  two leds  | single led |
        # recordstate  standby   red green
        #    false      false    off   on     off
        #    true       false    blnk  on     blnk
        #    false      true      on   off    off
        #    true       true     blnk  off    blnk

        PATTERN_ON = (20, 0xffffffff, 0xffffffff)
        PATTERN_OFF = (20, 0, 0)
        PATTERN_BLINK = (20, 0x55555555, 0xa7fccf7a)

        nr_leds = SystemInfo.get("NumFrontpanelLEDs", 0)

        if nr_leds == 1:
            FrontpanelLed(which=0,
                          boolean=False,
                          patterns=[
                              PATTERN_OFF, PATTERN_BLINK, PATTERN_OFF,
                              PATTERN_BLINK
                          ]).connect(combine)
        elif nr_leds == 2:
            FrontpanelLed(which=0,
                          boolean=False,
                          patterns=[
                              PATTERN_OFF, PATTERN_BLINK, PATTERN_ON,
                              PATTERN_BLINK
                          ]).connect(combine)
            FrontpanelLed(
                which=1,
                boolean=False,
                patterns=[PATTERN_ON, PATTERN_ON, PATTERN_OFF,
                          PATTERN_OFF]).connect(combine)
예제 #5
0
def newSessionGlobals__init__(self, session):
	baseSessionGlobals__init__(self, session)
	global SessionGlobals_instance
	SessionGlobals_instance = self
	from Components.Sources.CurrentService import CurrentService
	from Components.Sources.EventInfo import EventInfo
	from Components.Sources.FrontendStatus import FrontendStatus
	from Components.Sources.FrontendInfo import FrontendInfo
	from Components.Sources.Source import Source
	from Components.Sources.TunerInfo import TunerInfo
	from Components.Sources.Boolean import Boolean
	from Components.Sources.RecordState import RecordState
	from Components.Converter.Combine import Combine
	from Components.Renderer.FrontpanelLed import FrontpanelLed
	self["CurrentService"] = CurrentService(session.nav)
	self["Event_Now"] = EventInfo(session.nav, EventInfo.NOW)
	self["Event_Next"] = EventInfo(session.nav, EventInfo.NEXT)
	self["FrontendStatus"] = FrontendStatus(service_source=session.nav.getCurrentService)
	self["FrontendInfo"] = FrontendInfo(navcore=session.nav)
	self["VideoPicture"] = Source()
	self["TunerInfo"] = TunerInfo()
	self["RecordState"] = RecordState(session)
	self["Standby"] = Boolean(fixed=False)

	from Components.SystemInfo import SystemInfo

	combine = Combine(func=lambda s: {(False, False): 0, (False, True): 1, (True, False): 2, (True, True): 3}[(s[0].boolean, s[1].boolean)])
	combine.connect(self["Standby"])
	combine.connect(self["RecordState"])

	#                      |  two leds  | single led |
	# recordstate  standby   red green
	#    false      false    off   on     off
	#    true       false    blnk  on     blnk
	#    false      true      on   off    off
	#    true       true     blnk  off    blnk

	PATTERN_ON = (20, 0xffffffff, 0xffffffff)
	PATTERN_OFF = (20, 0, 0)
	PATTERN_BLINK = (20, 0x55555555, 0xa7fccf7a)

	nr_leds = SystemInfo.get("NumFrontpanelLEDs", 0)

	if nr_leds == 1:
		FrontpanelLed(which=0, boolean=False, patterns=[PATTERN_OFF, PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK]).connect(combine)
	elif nr_leds == 2:
		if config.plugins.VFD_spark.redLed.value == '1':
			FrontpanelLed(which=0, boolean=False, patterns=[PATTERN_OFF, PATTERN_BLINK, PATTERN_ON, PATTERN_BLINK]).connect(combine)
		if config.plugins.VFD_spark.greenLed.value == '1':
			FrontpanelLed(which=1, boolean=False, patterns=[PATTERN_OFF, PATTERN_OFF, PATTERN_ON, PATTERN_OFF]).connect(combine)
		else:
			FrontpanelLed(which=0, boolean=False, patterns=[PATTERN_OFF, PATTERN_OFF, PATTERN_OFF, PATTERN_OFF]).connect(combine)
			FrontpanelLed(which=1, boolean=False, patterns=[PATTERN_OFF, PATTERN_OFF, PATTERN_OFF, PATTERN_OFF]).connect(combine)
예제 #6
0
    def __init__(self, session, scanList):
        Screen.__init__(self, session)

        self.scanList = scanList

        if hasattr(session, 'infobar'):
            self.currentInfobar = Screens.InfoBar.InfoBar.instance
            if self.currentInfobar:
                self.currentServiceList = self.currentInfobar.servicelist
                if self.session.pipshown and self.currentServiceList:
                    if self.currentServiceList.dopipzap:
                        self.currentServiceList.togglePipzap()
                    if hasattr(self.session, 'pip'):
                        del self.session.pip
                    self.session.pipshown = False
        else:
            self.currentInfobar = None

        self.session.postScanService = session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        self.session.nav.stopService()

        self["scan_progress"] = ProgressBar()
        self["scan_state"] = Label(_("scan state"))
        self["network"] = Label()
        self["transponder"] = Label()

        self["pass"] = Label("")
        self["servicelist"] = FIFOList()
        self["FrontendInfo"] = FrontendInfo()
        self["key_red"] = Label(_("Cancel"))
        self["key_green"] = Label(_("OK"))

        self["done_text"] = Label()

        self["actions"] = ActionMap(
            ["SetupActions", "MenuActions"], {
                "ok": self.ok,
                "save": self.ok,
                "cancel": self.cancel,
                "menu": self.doCloseRecursive
            }, -2)
        self.title = _("Service scan")
        if self.layoutFinished not in self.onLayoutFinish:
            self.onLayoutFinish.append(self.layoutFinished)
        self.onFirstExecBegin.append(self.doServiceScan)
        self.onClose.append(self.doPluginCB)
예제 #7
0
    def __init__(self, session, scanList):
        Screen.__init__(self, session)

        self["Title"] = Label(_("Scanning..."))
        self.scanList = scanList

        if hasattr(session, 'infobar'):
            self.currentInfobar = Screens.InfoBar.InfoBar.instance
            if self.currentInfobar:
                self.currentServiceList = self.currentInfobar.servicelist
                if self.session.pipshown and self.currentServiceList:
                    if self.currentServiceList.dopipzap:
                        self.currentServiceList.togglePipzap()
                    if hasattr(self.session, 'pip'):
                        del self.session.pip
                    self.session.pipshown = False
        else:
            self.currentInfobar = None

        self.session.nav.stopService()

        self["scan_progress"] = ProgressBar()
        self["scan_state"] = Label(_("scan state"))
        self["network"] = Label()
        self["transponder"] = Label()

        self["pass"] = Label("")
        self["servicelist"] = FIFOList()
        self["FrontendInfo"] = FrontendInfo()
        self["key_red"] = Label(_("Cancel"))
        self["key_green"] = Label(_("OK"))

        self["actions"] = ActionMap(
            ["SetupActions", "MenuActions"], {
                "up": self.up,
                "down": self.down,
                "ok": self.ok,
                "save": self.ok,
                "cancel": self.cancel,
                "menu": self.doCloseRecursive
            }, -2)
        self.setTitle(_("Service scan"))
        self.onFirstExecBegin.append(self.doServiceScan)
        self.scanTimer = eTimer()
        self.scanTimer.callback.append(self.scanPoll)
예제 #8
0
	def __init__(self, session, scanList):
		self.skin = SimpleServiceScan.skin
		Screen.__init__(self, session)

		self.scanList = scanList

		if hasattr(session, 'infobar'):
			self.currentInfobar = session.infobar
			self.currentServiceList = self.currentInfobar.servicelist
			if self.session.pipshown and self.currentServiceList:
				if self.currentServiceList.dopipzap:
					self.currentServiceList.togglePipzap()
				del self.session.pip
				self.session.pipshown = False
		else:
			self.currentInfobar = None

		self.session.nav.stopService()

		self["scan_progress"] = ProgressBar()
		self["scan_state"] = Label(_("Scan state"))
		self["network"] = Label()
		self["transponder"] = Label()

		self["pass"] = Label("")
		self["servicelist"] = FIFOList(len=15000)
		self["FrontendInfo"] = FrontendInfo()

		self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
		{
			"cancel": self.cancel,
			"ok": self.ok,
			"left": self["servicelist"].pageUp,
			"right": self["servicelist"].pageDown,
			"up": self["servicelist"].pageUp,
			"down": self["servicelist"].pageDown,
			"pageUp": self["servicelist"].pageUp,
			"pageDown": self["servicelist"].pageDown
		}, -2)

		self.onFirstExecBegin.append(self.doServiceScan)
예제 #9
0
파일: ServiceScan.py 프로젝트: vuteam/bbh
    def __init__(self, session, scanList):
        Screen.__init__(self, session)

        self.scanList = scanList

        self.session.nav.stopService()

        self["scan_progress"] = ProgressBar()
        self["scan_state"] = Label(_("scan state"))
        self["network"] = Label()
        self["transponder"] = Label()

        self["pass"] = Label("")
        self["servicelist"] = FIFOList(len=10)
        self["FrontendInfo"] = FrontendInfo()

        self["actions"] = ActionMap(["OkCancelActions"], {
            "ok": self.ok,
            "cancel": self.cancel
        })

        self.onFirstExecBegin.append(self.doServiceScan)
예제 #10
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self["CurrentService"] = CurrentService(session.nav)
        self["Event_Now"] = EventInfo(session.nav, EventInfo.NOW)
        self["Event_Next"] = EventInfo(session.nav, EventInfo.NEXT)
        self["FrontendStatus"] = FrontendStatus(
            service_source=session.nav.getCurrentService)
        self["FrontendInfo"] = FrontendInfo(navcore=session.nav)
        self["VideoPicture"] = Source()
        self["TunerInfo"] = TunerInfo()
        self["RecordState"] = RecordState(session)
        self["Standby"] = Boolean(fixed=False)
        self["HddSleepingState"] = HddState(session)

        from Components.SystemInfo import SystemInfo

        combine = Combine(func=lambda s: {
            (False, False): 0,
            (False, True): 1,
            (True, False): 2,
            (True, True): 3
        }[(s[0].boolean, s[1].boolean)])
        combine.connect(self["Standby"])
        combine.connect(self["RecordState"])
        combine.connect(self["HddSleepingState"])

        #					   |  two leds	| single led |
        # recordstate  standby	 red green
        #	 false		false	 off   on	  off
        #	 true		false	 blnk  on	  blnk
        #	 false		true	  on   off	  off
        #	 true		true	 blnk  off	  blnk

        PATTERN_ON = (20, 0xffffffff, 0xffffffff)
        PATTERN_OFF = (20, 0, 0)
        PATTERN_BLINK = (20, 0x55555555, 0xa7fccf7a)

        NormalLed0 = PATTERN_OFF
        NormalLed1 = PATTERN_OFF
        if config.usage.frontled_color.value == "1":
            NormalLed0 = PATTERN_ON
        if config.usage.frontled_color.value == "2":
            NormalLed1 = PATTERN_ON
        if config.usage.frontled_color.value == "3":
            NormalLed0 = PATTERN_BLINK
        if config.usage.frontled_color.value == "4":
            NormalLed1 = PATTERN_BLINK

        RecLed0 = PATTERN_OFF
        RecLed1 = PATTERN_OFF
        if config.usage.frontledrec_color.value == "1":
            RecLed0 = PATTERN_ON
        if config.usage.frontledrec_color.value == "2":
            RecLed1 = PATTERN_ON
        if config.usage.frontledrec_color.value == "3":
            RecLed0 = PATTERN_BLINK
        if config.usage.frontledrec_color.value == "4":
            RecLed1 = PATTERN_BLINK

        StandbyLed0 = PATTERN_OFF
        StandbyLed1 = PATTERN_OFF
        if config.usage.frontledstdby_color.value == "1":
            StandbyLed0 = PATTERN_ON
        if config.usage.frontledstdby_color.value == "2":
            StandbyLed1 = PATTERN_ON
        if config.usage.frontledstdby_color.value == "3":
            StandbyLed0 = PATTERN_BLINK
        if config.usage.frontledstdby_color.value == "4":
            StandbyLed1 = PATTERN_BLINK

        RecstdbyLed0 = PATTERN_OFF
        RecstdbyLed1 = PATTERN_OFF
        if config.usage.frontledrecstdby_color.value == "1":
            RecstdbyLed0 = PATTERN_ON
        if config.usage.frontledrecstdby_color.value == "2":
            RecstdbyLed1 = PATTERN_ON
        if config.usage.frontledrecstdby_color.value == "3":
            RecstdbyLed0 = PATTERN_BLINK
        if config.usage.frontledrecstdby_color.value == "4":
            RecstdbyLed1 = PATTERN_BLINK

        nr_leds = SystemInfo.get("NumFrontpanelLEDs", 0)

        if nr_leds == 1:
            FrontpanelLed(which=0,
                          boolean=False,
                          patterns=[
                              PATTERN_OFF, PATTERN_BLINK, PATTERN_OFF,
                              PATTERN_BLINK
                          ]).connect(combine)
        elif nr_leds == 2:
            if getBoxType() == "dm520":
                FrontpanelLed(which=0,
                              boolean=False,
                              patterns=[
                                  PATTERN_ON, PATTERN_BLINK, PATTERN_OFF,
                                  PATTERN_BLINK
                              ]).connect(combine)
                FrontpanelLed(which=1,
                              boolean=False,
                              patterns=[
                                  PATTERN_OFF, PATTERN_OFF, PATTERN_OFF,
                                  PATTERN_OFF
                              ]).connect(combine)
            elif getMachineBuild() == "dm4kgen":
                FrontpanelLed(
                    which=0,
                    boolean=False,
                    patterns=[NormalLed0, RecLed0, StandbyLed0,
                              RecstdbyLed0]).connect(combine)
                FrontpanelLed(
                    which=1,
                    boolean=False,
                    patterns=[NormalLed1, RecLed1, StandbyLed1,
                              RecstdbyLed1]).connect(combine)
            else:
                FrontpanelLed(which=0,
                              boolean=False,
                              patterns=[
                                  PATTERN_OFF, PATTERN_BLINK, PATTERN_ON,
                                  PATTERN_BLINK
                              ]).connect(combine)
                FrontpanelLed(which=1,
                              boolean=False,
                              patterns=[
                                  PATTERN_ON, PATTERN_ON, PATTERN_OFF,
                                  PATTERN_OFF
                              ]).connect(combine)
예제 #11
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self['CurrentService'] = CurrentService(session.nav)
     self['CurrentTime'] = Clock()
     self['Event_Now'] = EventInfo(session.nav, EventInfo.NOW)
     self['Event_Next'] = EventInfo(session.nav, EventInfo.NEXT)
     self['FrontendStatus'] = FrontendStatus(
         service_source=session.nav.getCurrentService)
     self['FrontendInfo'] = FrontendInfo(navcore=session.nav)
     self['VideoPicture'] = Source()
     self['TunerInfo'] = TunerInfo()
     self['RecordState'] = RecordState(session)
     self['Standby'] = Boolean(fixed=False)
     from Components.SystemInfo import SystemInfo
     combine = Combine(func=lambda s: {
         (False, False): 0,
         (False, True): 1,
         (True, False): 2,
         (True, True): 3
     }[s[0].boolean, s[1].boolean])
     combine.connect(self['Standby'])
     combine.connect(self['RecordState'])
     PATTERN_ON = (20, 4294967295, 4294967295)
     PATTERN_OFF = (20, 0, 0)
     PATTERN_BLINK = (20, 1431655765, 2818363258)
     have_display = SystemInfo.get('FrontpanelDisplay', False)
     have_touch_sensor = SystemInfo.get('HaveTouchSensor', False)
     nr_leds = SystemInfo.get('NumFrontpanelLEDs', 0)
     if nr_leds == 1:
         FrontpanelLed(which=0,
                       boolean=False,
                       patterns=[
                           PATTERN_OFF if have_display else PATTERN_ON,
                           PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK
                       ]).connect(combine)
     elif nr_leds == 2:
         if have_touch_sensor:
             FrontpanelLed(which=0,
                           boolean=False,
                           patterns=[
                               PATTERN_ON, PATTERN_BLINK, PATTERN_OFF,
                               PATTERN_BLINK
                           ]).connect(combine)
             FrontpanelLed(which=1,
                           boolean=False,
                           patterns=[
                               PATTERN_OFF, PATTERN_OFF, PATTERN_OFF,
                               PATTERN_OFF
                           ]).connect(combine)
         else:
             FrontpanelLed(which=0,
                           boolean=False,
                           patterns=[
                               PATTERN_OFF, PATTERN_BLINK, PATTERN_ON,
                               PATTERN_BLINK
                           ]).connect(combine)
             FrontpanelLed(which=1,
                           boolean=False,
                           patterns=[
                               PATTERN_ON, PATTERN_ON, PATTERN_OFF,
                               PATTERN_OFF
                           ]).connect(combine)