Example #1
0
	def __init__(self):
		Renderer.__init__(self)
		self.PicLoad = ePicLoad()
		self.PicLoad.PictureData.get().append(self.updatePicon)
		self.piconsize = (0,0)
		self.pngname = ""
		self.lastPath = None
		if getDisplayType() in ("bwlcd255","bwlcd140") or config.lcd.picon_pack.value:
			pngname = findLcdPicon("lcd_picon_default")
		else:
			pngname = findLcdPicon("picon_default")
		self.defaultpngname = None
		if not pngname:
			if getDisplayType() in ("bwlcd255","bwlcd140") or config.lcd.picon_pack.value:
				tmp = resolveFilename(SCOPE_CURRENT_SKIN, "lcd_picon_default.png")
			else:
				tmp = resolveFilename(SCOPE_CURRENT_SKIN, "picon_default.png")
			if pathExists(tmp):
				pngname = tmp
			else:
				if getDisplayType() in ("bwlcd255","bwlcd140") or config.lcd.picon_pack.value:
					pngname = resolveFilename(SCOPE_SKIN_IMAGE, "lcd_picon_default.png")
				else:
					pngname = resolveFilename(SCOPE_SKIN_IMAGE, "picon_default.png")
		if os.path.getsize(pngname):
			self.defaultpngname = pngname
Example #2
0
 def __init__(self):
     Renderer.__init__(self)
     self.PicLoad = ePicLoad()
     self.PicLoad.PictureData.get().append(self.updatePicon)
     self.piconsize = (0, 0)
     self.pngname = ""
     self.lastPath = None
     if getDisplayType() in ('bwlcd255',
                             'bwlcd140') and not SystemInfo["grautec"]:
         pngname = findLcdPicon("lcd_picon_default")
     else:
         pngname = findLcdPicon("picon_default")
     self.defaultpngname = None
     if not pngname:
         if getDisplayType() in ('bwlcd255',
                                 'bwlcd140') and not SystemInfo["grautec"]:
             tmp = resolveFilename(SCOPE_ACTIVE_SKIN,
                                   "lcd_picon_default.png")
         else:
             tmp = resolveFilename(SCOPE_ACTIVE_SKIN, "picon_default.png")
         if pathExists(tmp):
             pngname = tmp
         else:
             if getDisplayType() in (
                     'bwlcd255', 'bwlcd140') and not SystemInfo["grautec"]:
                 pngname = resolveFilename(SCOPE_ACTIVE_SKIN,
                                           "lcd_picon_default.png")
             else:
                 pngname = resolveFilename(SCOPE_ACTIVE_SKIN,
                                           "picon_default.png")
     if os.path.getsize(pngname):
         self.defaultpngname = pngname
Example #3
0
def onMountpointRemoved(mountpoint):
	global searchPaths
	if getDisplayType() in ('bwlcd255', 'bwlcd140') and not SystemInfo["grautec"] or os.path.isdir(mountpoint + 'piconlcd'):
		path = os.path.join(mountpoint, 'piconlcd') + '/'
	else:
		path = os.path.join(mountpoint, 'picon') + '/'
	try:
		searchPaths.remove(path)
		print "[LcdPicon] removed path:", path
	except:
		pass
Example #4
0
def onMountpointRemoved(mountpoint):
	global searchPaths
	if getDisplayType() in ("bwlcd255","bwlcd140") or config.lcd.picon_pack.value:
		path = os.path.join(mountpoint, 'piconlcd') + '/'
	else:
		path = os.path.join(mountpoint, 'picon') + '/'
	try:
		searchPaths.remove(path)
		print "[LcdPicon] removed path:", path
	except:
		pass
Example #5
0
def onMountpointRemoved(mountpoint):
    global searchPaths
    if getDisplayType() in ('bwlcd255', 'bwlcd140') and not BoxInfo.getItem(
            "grautec") or os.path.isdir(mountpoint + 'piconlcd'):
        path = os.path.join(mountpoint, 'piconlcd') + '/'
    else:
        path = os.path.join(mountpoint, 'picon') + '/'
    try:
        searchPaths.remove(path)
        print("[LcdPicon] removed path: %s" % path)
    except:
        pass
Example #6
0
def onMountpointAdded(mountpoint):
	global searchPaths
	try:
		if getDisplayType() in ("bwlcd255","bwlcd140") or config.lcd.picon_pack.value:
			path = os.path.join(mountpoint, 'piconlcd') + '/'
		else:
			path = os.path.join(mountpoint, 'picon') + '/'
		if os.path.isdir(path) and path not in searchPaths:
			for fn in os.listdir(path):
				if fn.endswith('.png'):
					print "[LcdPicon] adding path:", path
					searchPaths.append(path)
					break
	except Exception, ex:
		print "[LcdPicon] Failed to investigate %s:" % mountpoint, ex
Example #7
0
def onMountpointAdded(mountpoint):
	global searchPaths
	try:
		if getDisplayType() in ('bwlcd255', 'bwlcd140') and not BoxInfo.getItem("grautec") or os.path.isdir(mountpoint + 'piconlcd'):
			path = os.path.join(mountpoint, 'piconlcd') + '/'
		else:
			path = os.path.join(mountpoint, 'picon') + '/'
		if os.path.isdir(path) and path not in searchPaths:
			for fn in os.listdir(path):
				if fn.endswith('.png'):
					print("[LcdPicon] adding path:", path)
					searchPaths.append(path)
					break
	except Exception as ex:
		print("[LcdPicon] Failed to investigate %s:" % mountpoint, ex)
Example #8
0
def onMountpointAdded(mountpoint):
    try:
        if getDisplayType() in ('bwlcd255', 'bwlcd140') and not SystemInfo[
                'grautec'] or os.path.isdir(mountpoint + 'piconlcd'):
            path = os.path.join(mountpoint, 'piconlcd') + '/'
        else:
            path = os.path.join(mountpoint, 'XPicons') + '/'
            if os.path.isdir(path) and path not in searchPaths:
                for fn in os.listdir(path):
                    if fn.endswith('.png'):
                        print '[LcdPicon] adding path:', path
                        searchPaths.append(path)
                        break

            path = os.path.join(mountpoint, 'XPicons/picon') + '/'
            if os.path.isdir(path) and path not in searchPaths:
                for fn in os.listdir(path):
                    if fn.endswith('.png'):
                        print '[LcdPicon] adding path:', path
                        searchPaths.append(path)
                        break

            path = os.path.join(mountpoint, 'picon') + '/'
            if os.path.isdir(path) and path not in searchPaths:
                for fn in os.listdir(path):
                    if fn.endswith('.png'):
                        print '[LcdPicon] adding path:', path
                        searchPaths.append(path)
                        break

            path = mountpoint
            if os.path.isdir(path) and path not in searchPaths:
                for fn in os.listdir(path):
                    if fn.endswith('.png'):
                        print '[LcdPicon] adding path:', path
                        searchPaths.append(path)
                        break

    except Exception as ex:
        print '[LcdPicon] Failed to investigate %s:' % mountpoint, ex
Example #9
0
SystemInfo["endbutton"] = getBoxType().startswith('ixuss')
SystemInfo["3FunctionButtons"] = getBoxType() == "et8000" or getBoxType() == "et6x00" or getBoxType() == "et10000" or getBoxType().startswith('gb')
SystemInfo["4FunctionButtons"] = getBoxType().startswith('gb')
SystemInfo["WakeOnLAN"] = fileCheck("/proc/stb/fp/wol") or fileCheck("/proc/stb/power/wol")
SystemInfo["HDMICEC"] = (fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) and fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
SystemInfo["HasHDMI-CEC"] = (fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) and fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
SystemInfo["SABSetup"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/SABnzbd/plugin.pyo")
SystemInfo["SeekStatePlay"] = False
SystemInfo["GraphicLCD"] = getBoxType() in ('vuultimo', 'xpeedlx3', 'et10000', 'mutant2400', 'quadbox2400', 'sezammarvel', 'atemionemesis', 'mbultra', 'beyonwizt4')
SystemInfo["Blindscan"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/plugin.pyo")
SystemInfo["Satfinder"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/Satfinder/plugin.pyo")
SystemInfo["HasExternalPIP"] = getMachineBuild() not in ('et9x00', 'et6x00', 'et5x00') and fileCheck("/proc/stb/vmpeg/1/external")
SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
SystemInfo["VideoDestinationConfigurable"] = fileExists("/proc/stb/vmpeg/0/dst_left")
SystemInfo["GBWOL"] = fileExists("/usr/bin/gigablue_wol")
SystemInfo["LCDSKINSetup"] = path.exists("/usr/share/enigma2/display") and getDisplayType() not in ('7segment')
SystemInfo["7segment"] = getDisplayType() in ('7segment')
SystemInfo["7segmentORtextlcd7segment"] = getDisplayType() in ('7segment','textlcd7segment')
SystemInfo["grautec"] = fileExists("/tmp/usbtft")
SystemInfo["isGBIPBOX"] = fileExists("/usr/lib/enigma2/python/gbipbox.so")
SystemInfo["CIHelper"] = fileExists("/usr/bin/cihelper")
SystemInfo["3DMode"] = fileCheck("/proc/stb/fb/3dmode") or fileCheck("/proc/stb/fb/primary/3d")
SystemInfo["3DZNorm"] = fileCheck("/proc/stb/fb/znorm") or fileCheck("/proc/stb/fb/primary/zoffset")
SystemInfo["CanUse3DModeChoices"] = fileExists('/proc/stb/fb/3dmode_choices') and True or False
SystemInfo["need_dsw"] = getBoxType() not in ('osminiplus','osmega')
SystemInfo["HaveCISSL"] = fileCheck("/etc/ssl/certs/customer.pem") and fileCheck("/etc/ssl/certs/device.pem")
SystemInfo["HasMultichannelPCM"] = fileCheck("/proc/stb/audio/multichannel_pcm")
SystemInfo["HaveTouchSensor"] = getBoxType() in ('dm520', 'dm525', 'dm900')
SystemInfo["DefaultDisplayBrightness"] = getBoxType() == 'dm900' and 8 or 5
SystemInfo["HasRootSubdir"] = fileHas("/proc/cmdline", "rootsubdir=")
SystemInfo["RecoveryMode"] = SystemInfo["HasRootSubdir"] and getMachineBuild() not in ('vs1500','hd51','h7') or fileCheck("/proc/stb/fp/boot_mode")
Example #10
0
SystemInfo["DeepstandbySupport"] = HardwareInfo().has_deepstandby()
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["PowerLed"] = fileExists("/proc/stb/power/powerled")
SystemInfo["PowerLed2"] = fileExists("/proc/stb/power/powerled2")
SystemInfo["StandbyLED"] = fileExists("/proc/stb/power/standbyled")
SystemInfo["StandbyPowerLed"] = fileExists("/proc/stb/power/standbyled")
SystemInfo["SuspendPowerLed"] = fileExists("/proc/stb/power/suspendled")
SystemInfo["LedPowerColor"] = fileExists("/proc/stb/fp/ledpowercolor")
SystemInfo["LedStandbyColor"] = fileExists("/proc/stb/fp/ledstandbycolor")
SystemInfo["LedSuspendColor"] = fileExists("/proc/stb/fp/ledsuspendledcolor")
SystemInfo["Power4x7On"] = fileExists("/proc/stb/fp/power4x7on")
SystemInfo["Power4x7Standby"] = fileExists("/proc/stb/fp/power4x7standby")
SystemInfo["Power4x7Suspend"] = fileExists("/proc/stb/fp/power4x7suspend")
SystemInfo["ConfigDisplay"] = SystemInfo[
    "FrontpanelDisplay"] and getDisplayType() not in ('7segment')
SystemInfo["LCDSKINSetup"] = path.exists(
    "/usr/share/enigma2/display") and getDisplayType() not in ('7segment')
SystemInfo["FBLCDDisplay"] = fileCheck("/proc/stb/fb/sd_detach")
SystemInfo["lxbuttons"] = getBrandOEM() == "ini"
SystemInfo["homebutton"] = getBoxType().startswith('ixuss')
SystemInfo["endbutton"] = getBoxType().startswith('ixuss')
SystemInfo["3FunctionButtons"] = getBoxType() == "et8000" or getBoxType(
) == "et6x00" or getBoxType() == "et10000" or getBoxType().startswith('gb')
SystemInfo["4FunctionButtons"] = getBoxType().startswith('gb')
SystemInfo["WakeOnLAN"] = fileCheck("/proc/stb/power/wol") or fileCheck(
    "/proc/stb/fp/wol")
if getBoxType() in ('gbquad', 'gbquadplus', 'gb800ueplus', 'gb800seplus',
                    'gbipbox'):
    SystemInfo["WOL"] = False
else:
Example #11
0
SystemInfo["GraphicLCD"] = getBoxType() in ('vuultimo', 'xpeedlx3', 'et10000',
                                            'mutant2400', 'quadbox2400',
                                            'sezammarvel', 'atemionemesis',
                                            'mbultra', 'beyonwizt4')
SystemInfo["Blindscan"] = fileExists(
    "/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/plugin.pyo")
SystemInfo["Satfinder"] = fileExists(
    "/usr/lib/enigma2/python/Plugins/SystemPlugins/Satfinder/plugin.pyo")
SystemInfo["HasExternalPIP"] = getMachineBuild() not in (
    'et9x00', 'et6x00', 'et5x00') and fileCheck("/proc/stb/vmpeg/1/external")
SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
SystemInfo["VideoDestinationConfigurable"] = fileExists(
    "/proc/stb/vmpeg/0/dst_left")
SystemInfo["GBWOL"] = fileExists("/usr/bin/gigablue_wol")
SystemInfo["LCDSKINSetup"] = path.exists("/usr/share/enigma2/display")
SystemInfo["7segment"] = getDisplayType() in ('7segment')
SystemInfo["grautec"] = fileExists("/tmp/usbtft")
SystemInfo["isGBIPBOX"] = fileExists("/usr/lib/enigma2/python/gbipbox.so")
SystemInfo["CIHelper"] = fileExists("/usr/bin/cihelper")
SystemInfo["3DMode"] = fileCheck("/proc/stb/fb/3dmode") or fileCheck(
    "/proc/stb/fb/primary/3d")
SystemInfo["3DZNorm"] = fileCheck("/proc/stb/fb/znorm") or fileCheck(
    "/proc/stb/fb/primary/zoffset")
SystemInfo["CanUse3DModeChoices"] = fileExists(
    '/proc/stb/fb/3dmode_choices') and True or False
SystemInfo["need_dsw"] = getBoxType() not in ('osminiplus', 'osmega')
SystemInfo["HaveCISSL"] = fileCheck(
    "/etc/ssl/certs/customer.pem") and fileCheck("/etc/ssl/certs/device.pem")
SystemInfo["HasMultichannelPCM"] = fileCheck(
    "/proc/stb/audio/multichannel_pcm")
SystemInfo["HaveTouchSensor"] = getBoxType() in ('dm520', 'dm525', 'dm900')
Example #12
0
File: Lcd.py Project: TwolDE2/ATV65
def InitLcd():
    # FIXME remove getBoxType
    if getBoxType() in ('gbx34k', 'force4', 'alien5', 'viperslim', 'lunix',
                        'lunix4k', 'purehdse', 'vipert2c', 'evoslimse',
                        'evoslimt2c', 'valalinux', 'tmtwin4k', 'tmnanom3',
                        'mbmicrov2', 'revo4k', 'force3uhd', 'force2nano',
                        'evoslim', 'wetekplay', 'wetekplay2', 'wetekhub',
                        'ultrabox', 'novaip', 'dm520', 'dm525', 'purehd',
                        'mutant11', 'xpeedlxpro', 'zgemmai55', 'sf98',
                        'et7x00mini', 'xpeedlxcs2', 'xpeedlxcc', 'e4hd',
                        'e4hdhybrid', 'mbmicro', 'beyonwizt2', 'amikomini',
                        'dynaspark', 'amiko8900', 'sognorevolution',
                        'arguspingulux', 'arguspinguluxmini',
                        'arguspinguluxplus', 'sparkreloaded', 'sabsolo',
                        'sparklx', 'gis8120', 'gb800se', 'gb800solo',
                        'gb800seplus', 'gbultrase', 'gbipbox', 'tmsingle',
                        'tmnano2super', 'iqonios300hd', 'iqonios300hdv2',
                        'optimussos1plus', 'optimussos1', 'vusolo', 'et4x00',
                        'et5x00', 'et6x00', 'et7000', 'et7100', 'mixosf7',
                        'mixoslumi', 'gbx1', 'gbx2', 'gbx3', 'gbx3h'):
        detected = False
    elif getBoxType() in ('pulse4kmini', ):
        detected = True
    else:
        detected = eDBoxLCD.getInstance().detected()
    BoxInfo.setItem("Display", detected)
    config.lcd = ConfigSubsection()

    if exists("/proc/stb/lcd/mode"):
        can_lcdmodechecking = fileReadLine("/proc/stb/lcd/mode")
    else:
        can_lcdmodechecking = False
    BoxInfo.setItem("LCDMiniTV", can_lcdmodechecking)

    if detected:
        ilcd = LCD()
        if can_lcdmodechecking:

            def setLCDModeMinitTV(configElement):
                print("[Lcd] setLCDModeMinitTV='%s'." % configElement.value)
                fileWriteLine("/proc/stb/lcd/mode", configElement.value)

            def setMiniTVFPS(configElement):
                print("[Lcd] setMiniTVFPS='%s'." % configElement.value)
                fileWriteLine("/proc/stb/lcd/fps", configElement.value)

            def setLCDModePiP(configElement):
                pass  # DEBUG: Should this be doing something?

            def setLCDScreenshot(configElement):
                ilcd.setScreenShot(configElement.value)

            config.lcd.modepip = ConfigSelection(choices={
                "0": _("Off"),
                "5": _("PiP"),
                "7": _("PiP with OSD")
            },
                                                 default="0")
            config.lcd.modepip.addNotifier(setLCDModePiP)
            config.lcd.screenshot = ConfigYesNo(default=False)
            config.lcd.screenshot.addNotifier(setLCDScreenshot)
            config.lcd.modeminitv = ConfigSelection(choices={
                "0": _("normal"),
                "1": _("MiniTV"),
                "2": _("OSD"),
                "3": _("MiniTV with OSD")
            },
                                                    default="0")
            config.lcd.fpsminitv = ConfigSlider(default=30, limits=(0, 30))
            config.lcd.modeminitv.addNotifier(setLCDModeMinitTV)
            config.lcd.fpsminitv.addNotifier(setMiniTVFPS)
        else:
            config.lcd.modeminitv = ConfigNothing()
            config.lcd.screenshot = ConfigNothing()
            config.lcd.fpsminitv = ConfigNothing()
        config.lcd.scroll_speed = ConfigSelection(choices=[("500", _("slow")),
                                                           ("300",
                                                            _("normal")),
                                                           ("100", _("fast"))],
                                                  default="300")
        config.lcd.scroll_delay = ConfigSelection(choices=[
            ("10000", "10 %s" % _("seconds")), ("20000",
                                                "20 %s" % _("seconds")),
            ("30000", "30 %s" % _("seconds")), ("60000", "1 %s" % _("minute")),
            ("300000", "5 %s" % _("minutes")), ("noscrolling", _("Off"))
        ],
                                                  default="10000")

        def setLCDbright(configElement):
            ilcd.setBright(configElement.value)

        def setLCDstandbybright(configElement):
            ilcd.setStandbyBright(configElement.value)

        def setLCDdimbright(configElement):
            ilcd.setDimBright(configElement.value)

        def setLCDdimdelay(configElement):
            ilcd.setDimDelay(configElement.value)

        def setLCDcontrast(configElement):
            ilcd.setContrast(configElement.value)

        def setLCDinverted(configElement):
            ilcd.setInverted(configElement.value)

        def setLCDflipped(configElement):
            ilcd.setFlipped(configElement.value)

        def setLCDminitvmode(configElement):
            ilcd.setLCDMiniTVMode(configElement.value)

        def setLCDminitvpipmode(configElement):
            ilcd.setLCDMiniTVPIPMode(configElement.value)

        def setLCDminitvfps(configElement):
            ilcd.setLCDMiniTVFPS(configElement.value)

        def setLEDnormalstate(configElement):
            ilcd.setLEDNormalState(configElement.value)

        def setLEDdeepstandby(configElement):
            ilcd.setLEDDeepStandbyState(configElement.value)

        def setLEDblinkingtime(configElement):
            ilcd.setLEDBlinkingTime(configElement.value)

        def setPowerLEDstate(configElement):
            if exists("/proc/stb/power/powerled"):
                fileWriteLine("/proc/stb/power/powerled",
                              "on" if configElement.value else "off")

        def setPowerLEDstate2(configElement):
            if exists("/proc/stb/power/powerled2"):
                fileWriteLine("/proc/stb/power/powerled2",
                              "on" if configElement.value else "off")

        def setPowerLEDstanbystate(configElement):
            if exists("/proc/stb/power/standbyled"):
                fileWriteLine("/proc/stb/power/standbyled",
                              "on" if configElement.value else "off")

        def setPowerLEDdeepstanbystate(configElement):
            if exists("/proc/stb/power/suspendled"):
                fileWriteLine("/proc/stb/power/suspendled",
                              "on" if configElement.value else "off")

        def setLedPowerColor(configElement):
            if exists("/proc/stb/fp/ledpowercolor"):
                fileWriteLine("/proc/stb/fp/ledpowercolor",
                              configElement.value)

        def setLedStandbyColor(configElement):
            if exists("/proc/stb/fp/ledstandbycolor"):
                fileWriteLine("/proc/stb/fp/ledstandbycolor",
                              configElement.value)

        def setLedSuspendColor(configElement):
            if exists("/proc/stb/fp/ledsuspendledcolor"):
                fileWriteLine("/proc/stb/fp/ledsuspendledcolor",
                              configElement.value)

        def setLedBlinkControlColor(configElement):
            if exists("/proc/stb/fp/led_blink"):
                fileWriteLine("/proc/stb/fp/led_blink", configElement.value)

        def setLedBrightnessControl(configElement):
            if exists("/proc/stb/fp/led_brightness"):
                fileWriteLine("/proc/stb/fp/led_brightness",
                              configElement.value)

        def setLedColorControlColor(configElement):
            if exists("/proc/stb/fp/led_color"):
                fileWriteLine("/proc/stb/fp/led_color", configElement.value)

        def setLedFadeControlColor(configElement):
            if exists("/proc/stb/fp/led_fade"):
                fileWriteLine("/proc/stb/fp/led_fade", configElement.value)

        def setPower4x7On(configElement):
            if exists("/proc/stb/fp/power4x7on"):
                fileWriteLine("/proc/stb/fp/power4x7on",
                              "on" if configElement.value else "off")

        def setPower4x7Standby(configElement):
            if exists("/proc/stb/fp/power4x7standby"):
                fileWriteLine("/proc/stb/fp/power4x7standby",
                              "on" if configElement.value else "off")

        def setPower4x7Suspend(configElement):
            if exists("/proc/stb/fp/power4x7suspend"):
                fileWriteLine("/proc/stb/fp/power4x7suspend",
                              "on" if configElement.value else "off")

        def setXcoreVFD(configElement):
            if exists("/sys/module/brcmstb_osmega/parameters/pt6302_cgram"):
                fileWriteLine(
                    "/sys/module/brcmstb_osmega/parameters/pt6302_cgram",
                    configElement.value)
            if exists("/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram"):
                fileWriteLine(
                    "/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram",
                    configElement.value)
            if exists(
                    "/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram"
            ):
                fileWriteLine(
                    "/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram",
                    configElement.value)
            if exists(
                    "/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram"
            ):
                fileWriteLine(
                    "/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram",
                    configElement.value)

        config.usage.vfd_xcorevfd = ConfigSelection(choices=[
            ("0", _("12 character")), ("1", _("8 character"))
        ],
                                                    default="0")
        config.usage.vfd_xcorevfd.addNotifier(setXcoreVFD)
        config.usage.lcd_powerled = ConfigOnOff(default=True)
        config.usage.lcd_powerled.addNotifier(setPowerLEDstate)
        config.usage.lcd_powerled2 = ConfigOnOff(default=True)
        config.usage.lcd_powerled2.addNotifier(setPowerLEDstate2)
        config.usage.lcd_standbypowerled = ConfigOnOff(default=True)
        config.usage.lcd_standbypowerled.addNotifier(setPowerLEDstanbystate)
        config.usage.lcd_deepstandbypowerled = ConfigOnOff(default=True)
        config.usage.lcd_deepstandbypowerled.addNotifier(
            setPowerLEDdeepstanbystate)

        if getBoxType() in ('dual', ):
            config.usage.lcd_ledpowercolor = ConfigSelection(
                default="1", choices=[("0", _("off")), ("1", _("blue"))])
            config.usage.lcd_ledpowercolor.addNotifier(setLedPowerColor)

            config.usage.lcd_ledstandbycolor = ConfigSelection(
                default="1", choices=[("0", _("off")), ("1", _("blue"))])
            config.usage.lcd_ledstandbycolor.addNotifier(setLedStandbyColor)

            config.usage.lcd_ledsuspendcolor = ConfigSelection(
                default="1", choices=[("0", _("off")), ("1", _("blue"))])
            config.usage.lcd_ledsuspendcolor.addNotifier(setLedSuspendColor)
        else:
            config.usage.lcd_ledpowercolor = ConfigSelection(
                default="1",
                choices=[("0", _("Off")), ("1", _("blue")), ("2", _("red")),
                         ("3", _("violet"))])
            config.usage.lcd_ledpowercolor.addNotifier(setLedPowerColor)

            config.usage.lcd_ledstandbycolor = ConfigSelection(
                default="3",
                choices=[("0", _("Off")), ("1", _("blue")), ("2", _("red")),
                         ("3", _("violet"))])
            config.usage.lcd_ledstandbycolor.addNotifier(setLedStandbyColor)

            config.usage.lcd_ledsuspendcolor = ConfigSelection(
                default="2",
                choices=[("0", _("Off")), ("1", _("blue")), ("2", _("red")),
                         ("3", _("violet"))])
            config.usage.lcd_ledsuspendcolor.addNotifier(setLedSuspendColor)

        config.usage.lcd_power4x7on = ConfigOnOff(default=True)
        config.usage.lcd_power4x7on.addNotifier(setPower4x7On)

        config.usage.lcd_power4x7standby = ConfigOnOff(default=True)
        config.usage.lcd_power4x7standby.addNotifier(setPower4x7Standby)

        config.usage.lcd_power4x7suspend = ConfigOnOff(default=True)
        config.usage.lcd_power4x7suspend.addNotifier(setPower4x7Suspend)

        if model in ('dm900', 'dm920', 'e4hdultra', 'protek4k'):
            standby_default = 4
        elif model in ("spycat4kmini", "osmega"):
            standby_default = 10
        else:
            standby_default = 1
        if not ilcd.isOled():
            config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
            config.lcd.contrast.addNotifier(setLCDcontrast)
        else:
            config.lcd.contrast = ConfigNothing()

        if model in ('novatwin', 'novacombo', 'mixosf5', 'mixosf5mini',
                     'gi9196m', 'gi9196lite', 'zgemmas2s', 'zgemmash1',
                     'zgemmash2', 'zgemmass', 'zgemmahs', 'zgemmah2s',
                     'zgemmah2h', 'spycat'):
            config.lcd.standby = ConfigSlider(default=standby_default,
                                              limits=(0, 4))
            config.lcd.dimbright = ConfigSlider(default=standby_default,
                                                limits=(0, 4))
            config.lcd.bright = ConfigSlider(default=4, limits=(0, 4))
        elif model in ("spycat4kmini", "osmega"):
            config.lcd.standby = ConfigSlider(default=standby_default,
                                              limits=(0, 10))
            config.lcd.dimbright = ConfigSlider(default=standby_default,
                                                limits=(0, 10))
            config.lcd.bright = ConfigSlider(default=10, limits=(0, 10))
        else:
            config.lcd.standby = ConfigSlider(default=standby_default,
                                              limits=(0, 10))
            config.lcd.dimbright = ConfigSlider(default=standby_default,
                                                limits=(0, 10))
            config.lcd.bright = ConfigSlider(
                default=BoxInfo.getItem("DefaultDisplayBrightness"),
                limits=(0, 10))
        config.lcd.dimbright.addNotifier(setLCDdimbright)
        config.lcd.dimbright.apply = lambda: setLCDdimbright(config.lcd.
                                                             dimbright)
        config.lcd.dimdelay = ConfigSelection(choices=[
            ("5", "5 %s" % _("seconds")), ("10", "10 %s" % _("seconds")),
            ("15", "15 %s" % _("seconds")), ("20", "20 %s" % _("seconds")),
            ("30", "30 %s" % _("seconds")), ("60", "1 %s" % _("minute")),
            ("120", "2 %s" % _("minutes")), ("300", "5 %s" % _("minutes")),
            ("0", _("Off"))
        ],
                                              default="0")
        config.lcd.dimdelay.addNotifier(setLCDdimdelay)
        config.lcd.standby.addNotifier(setLCDstandbybright)
        config.lcd.standby.apply = lambda: setLCDstandbybright(config.lcd.
                                                               standby)
        config.lcd.bright.addNotifier(setLCDbright)
        config.lcd.bright.apply = lambda: setLCDbright(config.lcd.bright)
        config.lcd.bright.callNotifiersOnSaveAndCancel = True
        config.lcd.invert = ConfigYesNo(default=False)
        config.lcd.invert.addNotifier(setLCDinverted)

        config.lcd.flip = ConfigYesNo(default=False)
        config.lcd.flip.addNotifier(setLCDflipped)

        if BoxInfo.getItem("LcdLiveTV"):

            def lcdLiveTvChanged(configElement):
                open(BoxInfo.getItem("LcdLiveTV"),
                     "w").write(configElement.value and "0" or "1")
                try:
                    InfoBarInstance = InfoBar.instance
                    InfoBarInstance and InfoBarInstance.session.open(
                        dummyScreen)
                except:
                    pass

            config.lcd.showTv = ConfigYesNo(default=False)
            config.lcd.showTv.addNotifier(lcdLiveTvChanged)

        if BoxInfo.getItem("LCDMiniTV") and config.misc.boxtype.value not in (
                'gbquad', 'gbquadplus', 'gbquad4k', 'gbue4k'):
            config.lcd.minitvmode = ConfigSelection(
                [("0", _("normal")), ("1", _("MiniTV")), ("2", _("OSD")),
                 ("3", _("MiniTV with OSD"))], "0")
            config.lcd.minitvmode.addNotifier(setLCDminitvmode)
            config.lcd.minitvpipmode = ConfigSelection(
                [("0", _("Off")), ("5", _("PiP")),
                 ("7", _("PiP with OSD"))], "0")
            config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode)
            config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30))
            config.lcd.minitvfps.addNotifier(setLCDminitvfps)

        if BoxInfo.getItem("VFD_scroll_repeats") and model not in (
                'ixussone',
                'ixusszero') and getDisplayType() not in ('7segment', ):

            def scroll_repeats(el):
                open(BoxInfo.getItem("VFD_scroll_repeats"),
                     "w").write(el.value)

            choicelist = [("0", _("None")), ("1", _("1x")), ("2", _("2x")),
                          ("3", _("3x")), ("4", _("4x")),
                          ("500", _("Continues"))]
            config.usage.vfd_scroll_repeats = ConfigSelection(
                default="3", choices=choicelist)
            config.usage.vfd_scroll_repeats.addNotifier(
                scroll_repeats, immediate_feedback=False)
        else:
            config.usage.vfd_scroll_repeats = ConfigNothing()

        if BoxInfo.getItem("VFD_scroll_delay") and model not in (
                'ixussone',
                'ixusszero') and getDisplayType() not in ('7segment', ):

            def scroll_delay(el):
                # add workaround for Boxes who need hex code
                if model in ('sf4008', 'beyonwizu4'):
                    open(BoxInfo.getItem("VFD_scroll_delay"),
                         "w").write(hex(int(el.value)))
                else:
                    open(BoxInfo.getItem("VFD_scroll_delay"),
                         "w").write(str(el.value))

            config.usage.vfd_scroll_delay = ConfigSlider(default=150,
                                                         increment=10,
                                                         limits=(0, 500))
            config.usage.vfd_scroll_delay.addNotifier(scroll_delay,
                                                      immediate_feedback=False)
            config.lcd.hdd = ConfigYesNo(default=True)
        else:
            config.lcd.hdd = ConfigNothing()
            config.usage.vfd_scroll_delay = ConfigNothing()

        if BoxInfo.getItem("VFD_initial_scroll_delay") and model not in (
                'ixussone',
                'ixusszero') and getDisplayType() not in ('7segment', ):

            def initial_scroll_delay(el):
                if model in ('sf4008', 'beyonwizu4'):
                    # add workaround for Boxes who need hex code
                    open(BoxInfo.getItem("VFD_initial_scroll_delay"),
                         "w").write(hex(int(el.value)))
                else:
                    open(BoxInfo.getItem("VFD_initial_scroll_delay"),
                         "w").write(el.value)

            config.usage.vfd_initial_scroll_delay = ConfigSelection(
                choices=[("3000", "3 %s" % _("seconds")),
                         ("5000", "5 %s" % _("seconds")),
                         ("10000", "10 %s" % _("seconds")),
                         ("20000", "20 %s" % _("seconds")),
                         ("30000", "30 %s" % _("seconds")),
                         ("0", _("No delay"))],
                default="10000")
            config.usage.vfd_initial_scroll_delay.addNotifier(
                initial_scroll_delay, immediate_feedback=False)
        else:
            config.usage.vfd_initial_scroll_delay = ConfigNothing()

        if BoxInfo.getItem("VFD_final_scroll_delay") and model not in (
                'ixussone',
                'ixusszero') and getDisplayType() not in ('7segment', ):

            def final_scroll_delay(el):
                if model in ('sf4008', 'beyonwizu4'):
                    # add workaround for Boxes who need hex code
                    open(BoxInfo.getItem("VFD_final_scroll_delay"),
                         "w").write(hex(int(el.value)))
                else:
                    open(BoxInfo.getItem("VFD_final_scroll_delay"),
                         "w").write(el.value)

            config.usage.vfd_final_scroll_delay = ConfigSelection(
                choices=[("3000", "3 %s" % _("seconds")),
                         ("5000", "5 %s" % _("seconds")),
                         ("10000", "10 %s" % _("seconds")),
                         ("20000", "20 %s" % _("seconds")),
                         ("30000", "30 %s" % _("seconds")),
                         ("0", _("No delay"))],
                default="10000")
            config.usage.vfd_final_scroll_delay.addNotifier(
                final_scroll_delay, immediate_feedback=False)
        else:
            config.usage.vfd_final_scroll_delay = ConfigNothing()
        if exists("/proc/stb/lcd/show_symbols"):

            def setLCDmode(configElement):
                ilcd.setMode("1" if configElement.value else "0")

            config.lcd.mode = ConfigYesNo(default=True)
            config.lcd.mode.addNotifier(setLCDmode)
        else:
            config.lcd.mode = ConfigNothing()
        if exists("/proc/stb/power/vfd") or exists("/proc/stb/lcd/vfd"):

            def setLCDpower(configElement):
                ilcd.setPower("1" if configElement.value else "0")

            config.lcd.power = ConfigYesNo(default=True)
            config.lcd.power.addNotifier(setLCDpower)
        else:
            config.lcd.power = ConfigNothing()
        if exists("/proc/stb/fb/sd_detach"):

            def setfblcddisplay(configElement):
                ilcd.setfblcddisplay("1" if configElement.value else "0")

            config.lcd.fblcddisplay = ConfigYesNo(default=True)
            config.lcd.fblcddisplay.addNotifier(setfblcddisplay)
        else:
            config.lcd.fblcddisplay = ConfigNothing()
        if exists("/proc/stb/lcd/show_outputresolution"):

            def setLCDshowoutputresolution(configElement):
                ilcd.setShowoutputresolution(
                    "1" if configElement.value else "0")

            config.lcd.showoutputresolution = ConfigYesNo(default=True)
            config.lcd.showoutputresolution.addNotifier(
                setLCDshowoutputresolution)
        else:
            config.lcd.showoutputresolution = ConfigNothing()
        if model == "vuultimo":
            config.lcd.ledblinkingtime = ConfigSlider(default=5,
                                                      increment=1,
                                                      limits=(0, 15))
            config.lcd.ledblinkingtime.addNotifier(setLEDblinkingtime)
            config.lcd.ledbrightnessdeepstandby = ConfigSlider(default=1,
                                                               increment=1,
                                                               limits=(0, 15))
            config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDdeepstandby)
            config.lcd.ledbrightnessdeepstandby.apply = lambda: setLEDdeepstandby(
                config.lcd.ledbrightnessdeepstandby)
            config.lcd.ledbrightnessstandby = ConfigSlider(default=1,
                                                           increment=1,
                                                           limits=(0, 15))
            config.lcd.ledbrightnessstandby.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightnessstandby.apply = lambda: setLEDnormalstate(
                config.lcd.ledbrightnessstandby)
            config.lcd.ledbrightness = ConfigSlider(default=3,
                                                    increment=1,
                                                    limits=(0, 15))
            config.lcd.ledbrightness.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightness.apply = lambda: setLEDnormalstate(
                config.lcd.ledbrightness)
            config.lcd.ledbrightness.callNotifiersOnSaveAndCancel = True
        else:

            def doNothing():
                pass

            config.lcd.ledbrightness = ConfigNothing()
            config.lcd.ledbrightness.apply = lambda: doNothing()
            config.lcd.ledbrightnessstandby = ConfigNothing()
            config.lcd.ledbrightnessstandby.apply = lambda: doNothing()
            config.lcd.ledbrightnessdeepstandby = ConfigNothing()
            config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing()
            config.lcd.ledblinkingtime = ConfigNothing()
    else:

        def doNothing():
            pass

        config.lcd.contrast = ConfigNothing()
        config.lcd.bright = ConfigNothing()
        config.lcd.standby = ConfigNothing()
        config.lcd.bright.apply = lambda: doNothing()
        config.lcd.standby.apply = lambda: doNothing()
        config.lcd.power = ConfigNothing()
        config.lcd.fblcddisplay = ConfigNothing()
        config.lcd.mode = ConfigNothing()
        config.lcd.hdd = ConfigNothing()
        config.lcd.scroll_speed = ConfigSelection(choices=[("500", _("slow")),
                                                           ("300",
                                                            _("normal")),
                                                           ("100", _("fast"))],
                                                  default="300")
        config.lcd.scroll_delay = ConfigSelection(choices=[
            ("10000", "10 %s" % _("seconds")), ("20000",
                                                "20 %s" % _("seconds")),
            ("30000", "30 %s" % _("seconds")), ("60000", "1 %s" % _("minute")),
            ("300000", "5 %s" % _("minutes")), ("noscrolling", _("Off"))
        ],
                                                  default="10000")
        config.lcd.showoutputresolution = ConfigNothing()
        config.lcd.ledbrightness = ConfigNothing()
        config.lcd.ledbrightness.apply = lambda: doNothing()
        config.lcd.ledbrightnessstandby = ConfigNothing()
        config.lcd.ledbrightnessstandby.apply = lambda: doNothing()
        config.lcd.ledbrightnessdeepstandby = ConfigNothing()
        config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing()
        config.lcd.ledblinkingtime = ConfigNothing()

    config.misc.standbyCounter.addNotifier(standbyCounterChanged,
                                           initial_call=False)
Example #13
0
print "getBrandOEM=%s<" %boxbranding.getBrandOEM()
print "getOEVersion=%s<" %boxbranding.getOEVersion()
print "getDriverDate=%s<" %boxbranding.getDriverDate()
print "getImageVersion=%s<" %boxbranding.getImageVersion()
print "getImageBuild=%s<" %boxbranding.getImageBuild()
print "getImageDevBuild=%s<" %boxbranding.getImageDevBuild()
print "getImageType=%s<" %boxbranding.getImageType()
print "getImageDistro=%s<" %boxbranding.getImageDistro()
print "getImageFolder=%s<" %boxbranding.getImageFolder()
print "getImageFileSystem=%s<" %boxbranding.getImageFileSystem()
print "getImageDevBuild=%s<" %boxbranding.getImageDevBuild()
print "getImageType=%s<" %boxbranding.getImageType()
print "getMachineMake=%s<" %boxbranding.getMachineMake()
print "getImageArch=%s<" %boxbranding.getImageArch()
print "getFeedsUrl=%s<" %boxbranding.getFeedsUrl()
print "getDisplayType=%s<" %boxbranding.getDisplayType()
print "getHaveHDMI=%s<" %boxbranding.getHaveHDMI()
print "getHaveYUV=%s<" %boxbranding.getHaveYUV()
print "getHaveRCA=%s<" %boxbranding.getHaveRCA()
print "getHaveAVJACK=%s<" %boxbranding.getHaveAVJACK()
print "getHaveSCART=%s<" %boxbranding.getHaveSCART()
print "getHaveSCARTYUV=%s<" %boxbranding.getHaveSCARTYUV()
print "getHaveDVI=%s<" %boxbranding.getHaveDVI()
print "getHaveMiniTV=%s<" %boxbranding.getHaveMiniTV()
print "getHaveHDMIinHD=%s<" %boxbranding.getHaveHDMIinHD()
print "getHaveHDMIinFHD=%s<" %boxbranding.getHaveHDMIinFHD()
print "getHaveWOL=%s<" %boxbranding.getHaveWOL()
print "getHaveWWOL=%s<" %boxbranding.getHaveWWOL()
print "getHaveTranscoding1=%s<" %boxbranding.getHaveTranscoding1()
print "getHaveTranscoding2=%s<" %boxbranding.getHaveTranscoding2()
print "getHaveCI=%s<" %boxbranding.getHaveCI()
Example #14
0
print("getMachineUBINIZE=%s<" %boxbranding.getMachineUBINIZE())
print("getBoxType=%s<" %boxbranding.getBoxType())
print("getBrandOEM=%s<" %boxbranding.getBrandOEM())
print("getOEVersion=%s<" %boxbranding.getOEVersion())
print("getDriverDate=%s<" %boxbranding.getDriverDate())
print("getImageVersion=%s<" %boxbranding.getImageVersion())
print("getImageBuild=%s<" %boxbranding.getImageBuild())
print("getImageDistro=%s<" %boxbranding.getImageDistro())
print("getImageFolder=%s<" %boxbranding.getImageFolder())
print("getImageFileSystem=%s<" %boxbranding.getImageFileSystem())
print("getImageDevBuild=%s<" %boxbranding.getImageDevBuild())
print("getImageType=%s<" %boxbranding.getImageType())
print("getMachineMake=%s<" %boxbranding.getMachineMake())
print("getImageArch=%s<" %boxbranding.getImageArch())
print("getFeedsUrl=%s<" %boxbranding.getFeedsUrl())
print("getDisplayType=%s<" %boxbranding.getDisplayType())
print("getHaveHDMI%s<" %boxbranding.getHaveHDMI())
print("getHaveYUV%s<" %boxbranding.getHaveYUV())
print("getHaveRCA%s<" %boxbranding.getHaveRCA())
print("getHaveAVJACK%s<" %boxbranding.getHaveAVJACK())
print("getHaveSCART%s<" %boxbranding.getHaveSCART())
print("getHaveSCARTYUV%s<" %boxbranding.getHaveSCARTYUV())
print("getHaveDVI%s<" %boxbranding.getHaveDVI())
print("getHaveMiniTV%s<" %boxbranding.getHaveMiniTV())
print("getHaveHDMIinHD%s<" %boxbranding.getHaveHDMIinHD())
print("getHaveHDMIinFHD%s<" %boxbranding.getHaveHDMIinFHD())
print("getHaveWOL%s<" %boxbranding.getHaveWOL())
print("getHaveWWOL%s<" %boxbranding.getHaveWWOL())
print("getHaveTranscoding1%s<" %boxbranding.getHaveTranscoding1())
print("getHaveTranscoding2%s<" %boxbranding.getHaveTranscoding2())
print("getHaveCI%s<" %boxbranding.getHaveCI())
Example #15
0
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["StandbyLED"] = fileCheck("/proc/stb/power/standbyled")
SystemInfo["PowerOffDisplay"] = HardwareInfo().get_device_model(
) not in "formuler1" and fileCheck("/proc/stb/power/vfd") or fileCheck(
    "/proc/stb/lcd/vfd")
SystemInfo["WakeOnLAN"] = not (HardwareInfo().get_device_model() in (
    "et8000", "et10000")) and fileCheck("/proc/stb/power/wol") or fileCheck(
        "/proc/stb/fp/wol")
SystemInfo["HasExternalPIP"] = not HardwareInfo().get_device_model(
).startswith("et9") and fileCheck("/proc/stb/vmpeg/1/external")
SystemInfo["VideoDestinationConfigurable"] = fileExists(
    "/proc/stb/vmpeg/0/dst_left")
SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
SystemInfo["LCDSKINSetup"] = path.exists(
    "/usr/share/enigma2/display") and getDisplayType() not in ('7segment')
SystemInfo["7segment"] = getBoxType() in ('sf8008')
SystemInfo["LcdLiveTV"] = fileCheck("/proc/stb/fb/sd_detach") or fileCheck(
    "/proc/stb/lcd/live_enable")
SystemInfo["LcdLiveTVMode"] = fileCheck("/proc/stb/lcd/mode")
SystemInfo["FastChannelChange"] = False
SystemInfo["3DMode"] = fileCheck("/proc/stb/fb/3dmode") or fileCheck(
    "/proc/stb/fb/primary/3d")
SystemInfo["3DZNorm"] = fileCheck("/proc/stb/fb/znorm") or fileCheck(
    "/proc/stb/fb/primary/zoffset")
SystemInfo["Blindscan_t2_available"] = fileCheck("/proc/stb/info/vumodel")
SystemInfo["RcTypeChangable"] = not (
    HardwareInfo().get_device_model().startswith('et8500')
    or HardwareInfo().get_device_model().startswith('et7')) and pathExists(
        '/proc/stb/ir/rc/type')
SystemInfo["HasFullHDSkinSupport"] = HardwareInfo().get_device_model() not in (
Example #16
0
SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
for cislot in range(0, SystemInfo["CommonInterface"]):
    SystemInfo["CI%dSupportsHighBitrates" % cislot] = fileCheck(
        "/proc/stb/tsmux/ci%d_tsclk" % cislot)
    SystemInfo["CI%dRelevantPidsRoutingSupport" % cislot] = fileCheck(
        "/proc/stb/tsmux/ci%d_relevant_pids_routing" % cislot)

SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["PIPAvailable"] = getMachineBuild() not in (
    "i55plus") and SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance(
).canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists(
    "/dev/dbox/lcd0")
SystemInfo["7segment"] = getDisplayType() in ('7segment')
SystemInfo["ConfigDisplay"] = SystemInfo[
    "FrontpanelDisplay"] and getDisplayType() not in ('7segment')
SystemInfo["LCDSKINSetup"] = pathExists(
    "/usr/share/enigma2/display") and not SystemInfo["7segment"]
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck(
    "/proc/stb/video/zapping_mode")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["OledDisplay"] = fileExists("/dev/dbox/oled0")
SystemInfo["LcdDisplay"] = fileExists("/dev/dbox/lcd0")
SystemInfo["DisplayLED"] = getBoxType() in ('gb800se', 'gb800solo', 'gbx1',
                                            'gbx2', 'gbx3', 'gbx3h')
SystemInfo["LEDButtons"] = getBoxType() == 'vuultimo'
SystemInfo["DeepstandbySupport"] = HardwareInfo().has_deepstandby()
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
Example #17
0
class AVSwitch:

    has_rca = getHaveRCA() in ('True', )
    has_dvi = getHaveDVI() in ('True', )
    has_jack = getHaveAVJACK() in ('True', )
    has_scart = getHaveSCART() in ('True', )

    print "SystemInfo", "MachineBuild", getMachineBuild()
    print "SystemInfo", "BoxType", getBoxType()
    print "SystemInfo", "BrandOEM", getBrandOEM()
    print "SystemInfo", "DisplayType", getDisplayType()
    print "SystemInfo", "HaveRCA", getHaveRCA()
    print "SystemInfo", "getHaveDVI", getHaveDVI()
    print "SystemInfo", "HaveYUV", getHaveYUV()
    print "SystemInfo", "HaveSCART", getHaveSCART()
    print "SystemInfo", "HaveAVJACK", getHaveAVJACK()
    print "SystemInfo", "HaveSCARTYUV", getHaveSCARTYUV()
    print "SystemInfo", "HaveHDMI", getHaveHDMI()
    print "SystemInfo", "MachineMtdRoot", getMachineMtdRoot()
    print "VideoWizard", "has_dvi", has_dvi
    print "VideoWizard", "has_rca", has_rca
    print "VideoWizard", "has_jack", has_jack
    print "VideoWizard", "has_scart", has_scart
    print "AVSwitch", "Scart-YPbPr", SystemInfo["Scart-YPbPr"]
    print "AVSwitch", "no_YPbPr", SystemInfo["no_YPbPr"]
    print "AVSwitch", "yellow_RCA_no_scart", SystemInfo["yellow_RCA_no_scart"]
    print "AVSwitch", "no_yellow_RCA__no_scart", SystemInfo[
        "no_yellow_RCA__no_scart"]

    rates = {}  # high-level, use selectable modes.
    modes = {}  # a list of (high-level) modes for a certain port.

    rates["PAL"] = {
        "50Hz": {
            50: "pal"
        },
        "60Hz": {
            60: "pal60"
        },
        "multi": {
            50: "pal",
            60: "pal60"
        }
    }

    rates["NTSC"] = {"60Hz": {60: "ntsc"}}

    rates["Multi"] = {"multi": {50: "pal", 60: "ntsc"}}

    rates["480i"] = {"60Hz": {60: "480i"}}

    rates["576i"] = {"50Hz": {50: "576i"}}

    rates["480p"] = {"60Hz": {60: "480p"}}

    rates["576p"] = {"50Hz": {50: "576p"}}

    rates["720p"] = {
        "50Hz": {
            50: "720p50"
        },
        "60Hz": {
            60: "720p"
        },
        "multi": {
            50: "720p50",
            60: "720p"
        }
    }

    rates["1080i"] = {
        "50Hz": {
            50: "1080i50"
        },
        "60Hz": {
            60: "1080i"
        },
        "multi": {
            50: "1080i50",
            60: "1080i"
        }
    }

    rates["1080p"] = {
        "50Hz": {
            50: "1080p50"
        },
        "60Hz": {
            60: "1080p"
        },
        "multi": {
            50: "1080p50",
            60: "1080p"
        }
    }

    rates["2160p"] = {
        "50Hz": {
            50: "2160p50"
        },
        "60Hz": {
            60: "2160p"
        },
        "multi": {
            50: "2160p50",
            60: "2160p"
        }
    }

    rates["2160p30"] = {"multi": {50: "2160p25", 60: "2160p30"}}

    rates["PC"] = {
        "1024x768": {
            60: "1024x768"
        },  # not possible on DM7025
        "800x600": {
            60: "800x600"
        },  # also not possible
        "720x480": {
            60: "720x480"
        },
        "720x576": {
            60: "720x576"
        },
        "1280x720": {
            60: "1280x720"
        },
        "1280x720 multi": {
            50: "1280x720_50",
            60: "1280x720"
        },
        "1920x1080": {
            60: "1920x1080"
        },
        "1920x1080 multi": {
            50: "1920x1080",
            60: "1920x1080_50"
        },
        "1280x1024": {
            60: "1280x1024"
        },
        "1366x768": {
            60: "1366x768"
        },
        "1366x768 multi": {
            50: "1366x768",
            60: "1366x768_50"
        },
        "1280x768": {
            60: "1280x768"
        },
        "640x480": {
            60: "640x480"
        }
    }

    modes["Scart"] = ["PAL", "NTSC", "Multi"]
    # modes["DVI-PC"] = ["PC"]

    modes["HDMI"] = SystemInfo["VideoModes"][0]
    widescreen_modes = SystemInfo["VideoModes"][1]

    modes["YPbPr"] = modes["HDMI"]

    if SystemInfo["Scart-YPbPr"]:
        modes["Scart-YPbPr"] = modes["HDMI"]

    # if "DVI-PC" in modes and not getModeList("DVI-PC"):
    # 	print "[VideoHardware] remove DVI-PC because of not existing modes"
    # 	del modes["DVI-PC"]

    if "YPbPr" in modes and SystemInfo["no_YPbPr"]:
        del modes["YPbPr"]

    if "Scart" in modes and SystemInfo["yellow_RCA_no_scart"]:
        modes["RCA"] = modes["Scart"]
        del modes["Scart"]

    if "Scart" in modes and SystemInfo["no_yellow_RCA__no_scart"]:
        del modes["Scart"]

    def __init__(self):
        self.last_modes_preferred = []
        self.on_hotplug = CList()
        self.current_mode = None
        self.current_port = None

        self.readAvailableModes()

        self.createConfig()
        self.readPreferredModes()

    def readAvailableModes(self):
        try:
            f = open("/proc/stb/video/videomode_choices")
            modes = f.read()[:-1]
            f.close()
        except IOError:
            print "[VideoHardware] couldn't read available videomodes."
            modes = []
            return modes
        return modes.split(' ')

    def readPreferredModes(self):
        try:
            f = open("/proc/stb/video/videomode_preferred")
            modes = f.read()[:-1]
            f.close()
            self.modes_preferred = modes.split(' ')
        except IOError:
            print "[VideoHardware] reading preferred modes failed, using all modes"
            self.modes_preferred = self.readAvailableModes()

        if self.modes_preferred != self.last_modes_preferred:
            self.last_modes_preferred = self.modes_preferred
            self.on_hotplug("HDMI")  # must be HDMI

    # check if a high-level mode with a given rate is available.
    def isModeAvailable(self, port, mode, rate):
        rate = self.rates[mode][rate]
        for mode in rate.values():
            if mode not in self.readAvailableModes():
                return False
        return True

    def isWidescreenMode(self, port, mode):
        return mode in self.widescreen_modes

    def setMode(self, port, mode, rate, force=None):
        print "[VideoHardware] setMode - port: %s, mode: %s, rate: %s" % (
            port, mode, rate)

        # config.av.videoport.setValue(port)
        # we can ignore "port"
        self.current_mode = mode
        self.current_port = port
        modes = self.rates[mode][rate]

        mode_50 = modes.get(50)
        mode_60 = modes.get(60)
        if mode_50 is None or force == 60:
            mode_50 = mode_60
        if mode_60 is None or force == 50:
            mode_60 = mode_50

        if os.path.exists(
                '/proc/stb/video/videomode_50hz') and getBoxType() not in (''):
            f = open("/proc/stb/video/videomode_50hz", "w")
            f.write(mode_50)
            f.close()
        if os.path.exists(
                '/proc/stb/video/videomode_60hz') and getBoxType() not in (''):
            f = open("/proc/stb/video/videomode_60hz", "w")
            f.write(mode_60)
            f.close()
        try:
            set_mode = modes.get(int(rate[:2]))
        except:  # not support 50Hz, 60Hz for 1080p
            set_mode = mode_50
        f = open("/proc/stb/video/videomode", "w")
        f.write(set_mode)
        f.close()
        map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3}
        self.setColorFormat(map[config.av.colorformat.value])

    def saveMode(self, port, mode, rate):
        config.av.videoport.setValue(port)
        config.av.videoport.save()
        if port in config.av.videomode:
            config.av.videomode[port].setValue(mode)
            config.av.videomode[port].save()
        if mode in config.av.videorate:
            config.av.videorate[mode].setValue(rate)
            config.av.videorate[mode].save()

    def isPortAvailable(self, port):
        # fixme
        return True

    def isPortUsed(self, port):
        if port == "HDMI":
            self.readPreferredModes()
            return len(self.modes_preferred) != 0
        else:
            return True

    def getPortList(self):
        return [port for port in self.modes if self.isPortAvailable(port)]

    # get a list with all modes, with all rates, for a given port.
    def getModeList(self, port):
        res = []
        for mode in self.modes[port]:
            # list all rates which are completely valid
            rates = [
                rate for rate in self.rates[mode]
                if self.isModeAvailable(port, mode, rate)
            ]

            # if at least one rate is ok, add this mode
            if len(rates):
                res.append((mode, rates))
        return res

    def createConfig(self, *args):
        hw_type = HardwareInfo().get_device_name()
        has_hdmi = HardwareInfo().has_hdmi()
        lst = []

        config.av.videomode = ConfigSubDict()
        config.av.videorate = ConfigSubDict()

        # create list of output ports
        portlist = self.getPortList()
        for port in portlist:
            descr = port
            if 'HDMI' in port:
                lst.insert(0, (port, descr))
            else:
                lst.append((port, descr))

            modes = self.getModeList(port)
            if len(modes):
                config.av.videomode[port] = ConfigSelection(
                    choices=[mode for (mode, rates) in modes])
            for (mode, rates) in modes:
                config.av.videorate[mode] = ConfigSelection(choices=rates)
        config.av.videoport = ConfigSelection(choices=lst)

    def setInput(self, input):
        INPUT = {"ENCODER": 0, "SCART": 1, "AUX": 2}
        eAVSwitch.getInstance().setInput(INPUT[input])

    def setColorFormat(self, value):
        if not self.current_port:
            self.current_port = config.av.videoport.value
        if self.current_port in ("YPbPr", "Scart-YPbPr"):
            eAVSwitch.getInstance().setColorFormat(3)
        elif self.current_port in ("RCA"):
            eAVSwitch.getInstance().setColorFormat(0)
        else:
            eAVSwitch.getInstance().setColorFormat(value)

    def setConfiguredMode(self):
        port = config.av.videoport.value
        if port not in config.av.videomode:
            print "[VideoHardware] current port not available, not setting videomode"
            return

        mode = config.av.videomode[port].value

        if mode not in config.av.videorate:
            print "[VideoHardware] current mode not available, not setting videomode"
            return

        rate = config.av.videorate[mode].value
        self.setMode(port, mode, rate)

    def setAspect(self, cfgelement):
        print "[VideoHardware] setting aspect: %s" % cfgelement.value
        f = open("/proc/stb/video/aspect", "w")
        f.write(cfgelement.value)
        f.close()

    def setWss(self, cfgelement):
        if not cfgelement.value:
            wss = "auto(4:3_off)"
        else:
            wss = "auto"
        print "[VideoHardware] setting wss: %s" % wss
        f = open("/proc/stb/denc/0/wss", "w")
        f.write(wss)
        f.close()

    def setPolicy43(self, cfgelement):
        print "[VideoHardware] setting policy: %s" % cfgelement.value
        f = open("/proc/stb/video/policy", "w")
        f.write(cfgelement.value)
        f.close()

    def setPolicy169(self, cfgelement):
        if os.path.exists("/proc/stb/video/policy2"):
            print "[VideoHardware] setting policy2: %s" % cfgelement.value
            f = open("/proc/stb/video/policy2", "w")
            f.write(cfgelement.value)
            f.close()

    def getOutputAspect(self):
        ret = (16, 9)
        port = config.av.videoport.value
        if port not in config.av.videomode:
            print "[VideoHardware] current port not available in getOutputAspect!!! force 16:9"
        else:
            mode = config.av.videomode[port].value
            force_widescreen = self.isWidescreenMode(port, mode)
            is_widescreen = force_widescreen or config.av.aspect.value in (
                "16:9", "16:10")
            is_auto = config.av.aspect.value == "auto"
            if is_widescreen:
                if force_widescreen:
                    pass
                else:
                    aspect = {
                        "16:9": "16:9",
                        "16:10": "16:10"
                    }[config.av.aspect.value]
                    if aspect == "16:10":
                        ret = (16, 10)
            elif is_auto:
                try:
                    aspect_str = open("/proc/stb/vmpeg/0/aspect", "r").read()
                    if aspect_str == "1":  # 4:3
                        ret = (4, 3)
                except IOError:
                    pass
            else:  # 4:3
                ret = (4, 3)
        return ret

    def getFramebufferScale(self):
        aspect = self.getOutputAspect()
        fb_size = getDesktop(0).size()
        return aspect[0] * fb_size.height(), aspect[1] * fb_size.width()

    def getAspectRatioSetting(self):
        valstr = config.av.aspectratio.value
        if valstr == "4_3_letterbox":
            val = 0
        elif valstr == "4_3_panscan":
            val = 1
        elif valstr == "16_9":
            val = 2
        elif valstr == "16_9_always":
            val = 3
        elif valstr == "16_10_letterbox":
            val = 4
        elif valstr == "16_10_panscan":
            val = 5
        elif valstr == "16_9_letterbox":
            val = 6
        return val
Example #18
0
SystemInfo["endbutton"] = getBoxType().startswith('ixuss')
SystemInfo["3FunctionButtons"] = getBoxType() == "et8000" or getBoxType() == "et6x00" or getBoxType() == "et10000" or getBoxType().startswith('gb')
SystemInfo["4FunctionButtons"] = getBoxType().startswith('gb')
SystemInfo["WakeOnLAN"] = fileCheck("/proc/stb/fp/wol") or fileCheck("/proc/stb/power/wol")
SystemInfo["HDMICEC"] = (fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) and fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
SystemInfo["HasHDMI-CEC"] = (fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) and fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
SystemInfo["SABSetup"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/SABnzbd/plugin.pyo")
SystemInfo["SeekStatePlay"] = False
SystemInfo["GraphicLCD"] = getBoxType() in ('vuultimo', 'xpeedlx3', 'et10000', 'mutant2400', 'quadbox2400', 'sezammarvel', 'atemionemesis', 'mbultra', 'beyonwizt4')
SystemInfo["Blindscan"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/plugin.pyo")
SystemInfo["Satfinder"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/Satfinder/plugin.pyo")
SystemInfo["HasExternalPIP"] = getMachineBuild() not in ('et9x00', 'et6x00', 'et5x00') and fileCheck("/proc/stb/vmpeg/1/external")
SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
SystemInfo["VideoDestinationConfigurable"] = fileExists("/proc/stb/vmpeg/0/dst_left")
SystemInfo["GBWOL"] = fileExists("/usr/bin/gigablue_wol")
SystemInfo["LCDSKINSetup"] = path.exists("/usr/share/enigma2/display") and getDisplayType() not in ('7segment')
SystemInfo["grautec"] = fileExists("/tmp/usbtft")
SystemInfo["isGBIPBOX"] = fileExists("/usr/lib/enigma2/python/gbipbox.so")
SystemInfo["CIHelper"] = fileExists("/usr/bin/cihelper")
SystemInfo["3DMode"] = fileCheck("/proc/stb/fb/3dmode") or fileCheck("/proc/stb/fb/primary/3d")
SystemInfo["3DZNorm"] = fileCheck("/proc/stb/fb/znorm") or fileCheck("/proc/stb/fb/primary/zoffset")
SystemInfo["CanUse3DModeChoices"] = fileExists('/proc/stb/fb/3dmode_choices') and True or False
SystemInfo["HaveMultiBoot"] = (fileCheck("/boot/STARTUP") or fileCheck("/boot/cmdline.txt"))
SystemInfo["HaveMultiBootHD"] = fileCheck("/boot/STARTUP") and getMachineBuild() in ('hd51','vs1500','h7','ceryon7252')
SystemInfo["HaveMultiBootXC"] = fileCheck("/boot/cmdline.txt")
SystemInfo["HaveMultiBootGB"] = fileCheck("/boot/STARTUP") and getMachineBuild() in ('gb7252')
SystemInfo["HaveMultiBootCY"] = fileCheck("/boot/STARTUP") and getMachineBuild() in ('8100s')
SystemInfo["HaveMultiBootOS"] = fileCheck("/boot/STARTUP") and getMachineBuild() in ('osmio4k')
SystemInfo["HaveMultiBootDS"] = fileCheck("/boot/STARTUP") and getMachineBuild() in ('cc1','sf8008','ustym4kpro') and fileCheck("/dev/sda")
SystemInfo["need_dsw"] = getBoxType() not in ('osminiplus','osmega')
SystemInfo["HaveCISSL"] = fileCheck("/etc/ssl/certs/customer.pem") and fileCheck("/etc/ssl/certs/device.pem")
Example #19
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("About"))
		hddsplit = skin.parameters.get("AboutHddSplit", 0)

		model = getBoxType()

		procmodel = getBoxProc()

		stbplatform = boxbranding.getMachineBuild()

		AboutText = _("Hardware: ") + model + "\n"
		if stbplatform != model:
			AboutText += _("Platform: ") + stbplatform + "\n"
		if procmodel != model:
			AboutText += _("Proc model: ") + procmodel + "\n"

		procmodeltype = getBoxProcType()
		if procmodeltype is not None and procmodeltype != "unknown":
			AboutText += _("Hardware type: ") + procmodeltype + "\n"

		hwserial = getHWSerial()
		if hwserial is not None and hwserial != "unknown":
			AboutText += _("Hardware serial: ") + hwserial + "\n"
		if hwserial is not None and hwserial == "unknown":
			AboutText += _("Hardware serial: ") + about.getCPUSerial() + "\n"

		AboutText += _("Brand/Meta: ") + getBoxBrand() + "\n"

		AboutText += "\n"
		cpu = about.getCPUInfoString()
		AboutText += _("CPU: ") + cpu + "\n"
		AboutText += _("CPU brand: ") + about.getCPUBrand() + "\n"

		socfamily = boxbranding.getSoCFamily()
		if socfamily is not None:
			AboutText += _("SoC family: ") + socfamily + "\n"

		AboutText += _("CPU architecture: ") + about.getCPUArch() + "\n"

		if not boxbranding.getDisplayType().startswith(' '):
			AboutText += "\n"
			AboutText += _("Display type: ") + boxbranding.getDisplayType() + "\n"

		# [WanWizard] Removed until we find a reliable way to determine the installation date
		# AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

		EnigmaVersion = about.getEnigmaVersionString()
		EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
		if len(EnigmaVersion) == 3:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[2] + "-" + EnigmaVersion[1] + ")"
		else:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
		EnigmaVersion = _("Enigma2 version: ") + EnigmaVersion
		self["EnigmaVersion"] = StaticText(EnigmaVersion)
		AboutText += "\n" + EnigmaVersion + "\n"
		AboutText += _("Last update: ") + about.getUpdateDateString() + "\n"
		AboutText += _("Enigma2 (re)starts: %d\n") % config.misc.startCounter.value
		AboutText += _("Enigma2 debug level: %d\n") % eGetEnigmaDebugLvl()

		if fileExists("/etc/openvision/mediaservice"):
			mediaservice = open("/etc/openvision/mediaservice", "r").read().strip()
			AboutText += _("Media service: ") + mediaservice.replace("enigma2-plugin-systemplugins-","") + "\n"

		AboutText += "\n"

		AboutText += _("Drivers version: ") + about.getDriverInstalledDate() + "\n"
		AboutText += _("Kernel version: ") + boxbranding.getKernelVersion() + "\n"

		GStreamerVersion = _("GStreamer version: ") + about.getGStreamerVersionString(cpu).replace("GStreamer","")
		self["GStreamerVersion"] = StaticText(GStreamerVersion)
		AboutText += "\n" + GStreamerVersion + "\n"

		FFmpegVersion = _("FFmpeg version: ") + about.getFFmpegVersionString()
		self["FFmpegVersion"] = StaticText(FFmpegVersion)
		AboutText += FFmpegVersion + "\n"

		AboutText += "\n"
		AboutText += _("Python version: ") + about.getPythonVersionString() + "\n"
		AboutText += "\n"

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %s") % fp_version

			AboutText += fp_version + "\n"

		self["FPVersion"] = StaticText(fp_version)

		AboutText += _('Skin & Resolution: %s (%sx%s)\n') % (config.skin.primary_skin.value.split('/')[0], getDesktop(0).size().width(), getDesktop(0).size().height())

		self["TunerHeader"] = StaticText(_("Detected NIMs:"))
		AboutText += "\n"
		AboutText += _("Detected NIMs:") + "\n"

		nims = nimmanager.nimListCompressed()
		for count in range(len(nims)):
			if count < 4:
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")
			AboutText += nims[count] + "\n"

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		AboutText += "\n"
		AboutText += _("Detected HDD:") + "\n"

		hddlist = harddiskmanager.HDDList()
		hddinfo = ""
		if hddlist:
			formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)"
			for count in range(len(hddlist)):
				if hddinfo:
					hddinfo += "\n"
				hdd = hddlist[count][1]
				if int(hdd.free()) > 1024:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.Totalfree()/1024.0, "G", _("free"))
				else:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.Totalfree(), "M", _("free"))
		else:
			hddinfo = _("none")
		self["hddA"] = StaticText(hddinfo)
		AboutText += hddinfo + "\n\n" + _("Network Info:")
		for x in about.GetIPsFromNetworkInterfaces():
			AboutText += "\n" + x[0] + ": " + x[1]
		AboutText += '\n\n' + _("Uptime") + ": " + about.getBoxUptime()

		self["AboutScrollLabel"] = ScrollLabel(AboutText)
		self["key_green"] = Button(_("Translations"))
		self["key_red"] = Button(_("Latest Commits"))
		self["key_yellow"] = Button(_("Troubleshoot"))
		self["key_blue"] = Button(_("Memory Info"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"red": self.showCommits,
				"green": self.showTranslationInfo,
				"blue": self.showMemoryInfo,
				"yellow": self.showTroubleshoot,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
SystemInfo["canMode12"] = "%s_4.boxmode" % model in cmdline and cmdline[
    "%s_4.boxmode" % model] in ("1", "12") and "192M"
SystemInfo["canFlashWithOfgwrite"] = True
SystemInfo["HDRSupport"] = fileExists(
    "/proc/stb/hdmi/hlg_support_choices") and fileCheck(
        "/proc/stb/hdmi/hlg_support")
SystemInfo["CanDownmixAC3"] = fileHas("/proc/stb/audio/ac3_choices", "downmix")
SystemInfo["CanDownmixDTS"] = fileHas("/proc/stb/audio/dts_choices", "downmix")
SystemInfo["CanDownmixAAC"] = fileHas("/proc/stb/audio/aac_choices", "downmix")
SystemInfo["HDMIAudioSource"] = fileCheck("/proc/stb/hdmi/audio_source")
SystemInfo["BootDevice"] = getBootdevice()
SystemInfo["LnbPowerAlwaysOn"] = False
SystemInfo["SmallFlash"] = fileExists("/etc/smallflash")
SystemInfo["MiddleFlash"] = fileExists("/etc/middleflash")
SystemInfo["HaveCISSL"] = fileCheck(
    "/etc/ssl/certs/customer.pem") and fileCheck("/etc/ssl/certs/device.pem")
SystemInfo["CanChangeOsdAlpha"] = access("/proc/stb/video/alpha",
                                         R_OK) and True or False
SystemInfo["ScalerSharpness"] = fileExists(
    "/proc/stb/vmpeg/0/pep_scaler_sharpness")
SystemInfo["OScamInstalled"] = fileExists("/usr/bin/oscam") or fileExists(
    "/usr/bin/oscam-emu") or fileExists("/usr/bin/oscam-smod")
SystemInfo["OScamIsActive"] = SystemInfo["OScamInstalled"] and fileExists(
    "/tmp/.oscam/oscam.version")
SystemInfo["NCamInstalled"] = fileExists("/usr/bin/ncam")
SystemInfo["NCamIsActive"] = SystemInfo["NCamInstalled"] and fileExists(
    "/tmp/.ncam/ncam.version")
SystemInfo["OpenVisionModule"] = fileCheck("/proc/stb/info/openvision")
SystemInfo["7segment"] = getDisplayType() == "7segment"
SystemInfo["CanFadeOut"] = False
Example #21
0
                                            'sezammarvel', 'atemionemesis',
                                            'mbultra', 'beyonwizt4')
SystemInfo["Blindscan"] = fileExists(
    "/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/plugin.pyo")
SystemInfo["Satfinder"] = fileExists(
    "/usr/lib/enigma2/python/Plugins/SystemPlugins/Satfinder/plugin.pyo")
SystemInfo["HasExternalPIP"] = getMachineBuild() not in (
    'et9x00', 'et6x00', 'et5x00') and fileCheck("/proc/stb/vmpeg/1/external")
SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
SystemInfo["VideoDestinationConfigurable"] = fileExists(
    "/proc/stb/vmpeg/0/dst_left")
SystemInfo["GBWOL"] = fileExists("/usr/bin/gigablue_wol")
SystemInfo["VuplusVFD"] = getBoxType() in ('vuduo2')
SystemInfo["XcoreVFD"] = getMachineBuild() in ('xc7346', 'xc7439')
SystemInfo["LCDSKINSetup"] = path.exists(
    "/usr/share/enigma2/display") and getDisplayType() not in (
        '7segment', 'textlcd7segment') and not fileExists(
            "/usr/lib/enigma2/python/Plugins/Extensions/LCD4linux/plugin.pyo"
        ) or SystemInfo["VuplusVFD"]
SystemInfo["LCDClockSetup"] = path.exists(
    "/usr/share/enigma2/display") and getDisplayType() not in (
        'textlcd', '7segment', 'textlcd7segment') and not fileExists(
            "/usr/lib/enigma2/python/Plugins/Extensions/LCD4linux/plugin.pyo")
SystemInfo["VFD_scroll_repeats"] = fileCheck("/proc/stb/lcd/scroll_repeats")
SystemInfo["VFD_scroll_delay"] = fileCheck("/proc/stb/lcd/scroll_delay")
SystemInfo["VFD_initial_scroll_delay"] = fileCheck(
    "/proc/stb/lcd/initial_scroll_delay")
SystemInfo["VFD_final_scroll_delay"] = fileCheck(
    "/proc/stb/lcd/final_scroll_delay")
SystemInfo["LCDMiniTV"] = fileExists("/proc/stb/lcd/mode")
SystemInfo["LCDMiniTVPiP"] = SystemInfo["LCDMiniTV"] and getBoxType() not in (
Example #22
0
def useLcdPicons():
    return getDisplayType() in ("bwlcd255", "bwlcd140",
                                "bwlcd128") or config.lcd.picon_pack.value
Example #23
0
class AVSwitch:
	hw_type = HardwareInfo().get_device_name()
	has_rca = getHaveRCA() in ('True',)
	has_dvi = getHaveDVI() in ('True',)
	has_jack = getHaveAVJACK() in ('True',)
	has_scart = getHaveSCART() in ('True',)

	print "SystemInfo", "MachineBuild", getMachineBuild()
	print "SystemInfo", "BoxType", getBoxType()
	print "SystemInfo", "BrandOEM", getBrandOEM()
	print "SystemInfo", "DisplayType", getDisplayType()
	print "SystemInfo", "HaveRCA", getHaveRCA()
	print "SystemInfo", "getHaveDVI", getHaveDVI()
	print "SystemInfo", "HaveYUV", getHaveYUV()
	print "SystemInfo", "HaveSCART", getHaveSCART()
	print "SystemInfo", "HaveAVJACK", getHaveAVJACK()
	print "SystemInfo", "HaveSCARTYUV", getHaveSCARTYUV()
	print "SystemInfo", "HaveHDMI", getHaveHDMI()
	print "SystemInfo", "MachineMtdRoot", getMachineMtdRoot()
	print "VideoWizard", "has_dvi", has_dvi
	print "VideoWizard", "has_rca", has_rca
	print "VideoWizard", "has_jack", has_jack
	print "VideoWizard", "has_scart", has_scart
	print "AVSwitch", "Scart-YPbPr", SystemInfo["Scart-YPbPr"]
	print "AVSwitch", "no_YPbPr", SystemInfo["no_YPbPr"]
	print "AVSwitch", "yellow_RCA_no_scart", SystemInfo["yellow_RCA_no_scart"]
	print "AVSwitch", "no_yellow_RCA__no_scart", SystemInfo["no_yellow_RCA__no_scart"]

	rates = { } # high-level, use selectable modes.
	modes = { }  # a list of (high-level) modes for a certain port.

	rates["PAL"]  = { "50Hz":  { 50: "pal" },
					  "60Hz":  { 60: "pal60" },
					  "multi": { 50: "pal", 60: "pal60" } }

	rates["NTSC"]  = { "60Hz": { 60: "ntsc" } }

	rates["Multi"] = { "multi": { 50: "pal", 60: "ntsc" } }

	rates["480i"] = { "60Hz": { 60: "480i" } }

	rates["576i"] = { "50Hz": { 50: "576i" } }

	rates["480p"] = { "60Hz": { 60: "480p" } }

	rates["576p"] = { "50Hz": { 50: "576p" } }

	rates["720p"] = { "50Hz": { 50: "720p50" },
					  "60Hz": { 60: "720p" },
					  "multi": { 50: "720p50", 60: "720p" } }

	rates["1080i"] = { "50Hz":  { 50: "1080i50" },
					   "60Hz":  { 60: "1080i" },
					   "multi": { 50: "1080i50", 60: "1080i" } }

	rates["1080p"] = { "50Hz":  { 50: "1080p50" },
					   "60Hz":  { 60: "1080p" },
					   "multi": { 50: "1080p50", 60: "1080p" } }

	rates["2160p"] = { "50Hz":  { 50: "2160p50" },
					   "60Hz":  { 60: "2160p" },
					   "multi": { 50: "2160p50", 60: "2160p" } }

	rates["2160p30"] = { "multi": { 50: "2160p25", 60: "2160p30" } }

	rates["PC"] = {
		"1024x768": { 60: "1024x768" }, # not possible on DM7025
		"800x600" : { 60: "800x600" },  # also not possible
		"720x480" : { 60: "720x480" },
		"720x576" : { 60: "720x576" },
		"1280x720": { 60: "1280x720" },
		"1280x720 multi": { 50: "1280x720_50", 60: "1280x720" },
		"1920x1080": { 60: "1920x1080"},
		"1920x1080 multi": { 50: "1920x1080", 60: "1920x1080_50" },
		"1280x1024" : { 60: "1280x1024"},
		"1366x768" : { 60: "1366x768"},
		"1366x768 multi" : { 50: "1366x768", 60: "1366x768_50" },
		"1280x768": { 60: "1280x768" },
		"640x480" : { 60: "640x480" }
	}

	modes["Scart"] = ["PAL", "NTSC", "Multi"]
	# modes["DVI-PC"] = ["PC"]

	modes["HDMI"] = SystemInfo["VideoModes"][0] 
	widescreen_modes = SystemInfo["VideoModes"][1]

	modes["YPbPr"] = modes["HDMI"]
	if getBoxType() in ('dm500hd', 'dm800', 'vuuno', 'vusolo', 'vusolo2', 'vuultimo', 'vuduo', 'vuduo2'):
		
		if SystemInfo["Scart-YPbPr"]:
		modes["Scart-YPbPr"] = modes["HDMI"]

	# if "DVI-PC" in modes and not getModeList("DVI-PC"):
	# 	print "[VideoHardware] remove DVI-PC because of not existing modes"
	# 	del modes["DVI-PC"]

	if "YPbPr" in modes and SystemInfo["no_YPbPr"]:
		del modes["YPbPr"]

	if "Scart" in modes and SystemInfo["yellow_RCA_no_scart"]:
		modes["RCA"] = modes["Scart"]
		del modes["Scart"]

	if "Scart" in modes and SystemInfo["no_yellow_RCA__no_scart"]:
		del modes["Scart"]

	def __init__(self):
		self.last_modes_preferred =  [ ]
		self.on_hotplug = CList()
		self.current_mode = None
		self.current_port = None

		self.readAvailableModes()

		self.createConfig()
		self.readPreferredModes()

	def readAvailableModes(self):
		try:
			f = open("/proc/stb/video/videomode_choices")
			modes = f.read()[:-1]
			f.close()
		except IOError:
			print "[VideoHardware] couldn't read available videomodes."
			modes = [ ]
			return modes
		return modes.split(' ')

	def readPreferredModes(self):
		try:
			f = open("/proc/stb/video/videomode_preferred")
			modes = f.read()[:-1]
			f.close()
			self.modes_preferred = modes.split(' ')
		except IOError:
			print "[VideoHardware] reading preferred modes failed, using all modes"
			self.modes_preferred = self.readAvailableModes()

		if self.modes_preferred != self.last_modes_preferred:
			self.last_modes_preferred = self.modes_preferred
			self.on_hotplug("HDMI") # must be HDMI

	# check if a high-level mode with a given rate is available.
	def isModeAvailable(self, port, mode, rate):
		rate = self.rates[mode][rate]
		for mode in rate.values():
			if mode not in self.readAvailableModes():
				return False
		return True

	def isWidescreenMode(self, port, mode):
		return mode in self.widescreen_modes

	def setMode(self, port, mode, rate, force = None):
		print "[VideoHardware] setMode - port: %s, mode: %s, rate: %s" % (port, mode, rate)

		# config.av.videoport.setValue(port)
		# we can ignore "port"
		self.current_mode = mode
		self.current_port = port
		modes = self.rates[mode][rate]

		mode_50 = modes.get(50)
		mode_60 = modes.get(60)
		if mode_50 is None or force == 60:
			mode_50 = mode_60
		if mode_60 is None or force == 50:
			mode_60 = mode_50

		if os.path.exists('/proc/stb/video/videomode_50hz') and getBoxType() not in (''):
			f = open("/proc/stb/video/videomode_50hz", "w")
			f.write(mode_50)
			f.close()
		if os.path.exists('/proc/stb/video/videomode_60hz') and getBoxType() not in (''):
			f = open("/proc/stb/video/videomode_60hz", "w")
			f.write(mode_60)
			f.close()
		try:
			set_mode = modes.get(int(rate[:2]))
		except: # not support 50Hz, 60Hz for 1080p
			set_mode = mode_50
		f = open("/proc/stb/video/videomode", "w")
		f.write(set_mode)
		f.close()
		map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3}
		self.setColorFormat(map[config.av.colorformat.value])

	def saveMode(self, port, mode, rate):
		config.av.videoport.setValue(port)
		config.av.videoport.save()
		if port in config.av.videomode:
			config.av.videomode[port].setValue(mode)
			config.av.videomode[port].save()
		if mode in config.av.videorate:
			config.av.videorate[mode].setValue(rate)
			config.av.videorate[mode].save()

	def isPortAvailable(self, port):
		# fixme
		return True

	def isPortUsed(self, port):
		if port == "HDMI":
			self.readPreferredModes()
			return len(self.modes_preferred) != 0
		else:
			return True

	def getPortList(self):
		return [port for port in self.modes if self.isPortAvailable(port)]

	# get a list with all modes, with all rates, for a given port.
	def getModeList(self, port):
		res = [ ]
		for mode in self.modes[port]:
			# list all rates which are completely valid
			rates = [rate for rate in self.rates[mode] if self.isModeAvailable(port, mode, rate)]

			# if at least one rate is ok, add this mode
			if len(rates):
				res.append( (mode, rates) )
		return res

	def createConfig(self, *args):
		hw_type = HardwareInfo().get_device_name()
		has_hdmi = HardwareInfo().has_hdmi()
		lst = []

		config.av.videomode = ConfigSubDict()
		config.av.videorate = ConfigSubDict()

		# create list of output ports
		portlist = self.getPortList()
		for port in portlist:
			descr = port
			if 'HDMI' in port:
				lst.insert(0, (port, descr))
			else:
				lst.append((port, descr))

			modes = self.getModeList(port)
			if len(modes):
				config.av.videomode[port] = ConfigSelection(choices = [mode for (mode, rates) in modes])
			for (mode, rates) in modes:
				config.av.videorate[mode] = ConfigSelection(choices = rates)
		config.av.videoport = ConfigSelection(choices = lst)

	def setInput(self, input):
		INPUT = { "ENCODER": 0, "SCART": 1, "AUX": 2 }
		eAVSwitch.getInstance().setInput(INPUT[input])

	def setColorFormat(self, value):
		if not self.current_port:
			self.current_port = config.av.videoport.value
		if self.current_port in ("YPbPr", "Scart-YPbPr"):
			eAVSwitch.getInstance().setColorFormat(3)
		elif self.current_port in ("RCA"):
			eAVSwitch.getInstance().setColorFormat(0)
		else:
			eAVSwitch.getInstance().setColorFormat(value)

	def setConfiguredMode(self):
		port = config.av.videoport.value
		if port not in config.av.videomode:
			print "[VideoHardware] current port not available, not setting videomode"
			return

		mode = config.av.videomode[port].value

		if mode not in config.av.videorate:
			print "[VideoHardware] current mode not available, not setting videomode"
			return

		rate = config.av.videorate[mode].value
		self.setMode(port, mode, rate)

	def setAspect(self, cfgelement):
		print "[VideoHardware] setting aspect: %s" % cfgelement.value
		f = open("/proc/stb/video/aspect", "w")
		f.write(cfgelement.value)
		f.close()

	def setWss(self, cfgelement):
		if not cfgelement.value:
			wss = "auto(4:3_off)"
		else:
			wss = "auto"
		print "[VideoHardware] setting wss: %s" % wss
		f = open("/proc/stb/denc/0/wss", "w")
		f.write(wss)
		f.close()

	def setPolicy43(self, cfgelement):
		print "[VideoHardware] setting policy: %s" % cfgelement.value
		f = open("/proc/stb/video/policy", "w")
		f.write(cfgelement.value)
		f.close()

	def setPolicy169(self, cfgelement):
		if os.path.exists("/proc/stb/video/policy2"):
			print "[VideoHardware] setting policy2: %s" % cfgelement.value
			f = open("/proc/stb/video/policy2", "w")
			f.write(cfgelement.value)
			f.close()

	def getOutputAspect(self):
		ret = (16,9)
		port = config.av.videoport.value
		if port not in config.av.videomode:
			print "[VideoHardware] current port not available in getOutputAspect!!! force 16:9"
		else:
			mode = config.av.videomode[port].value
			force_widescreen = self.isWidescreenMode(port, mode)
			is_widescreen = force_widescreen or config.av.aspect.value in ("16:9", "16:10")
			is_auto = config.av.aspect.value == "auto"
			if is_widescreen:
				if force_widescreen:
					pass
				else:
					aspect = {"16:9": "16:9", "16:10": "16:10"}[config.av.aspect.value]
					if aspect == "16:10":
						ret = (16,10)
			elif is_auto:
				try:
					aspect_str = open("/proc/stb/vmpeg/0/aspect", "r").read()
					if aspect_str == "1": # 4:3
						ret = (4,3)
				except IOError:
					pass
			else:  # 4:3
				ret = (4,3)
		return ret

	def getFramebufferScale(self):
		aspect = self.getOutputAspect()
		fb_size = getDesktop(0).size()
		return aspect[0] * fb_size.height(), aspect[1] * fb_size.width()

	def getAspectRatioSetting(self):
		valstr = config.av.aspectratio.value
		if valstr == "4_3_letterbox":
			val = 0
		elif valstr == "4_3_panscan":
			val = 1
		elif valstr == "16_9":
			val = 2
		elif valstr == "16_9_always":
			val = 3
		elif valstr == "16_10_letterbox":
			val = 4
		elif valstr == "16_10_panscan":
			val = 5
		elif valstr == "16_9_letterbox":
			val = 6
		return val

iAVSwitch = AVSwitch()

def InitAVSwitch():
	config.av.yuvenabled = ConfigBoolean(default=True)
	colorformat_choices = {"cvbs": _("CVBS"), "rgb": _("RGB"), "svideo": _("S-Video")}
	# when YUV is not enabled, don't let the user select it
	if config.av.yuvenabled.value:
		colorformat_choices["yuv"] = _("YPbPr")

	config.av.autores = ConfigSelection(choices={"disabled": _("Disabled"), "all": _("All resolutions"), "hd": _("only HD")}, default="disabled")
	choicelist = []
	for i in range(5, 16):
		choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i))
	config.av.autores_label_timeout = ConfigSelection(default = "5", choices = [("0", _("Not Shown"))] + choicelist)
	config.av.autores_delay = ConfigSelectionNumber(min = 0, max = 15000, stepwidth = 500, default = 500, wraparound = True)
	config.av.autores_deinterlace = ConfigYesNo(default=False)
	config.av.autores_sd = ConfigSelection(choices={"720p": _("720p"), "1080i": _("1080i")}, default="720p")
	config.av.autores_480p24 = ConfigSelection(choices={"480p24": _("480p 24Hz"), "720p24": _("720p 24Hz"), "1080p24": _("1080p 24Hz")}, default="1080p24")
	config.av.autores_720p24 = ConfigSelection(choices={"720p24": _("720p 24Hz"), "1080p24": _("1080p 24Hz")}, default="1080p24")
	config.av.autores_1080p24 = ConfigSelection(choices={"1080p24": _("1080p 24Hz"), "1080p25": _("1080p 25Hz")}, default="1080p24")
	config.av.autores_1080p25 = ConfigSelection(choices={"1080p25": _("1080p 25Hz"), "1080p50": _("1080p 50Hz")}, default="1080p25")
	config.av.autores_1080p30 = ConfigSelection(choices={"1080p30": _("1080p 30Hz"), "1080p60": _("1080p 60Hz")}, default="1080p30")
	config.av.autores_2160p24 = ConfigSelection(choices={"2160p24": _("2160p 24Hz"), "2160p25": _("2160p 25Hz"), "2160p30": _("2160p 30Hz")}, default="2160p24")
	config.av.autores_2160p25 = ConfigSelection(choices={"2160p25": _("2160p 25Hz"), "2160p50": _("2160p 50Hz")}, default="2160p25")
	config.av.autores_2160p30 = ConfigSelection(choices={"2160p30": _("2160p 30Hz"), "2160p60": _("2160p 60Hz")}, default="2160p30")
	config.av.colorformat = ConfigSelection(choices=colorformat_choices, default="rgb")
	config.av.aspectratio = ConfigSelection(choices={
			"4_3_letterbox": _("4:3 Letterbox"),
			"4_3_panscan": _("4:3 PanScan"),
			"16_9": _("16:9"),
			"16_9_always": _("16:9 always"),
			"16_10_letterbox": _("16:10 Letterbox"),
			"16_10_panscan": _("16:10 PanScan"),
			"16_9_letterbox": _("16:9 Letterbox")},
			default = "16_9")
	config.av.aspect = ConfigSelection(choices={
			"4:3": _("4:3"),
			"16:9": _("16:9"),
			"16:10": _("16:10"),
			"auto": _("Automatic")},
			default = "16:9")
	policy2_choices = {
	# TRANSLATORS: (aspect ratio policy: black bars on top/bottom) in doubt, keep english term.
	"letterbox": _("Letterbox"),
	# TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term
	"panscan": _("Pan&scan"),
	# TRANSLATORS: (aspect ratio policy: display as fullscreen, even if this breaks the aspect)
	"scale": _("Just scale")}
	if os.path.exists("/proc/stb/video/policy2_choices"):
		f = open("/proc/stb/video/policy2_choices")
		if "auto" in f.readline():
			# TRANSLATORS: (aspect ratio policy: always try to display as fullscreen, when there is no content (black bars) on left/right, even if this breaks the aspect.
			policy2_choices.update({"auto": _("Auto")})
		f.close()
	config.av.policy_169 = ConfigSelection(choices=policy2_choices, default = "letterbox")
	policy_choices = {
	# TRANSLATORS: (aspect ratio policy: black bars on left/right) in doubt, keep english term.
	"panscan": _("Pillarbox"),
	# TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term
	"letterbox": _("Pan&scan"),
	# TRANSLATORS: (aspect ratio policy: display as fullscreen, with stretching the left/right)
	# "nonlinear": _("Nonlinear"),
	# TRANSLATORS: (aspect ratio policy: display as fullscreen, even if this breaks the aspect)
	"bestfit": _("Just scale")}
	if os.path.exists("/proc/stb/video/policy_choices"):
		f = open("/proc/stb/video/policy_choices")
		if "auto" in f.readline():
			# TRANSLATORS: (aspect ratio policy: always try to display as fullscreen, when there is no content (black bars) on left/right, even if this breaks the aspect.
			policy_choices.update({"auto": _("Auto")})
		f.close()
	config.av.policy_43 = ConfigSelection(choices=policy_choices, default = "panscan")
	config.av.tvsystem = ConfigSelection(choices = {"pal": _("PAL"), "ntsc": _("NTSC"), "multinorm": _("multinorm")}, default="pal")
	config.av.wss = ConfigEnableDisable(default = True)
	config.av.generalAC3delay = ConfigSelectionNumber(-1000, 1000, 5, default = 0)
	config.av.generalPCMdelay = ConfigSelectionNumber(-1000, 1000, 5, default = 0)
	config.av.vcrswitch = ConfigEnableDisable(default = False)

	config.av.aspect.setValue('16:9')
	config.av.aspect.addNotifier(iAVSwitch.setAspect)
	config.av.wss.addNotifier(iAVSwitch.setWss)
	config.av.policy_43.addNotifier(iAVSwitch.setPolicy43)
	config.av.policy_169.addNotifier(iAVSwitch.setPolicy169)

	def setColorFormat(configElement):
		if config.av.videoport and config.av.videoport.value in ("YPbPr", "Scart-YPbPr"):
			iAVSwitch.setColorFormat(3)
		elif config.av.videoport and config.av.videoport.value in ("RCA"):
			iAVSwitch.setColorFormat(0)
		else:
			map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3}
			iAVSwitch.setColorFormat(map[configElement.value])
	config.av.colorformat.addNotifier(setColorFormat)

	def setAspectRatio(configElement):
		map = {"4_3_letterbox": 0, "4_3_panscan": 1, "16_9": 2, "16_9_always": 3, "16_10_letterbox": 4, "16_10_panscan": 5, "16_9_letterbox" : 6}
		iAVSwitch.setAspectRatio(map[configElement.value])

	iAVSwitch.setInput("ENCODER") # init on startup
	SystemInfo["ScartSwitch"] = eAVSwitch.getInstance().haveScartSwitch()

	if SystemInfo["Canedidchecking"]:
		def setEDIDBypass(configElement):
			try:
				f = open("/proc/stb/hdmi/bypass_edid_checking", "w")
				f.write(configElement.value)
				f.close()
			except:
				pass
		config.av.bypass_edid_checking = ConfigSelection(choices={
				"00000000": _("off"),
				"00000001": _("on")},
				default = "00000000")
		config.av.bypass_edid_checking.addNotifier(setEDIDBypass)
	else:
		config.av.bypass_edid_checking = ConfigNothing()

	if SystemInfo["havecolorspace"]:
		def setHDMIColorspace(configElement):
			try:
				f = open("/proc/stb/video/hdmi_colorspace", "w")
				f.write(configElement.value)
				f.close()
			except:
				pass
		if getBoxType() in ('vuzero4k','vusolo4k','vuuno4k','vuuno4kse','vuultimo4k'):
			config.av.hdmicolorspace = ConfigSelection(choices={
					"Edid(Auto)": _("Auto"),
					"Hdmi_Rgb": _("RGB"),
					"444": _("YCbCr444"),
					"422": _("YCbCr422"),
					"420": _("YCbCr420")},
					default = "Edid(Auto)")
		else:
			config.av.hdmicolorspace = ConfigSelection(choices={
					"auto": _("auto"),
					"rgb": _("rgb"),
					"420": _("420"),
					"422": _("422"),
					"444": _("444")},
					default = "auto")
		config.av.hdmicolorspace.addNotifier(setHDMIColorspace)
	else:
		config.av.hdmicolorspace = ConfigNothing()

	if SystemInfo["havecolorimetry"]:
		def setHDMIColorimetry(configElement):
			try:
				f = open("/proc/stb/video/hdmi_colorimetry", "w")
				f.write(configElement.value)
				f.close()
			except:
				pass
		config.av.hdmicolorimetry = ConfigSelection(choices={
				"Auto": _("Auto"),
				"bt2020ncl": _("BT 2020 NCL"),
				"bt2020cl": _("BT 2020 CL"),
				"bt709": _("BT 709")},
				default = "Auto")
		config.av.hdmicolorimetry.addNotifier(setHDMIColorimetry)
	else:
		config.av.hdmicolorimetry = ConfigNothing()

	if SystemInfo["haveboxmode"]:
		def setBoxmode(configElement):
			try:
				f = open("/proc/stb/info/boxmode", "w")
				f.write(configElement.value)
				f.close()
			except:
				pass
		config.av.boxmode = ConfigSelection(choices={
				"12": _("PIP enabled, no HDR"),
				"1": _("HDR, 12bit 4:2:0/4:2:2, no PIP")},
				default = "12")
		config.av.boxmode.addNotifier(setBoxmode)
	else:
		config.av.boxmode = ConfigNothing()

	if SystemInfo["havehdmicolordepth"]:
		def setHdmiColordepth(configElement):
			try:
				f = open("/proc/stb/video/hdmi_colordepth", "w")
				f.write(configElement.value)
				f.close()
			except:
				pass
		config.av.hdmicolordepth = ConfigSelection(choices={
				"auto": _("Auto"),
				"8bit": _("8bit"),
				"10bit": _("10bit"),
				"12bit": _("12bit")},
				default = "auto")
		config.av.hdmicolordepth.addNotifier(setHdmiColordepth)
	else:
		config.av.hdmicolordepth = ConfigNothing()

	if SystemInfo["Canaudiosource"]:
		def setAudioSource(configElement):
			try:
				f = open("/proc/stb/hdmi/audio_source", "w")
				f.write(configElement.value)
				f.close()
			except:
				pass
		config.av.audio_source = ConfigSelection(choices={
				"pcm": _("PCM"),
				"spdif": _("SPDIF")},
				default="pcm")
		config.av.audio_source.addNotifier(setAudioSource)
	else:
		config.av.audio_source = ConfigNothing()

	if SystemInfo["Can3DSurround"]:
		def set3DSurround(configElement):
			f = open("/proc/stb/audio/3d_surround", "w")
			f.write(configElement.value)
			f.close()
		choice_list = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]
		config.av.surround_3d = ConfigSelection(choices = choice_list, default = "none")
		config.av.surround_3d.addNotifier(set3DSurround)
	else:
		config.av.surround_3d = ConfigNothing()

	if SystemInfo["Can3DSpeaker"]:
		def set3DSurroundSpeaker(configElement):
			f = open("/proc/stb/audio/3d_surround_speaker_position", "w")
			f.write(configElement.value)
			f.close()
		choice_list = [("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))]
		config.av.surround_3d_speaker = ConfigSelection(choices = choice_list, default = "center")
		config.av.surround_3d_speaker.addNotifier(set3DSurroundSpeaker)
	else:
		config.av.surround_3d_speaker = ConfigNothing()

	if SystemInfo["CanAutoVolume"]:
		def setAutoVolume(configElement):
			f = open("/proc/stb/audio/avl", "w")
			f.write(configElement.value)
			f.close()
		choice_list = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]
		config.av.autovolume = ConfigSelection(choices = choice_list, default = "none")
		config.av.autovolume.addNotifier(setAutoVolume)
	else:
		config.av.autovolume = ConfigNothing()

	if SystemInfo["supportPcmMultichannel"]:
		def setPCMMultichannel(configElement):
			open("/proc/stb/audio/multichannel_pcm", "w").write(configElement.value and "enable" or "disable")
		config.av.pcm_multichannel = ConfigYesNo(default = False)
		config.av.pcm_multichannel.addNotifier(setPCMMultichannel)

	if SystemInfo["CanDownmixAC3"]:
		def setAC3Downmix(configElement):
			open("/proc/stb/audio/ac3", "w").write(configElement.value and "downmix" or "passthrough")
			if SystemInfo.get("supportPcmMultichannel", False) and not configElement.value:
				SystemInfo["CanPcmMultichannel"] = True
			else:
				SystemInfo["CanPcmMultichannel"] = False
				if SystemInfo["supportPcmMultichannel"]:
					config.av.pcm_multichannel.setValue(False)
		config.av.downmix_ac3 = ConfigYesNo(default = True)
		config.av.downmix_ac3.addNotifier(setAC3Downmix)

	if SystemInfo["CanDownmixDTS"]:
		def setDTSDownmix(configElement):
			open("/proc/stb/audio/dts", "w").write(configElement.value and "downmix" or "passthrough")
		config.av.downmix_dts = ConfigYesNo(default = True)
		config.av.downmix_dts.addNotifier(setDTSDownmix)

	if SystemInfo["CanDownmixAAC"]:
		def setAACDownmix(configElement):
			open("/proc/stb/audio/aac", "w").write(configElement.value and "downmix" or "passthrough")
		config.av.downmix_aac = ConfigYesNo(default = True)
		config.av.downmix_aac.addNotifier(setAACDownmix)


	if SystemInfo["CanAACTranscode"]:
		def setAACTranscode(configElement):
			open("/proc/stb/audio/aac_transcode", "w").write(configElement.value)
		config.av.transcodeaac = ConfigSelection(default = "off", choices = [("off", _("off")), ("ac3", _("AC3")), ("dts", _("DTS"))])
		config.av.transcodeaac.addNotifier(setAACTranscode)
	else:
		config.av.transcodeaac = ConfigNothing()

	if SystemInfo["HasScaler_sharpness"]:
		def setScaler_sharpness(config):
			myval = int(config.value)
			try:
				print "[VideoHardware] setting scaler_sharpness to: %0.8X" % myval
				f = open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w")
				f.write("%0.8X" % myval)
				f.close()
				f = open("/proc/stb/vmpeg/0/pep_apply", "w")
				f.write("1")
				f.close()
			except IOError:
				print "[VideoHardware] couldn't write pep_scaler_sharpness"

		if getBoxType() in ('gbquad', 'gbquadplus'):
			config.av.scaler_sharpness = ConfigSlider(default=5, limits=(0,26))
		else:
			config.av.scaler_sharpness = ConfigSlider(default=13, limits=(0,26))
		config.av.scaler_sharpness.addNotifier(setScaler_sharpness)
	else:
		config.av.scaler_sharpness = NoSave(ConfigNothing())

	config.av.edid_override = ConfigYesNo(default = False)

	iAVSwitch.setConfiguredMode()

class VideomodeHotplug:
	def __init__(self):
		pass

	def start(self):
		iAVSwitch.on_hotplug.append(self.hotplug)

	def stop(self):
		iAVSwitch.on_hotplug.remove(self.hotplug)

	def hotplug(self, what):
		print "[VideoHardware] hotplug detected on port '%s'" % what
		port = config.av.videoport.value
		mode = config.av.videomode[port].value
		rate = config.av.videorate[mode].value

		if not iAVSwitch.isModeAvailable(port, mode, rate):
			print "[VideoHardware] mode %s/%s/%s went away!" % (port, mode, rate)
			modelist = iAVSwitch.getModeList(port)
			if not len(modelist):
				print "[VideoHardware] sorry, no other mode is available (unplug?). Doing nothing."
				return
			mode = modelist[0][0]
			rate = modelist[0][1]
			print "[VideoHardware] setting %s/%s/%s" % (port, mode, rate)
			iAVSwitch.setMode(port, mode, rate)

hotplug = None

def startHotplug():
	global hotplug
	hotplug = VideomodeHotplug()
	hotplug.start()

def stopHotplug():
	global hotplug
	hotplug.stop()

def InitiVideomodeHotplug(**kwargs):
	startHotplug()
Example #24
0
SystemInfo["HDRSupport"] = fileExists("/proc/stb/hdmi/hlg_support_choices") and fileCheck("/proc/stb/hdmi/hlg_support")
SystemInfo["CanDownmixAC3"] = fileHas("/proc/stb/audio/ac3_choices","downmix")
SystemInfo["CanDownmixDTS"] = fileHas("/proc/stb/audio/dts_choices","downmix")
SystemInfo["CanDownmixAAC"] = fileHas("/proc/stb/audio/aac_choices","downmix")
SystemInfo["HDMIAudioSource"] = fileCheck("/proc/stb/hdmi/audio_source")
SystemInfo["SmallFlash"] = fileExists("/etc/smallflash")
SystemInfo["HaveCISSL"] = fileCheck("/etc/ssl/certs/customer.pem") and fileCheck("/etc/ssl/certs/device.pem")
SystemInfo["CanChangeOsdAlpha"] = access("/proc/stb/video/alpha", R_OK) and True or False
SystemInfo["ScalerSharpness"] = fileExists("/proc/stb/vmpeg/0/pep_scaler_sharpness")
SystemInfo["OScamInstalled"] = fileExists("/usr/bin/oscam") or fileExists("/usr/bin/oscam-emu") or fileExists("/usr/bin/oscam-smod")
SystemInfo["OScamIsActive"] = SystemInfo["OScamInstalled"] and fileExists("/tmp/.oscam/oscam.version")
SystemInfo["NCamInstalled"] = fileExists("/usr/bin/ncam")
SystemInfo["NCamIsActive"] = SystemInfo["NCamInstalled"] and fileExists("/tmp/.ncam/ncam.version")
SystemInfo["OpenVisionModule"] = fileCheck("/proc/stb/info/openvision")
SystemInfo["OLDE2API"] = getBoxType() in ("dm800","su980")
SystemInfo["7segment"] = getDisplayType() == "7segment"
SystemInfo["OSDAnimation"] = fileCheck("/proc/stb/fb/animation_mode")
SystemInfo["RecoveryMode"] = fileCheck("/proc/stb/fp/boot_mode") and getBoxType() not in ("hd51","h7")
SystemInfo["AndroidMode"] =  SystemInfo["RecoveryMode"] and getBoxType() == "multibox" or getBoxBrand() in ("hypercube","linkdroid","mecool","wetek") or getBoxType() == "dreamone"
SystemInfo["grautec"] = fileExists("/tmp/usbtft")
SystemInfo["CanAC3plusTranscode"] = fileExists("/proc/stb/audio/ac3plus_choices")
SystemInfo["CanDTSHD"] = fileExists("/proc/stb/audio/dtshd_choices")
SystemInfo["CanWMAPRO"] = fileExists("/proc/stb/audio/wmapro")
SystemInfo["CanDownmixAACPlus"] = fileExists("/proc/stb/audio/aacplus_choices")
SystemInfo["CanAACTranscode"] = fileExists("/proc/stb/audio/aac_transcode_choices")
SystemInfo["GraphicLCD"] = getBoxType() in ("vuultimo","xpeedlx3","et10000","hd2400","sezammarvel","atemionemesis","mbultra","beyonwizt4","osmio4kplus")
SystemInfo["LCDMiniTV"] = fileExists("/proc/stb/lcd/mode")
SystemInfo["LCDMiniTVPiP"] = SystemInfo["LCDMiniTV"] and getBoxType() not in ("gb800ueplus","gbquad4k","gbue4k")
SystemInfo["DefaultDisplayBrightness"] = getBoxType() in ("dm900","dm920") and 8 or 5
SystemInfo["ConfigDisplay"] = SystemInfo["FrontpanelDisplay"] and getDisplayType() != "7segment"
SystemInfo["DreamBoxAudio"] = getBoxType() in ("dm900","dm920","dm7080","dm800")
Example #25
0
SystemInfo["MachineBrand"] = getMachineBrand()
SystemInfo["MachineName"] = getMachineName()
SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
for cislot in range(0, SystemInfo["CommonInterface"]):
	SystemInfo["CI%dSupportsHighBitrates" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_tsclk" % cislot)
	SystemInfo["CI%dRelevantPidsRoutingSupport" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_relevant_pids_routing" % cislot)
SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["Udev"] = not fileExists("/dev/.devfsd")
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
SystemInfo["7segment"] = getDisplayType() in ("7segment")
SystemInfo["ConfigDisplay"] = SystemInfo["FrontpanelDisplay"] and getDisplayType() not in ("7segment")
SystemInfo["LCDSKINSetup"] = pathExists("/usr/share/enigma2/display") and not SystemInfo["7segment"]
SystemInfo["OledDisplay"] = fileExists("/dev/dbox/oled0")
SystemInfo["LcdDisplay"] = fileExists("/dev/dbox/lcd0")
SystemInfo["DisplayLED"] = False
SystemInfo["LEDButtons"] = False
SystemInfo["DeepstandbySupport"] = HardwareInfo().has_deepstandby()
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["PowerLED"] = False
SystemInfo["PowerLED2"] = False
SystemInfo["StandbyLED"] = False
SystemInfo["SuspendLED"] = False
SystemInfo["LedPowerColor"] = False
SystemInfo["LedStandbyColor"] = False
Example #26
0
	return numLeds

def hassoftcaminstalled():
	from Tools.camcontrol import CamControl
	return len(CamControl("softcam").getList()) > 1

def getBootdevice():
	dev = ("root" in cmdline and cmdline["root"].startswith("/dev/")) and cmdline["root"][5:]
	while dev and not fileExists("/sys/block/%s" % dev):
		dev = dev[:-1]
	return dev

model = getBoxType()
brand = getBoxBrand()
platform = getMachineBuild()
displaytype = getDisplayType()
architecture = getImageArch()
socfamily = getSoCFamily()

SystemInfo["InDebugMode"] = eGetEnigmaDebugLvl() >= 4
SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
for cislot in range(0, SystemInfo["CommonInterface"]):
	SystemInfo["CI%dSupportsHighBitrates" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_tsclk" % cislot)
	SystemInfo["CI%dRelevantPidsRoutingSupport" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_relevant_pids_routing" % cislot)
SystemInfo["HasSoftcamInstalled"] = hassoftcaminstalled()
SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["Udev"] = not fileExists("/dev/.devfsd")
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
Example #27
0
def InitLcd():
    if getBoxType() in ('vusolo'):
        detected = False
    else:
        detected = eDBoxLCD.getInstance().detected()

    ilcd = LCD()

    SystemInfo["Display"] = detected
    config.lcd = ConfigSubsection()

    if fileExists("/proc/stb/lcd/mode"):
        f = open("/proc/stb/lcd/mode", "r")
        can_lcdmodechecking = f.read().strip().split(" ")
        print("[LCD] LCDMiniTV", can_lcdmodechecking)
        f.close()
    else:
        can_lcdmodechecking = False

    if SystemInfo["PowerLED"]:

        def setPowerLEDstate(configElement):
            print("[LCD] PowerLED = %s" % SystemInfo["PowerLED"])
            f = open("/proc/stb/power/powerled", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.powerled = ConfigSelection(default="on",
                                              choices=[("off", _("Off")),
                                                       ("on", _("On"))])
        config.lcd.powerled.addNotifier(setPowerLEDstate)

    if SystemInfo["PowerLED2"]:

        def setPowerLEDstate2(configElement):
            print("[LCD] PowerLED2 = %s" % SystemInfo["PowerLED2"])
            f = open("/proc/stb/power/powerled2", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.powerled2 = ConfigSelection(default="on",
                                               choices=[("off", _("Off")),
                                                        ("on", _("On"))])
        config.lcd.powerled2.addNotifier(setPowerLEDstate2)

    if SystemInfo["StandbyLED"]:

        def setPowerLEDstanbystate(configElement):
            print("[LCD] StandbyLED = %s configElement = %s" %
                  (SystemInfo["StandbyLED"], configElement.value))
            f = open("/proc/stb/power/standbyled", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.standbyLED = ConfigSelection(default="on",
                                                choices=[("off", _("Off")),
                                                         ("on", _("On"))])
        config.lcd.standbyLED.addNotifier(setPowerLEDstanbystate)

    if SystemInfo["SuspendLED"]:

        def setPowerLEDdeepstanbystate(configElement):
            print("[LCD] SuspendLED = %s configElement = %s" %
                  (SystemInfo["SuspendLED"], configElement.value))
            f = open("/proc/stb/power/suspendled", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.suspendLED = ConfigSelection(default="on",
                                                choices=[("off", _("Off")),
                                                         ("on", _("On"))])
        config.lcd.suspendLED.addNotifier(setPowerLEDdeepstanbystate)

    if SystemInfo["LedPowerColor"]:

        def setLedPowerColor(configElement):
            f = open("/proc/stb/fp/ledpowercolor", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.ledpowercolor = ConfigSelection(default="1",
                                                   choices=[("0", _("off")),
                                                            ("1", _("blue")),
                                                            ("2", _("red")),
                                                            ("3", _("violet"))
                                                            ])
        config.lcd.ledpowercolor.addNotifier(setLedPowerColor)

    if SystemInfo["LedStandbyColor"]:

        def setLedStandbyColor(configElement):
            f = open("/proc/stb/fp/ledstandbycolor", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.ledstandbycolor = ConfigSelection(default="3",
                                                     choices=[("0", _("off")),
                                                              ("1", _("blue")),
                                                              ("2", _("red")),
                                                              ("3",
                                                               _("violet"))])
        config.lcd.ledstandbycolor.addNotifier(setLedStandbyColor)

    if SystemInfo["LedSuspendColor"]:

        def setLedSuspendColor(configElement):
            f = open("/proc/stb/fp/ledsuspendledcolor", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.ledsuspendcolor = ConfigSelection(default="2",
                                                     choices=[("0", _("off")),
                                                              ("1", _("blue")),
                                                              ("2", _("red")),
                                                              ("3",
                                                               _("violet"))])
        config.lcd.ledsuspendcolor.addNotifier(setLedSuspendColor)

    if SystemInfo["Power24x7On"]:

        def setPower24x7On(configElement):
            f = open("/proc/stb/fp/power4x7on", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.power24x7on = ConfigSelection(default="on",
                                                 choices=[("off", _("Off")),
                                                          ("on", _("On"))])
        config.lcd.power24x7on.addNotifier(setPower24x7On)

    if SystemInfo["Power24x7Standby"]:

        def setPower24x7Standby(configElement):
            f = open("/proc/stb/fp/power4x7standby", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.power24x7standby = ConfigSelection(default="off",
                                                      choices=[
                                                          ("off", _("Off")),
                                                          ("on", _("On"))
                                                      ])
        config.lcd.power24x7standby.addNotifier(setPower24x7Standby)

    if SystemInfo["Power24x7Suspend"]:

        def setPower24x7Suspend(configElement):
            f = open("/proc/stb/fp/power4x7suspend", "w")
            f.write(configElement.value)
            f.close()

        config.lcd.power24x7suspend = ConfigSelection(default="off",
                                                      choices=[
                                                          ("off", _("Off")),
                                                          ("on", _("On"))
                                                      ])
        config.lcd.power24x7suspend.addNotifier(setPower24x7Suspend)

    if SystemInfo["LEDButtons"]:

        def setLEDnormalstate(configElement):
            ilcd.setLEDNormalState(configElement.value)

        def setLEDdeepstandby(configElement):
            ilcd.setLEDDeepStandbyState(configElement.value)

        def setLEDblinkingtime(configElement):
            ilcd.setLEDBlinkingTime(configElement.value)

        config.lcd.ledblinkingtime = ConfigSlider(default=5,
                                                  increment=1,
                                                  limits=(0, 15))
        config.lcd.ledblinkingtime.addNotifier(setLEDblinkingtime)
        config.lcd.ledbrightnessdeepstandby = ConfigSlider(default=1,
                                                           increment=1,
                                                           limits=(0, 15))
        config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDnormalstate)
        config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDdeepstandby)
        config.lcd.ledbrightnessdeepstandby.apply = lambda: setLEDdeepstandby(
            config.lcd.ledbrightnessdeepstandby)
        config.lcd.ledbrightnessstandby = ConfigSlider(default=1,
                                                       increment=1,
                                                       limits=(0, 15))
        config.lcd.ledbrightnessstandby.addNotifier(setLEDnormalstate)
        config.lcd.ledbrightnessstandby.apply = lambda: setLEDnormalstate(
            config.lcd.ledbrightnessstandby)
        config.lcd.ledbrightness = ConfigSlider(default=3,
                                                increment=1,
                                                limits=(0, 15))
        config.lcd.ledbrightness.addNotifier(setLEDnormalstate)
        config.lcd.ledbrightness.apply = lambda: setLEDnormalstate(
            config.lcd.ledbrightness)

    if detected:
        config.lcd.scroll_speed = ConfigSelection(default="300",
                                                  choices=[("500", _("slow")),
                                                           ("300",
                                                            _("normal")),
                                                           ("100", _("fast"))])
        config.lcd.scroll_delay = ConfigSelection(
            default="10000",
            choices=[("10000", "10 " + _("seconds")),
                     ("20000", "20 " + _("seconds")),
                     ("30000", "30 " + _("seconds")),
                     ("60000", "1 " + _("minute")),
                     ("300000", "5 " + _("minutes")),
                     ("noscrolling", _("off"))])

        def setLCDbright(configElement):
            ilcd.setBright(configElement.value)

        def setLCDstandbybright(configElement):
            ilcd.setStandbyBright(configElement.value)

        def setLCDdimbright(configElement):
            ilcd.setDimBright(configElement.value)

        def setLCDdimdelay(configElement):
            ilcd.setDimDelay(configElement.value)

        def setLCDcontrast(configElement):
            ilcd.setContrast(configElement.value)

        def setLCDinverted(configElement):
            ilcd.setInverted(configElement.value)

        def setLCDflipped(configElement):
            ilcd.setFlipped(configElement.value)

        def setLCDmode(configElement):
            ilcd.setMode(configElement.value)

        def setLCDpower(configElement):
            ilcd.setPower(configElement.value)

        def setLCDminitvmode(configElement):
            ilcd.setLCDMiniTVMode(configElement.value)

        def setLCDminitvpipmode(configElement):
            ilcd.setLCDMiniTVPIPMode(configElement.value)

        def setLCDminitvfps(configElement):
            ilcd.setLCDMiniTVFPS(configElement.value)

        standby_default = 0

        if not ilcd.isOled():
            config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
            config.lcd.contrast.addNotifier(setLCDcontrast)
        else:
            config.lcd.contrast = ConfigNothing()
            standby_default = 1

        config.lcd.standby = ConfigSlider(default=standby_default,
                                          limits=(0, 10))
        config.lcd.standby.addNotifier(setLCDbright)
        config.lcd.standby.apply = lambda: setLCDbright(config.lcd.standby)

        config.lcd.bright = ConfigSlider(default=5, limits=(0, 10))
        config.lcd.bright.addNotifier(setLCDbright)
        config.lcd.bright.apply = lambda: setLCDbright(config.lcd.bright)
        config.lcd.dimbright = ConfigSlider(default=standby_default,
                                            limits=(0, 10))
        config.lcd.dimbright.addNotifier(setLCDdimbright)
        config.lcd.dimbright.apply = lambda: setLCDdimbright(config.lcd.
                                                             dimbright)
        config.lcd.dimdelay = ConfigSelection(default="0",
                                              choices=[
                                                  ("5", "5 " + _("seconds")),
                                                  ("10", "10 " + _("seconds")),
                                                  ("15", "15 " + _("seconds")),
                                                  ("20", "20 " + _("seconds")),
                                                  ("30", "30 " + _("seconds")),
                                                  ("60", "1 " + _("minute")),
                                                  ("120", "2 " + _("minutes")),
                                                  ("300", "5 " + _("minutes")),
                                                  ("0", _("off"))
                                              ])
        config.lcd.dimdelay.addNotifier(setLCDdimdelay)

        config.lcd.invert = ConfigYesNo(default=False)
        config.lcd.invert.addNotifier(setLCDinverted)

        def PiconPackChanged(configElement):
            configElement.save()

        config.lcd.picon_pack = ConfigYesNo(default=False)
        config.lcd.picon_pack.addNotifier(PiconPackChanged)

        config.lcd.flip = ConfigYesNo(default=False)
        config.lcd.flip.addNotifier(setLCDflipped)

        if SystemInfo["LcdPowerOn"]:
            config.lcd.power = ConfigSelection([("0", _("Off")),
                                                ("1", _("On"))], "1")
            config.lcd.power.addNotifier(setLCDpower)
        else:
            config.lcd.power = ConfigNothing()

        if SystemInfo["LcdLiveTV"]:

            def lcdLiveTvChanged(configElement):
                setLCDLiveTv(configElement.value)
                configElement.save()

            config.lcd.showTv = ConfigYesNo(default=False)
            config.lcd.showTv.addNotifier(lcdLiveTvChanged)

            if "live_enable" in SystemInfo["LcdLiveTV"]:
                config.misc.standbyCounter.addNotifier(
                    standbyCounterChangedLCDLiveTV, initial_call=False)

        if SystemInfo["LCDMiniTV"] and getBoxType() not in ('gbquad4k',
                                                            'gbue4k'):
            config.lcd.minitvmode = ConfigSelection(
                [("0", _("normal")), ("1", _("MiniTV")), ("2", _("OSD")),
                 ("3", _("MiniTV with OSD"))], "0")
            config.lcd.minitvmode.addNotifier(setLCDminitvmode)
            config.lcd.minitvpipmode = ConfigSelection(
                [("0", _("off")), ("5", _("PIP")),
                 ("7", _("PIP with OSD"))], "0")
            config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode)
            config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30))
            config.lcd.minitvfps.addNotifier(setLCDminitvfps)
        elif can_lcdmodechecking and getBoxType() in ('gbquad4k', 'gbue4k'):
            #  (0:normal, 1:video0, 2:fb, 3:vide0+fb, 4:video1, 5:vide0+video1, 6:video1+fb, 7:video0+video1+fb)
            config.lcd.minitvmode = ConfigSelection(
                default="0",
                choices=[("0", _("normal")),
                         ("1", _("MiniTV") + _(" - video0")),
                         ("3", _("MiniTV with OSD") + _(" - video0")),
                         ("2", _("OSD")), ("4", _("MiniTV") + _(" - video1")),
                         ("6", _("MiniTV with OSD") + _(" - video1")),
                         ("5", _("MiniTV") + _(" - video0+video1")),
                         ("7", _("MiniTV with OSD") + _(" - video0+video1"))])
            config.lcd.minitvmode.addNotifier(setLCDminitvmode)
            config.lcd.minitvpipmode = ConfigSelection(default="0",
                                                       choices=[
                                                           ("0", _("off")),
                                                           ("4", _("PIP")),
                                                           ("6",
                                                            _("PIP with OSD"))
                                                       ])
            config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode)
            config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30))
            config.lcd.minitvfps.addNotifier(setLCDminitvfps)
        else:
            config.lcd.minitvmode = ConfigNothing()
            config.lcd.minitvpipmode = ConfigNothing()
            config.lcd.minitvfps = ConfigNothing()

        if SystemInfo["VFD_scroll_repeats"] and getDisplayType() not in (
                '7segment'):

            def scroll_repeats(el):
                open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value)

            choicelist = [("0", _("None")), ("1", _("1X")), ("2", _("2X")),
                          ("3", _("3X")), ("4", _("4X")),
                          ("500", _("Continues"))]
            config.usage.vfd_scroll_repeats = ConfigSelection(
                default="3", choices=choicelist)
            config.usage.vfd_scroll_repeats.addNotifier(
                scroll_repeats, immediate_feedback=False)

        if SystemInfo["VFD_scroll_delay"] and getDisplayType() not in (
                '7segment'):

            def scroll_delay(el):
                open(SystemInfo["VFD_scroll_delay"], "w").write(str(el.value))

            config.usage.vfd_scroll_delay = ConfigSlider(default=150,
                                                         increment=10,
                                                         limits=(0, 500))
            config.usage.vfd_scroll_delay.addNotifier(scroll_delay,
                                                      immediate_feedback=False)

        if SystemInfo["VFD_initial_scroll_delay"] and getDisplayType() not in (
                '7segment'):

            def initial_scroll_delay(el):
                open(SystemInfo["VFD_initial_scroll_delay"],
                     "w").write(el.value)

            choicelist = [("10000", "10 " + _("seconds")),
                          ("20000", "20 " + _("seconds")),
                          ("30000", "30 " + _("seconds")),
                          ("0", _("no delay"))]
            config.usage.vfd_initial_scroll_delay = ConfigSelection(
                default="1000", choices=choicelist)
            config.usage.vfd_initial_scroll_delay.addNotifier(
                initial_scroll_delay, immediate_feedback=False)

        if SystemInfo["VFD_final_scroll_delay"] and getDisplayType() not in (
                '7segment'):

            def final_scroll_delay(el):
                open(SystemInfo["VFD_final_scroll_delay"], "w").write(el.value)

            choicelist = [("10000", "10 " + _("seconds")),
                          ("20000", "20 " + _("seconds")),
                          ("30000", "30 " + _("seconds")),
                          ("0", _("no delay"))]
            config.usage.vfd_final_scroll_delay = ConfigSelection(
                default="1000", choices=choicelist)
            config.usage.vfd_final_scroll_delay.addNotifier(
                final_scroll_delay, immediate_feedback=False)

        if fileExists("/proc/stb/lcd/show_symbols"):
            config.lcd.mode = ConfigSelection([("0", _("no")),
                                               ("1", _("yes"))], "1")
            config.lcd.mode.addNotifier(setLCDmode)
        else:
            config.lcd.mode = ConfigNothing()

    else:

        def doNothing():
            pass

        config.lcd.contrast = ConfigNothing()
        config.lcd.bright = ConfigNothing()
        config.lcd.standby = ConfigNothing()
        config.lcd.bright.apply = lambda: doNothing()
        config.lcd.standby.apply = lambda: doNothing()
        config.lcd.mode = ConfigNothing()
        config.lcd.power = ConfigNothing()
        config.lcd.ledbrightness = ConfigNothing()
        config.lcd.ledbrightness.apply = lambda: doNothing()
        config.lcd.ledbrightnessstandby = ConfigNothing()
        config.lcd.ledbrightnessstandby.apply = lambda: doNothing()
        config.lcd.ledbrightnessdeepstandby = ConfigNothing()
        config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing()
        config.lcd.ledblinkingtime = ConfigNothing()
        config.lcd.picon_pack = ConfigNothing()

    config.misc.standbyCounter.addNotifier(standbyCounterChanged,
                                           initial_call=False)
Example #28
0
def useLcdPicons():
    return getDisplayType() in ('bwlcd255', 'bwlcd140',
                                'bwlcd128') or config.lcd.picon_pack.value
Example #29
0
	while fileExists("/proc/stb/fp/led%d_pattern" % leds):
		leds += 1
	return leds

SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
for cislot in range (0, SystemInfo["CommonInterface"]):
	SystemInfo["CI%dSupportsHighBitrates" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_tsclk"  % cislot)
	SystemInfo["CI%dRelevantPidsRoutingSupport" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_relevant_pids_routing"  % cislot)

SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
SystemInfo["7segment"] = getDisplayType() in ('7segment')
SystemInfo["ConfigDisplay"] = SystemInfo["FrontpanelDisplay"] and getDisplayType() not in ('7segment')
SystemInfo["LCDSKINSetup"] = pathExists("/usr/share/enigma2/display") and not SystemInfo["7segment"]
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["OledDisplay"] = fileExists("/dev/dbox/oled0")
SystemInfo["LcdDisplay"] = fileExists("/dev/dbox/lcd0")
SystemInfo["DisplayLED"] = False
SystemInfo["LEDButtons"] = getBoxType() == 'vuultimo'
SystemInfo["DeepstandbySupport"] = HardwareInfo().has_deepstandby()
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["StandbyLED"] = fileCheck("/proc/stb/power/standbyled")
SystemInfo["WakeOnLAN"] = fileCheck("/proc/stb/power/wol") or fileCheck("/proc/stb/fp/wol")
SystemInfo["HDMICEC"] = (fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) and fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
SystemInfo["SABSetup"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/SABnzbd/plugin.pyo")
Example #30
0
def getInfo(session=None, need_fullinfo=False):
    # TODO: get webif versione somewhere!
    info = {}
    global STATICBOXINFO

    if not (STATICBOXINFO is None or need_fullinfo):
        return STATICBOXINFO

    info['brand'] = getBoxBrand()
    info['model'] = getBoxType()
    info['platform'] = boxbranding.getMachineBuild()

    try:
        info['procmodel'] = getBoxProc()
    except:  # noqa: E722
        info['procmodel'] = boxbranding.getMachineProcModel()

    try:
        info['procmodeltype'] = getBoxProcType()
    except:  # noqa: E722
        info['procmodeltype'] = None

    try:
        info['lcd'] = getLcd()
    except:  # noqa: E722
        info['lcd'] = 0

    try:
        info['grabpip'] = getGrabPip()
    except:  # noqa: E722
        info['grabpip'] = 0

    cpu = about.getCPUInfoString()
    info['chipset'] = cpu
    info['cpubrand'] = about.getCPUBrand()
    info['socfamily'] = boxbranding.getSoCFamily()
    info['cpuarch'] = about.getCPUArch()
    if config.OpenWebif.about_benchmark.value is True:
        info['cpubenchmark'] = about.getCPUBenchmark()
    else:
        info['cpubenchmark'] = _("Disabled in configuration")
    info['flashtype'] = about.getFlashType()

    memFree = 0
    for line in open("/proc/meminfo", 'r'):
        parts = line.split(':')
        key = parts[0].strip()
        if key == "MemTotal":
            info['mem1'] = parts[1].strip().replace("kB", _("kB"))
        elif key in ("MemFree", "Buffers", "Cached"):
            memFree += int(parts[1].strip().split(' ', 1)[0])
    info['mem2'] = "%s %s" % (memFree, _("kB"))
    info['mem3'] = _("%s free / %s total") % (info['mem2'], info['mem1'])

    info['uptime'] = about.getBoxUptime()

    info["webifver"] = OPENWEBIFVER
    info['imagedistro'] = boxbranding.getImageDistro()
    info['oever'] = boxbranding.getImageBuild()
    info['visionversion'] = boxbranding.getVisionVersion()
    info['visionrevision'] = boxbranding.getVisionRevision()
    info['visionmodule'] = about.getVisionModule()

    if fileExists("/etc/openvision/multiboot"):
        multibootflag = open("/etc/openvision/multiboot", "r").read().strip()
        if multibootflag == "1":
            info['multiboot'] = _("Yes")
        else:
            info['multiboot'] = _("No")
    else:
        info['multiboot'] = _("Yes")

    info['enigmaver'] = getEnigmaVersionString()
    info['driverdate'] = about.getDriverInstalledDate()
    info['kernelver'] = boxbranding.getKernelVersion()
    info['dvbapitype'] = about.getDVBAPI()
    info['gstreamerversion'] = about.getGStreamerVersionString(cpu)
    info['ffmpegversion'] = about.getFFmpegVersionString()
    info['pythonversion'] = about.getPythonVersionString()

    try:
        info['hwserial'] = getHWSerial()
    except:  # noqa: E722
        info['hwserial'] = None

    if (info['hwserial'] is None or info['hwserial'] == "unknown"):
        info['hwserial'] = about.getCPUSerial()

    try:
        info['boxrctype'] = getBoxRCType()
    except:  # noqa: E722
        info['boxrctype'] = None

    if (info['boxrctype'] is None or info['boxrctype'] == "unknown"):
        if fileExists("/usr/bin/remotecfg"):
            info['boxrctype'] = _("Amlogic remote")
        elif fileExists("/usr/sbin/lircd"):
            info['boxrctype'] = _("LIRC remote")

    info['ovrctype'] = boxbranding.getRCType()
    info['ovrcname'] = boxbranding.getRCName()
    info['ovrcidnum'] = boxbranding.getRCIDNum()

    info['transcoding'] = boxbranding.getHaveTranscoding()
    info['multitranscoding'] = boxbranding.getHaveMultiTranscoding()

    info['displaytype'] = boxbranding.getDisplayType()

    info['updatedatestring'] = about.getUpdateDateString()
    info['enigmadebuglvl'] = eGetEnigmaDebugLvl()

    info['imagearch'] = boxbranding.getImageArch()
    info['imagefolder'] = boxbranding.getImageFolder()
    info['imagefilesystem'] = boxbranding.getImageFileSystem()
    info['feedsurl'] = boxbranding.getFeedsUrl()
    info['developername'] = boxbranding.getDeveloperName()
    info['builddatestring'] = about.getBuildDateString()
    info['imagefpu'] = boxbranding.getImageFPU()
    info['havemultilib'] = boxbranding.getHaveMultiLib()

    try:
        info['fp_version'] = getFPVersion()
    except:  # noqa: E722
        info['fp_version'] = None

    info['tuners'] = []
    for i in list(range(0, nimmanager.getSlotCount())):
        print(
            "[OpenWebif] -D- tuner '%d' '%s' '%s'" %
            (i, nimmanager.getNimName(i), nimmanager.getNim(i).getSlotName()))
        info['tuners'].append({
            "name":
            nimmanager.getNim(i).getSlotName(),
            "type":
            nimmanager.getNimName(i) + " (" +
            nimmanager.getNim(i).getFriendlyType() + ")",
            "rec":
            "",
            "live":
            ""
        })

    info['ifaces'] = []
    ifaces = iNetwork.getConfiguredAdapters()
    for iface in ifaces:
        info['ifaces'].append({
            "name":
            iNetwork.getAdapterName(iface),
            "friendlynic":
            getFriendlyNICChipSet(iface),
            "linkspeed":
            getLinkSpeed(iface),
            "mac":
            iNetwork.getAdapterAttribute(iface, "mac"),
            "dhcp":
            iNetwork.getAdapterAttribute(iface, "dhcp"),
            "ipv4method":
            getIPv4Method(iface),
            "ip":
            formatIp(iNetwork.getAdapterAttribute(iface, "ip")),
            "mask":
            formatIp(iNetwork.getAdapterAttribute(iface, "netmask")),
            "v4prefix":
            sum([
                bin(int(x)).count('1') for x in formatIp(
                    iNetwork.getAdapterAttribute(iface, "netmask")).split('.')
            ]),
            "gw":
            formatIp(iNetwork.getAdapterAttribute(iface, "gateway")),
            "ipv6":
            getAdapterIPv6(iface)['addr'],
            "ipmethod":
            getIPMethod(iface),
            "firstpublic":
            getAdapterIPv6(iface)['firstpublic']
        })

    info['hdd'] = []
    for hdd in harddiskmanager.hdd:
        dev = hdd.findMount()
        if dev:
            stat = os.statvfs(dev)
            free = stat.f_bavail * stat.f_frsize / 1048576.
        else:
            free = -1

        if free <= 1024:
            free = "%i %s" % (free, _("MB"))
        else:
            free = free / 1024.
            free = "%.1f %s" % (free, _("GB"))

        size = hdd.diskSize() * 1000000 / 1048576.
        if size > 1048576:
            size = "%.1f %s" % ((size / 1048576.), _("TB"))
        elif size > 1024:
            size = "%.1f %s" % ((size / 1024.), _("GB"))
        else:
            size = "%d %s" % (size, _("MB"))

        iecsize = hdd.diskSize()
        # Harddisks > 1000 decimal Gigabytes are labelled in TB
        if iecsize > 1000000:
            iecsize = (iecsize + 50000) // float(100000) / 10
            # Omit decimal fraction if it is 0
            if (iecsize % 1 > 0):
                iecsize = "%.1f %s" % (iecsize, _("TB"))
            else:
                iecsize = "%d %s" % (iecsize, _("TB"))
        # Round harddisk sizes beyond ~300GB to full tens: 320, 500, 640, 750GB
        elif iecsize > 300000:
            iecsize = "%d %s" % (((iecsize + 5000) // 10000 * 10), _("GB"))
        # ... be more precise for media < ~300GB (Sticks, SSDs, CF, MMC, ...): 1, 2, 4, 8, 16 ... 256GB
        elif iecsize > 1000:
            iecsize = "%d %s" % (((iecsize + 500) // 1000), _("GB"))
        else:
            iecsize = "%d %s" % (iecsize, _("MB"))

        info['hdd'].append({
            "model":
            hdd.model(),
            "capacity":
            size,
            "labelled_capacity":
            iecsize,
            "free":
            free,
            "mount":
            dev,
            "friendlycapacity":
            _("%s free / %s total") % (free, size + ' ("' + iecsize + '")')
        })

    info['shares'] = []
    autofiles = ('/etc/auto.network', '/etc/auto.network_vti')
    for autofs in autofiles:
        if fileExists(autofs):
            method = "autofs"
            for line in open(autofs).readlines():
                if not line.startswith('#'):
                    # Replace escaped spaces that can appear inside credentials with underscores
                    # Not elegant but we wouldn't want to expose credentials on the OWIF anyways
                    tmpline = line.replace("\ ", "_")
                    tmp = tmpline.split()
                    if not len(tmp) == 3:
                        continue
                    name = tmp[0].strip()
                    type = "unknown"
                    if "cifs" in tmp[1]:
                        # Linux still defaults to SMBv1
                        type = "SMBv1.0"
                        settings = tmp[1].split(",")
                        for setting in settings:
                            if setting.startswith("vers="):
                                type = setting.replace("vers=", "SMBv")
                    elif "nfs" in tmp[1]:
                        type = "NFS"

                    # Default is r/w
                    mode = _("r/w")
                    settings = tmp[1].split(",")
                    for setting in settings:
                        if setting == "ro":
                            mode = _("r/o")

                    uri = tmp[2]
                    parts = []
                    parts = tmp[2].split(':')
                    if parts[0] == "":
                        server = uri.split('/')[2]
                        uri = uri.strip()[1:]
                    else:
                        server = parts[0]

                    ipaddress = None
                    if server:
                        # Will fail on literal IPs
                        try:
                            # Try IPv6 first, as will Linux
                            if has_ipv6:
                                tmpaddress = None
                                tmpaddress = getaddrinfo(server, 0, AF_INET6)
                                if tmpaddress:
                                    ipaddress = "[" + list(
                                        tmpaddress)[0][4][0] + "]"
                            # Use IPv4 if IPv6 fails or is not present
                            if ipaddress is None:
                                tmpaddress = None
                                tmpaddress = getaddrinfo(server, 0, AF_INET)
                                if tmpaddress:
                                    ipaddress = list(tmpaddress)[0][4][0]
                        except:  # noqa: E722
                            pass

                    friendlyaddress = server
                    if ipaddress is not None and not ipaddress == server:
                        friendlyaddress = server + " (" + ipaddress + ")"
                    info['shares'].append({
                        "name": name,
                        "method": method,
                        "type": type,
                        "mode": mode,
                        "path": uri,
                        "host": server,
                        "ipaddress": ipaddress,
                        "friendlyaddress": friendlyaddress
                    })
    # TODO: fstab

    info['EX'] = ''

    if session:
        try:
            #  gets all current stream clients for images using eStreamServer
            #  TODO: merge eStreamServer and streamList
            #  TODO: get tuner info for streams
            #  TODO: get recoding/timer info if more than one
            info['streams'] = []
            try:
                from enigma import eStreamServer
                streamServer = eStreamServer.getInstance()
                if streamServer is not None:
                    for x in streamServer.getConnectedClients():
                        servicename = ServiceReference(
                            x[1]).getServiceName() or "(unknown service)"
                        if int(x[2]) == 0:
                            strtype = "S"
                        else:
                            strtype = "T"
                        info['streams'].append({
                            "ref": x[1],
                            "name": servicename,
                            "ip": x[0],
                            "type": strtype
                        })
            except Exception as error:
                print("[OpenWebif] -D- no eStreamServer %s" % error)
            recs = NavigationInstance.instance.getRecordings()
            if recs:
                #  only one stream and only TV
                from Plugins.Extensions.OpenWebif.controllers.stream import streamList
                s_name = ''
                # s_cip = ''

                print("[OpenWebif] -D- streamList count '%d'" %
                      len(streamList))
                if len(streamList) == 1:
                    from Screens.ChannelSelection import service_types_tv
                    # from enigma import eEPGCache
                    # epgcache = eEPGCache.getInstance()
                    serviceHandler = eServiceCenter.getInstance()
                    services = serviceHandler.list(
                        eServiceReference('%s ORDER BY name' %
                                          (service_types_tv)))
                    channels = services and services.getContent("SN", True)
                    s = streamList[0]
                    srefs = s.ref.toString()
                    for channel in channels:
                        if srefs == channel[0]:
                            s_name = channel[1] + ' (' + s.clientIP + ')'
                            break
                print("[OpenWebif] -D- s_name '%s'" % s_name)

                # only for debug
                for stream in streamList:
                    srefs = stream.ref.toString()
                    print("[OpenWebif] -D- srefs '%s'" % srefs)

                sname = ''
                timers = []
                for timer in NavigationInstance.instance.RecordTimer.timer_list:
                    if timer.isRunning() and not timer.justplay:
                        timers.append(
                            removeBad(timer.service_ref.getServiceName()))
                        print("[OpenWebif] -D- timer '%s'" %
                              timer.service_ref.getServiceName())


# TODO: more than one recording
                if len(timers) == 1:
                    sname = timers[0]

                if sname == '' and s_name != '':
                    sname = s_name

                print("[OpenWebif] -D- recs count '%d'" % len(recs))

                for rec in recs:
                    feinfo = rec.frontendInfo()
                    frontendData = feinfo and feinfo.getAll(True)
                    if frontendData is not None:
                        cur_info = feinfo.getTransponderData(True)
                        if cur_info:
                            nr = frontendData['tuner_number']
                            info['tuners'][nr]['rec'] = getOrbitalText(
                                cur_info) + ' / ' + sname

            service = session.nav.getCurrentService()
            if service is not None:
                sname = service.info().getName()
                feinfo = service.frontendInfo()
                frontendData = feinfo and feinfo.getAll(True)
                if frontendData is not None:
                    cur_info = feinfo.getTransponderData(True)
                    if cur_info:
                        nr = frontendData['tuner_number']
                        info['tuners'][nr]['live'] = getOrbitalText(
                            cur_info) + ' / ' + sname
        except Exception as error:
            info['EX'] = error

    info['timerpipzap'] = False
    info['timerautoadjust'] = False

    try:
        timer = RecordTimerEntry('', 0, 0, '', '', 0)
        if hasattr(timer, "pipzap"):
            info['timerpipzap'] = True
        if hasattr(timer, "autoadjust"):
            info['timerautoadjust'] = True
    except Exception as error:
        print("[OpenWebif] -D- RecordTimerEntry check %s" % error)

    STATICBOXINFO = info
    return info
Example #31
0
SystemInfo["HaveCISSL"] = fileCheck(
    "/etc/ssl/certs/customer.pem") and fileCheck("/etc/ssl/certs/device.pem")
SystemInfo["CanChangeOsdAlpha"] = access("/proc/stb/video/alpha",
                                         R_OK) and True or False
SystemInfo["ScalerSharpness"] = fileExists(
    "/proc/stb/vmpeg/0/pep_scaler_sharpness")
SystemInfo["OScamInstalled"] = fileExists("/usr/bin/oscam") or fileExists(
    "/usr/bin/oscam-emu") or fileExists("/usr/bin/oscam-smod")
SystemInfo["OScamIsActive"] = SystemInfo["OScamInstalled"] and fileExists(
    "/tmp/.oscam/oscam.version")
SystemInfo["NCamInstalled"] = fileExists("/usr/bin/ncam")
SystemInfo["NCamIsActive"] = SystemInfo["NCamInstalled"] and fileExists(
    "/tmp/.ncam/ncam.version")
SystemInfo["OpenVisionModule"] = fileCheck("/proc/stb/info/openvision")
SystemInfo["OLDE2API"] = model in ("dm800", "su980")
SystemInfo["7segment"] = getDisplayType() == "7segment"
SystemInfo["CanFadeOut"] = brand not in (
    "linkdroid", "mecool", "minix", "wetek", "hardkernel", "dinobot",
    "maxytec") and model not in (
        "gbtrio4k", "gbip4k", "sf8008", "sf8008m", "cc1", "ustym4kpro",
        "beyonwizv2", "viper4k", "dreamone", "hd60", "hd61", "h9", "h9combo",
        "h10", "i55plus"
    ) and not pathExists("/proc/hisi") and not fileExists("/usr/bin/hihalt")
SystemInfo["OSDAnimation"] = fileCheck("/proc/stb/fb/animation_mode")
SystemInfo["RecoveryMode"] = fileCheck(
    "/proc/stb/fp/boot_mode") and model not in ("hd51", "h7")
SystemInfo["AndroidMode"] = SystemInfo[
    "RecoveryMode"] and model == "multibox" or brand in (
        "hypercube", "linkdroid", "mecool", "wetek") or model == "dreamone"
SystemInfo["grautec"] = fileExists("/tmp/usbtft")
SystemInfo["CanAC3plusTranscode"] = fileExists(
Example #32
0
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()


def countFrontpanelLEDs():
	leds = 0
	if fileExists("/proc/stb/fp/led_set_pattern"):
		leds += 1

	while fileExists("/proc/stb/fp/led%d_pattern" % leds):
		leds += 1

	return leds

SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
SystemInfo["7segment"] = getDisplayType() in ('7segment')
SystemInfo["ConfigDisplay"] = SystemInfo["FrontpanelDisplay"] and getDisplayType() not in ('7segment')
SystemInfo["LCDSKINSetup"] = path.exists("/usr/share/enigma2/display") and getDisplayType() not in ('7segment')
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["OledDisplay"] = fileExists("/dev/dbox/oled0") or getBoxType() in ('osminiplus')
SystemInfo["LcdDisplay"] = fileExists("/dev/dbox/lcd0")
SystemInfo["FBLCDDisplay"] = fileCheck("/proc/stb/fb/sd_detach")
SystemInfo["DeepstandbySupport"] = HardwareInfo().has_deepstandby()
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["StandbyPowerLed"] = fileExists("/proc/stb/power/standbyled")
SystemInfo["LEDButtons"] = getBoxType() == 'vuultimo'
SystemInfo["WakeOnLAN"] = fileCheck("/proc/stb/power/wol") or fileCheck("/proc/stb/fp/wol")
SystemInfo["HDMICEC"] = (fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) and fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
Example #33
0
def InitLcd():
    if getBoxType() in (
            'gbx34k', 'force4', 'alien5', 'viperslim', 'lunix', 'lunix4k',
            'purehdse', 'vipert2c', 'evoslimse', 'evoslimt2c', 'valalinux',
            'tmtwin4k', 'tmnanom3', 'mbmicrov2', 'revo4k', 'force3uhd',
            'force2nano', 'evoslim', 'wetekplay', 'wetekplay2', 'wetekhub',
            'ultrabox', 'novaip', 'dm520', 'dm525', 'purehd', 'mutant11',
            'xpeedlxpro', 'zgemmai55', 'sf98', 'et7x00mini', 'xpeedlxcs2',
            'xpeedlxcc', 'e4hd', 'e4hdhybrid', 'mbmicro', 'beyonwizt2',
            'amikomini', 'dynaspark', 'amiko8900', 'sognorevolution',
            'arguspingulux', 'arguspinguluxmini', 'arguspinguluxplus',
            'sparkreloaded', 'sabsolo', 'sparklx', 'gis8120', 'gb800se',
            'gb800solo', 'gb800seplus', 'gbultrase', 'gbipbox', 'tmsingle',
            'tmnano2super', 'iqonios300hd', 'iqonios300hdv2',
            'optimussos1plus', 'optimussos1', 'vusolo', 'et4x00', 'et5x00',
            'et6x00', 'et7000', 'et7100', 'et7x00mini', 'mixosf7', 'mixoslumi',
            'gbx1', 'gbx2', 'gbx3', 'gbx3h'):
        detected = False
    else:
        detected = eDBoxLCD.getInstance().detected()
    SystemInfo["Display"] = detected
    config.lcd = ConfigSubsection()

    if fileExists("/proc/stb/lcd/mode"):
        f = open("/proc/stb/lcd/mode", "r")
        can_lcdmodechecking = f.read()
        f.close()
    else:
        can_lcdmodechecking = False
    SystemInfo["LCDMiniTV"] = can_lcdmodechecking

    if detected:
        ilcd = LCD()
        if can_lcdmodechecking:

            def setLCDModeMinitTV(configElement):
                try:
                    print 'setLCDModeMinitTV', configElement.value
                    f = open("/proc/stb/lcd/mode", "w")
                    f.write(configElement.value)
                    f.close()
                except:
                    pass

            def setMiniTVFPS(configElement):
                try:
                    print 'setMiniTVFPS', configElement.value
                    f = open("/proc/stb/lcd/fps", "w")
                    f.write("%d \n" % configElement.value)
                    f.close()
                except:
                    pass

            def setLCDModePiP(configElement):
                pass

            def setLCDScreenshot(configElement):
                ilcd.setScreenShot(configElement.value)

            config.lcd.modepip = ConfigSelection(choices={
                "0": _("off"),
                "5": _("PIP"),
                "7": _("PIP with OSD")
            },
                                                 default="0")
            if config.misc.boxtype.value in ('gbquad', 'gbquadplus'):
                config.lcd.modepip.addNotifier(setLCDModePiP)
            else:
                config.lcd.modepip = ConfigNothing()

            config.lcd.screenshot = ConfigYesNo(default=False)
            config.lcd.screenshot.addNotifier(setLCDScreenshot)

            config.lcd.modeminitv = ConfigSelection(choices={
                "0": _("normal"),
                "1": _("MiniTV"),
                "2": _("OSD"),
                "3": _("MiniTV with OSD")
            },
                                                    default="0")
            config.lcd.fpsminitv = ConfigSlider(default=30, limits=(0, 30))
            config.lcd.modeminitv.addNotifier(setLCDModeMinitTV)
            config.lcd.fpsminitv.addNotifier(setMiniTVFPS)
        else:
            config.lcd.modeminitv = ConfigNothing()
            config.lcd.screenshot = ConfigNothing()
            config.lcd.fpsminitv = ConfigNothing()

        config.lcd.scroll_speed = ConfigSelection(default="300",
                                                  choices=[("500", _("slow")),
                                                           ("300",
                                                            _("normal")),
                                                           ("100", _("fast"))])
        config.lcd.scroll_delay = ConfigSelection(
            default="10000",
            choices=[("10000", "10 " + _("seconds")),
                     ("20000", "20 " + _("seconds")),
                     ("30000", "30 " + _("seconds")),
                     ("60000", "1 " + _("minute")),
                     ("300000", "5 " + _("minutes")),
                     ("noscrolling", _("off"))])

        def setLCDbright(configElement):
            ilcd.setBright(configElement.value)

        def setLCDstandbybright(configElement):
            ilcd.setStandbyBright(configElement.value)

        def setLCDdimbright(configElement):
            ilcd.setDimBright(configElement.value)

        def setLCDdimdelay(configElement):
            ilcd.setDimDelay(configElement.value)

        def setLCDcontrast(configElement):
            ilcd.setContrast(configElement.value)

        def setLCDinverted(configElement):
            ilcd.setInverted(configElement.value)

        def setLCDflipped(configElement):
            ilcd.setFlipped(configElement.value)

        def setLCDmode(configElement):
            ilcd.setMode(configElement.value)

        def setLCDpower(configElement):
            ilcd.setPower(configElement.value)

        def setfblcddisplay(configElement):
            ilcd.setfblcddisplay(configElement.value)

        def setLCDshowoutputresolution(configElement):
            ilcd.setShowoutputresolution(configElement.value)

        def setLCDminitvmode(configElement):
            ilcd.setLCDMiniTVMode(configElement.value)

        def setLCDminitvpipmode(configElement):
            ilcd.setLCDMiniTVPIPMode(configElement.value)

        def setLCDminitvfps(configElement):
            ilcd.setLCDMiniTVFPS(configElement.value)

        def setLEDnormalstate(configElement):
            ilcd.setLEDNormalState(configElement.value)

        def setLEDdeepstandby(configElement):
            ilcd.setLEDDeepStandbyState(configElement.value)

        def setLEDblinkingtime(configElement):
            ilcd.setLEDBlinkingTime(configElement.value)

        def setPowerLEDstate(configElement):
            if fileExists("/proc/stb/power/powerled"):
                f = open("/proc/stb/power/powerled", "w")
                f.write(configElement.value)
                f.close()

        def setPowerLEDstanbystate(configElement):
            if fileExists("/proc/stb/power/standbyled"):
                f = open("/proc/stb/power/standbyled", "w")
                f.write(configElement.value)
                f.close()

        def setPowerLEDdeepstanbystate(configElement):
            if fileExists("/proc/stb/power/suspendled"):
                f = open("/proc/stb/power/suspendled", "w")
                f.write(configElement.value)
                f.close()

        def setLedPowerColor(configElement):
            if fileExists("/proc/stb/fp/ledpowercolor"):
                f = open("/proc/stb/fp/ledpowercolor", "w")
                f.write(configElement.value)
                f.close()

        def setLedStandbyColor(configElement):
            if fileExists("/proc/stb/fp/ledstandbycolor"):
                f = open("/proc/stb/fp/ledstandbycolor", "w")
                f.write(configElement.value)
                f.close()

        def setLedSuspendColor(configElement):
            if fileExists("/proc/stb/fp/ledsuspendledcolor"):
                f = open("/proc/stb/fp/ledsuspendledcolor", "w")
                f.write(configElement.value)
                f.close()

        def setPower4x7On(configElement):
            if fileExists("/proc/stb/fp/power4x7on"):
                f = open("/proc/stb/fp/power4x7on", "w")
                f.write(configElement.value)
                f.close()

        def setPower4x7Standby(configElement):
            if fileExists("/proc/stb/fp/power4x7standby"):
                f = open("/proc/stb/fp/power4x7standby", "w")
                f.write(configElement.value)
                f.close()

        def setPower4x7Suspend(configElement):
            if fileExists("/proc/stb/fp/power4x7suspend"):
                f = open("/proc/stb/fp/power4x7suspend", "w")
                f.write(configElement.value)
                f.close()

        def setXcoreVFD(configElement):
            if fileExists(
                    "/sys/module/brcmstb_osmega/parameters/pt6302_cgram"):
                f = open("/sys/module/brcmstb_osmega/parameters/pt6302_cgram",
                         "w")
                f.write(configElement.value)
                f.close()
            if fileExists(
                    "/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram"):
                f = open(
                    "/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram",
                    "w")
                f.write(configElement.value)
                f.close()
            if fileExists(
                    "/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram"
            ):
                f = open(
                    "/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram",
                    "w")
                f.write(configElement.value)
                f.close()
            if fileExists(
                    "/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram"
            ):
                f = open(
                    "/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram",
                    "w")
                f.write(configElement.value)
                f.close()

        config.usage.vfd_xcorevfd = ConfigSelection(default="0",
                                                    choices=[
                                                        ("0",
                                                         _("12 character")),
                                                        ("1", _("8 character"))
                                                    ])
        config.usage.vfd_xcorevfd.addNotifier(setXcoreVFD)

        config.usage.lcd_powerled = ConfigSelection(default="on",
                                                    choices=[("off", _("Off")),
                                                             ("on", _("On"))])
        config.usage.lcd_powerled.addNotifier(setPowerLEDstate)

        config.usage.lcd_standbypowerled = ConfigSelection(default="on",
                                                           choices=[("off",
                                                                     _("Off")),
                                                                    ("on",
                                                                     _("On"))])
        config.usage.lcd_standbypowerled.addNotifier(setPowerLEDstanbystate)

        config.usage.lcd_deepstandbypowerled = ConfigSelection(
            default="on", choices=[("off", _("Off")), ("on", _("On"))])
        config.usage.lcd_deepstandbypowerled.addNotifier(
            setPowerLEDdeepstanbystate)

        config.usage.lcd_ledpowercolor = ConfigSelection(default="1",
                                                         choices=[
                                                             ("0", _("off")),
                                                             ("1", _("blue")),
                                                             ("2", _("red")),
                                                             ("3", _("violet"))
                                                         ])
        config.usage.lcd_ledpowercolor.addNotifier(setLedPowerColor)

        config.usage.lcd_ledstandbycolor = ConfigSelection(
            default="3",
            choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")),
                     ("3", _("violet"))])
        config.usage.lcd_ledstandbycolor.addNotifier(setLedStandbyColor)

        config.usage.lcd_ledsuspendcolor = ConfigSelection(
            default="2",
            choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")),
                     ("3", _("violet"))])
        config.usage.lcd_ledsuspendcolor.addNotifier(setLedSuspendColor)

        config.usage.lcd_power4x7on = ConfigSelection(default="on",
                                                      choices=[
                                                          ("off", _("Off")),
                                                          ("on", _("On"))
                                                      ])
        config.usage.lcd_power4x7on.addNotifier(setPower4x7On)

        config.usage.lcd_power4x7standby = ConfigSelection(default="off",
                                                           choices=[("off",
                                                                     _("Off")),
                                                                    ("on",
                                                                     _("On"))])
        config.usage.lcd_power4x7standby.addNotifier(setPower4x7Standby)

        config.usage.lcd_power4x7suspend = ConfigSelection(default="off",
                                                           choices=[("off",
                                                                     _("Off")),
                                                                    ("on",
                                                                     _("On"))])
        config.usage.lcd_power4x7suspend.addNotifier(setPower4x7Suspend)

        def setDateOnStandby(configElement):
            pass

        def setDateFormat(configElement):
            pass

        from datetime import datetime
        ntime = datetime.now()
        # 8 digit
        if getBoxType() in ('formuler1', 'osminiplus'):
            config.usage.lcd_dateformat = ConfigSelection(
                default="%H:%M",
                choices=[("OFF", "Off"),
                         ("%H:%M", str(ntime.strftime(_("%H:%M")))),
                         ("A%H:%M %d/%m",
                          str(ntime.strftime(_("%H:%M <A> %d/%m")))),
                         ("A%H:%M %d/%m/%y",
                          str(ntime.strftime(_("%H:%M <A> %d/%m/%y")))),
                         ("A%H:%M %d %b",
                          str(ntime.strftime(_("%H:%M <A> %d %b")))),
                         ("A%H:%M %a %d",
                          str(ntime.strftime(_("%H:%M <A> %a %d"))))])
            config.usage.lcd_dateformat.addNotifier(setDateFormat)
        #12 digit
        elif getBoxType() in ('vusolo2', 'osmega'):
            config.usage.lcd_dateformat = ConfigSelection(
                default="%H:%M %d/%m",
                choices=[
                    ("OFF", "Off"), ("%H:%M", str(ntime.strftime(_("%H:%M")))),
                    ("%H:%M %d/%m", str(ntime.strftime(_("%H:%M %d/%m")))),
                    ("%H:%M %d %b", str(ntime.strftime(_("%H:%M %d %b")))),
                    ("%H:%M %a %d", str(ntime.strftime(_("%H:%M %a %d")))),
                    ("A%H:%M %d/%m",
                     str(ntime.strftime(_("%H:%M <A> %d/%m")))),
                    ("A%H:%M %d/%m/%y",
                     str(ntime.strftime(_("%H:%M <A> %d/%m/%y")))),
                    ("A%H:%M %d/%m/%Y",
                     str(ntime.strftime(_("%H:%M <A> %d/%m/%Y")))),
                    ("A%H:%M %d %b",
                     str(ntime.strftime(_("%H:%M <A> %d %b")))),
                    ("A%H:%M %d %b %y",
                     str(ntime.strftime(_("%H:%M <A> %d %b %y")))),
                    ("A%H:%M %a %d",
                     str(ntime.strftime(_("%H:%M <A> %a %d")))),
                    ("A%H:%M %a %d/%m",
                     str(ntime.strftime(_("%H:%M <A> %a %d/%m")))),
                    ("A%H:%M %a %d/%m/%y",
                     str(ntime.strftime(_("%H:%M <A> %a %d/%m/%y"))))
                ])
            config.usage.lcd_dateformat.addNotifier(setDateFormat)
        #16 digit
        elif getBoxType() in ('sf3038', 'sf4008', 'mutant51'):
            config.usage.lcd_dateformat = ConfigSelection(
                default="%H:%M %d/%m/%Y",
                choices=[("OFF", "Off"),
                         ("%H:%M", str(ntime.strftime(_("%H:%M")))),
                         ("%H:%M %d/%m",
                          str(ntime.strftime(_("%H:%M %d/%m")))),
                         ("%H:%M %d/%m/%y",
                          str(ntime.strftime(_("%H:%M %d/%m/%y")))),
                         ("%H:%M %d/%m/%Y",
                          str(ntime.strftime(_("%H:%M %d/%m/%Y")))),
                         ("%H:%M %d %b",
                          str(ntime.strftime(_("%H:%M %d %b")))),
                         ("%H:%M %d %b %y",
                          str(ntime.strftime(_("%H:%M %d %b %y")))),
                         ("%H:%M %a %d",
                          str(ntime.strftime(_("%H:%M %a %d")))),
                         ("%H:%M %a %d/%m",
                          str(ntime.strftime(_("%H:%M %a %d/%m")))),
                         ("A%H:%M %d/%m",
                          str(ntime.strftime(_("%H:%M <A> %d/%m")))),
                         ("A%H:%M %d/%m/%y",
                          str(ntime.strftime(_("%H:%M <A> %d/%m/%y")))),
                         ("A%H:%M %d/%m/%Y",
                          str(ntime.strftime(_("%H:%M <A> %d/%m/%Y")))),
                         ("A%H:%M %d %b",
                          str(ntime.strftime(_("%H:%M <A> %d %b")))),
                         ("A%H:%M %d %b %y",
                          str(ntime.strftime(_("%H:%M <A> %d %b %y")))),
                         ("A%H:%M %a %d",
                          str(ntime.strftime(_("%H:%M <A> %a %d")))),
                         ("A%H:%M %a %d/%m",
                          str(ntime.strftime(_("%H:%M <A> %a %d/%m")))),
                         ("A%H:%M %a %d/%m/%y",
                          str(ntime.strftime(_("%H:%M <A> %a %d/%m/%y")))),
                         ("A%H:%M %a %d/%m/%Y",
                          str(ntime.strftime(_("%H:%M <A> %a %d/%m/%Y"))))])
            config.usage.lcd_dateformat.addNotifier(setDateFormat)
        else:
            config.usage.lcd_dateformat = ConfigNothing()

        if getBoxType() in ('dm900', 'dm920', 'e4hdultra', 'protek4k'):
            standby_default = 4
        elif getBoxType() in ('spycat4kmini', 'osmega'):
            standby_default = 10
        else:
            standby_default = 1

        if not ilcd.isOled():
            config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
            config.lcd.contrast.addNotifier(setLCDcontrast)
        else:
            config.lcd.contrast = ConfigNothing()

        if getBoxType() in ('novatwin', 'novacombo', 'mixosf5', 'mixosf5mini',
                            'gi9196m', 'gi9196lite', 'zgemmas2s', 'zgemmash1',
                            'zgemmash2', 'zgemmass', 'marvel1', 'enfinity',
                            'spycat'):
            config.lcd.standby = ConfigSlider(default=standby_default,
                                              limits=(0, 4))
            config.lcd.dimbright = ConfigSlider(default=standby_default,
                                                limits=(0, 4))
            config.lcd.bright = ConfigSlider(default=4, limits=(0, 4))
        elif getBoxType() in ('zgemmahs', 'zgemmah2s', 'zgemmah2h',
                              'zgemmaslc'):
            config.lcd.standby = ConfigSlider(default=2, limits=(0, 8))
            config.lcd.dimbright = ConfigSlider(default=5, limits=(0, 8))
            config.lcd.bright = ConfigSlider(default=5, limits=(0, 8))
        elif getBoxType() in ('spycat4kmini', 'osmega'):
            config.lcd.standby = ConfigSlider(default=standby_default,
                                              limits=(0, 10))
            config.lcd.dimbright = ConfigSlider(default=standby_default,
                                                limits=(0, 10))
            config.lcd.bright = ConfigSlider(default=10, limits=(0, 10))
        else:
            config.lcd.standby = ConfigSlider(default=standby_default,
                                              limits=(0, 10))
            config.lcd.dimbright = ConfigSlider(default=standby_default,
                                                limits=(0, 10))
            config.lcd.bright = ConfigSlider(
                default=SystemInfo["DefaultDisplayBrightness"], limits=(0, 10))
        config.lcd.dimbright.addNotifier(setLCDdimbright)
        config.lcd.dimbright.apply = lambda: setLCDdimbright(config.lcd.
                                                             dimbright)
        config.lcd.dimdelay = ConfigSelection(default="0",
                                              choices=[
                                                  ("5", "5 " + _("seconds")),
                                                  ("10", "10 " + _("seconds")),
                                                  ("15", "15 " + _("seconds")),
                                                  ("20", "20 " + _("seconds")),
                                                  ("30", "30 " + _("seconds")),
                                                  ("60", "1 " + _("minute")),
                                                  ("120", "2 " + _("minutes")),
                                                  ("300", "5 " + _("minutes")),
                                                  ("0", _("off"))
                                              ])
        config.lcd.dimdelay.addNotifier(setLCDdimdelay)
        config.lcd.standby.addNotifier(setLCDstandbybright)
        config.lcd.standby.apply = lambda: setLCDstandbybright(config.lcd.
                                                               standby)
        config.lcd.bright.addNotifier(setLCDbright)
        config.lcd.bright.apply = lambda: setLCDbright(config.lcd.bright)
        config.lcd.bright.callNotifiersOnSaveAndCancel = True

        config.lcd.invert = ConfigYesNo(default=False)
        config.lcd.invert.addNotifier(setLCDinverted)

        config.lcd.flip = ConfigYesNo(default=False)
        config.lcd.flip.addNotifier(setLCDflipped)

        if SystemInfo["LcdLiveTV"]:

            def lcdLiveTvChanged(configElement):
                open(SystemInfo["LcdLiveTV"],
                     "w").write(configElement.value and "0" or "1")
                InfoBarInstance = InfoBar.instance
                InfoBarInstance and InfoBarInstance.session.open(dummyScreen)

            config.lcd.showTv = ConfigYesNo(default=False)
            config.lcd.showTv.addNotifier(lcdLiveTvChanged)

        if SystemInfo["LCDMiniTV"] and config.misc.boxtype.value not in (
                'gbquad', 'gbquadplus', 'gbquad4k', 'gbue4k'):
            config.lcd.minitvmode = ConfigSelection(
                [("0", _("normal")), ("1", _("MiniTV")), ("2", _("OSD")),
                 ("3", _("MiniTV with OSD"))], "0")
            config.lcd.minitvmode.addNotifier(setLCDminitvmode)
            config.lcd.minitvpipmode = ConfigSelection(
                [("0", _("off")), ("5", _("PIP")),
                 ("7", _("PIP with OSD"))], "0")
            config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode)
            config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30))
            config.lcd.minitvfps.addNotifier(setLCDminitvfps)

        if SystemInfo["VFD_scroll_repeats"] and getBoxType() not in (
                'ixussone',
                'ixusszero') and getDisplayType() not in ('7segment', ):

            def scroll_repeats(el):
                open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value)

            choicelist = [("0", _("None")), ("1", _("1X")), ("2", _("2X")),
                          ("3", _("3X")), ("4", _("4X")),
                          ("500", _("Continues"))]
            config.usage.vfd_scroll_repeats = ConfigSelection(
                default="3", choices=choicelist)
            config.usage.vfd_scroll_repeats.addNotifier(
                scroll_repeats, immediate_feedback=False)
        else:
            config.usage.vfd_scroll_repeats = ConfigNothing()

        if SystemInfo["VFD_scroll_delay"] and getBoxType() not in (
                'ixussone',
                'ixusszero') and getDisplayType() not in ('7segment', ):

            def scroll_delay(el):
                # add workaround for Boxes who need hex code
                if getBoxType() in ('sf4008', 'beyonwizu4'):
                    open(SystemInfo["VFD_scroll_delay"],
                         "w").write(hex(int(el.value)))
                else:
                    open(SystemInfo["VFD_scroll_delay"],
                         "w").write(str(el.value))

            config.usage.vfd_scroll_delay = ConfigSlider(default=150,
                                                         increment=10,
                                                         limits=(0, 500))
            config.usage.vfd_scroll_delay.addNotifier(scroll_delay,
                                                      immediate_feedback=False)
            config.lcd.hdd = ConfigSelection([("0", _("No")), ("1", _("Yes"))],
                                             "1")
        else:
            config.lcd.hdd = ConfigNothing()
            config.usage.vfd_scroll_delay = ConfigNothing()

        if SystemInfo["VFD_initial_scroll_delay"] and getBoxType() not in (
                'ixussone',
                'ixusszero') and getDisplayType() not in ('7segment', ):

            def initial_scroll_delay(el):
                if getBoxType() in ('sf4008', 'beyonwizu4'):
                    # add workaround for Boxes who need hex code
                    open(SystemInfo["VFD_initial_scroll_delay"],
                         "w").write(hex(int(el.value)))
                else:
                    open(SystemInfo["VFD_initial_scroll_delay"],
                         "w").write(el.value)

            choicelist = [("3000", "3 " + _("seconds")),
                          ("5000", "5 " + _("seconds")),
                          ("10000", "10 " + _("seconds")),
                          ("20000", "20 " + _("seconds")),
                          ("30000", "30 " + _("seconds")),
                          ("0", _("no delay"))]
            config.usage.vfd_initial_scroll_delay = ConfigSelection(
                default="10000", choices=choicelist)
            config.usage.vfd_initial_scroll_delay.addNotifier(
                initial_scroll_delay, immediate_feedback=False)
        else:
            config.usage.vfd_initial_scroll_delay = ConfigNothing()

        if SystemInfo["VFD_final_scroll_delay"] and getBoxType() not in (
                'ixussone',
                'ixusszero') and getDisplayType() not in ('7segment', ):

            def final_scroll_delay(el):
                if getBoxType() in ('sf4008', 'beyonwizu4'):
                    # add workaround for Boxes who need hex code
                    open(SystemInfo["VFD_final_scroll_delay"],
                         "w").write(hex(int(el.value)))
                else:
                    open(SystemInfo["VFD_final_scroll_delay"],
                         "w").write(el.value)

            choicelist = [("3000", "3 " + _("seconds")),
                          ("5000", "5 " + _("seconds")),
                          ("10000", "10 " + _("seconds")),
                          ("20000", "20 " + _("seconds")),
                          ("30000", "30 " + _("seconds")),
                          ("0", _("no delay"))]
            config.usage.vfd_final_scroll_delay = ConfigSelection(
                default="10000", choices=choicelist)
            config.usage.vfd_final_scroll_delay.addNotifier(
                final_scroll_delay, immediate_feedback=False)
        else:
            config.usage.vfd_final_scroll_delay = ConfigNothing()

        if fileExists("/proc/stb/lcd/show_symbols"):
            config.lcd.mode = ConfigSelection([("0", _("No")),
                                               ("1", _("Yes"))], "1")
            config.lcd.mode.addNotifier(setLCDmode)
        else:
            config.lcd.mode = ConfigNothing()

        if fileExists("/proc/stb/power/vfd") or fileExists(
                "/proc/stb/lcd/vfd"):
            config.lcd.power = ConfigSelection([("0", _("No")),
                                                ("1", _("Yes"))], "1")
            config.lcd.power.addNotifier(setLCDpower)
        else:
            config.lcd.power = ConfigNothing()

        if fileExists("/proc/stb/fb/sd_detach"):
            config.lcd.fblcddisplay = ConfigSelection([("1", _("No")),
                                                       ("0", _("Yes"))], "1")
            config.lcd.fblcddisplay.addNotifier(setfblcddisplay)
        else:
            config.lcd.fblcddisplay = ConfigNothing()

        if fileExists("/proc/stb/lcd/show_outputresolution"):
            config.lcd.showoutputresolution = ConfigSelection(
                [("0", _("No")), ("1", _("Yes"))], "1")
            config.lcd.showoutputresolution.addNotifier(
                setLCDshowoutputresolution)
        else:
            config.lcd.showoutputresolution = ConfigNothing()

        if getBoxType() == 'vuultimo':
            config.lcd.ledblinkingtime = ConfigSlider(default=5,
                                                      increment=1,
                                                      limits=(0, 15))
            config.lcd.ledblinkingtime.addNotifier(setLEDblinkingtime)
            config.lcd.ledbrightnessdeepstandby = ConfigSlider(default=1,
                                                               increment=1,
                                                               limits=(0, 15))
            config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDdeepstandby)
            config.lcd.ledbrightnessdeepstandby.apply = lambda: setLEDdeepstandby(
                config.lcd.ledbrightnessdeepstandby)
            config.lcd.ledbrightnessstandby = ConfigSlider(default=1,
                                                           increment=1,
                                                           limits=(0, 15))
            config.lcd.ledbrightnessstandby.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightnessstandby.apply = lambda: setLEDnormalstate(
                config.lcd.ledbrightnessstandby)
            config.lcd.ledbrightness = ConfigSlider(default=3,
                                                    increment=1,
                                                    limits=(0, 15))
            config.lcd.ledbrightness.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightness.apply = lambda: setLEDnormalstate(
                config.lcd.ledbrightness)
            config.lcd.ledbrightness.callNotifiersOnSaveAndCancel = True
        else:

            def doNothing():
                pass

            config.lcd.ledbrightness = ConfigNothing()
            config.lcd.ledbrightness.apply = lambda: doNothing()
            config.lcd.ledbrightnessstandby = ConfigNothing()
            config.lcd.ledbrightnessstandby.apply = lambda: doNothing()
            config.lcd.ledbrightnessdeepstandby = ConfigNothing()
            config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing()
            config.lcd.ledblinkingtime = ConfigNothing()
    else:

        def doNothing():
            pass

        config.lcd.contrast = ConfigNothing()
        config.lcd.bright = ConfigNothing()
        config.lcd.standby = ConfigNothing()
        config.lcd.bright.apply = lambda: doNothing()
        config.lcd.standby.apply = lambda: doNothing()
        config.lcd.power = ConfigNothing()
        config.lcd.fblcddisplay = ConfigNothing()
        config.lcd.mode = ConfigNothing()
        config.lcd.hdd = ConfigNothing()
        config.lcd.scroll_speed = ConfigSelection(default="300",
                                                  choices=[("500", _("slow")),
                                                           ("300",
                                                            _("normal")),
                                                           ("100", _("fast"))])
        config.lcd.scroll_delay = ConfigSelection(
            default="10000",
            choices=[("10000", "10 " + _("seconds")),
                     ("20000", "20 " + _("seconds")),
                     ("30000", "30 " + _("seconds")),
                     ("60000", "1 " + _("minute")),
                     ("300000", "5 " + _("minutes")),
                     ("noscrolling", _("off"))])
        config.lcd.showoutputresolution = ConfigNothing()
        config.lcd.ledbrightness = ConfigNothing()
        config.lcd.ledbrightness.apply = lambda: doNothing()
        config.lcd.ledbrightnessstandby = ConfigNothing()
        config.lcd.ledbrightnessstandby.apply = lambda: doNothing()
        config.lcd.ledbrightnessdeepstandby = ConfigNothing()
        config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing()
        config.lcd.ledblinkingtime = ConfigNothing()

    config.misc.standbyCounter.addNotifier(standbyCounterChanged,
                                           initial_call=False)
Example #34
0
def InitLcd():
	if getBoxType() in ('amikomini', 'dynaspark', 'amiko8900', 'sognorevolution', 'arguspingulux', 'arguspinguluxmini', 'arguspinguluxplus', 'sparkreloaded', 'sabsolo', 'sparklx', 'gis8120', 'et4x00', 'et5x00', 'et6x00', 'gb800se', 'gb800solo', 'iqonios300hd', 'mbmicro', 'sf128', 'sf138', 'tmsingle', 'tmnano2super', 'tmnanose', 'tmnanoseplus', 'tmnanosem2', 'tmnanosem2plus', 'tmnanosecombo', 'vusolo'):
		detected = False
	else:
		detected = eDBoxLCD.getInstance().detected()

	ilcd = LCD()

	SystemInfo["Display"] = detected
	config.lcd = ConfigSubsection()

	if fileExists("/proc/stb/lcd/mode"):
		f = open("/proc/stb/lcd/mode", "r")
		can_lcdmodechecking = f.read().strip().split(" ")
		print 'LCDMiniTV',can_lcdmodechecking
		f.close()
	else:
		can_lcdmodechecking = False

 	if SystemInfo["StandbyLED"]:
		def setLEDstandby(configElement):
			ilcd.setLEDStandby(configElement.value)
		config.usage.standbyLED = ConfigYesNo(default = True)
		config.usage.standbyLED.addNotifier(setLEDstandby)

	if SystemInfo["LEDButtons"]:
		def setLEDnormalstate(configElement):
			ilcd.setLEDNormalState(configElement.value)

		def setLEDdeepstandby(configElement):
			ilcd.setLEDDeepStandbyState(configElement.value)

		def setLEDblinkingtime(configElement):
			ilcd.setLEDBlinkingTime(configElement.value)

		config.lcd.ledblinkingtime = ConfigSlider(default = 5, increment = 1, limits = (0,15))
		config.lcd.ledblinkingtime.addNotifier(setLEDblinkingtime)
		config.lcd.ledbrightnessdeepstandby = ConfigSlider(default = 1, increment = 1, limits = (0,15))
		config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDnormalstate)
		config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDdeepstandby)
		config.lcd.ledbrightnessdeepstandby.apply = lambda : setLEDdeepstandby(config.lcd.ledbrightnessdeepstandby)
		config.lcd.ledbrightnessstandby = ConfigSlider(default = 1, increment = 1, limits = (0,15))
		config.lcd.ledbrightnessstandby.addNotifier(setLEDnormalstate)
		config.lcd.ledbrightnessstandby.apply = lambda : setLEDnormalstate(config.lcd.ledbrightnessstandby)
		config.lcd.ledbrightness = ConfigSlider(default = 3, increment = 1, limits = (0,15))
		config.lcd.ledbrightness.addNotifier(setLEDnormalstate)
		config.lcd.ledbrightness.apply = lambda : setLEDnormalstate(config.lcd.ledbrightness)
		config.lcd.ledbrightness.callNotifiersOnSaveAndCancel = True

	if detected:
		config.lcd.scroll_speed = ConfigSelection(default = "300", choices = [
			("500", _("slow")),
			("300", _("normal")),
			("100", _("fast"))])
		config.lcd.scroll_delay = ConfigSelection(default = "10000", choices = [
			("10000", "10 " + _("seconds")),
			("20000", "20 " + _("seconds")),
			("30000", "30 " + _("seconds")),
			("60000", "1 " + _("minute")),
			("300000", "5 " + _("minutes")),
			("noscrolling", _("off"))])

		def setLCDbright(configElement):
			ilcd.setBright(configElement.value);

		def setLCDstandbybright(configElement):
			ilcd.setStandbyBright(configElement.value);

		def setLCDdimbright(configElement):
			ilcd.setDimBright(configElement.value);

		def setLCDdimdelay(configElement):
			ilcd.setDimDelay(configElement.value);

		def setLCDcontrast(configElement):
			ilcd.setContrast(configElement.value)

		def setLCDinverted(configElement):
			ilcd.setInverted(configElement.value)

		def setLCDflipped(configElement):
			ilcd.setFlipped(configElement.value)

		def setLCDmode(configElement):
			ilcd.setMode(configElement.value)

		def setLCDpower(configElement):
			ilcd.setPower(configElement.value);

		def setLCDminitvmode(configElement):
			ilcd.setLCDMiniTVMode(configElement.value)

		def setLCDminitvpipmode(configElement):
			ilcd.setLCDMiniTVPIPMode(configElement.value)

		def setLCDminitvfps(configElement):
			ilcd.setLCDMiniTVFPS(configElement.value)

		standby_default = 0

		if not ilcd.isOled():
			config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
			config.lcd.contrast.addNotifier(setLCDcontrast)
		else:
			config.lcd.contrast = ConfigNothing()
			standby_default = 1

		config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10))
		config.lcd.standby.addNotifier(setLCDbright)
		config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby)

		config.lcd.bright = ConfigSlider(default=5, limits=(0, 10))
		config.lcd.bright.addNotifier(setLCDbright)
		config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright)
		config.lcd.bright.callNotifiersOnSaveAndCancel = True

		config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 10))
		config.lcd.dimbright.addNotifier(setLCDdimbright);
		config.lcd.dimbright.apply = lambda : setLCDdimbright(config.lcd.dimbright)
		config.lcd.dimdelay = ConfigSelection(default = "0", choices = [
			("5", "5 " + _("seconds")),
			("10", "10 " + _("seconds")),
			("15", "15 " + _("seconds")),
			("20", "20 " + _("seconds")),
			("30", "30 " + _("seconds")),
			("60", "1 " + _("minute")),
			("120", "2 " + _("minutes")),
			("300", "5 " + _("minutes")),
			("0", _("off"))])
		config.lcd.dimdelay.addNotifier(setLCDdimdelay);

		config.lcd.invert = ConfigYesNo(default=False)
		config.lcd.invert.addNotifier(setLCDinverted)

		def PiconPackChanged(configElement):
			configElement.save()
		config.lcd.picon_pack = ConfigYesNo(default=False)
		config.lcd.picon_pack.addNotifier(PiconPackChanged)

		config.lcd.flip = ConfigYesNo(default=False)
		config.lcd.flip.addNotifier(setLCDflipped)

		if SystemInfo["LcdLiveTV"]:
			def lcdLiveTvChanged(configElement):
				setLCDLiveTv(configElement.value)
				configElement.save()
			config.lcd.showTv = ConfigYesNo(default = False)
			config.lcd.showTv.addNotifier(lcdLiveTvChanged)

			if "live_enable" in SystemInfo["LcdLiveTV"]:
				config.misc.standbyCounter.addNotifier(standbyCounterChangedLCDLiveTV, initial_call = False)

		if SystemInfo["LCDMiniTV"] and getBoxType() not in ('gbquad4k', 'gbue4k'):
			config.lcd.minitvmode = ConfigSelection([("0", _("normal")), ("1", _("MiniTV")), ("2", _("OSD")), ("3", _("MiniTV with OSD"))], "0")
			config.lcd.minitvmode.addNotifier(setLCDminitvmode)
			config.lcd.minitvpipmode = ConfigSelection([("0", _("off")), ("5", _("PIP")), ("7", _("PIP with OSD"))], "0")
			config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode)
			config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30))
			config.lcd.minitvfps.addNotifier(setLCDminitvfps)
		elif can_lcdmodechecking and getBoxType() in ('gbquad4k', 'gbue4k'):
			#  (0:normal, 1:video0, 2:fb, 3:vide0+fb, 4:video1, 5:vide0+video1, 6:video1+fb, 7:video0+video1+fb)
			config.lcd.minitvmode = ConfigSelection(default = "0", choices=[
					("0", _("normal")),
					("1", _("MiniTV") + _(" - video0")),
					("3", _("MiniTV with OSD") + _(" - video0")),
					("2", _("OSD")),
					("4", _("MiniTV") + _(" - video1")),
					("6", _("MiniTV with OSD") + _(" - video1")),
					("5", _("MiniTV") + _(" - video0+video1")),
					("7", _("MiniTV with OSD") + _(" - video0+video1"))])
			config.lcd.minitvmode.addNotifier(setLCDminitvmode)
			config.lcd.minitvpipmode = ConfigSelection(default = "0", choices=[
					("0", _("off")),
					("4", _("PIP")),
					("6", _("PIP with OSD"))])
			config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode)
			config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30))
			config.lcd.minitvfps.addNotifier(setLCDminitvfps)
		else:
			config.lcd.minitvmode = ConfigNothing()
			config.lcd.minitvpipmode = ConfigNothing()
			config.lcd.minitvfps = ConfigNothing()

		if SystemInfo["VFD_scroll_repeats"] and getDisplayType() not in ('7segment'):
			def scroll_repeats(el):
				open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value)
			choicelist = [("0", _("None")), ("1", _("1X")), ("2", _("2X")), ("3", _("3X")), ("4", _("4X")), ("500", _("Continues"))]
			config.usage.vfd_scroll_repeats = ConfigSelection(default = "3", choices = choicelist)
			config.usage.vfd_scroll_repeats.addNotifier(scroll_repeats, immediate_feedback = False)

		if SystemInfo["VFD_scroll_delay"] and getDisplayType() not in ('7segment'):
			def scroll_delay(el):
				open(SystemInfo["VFD_scroll_delay"], "w").write(str(el.value))
			config.usage.vfd_scroll_delay = ConfigSlider(default = 150, increment = 10, limits = (0, 500))
			config.usage.vfd_scroll_delay.addNotifier(scroll_delay, immediate_feedback = False)

		if SystemInfo["VFD_initial_scroll_delay"] and getDisplayType() not in ('7segment'):
			def initial_scroll_delay(el):
				open(SystemInfo["VFD_initial_scroll_delay"], "w").write(el.value)
			choicelist = [
			("10000", "10 " + _("seconds")),
			("20000", "20 " + _("seconds")),
			("30000", "30 " + _("seconds")),
			("0", _("no delay"))]
			config.usage.vfd_initial_scroll_delay = ConfigSelection(default = "1000", choices = choicelist)
			config.usage.vfd_initial_scroll_delay.addNotifier(initial_scroll_delay, immediate_feedback = False)

		if SystemInfo["VFD_final_scroll_delay"] and getDisplayType() not in ('7segment'):
			def final_scroll_delay(el):
				open(SystemInfo["VFD_final_scroll_delay"], "w").write(el.value)
			choicelist = [
			("10000", "10 " + _("seconds")),
			("20000", "20 " + _("seconds")),
			("30000", "30 " + _("seconds")),
			("0", _("no delay"))]
			config.usage.vfd_final_scroll_delay = ConfigSelection(default = "1000", choices = choicelist)
			config.usage.vfd_final_scroll_delay.addNotifier(final_scroll_delay, immediate_feedback = False)

		if fileExists("/proc/stb/lcd/show_symbols"):
			config.lcd.mode = ConfigSelection([("0", _("no")), ("1", _("yes"))], "1")
			config.lcd.mode.addNotifier(setLCDmode)
		else:
			config.lcd.mode = ConfigNothing()

		if fileExists("/proc/stb/power/vfd"):
			config.lcd.power = ConfigSelection([("0", _("off")), ("1", _("on"))], "1")
			config.lcd.power.addNotifier(setLCDpower);
		else:
			config.lcd.power = ConfigNothing()

	else:
		def doNothing():
			pass
		config.lcd.contrast = ConfigNothing()
		config.lcd.bright = ConfigNothing()
		config.lcd.standby = ConfigNothing()
		config.lcd.bright.apply = lambda : doNothing()
		config.lcd.standby.apply = lambda : doNothing()
		config.lcd.mode = ConfigNothing()
		config.lcd.power = ConfigNothing()
		config.lcd.ledbrightness = ConfigNothing()
		config.lcd.ledbrightness.apply = lambda : doNothing()
		config.lcd.ledbrightnessstandby = ConfigNothing()
		config.lcd.ledbrightnessstandby.apply = lambda : doNothing()
		config.lcd.ledbrightnessdeepstandby = ConfigNothing()
		config.lcd.ledbrightnessdeepstandby.apply = lambda : doNothing()
		config.lcd.ledblinkingtime = ConfigNothing()
		config.lcd.picon_pack = ConfigNothing()

	config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call = False)