Jump to content


Photo

[WIP] PLi-DarkOS Skin


  • Please log in to reply
2057 replies to this topic

Re: [WIP] PLi-DarkOS Skin #841 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 13 December 2023 - 16:08

This is the renderer that is now insider this skin. It does his job but it is also kind of hardcoded method to calculate the box model back to brand and not all the possible brands are included yet. Currently a subset of logo's are located :/usr/share/enigma2/E2-DarkOS/icons/logos and there are also still pngs there (at least on my box but it could be history). 

 

When we decide just like it is done as far I understood for openwebif to put all this pictures in the image this renderer just needs cleanup (it has still some left overs to read png files)... and then for me it is also fine...

 

But I think 'brand' pictures could also be done with OpenPLi as a Zgemma logo is a Zgemma logo... Then also the hardcoded stuff in the renderer could be avoided... 

from enigma import ePixmap
from Components.Renderer.Renderer import Renderer
from Tools.LoadPixmap import LoadPixmap
from Tools.Directories import SCOPE_GUISKIN, resolveFilename
 
try:
        from Components.SystemInfo import BoxInfo
        model = BoxInfo.getItem("model")
except:
        from Tools.HardwareInfo import HardwareInfo
        model = HardwareInfo().get_device_model()
 
 
def getLogoPngName(logoType):
                logoname = ""
                if logoType == "model":
                        return model or ""
                elif logoType == "brand":
                        if model and model in ("vusolo", "vuduo", "vuuno", "vuzero", "vusolo2", "vusolose", "vuduo2",  "vuultimo", "vuzero4k", "vusolo4k", "vuuno4k", "vuuno4kse", "vuduo4k", "vuduo4kse", "vuultimo4k"):
                                logoname = "vulogo"
                        elif model and model in ("dagsmv200"):
                                logoname = "qviartlogo"
                        elif model and model in ("sf8008", "sf8008m", "sx988", "sx88v2", "sfx6008", "sfx6018"):
                                logoname = "octagonlogo"
                        elif model and model in ("pulse4k", "pulse4kmini"):
                                logoname = "pulselogo"
                        elif model and model in ("gbmv200"):
                                logoname = "gigabluelogo"
 
                return logoname
 
def getDefaultLogo(logoType, width, height):
                if logoType == "model":
                        defaultPngName = resolveFilename(SCOPE_GUISKIN, "icons/logos/deflogo.svg")
                else:
                        defaultPngName = resolveFilename(SCOPE_GUISKIN, "icons/logos/deflogo-small.svg")
 
                is_svg = defaultPngName.endswith(".svg")
                return LoadPixmap(defaultPngName, width=width, height=0 if is_svg else height)
 
def setLogo(px, logoType, width, height):
        pngname = resolveFilename(SCOPE_GUISKIN, "icons/logos/" + getLogoPngName(logoType) + ".svg")
        is_svg = pngname.endswith(".svg")
        png = LoadPixmap(pngname, width=width, height=0 if is_svg else height)
        if png != None:
                px.setPixmap(png)
        else:
                defaultLogo = getDefaultLogo(logoType, width, height)
                if defaultLogo != None:
                        px.setPixmap(defaultLogo)
 
 
class BoxLogo(Renderer):
        def __init__(self):
                Renderer.__init__(self)
                self.logoType = "model"
 
        GUI_WIDGET = ePixmap
 
        def applySkin(self, desktop, parent):
                attribs = self.skinAttributes[:]
                for (attrib, value) in self.skinAttributes:
                        if attrib == "logoType":
                                self.logoType = value
                                attribs.remove((attrib, value))
                                break
                self.skinAttributes = attribs
                return Renderer.applySkin(self, desktop, parent)
 
        def changed(self, what):
                pass
 
        def onShow(self):
                if self.instance:
                        setLogo(self.instance, self.logoType, self.instance.size().width(), self.instance.size().height())

Edited by littlesat, 13 December 2023 - 16:14.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #842 WanWizard

  • PLi® Core member
  • 70,775 posts

+1,830
Excellent

Posted 13 December 2023 - 16:14

Ok, so it is not a box or model logo, it is a brand logo?

 

That is a totally different matter, no matter how many models an image it is for, it always for only one brand, so that is doable without boxinfo.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: [WIP] PLi-DarkOS Skin #843 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 13 December 2023 - 16:16

Images that are currently in the skin...

root@vuultimo4k:/usr/share/enigma2/E2-DarkOS/icons/logos# ls -la
drwxr-xr-x    2 root     root          4096 Dec 12 09:46 .
drwxr-xr-x    6 root     root          8192 Dec 12 09:46 ..
-rw-r--r--    1 root     root          5426 Dec 12 04:35 dagsmv200.png
-rw-r--r--    1 root     root           787 Dec 12 04:35 deflogo-small.png
-rw-r--r--    1 root     root          4789 Dec 12 04:35 deflogo.png
-rw-r--r--    1 root     root          9239 Dec 12 04:35 dmm_logoS.svg
-rw-r--r--    1 root     root          5469 Dec 12 04:35 gb200mv.png
-rw-r--r--    1 root     root          1681 Dec 12 04:35 gigabluelogo.png
-rw-r--r--    1 root     root          3384 Dec 12 04:35 octagonlogo.png
-rw-r--r--    1 root     root          6740 Dec 12 04:35 pulse4k.png
-rw-r--r--    1 root     root          7828 Dec 12 04:35 pulse4kmini.png
-rw-r--r--    1 root     root          2387 Dec 12 04:35 pulselogo.png
-rw-r--r--    1 root     root          2560 Dec 12 04:35 qviartlogo.png
-rw-r--r--    1 root     root         13030 Dec 12 04:35 sf8008.png
-rw-r--r--    1 root     root         13030 Dec 12 04:35 sf8008m.png
-rw-r--r--    1 root     root         13030 Dec 12 04:35 sfx6008.png
-rw-r--r--    1 root     root         13030 Dec 12 04:35 sfx6018.png
-rw-r--r--    1 root     root         13030 Dec 12 04:35 sx88v2.png
-rw-r--r--    1 root     root         13030 Dec 12 04:35 sx988.png
-rw-r--r--    1 root     root          6649 Dec 12 04:35 vuduo4k.svg
-rw-r--r--    1 root     root          7296 Dec 12 04:35 vuduo4kse.svg
-rw-r--r--    1 root     root         16976 Dec 12 04:35 vulogo.svg
-rw-r--r--    1 root     root         19830 Dec 12 04:35 vuplusduo4kse.png
-rw-r--r--    1 root     root          7296 Dec 12 04:35 vuplusduo4kse.svg
-rw-r--r--    1 root     root          7079 Dec 12 04:35 vuultimo4k.svg

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #844 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 13 December 2023 - 16:17

And the renderer does brand -and- box logo... 

 

Actually a new skin feature that is in this skin... were we usually put OpenPLI logo's so we never had this discussion before.

 

Unless this it is still 'smart' to go for a good design... of course the 'brand' model could be stored in a different way as putting it hardcoded in such renderer is not really a structured method. But as far I understood the 'brand' should be already available somewhere...


Edited by littlesat, 13 December 2023 - 16:19.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #845 WanWizard

  • PLi® Core member
  • 70,775 posts

+1,830
Excellent

Posted 13 December 2023 - 16:20

Just a thought, wasn't it the goal of boxinfo to return paths to images (box, rc, etc) to avoid having code like this all over the place, or was that feature butched along the way too?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: [WIP] PLi-DarkOS Skin #846 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 13 December 2023 - 16:22

We have that already in https://github.com/O...dwareInfo.py#L8 and /proc/stb/info/brandname so no hardcoding needed... But it seems for VU+ brandname does not appear..... So this is not for all boxes and maybe some bsps do have it.

 

@Wanwizard,

Didn't you recently add something to the build to satisfy some multiboot stuff for other images... Is there already something for the brand included there or can we add it...?


Edited by littlesat, 13 December 2023 - 16:26.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #847 Huevos

  • PLi® Contributor
  • 4,747 posts

+167
Excellent

Posted 13 December 2023 - 20:57

Ok, so it is not a box or model logo, it is a brand logo?

 

That is a totally different matter, no matter how many models an image it is for, it always for only one brand, so that is doable without boxinfo.

The plan is a box logo and a brand logo.



Re: [WIP] PLi-DarkOS Skin #848 WanWizard

  • PLi® Core member
  • 70,775 posts

+1,830
Excellent

Posted 13 December 2023 - 21:02

We have that already in https://github.com/O...dwareInfo.py#L8 and /proc/stb/info/brandname so no hardcoding needed... But it seems for VU+ brandname does not appear..... So this is not for all boxes and maybe some bsps do have it.

 

If nobody can be bothered to look at implementing boxinfo, there's nothing more I can do.

 

Didn't you recently add something to the build to satisfy some multiboot stuff for other images... Is there already something for the brand included there or can we add it...?

 

No, I haven't. No clue what you are on about.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: [WIP] PLi-DarkOS Skin #849 Huevos

  • PLi® Contributor
  • 4,747 posts

+167
Excellent

Posted 13 December 2023 - 21:05

It wasn't directed at you. Or Huevos... ;).

If you implement /usr/lib/enigma.info I will add the BoxInfo code. Mine is as follows... but you just need a scaled down version that supports the requirements of WebIf and wherever else it will be used.

architecture=cortexa15hf-neon-vfpv4
avjack=False
blindscanbinary=blindscan
brand=vuplus
ci=True
compiledate='20231209'
dboxlcd=False
developername=openvix
displaybrand=Vu+
displaydistro=OpenViX
displaymodel=Ultimo4K
displaytype=colorlcd800
distro=openvix
driversdate='20190424'
dvi=False
feedsurl=http://openvixdev.satellites-xml.org/feeds/openvix/developer/6.4/vuultimo4k
fhdskin=True
forcemode=no
fpu=hard
friendlyfamily=vuultimo4k 
hdmi=True
hdmifhdin=True
hdmihdin=False
hdmistandbymode=0
imagebuild='010'
imagedevbuild='019'
imagedir=vuplus/ultimo4k
imagefs=tar.bz2 
imagetype=developer
imageversion='6.4'
imglanguage=multilang
imgrevision='010'
imgversion='6.4'
kernel='3.14.28-1.12'
kexecmb=True
kernelfile=kernel_auto.bin
machinebuild=vuultimo4k
mediaservice=servicegstreamer
middleflash=False
mkubifs=-m 2048 -e 126976 -c  
model=vuultimo4k
mtdbootfs=
mtdkernel=mmcblk0p1
mtdrootfs=mmcblk0p4
multilib=False
multitranscoding=False
oe=OE-Alliance 5.3
platform=vuultimo4k
python='3.11'
rca=False
rcidnum=2
rcname=vu2
rctype=0
rootfile=rootfs.tar.bz2
scart=False
noscartswitch=
scartyuv=False
smallflash=False
socfamily='bcm7376'
svideo=False
timerwakeupmode=0
transcoding=True
ubinize=-m 2048 -p 128KiB
vfdsymbol=False
wol=True
wwol=True
yuv=False

 


Edited by Huevos, 13 December 2023 - 21:11.


Re: [WIP] PLi-DarkOS Skin #850 WanWizard

  • PLi® Core member
  • 70,775 posts

+1,830
Excellent

Posted 13 December 2023 - 21:06

It is already there (as multiboot uses it), but not complete, and several things will need to be added at first boot because we don't have  or can't have the info at compile time.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: [WIP] PLi-DarkOS Skin #851 WanWizard

  • PLi® Core member
  • 70,775 posts

+1,830
Excellent

Posted 13 December 2023 - 21:09


Didn't you recently add something to the build to satisfy some multiboot stuff for other images... Is there already something for the brand included there or can we add it...?

 

No, I haven't. No clue what you are on about.

 

 

Now I understand. Only the minimum was implemented to satisfy the multiboot code.

 

If someone can implement boxinfo, assuming that everthing is there, I can spend some time next week on doing the OE and first boot side of things.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: [WIP] PLi-DarkOS Skin #852 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 13 December 2023 - 21:41

It would be nice when brand could be added there. When I have specs for boxinfo (I suggest this is python code) I can create it.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #853 Huevos

  • PLi® Contributor
  • 4,747 posts

+167
Excellent

Posted 13 December 2023 - 22:59

It would be nice when brand could be added there. When I have specs for boxinfo (I suggest this is python code) I can create it.

You don't need to create it. It is already in use. Don't think about creating something different or we will be back to square one. All the methods need to be identical to the current version used in WebIf and plugins or will not be compatible.


Edited by Huevos, 13 December 2023 - 23:05.


Re: [WIP] PLi-DarkOS Skin #854 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 13 December 2023 - 23:12

And about webif… it seems they moved from e2openplugins…
When it is there why is wanwizard asking for something extra’s?

Edited by littlesat, 13 December 2023 - 23:12.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #855 WanWizard

  • PLi® Core member
  • 70,775 posts

+1,830
Excellent

Posted 14 December 2023 - 11:26

I'm not asking for something extra in E2.

 

The boxinfo class relies on the text file created during build. In OE-A images, it is created from static values littered all over their OE. We can't and won't do that, and not all required info is available at build time due to the way we build.

 

So what I need to do is:

  • add all fields to the file when building, adding placeholders for missing info
  • create a bit of code that runs on first boot, that replaces the placeholders by runtime detected data

Once this is done, we can start by removing that type of code from E2 and replace it by calls to boxinfo.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: [WIP] PLi-DarkOS Skin #856 Huevos

  • PLi® Contributor
  • 4,747 posts

+167
Excellent

Posted 14 December 2023 - 12:11

I'm not asking for something extra in E2.

 

The boxinfo class relies on the text file created during build. In OE-A images, it is created from static values littered all over their OE. We can't and won't do that, and not all required info is available at build time due to the way we build.

 

So what I need to do is:

  • add all fields to the file when building, adding placeholders for missing info
  • create a bit of code that runs on first boot, that replaces the placeholders by runtime detected data

Once this is done, we can start by removing that type of code from E2 and replace it by calls to boxinfo.

Well if there is nothing extra in the python code how will OpenWebIf import it?



Re: [WIP] PLi-DarkOS Skin #857 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 14 December 2023 - 15:40

The pager points in the channel selection screen are fixed... Thanks looks nice...

 

For the boxinfo I have to wait until it is in... and know what needs to be added at runtime... Sorry that we have a different build system...


Edited by littlesat, 14 December 2023 - 15:41.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #858 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 14 December 2023 - 15:51

It took me a lot of time to find the file...

 

/usr/lib/enigma.info

 

I did never agree this was a good location to put such file... but actually the oe-a colleagues just did it... so it sounds another thing we have to live with...

 

I also see every thing regarding this file is arranged in SystemInfo.py...

 

https://github.com/O...s/SystemInfo.py

 

I have no idea if we simply could add info here... -or- we also need to update the enigma.info file on that strange location for it /usr/lib...


Edited by littlesat, 14 December 2023 - 15:51.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #859 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 14 December 2023 - 15:57

I also see here is some lack of design..... there are a lot of work-a-rounds in this code due to the format from that enigma.info file did not have a fantasy format. A work-a-round for firmware versions because it can think it is a float...True False On Off that is converted to boolean.... But again it is there now...

 

But with the values we have no the parsing could be less complicated as long boxinfo is used to get the values, which also get values from systeminfo with getItem... so everything that is already done at runtime for systeminfo should already be there... (at least in enigma2). So it would be nice when the brand is at least in the enigma.info

 

Sounds also that the checksum is not really needed as it is not parsed at all...

imgversion='develop'
imgrevision=''
distro=openpli
displaydistro=OpenPLi
compiledate='20231213'
checksum=9b521ed40fe180b29bbd498e9f432c29

Edited by littlesat, 14 December 2023 - 16:16.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: [WIP] PLi-DarkOS Skin #860 littlesat

  • PLi® Core member
  • 57,390 posts

+708
Excellent

Posted 14 December 2023 - 16:21

class BoxInformation:
                def __init__(self, root=""):
                                self.immutableList = []
                                self.boxInfo = {}
                                file = root + pathjoin(resolveFilename(SCOPE_LIBDIR), "enigma.info")
                                self.boxInfo["overrideactive"] = False  # not currently used by us
                                lines = fileReadLines(file)
                                if lines:
                                                for line in lines:
                                                                if line.startswith("#") or line.strip() == "" or line.strip().lower().startswith("checksum") or "=" not in line:
                                                                                continue
                                                                item, value = [x.strip() for x in line.split("=", 1)]
                                                                if item:
                                                                                self.immutableList.append(item)
                                                                                # Temporary fix: some items that look like floats are not floats and should be handled as strings, e.g. python "3.10" should not be processed as "3.1".
                                                                                if not (value.startswith("\"") or value.startswith("'")) and item in ("python", "imageversion", "imgversion"):
                                                                                                value = '"' + value + '"'  # wrap it so it is treated as a string
                                                                                self.boxInfo[item] = self.processValue(value)
                                                # print("[SystemInfo] Enigma information file data loaded into BoxInfo.")
                                else:
                                                print("[BoxInfo] ERROR: %s is not available!  The system is unlikely to boot or operate correctly." % file)
 
                def processValue(self, value):
                                if value is None:
                                                pass
                                elif (value.startswith("\"") or value.startswith("'")) and value.endswith(value[0]):
                                                value = value[1:-1]
                                elif value.startswith("(") and value.endswith(")"):
                                                data = []
                                                for item in [x.strip() for x in value[1:-1].split(",")]:
                                                                data.append(self.processValue(item))
                                                value = tuple(data)
                                elif value.startswith("[") and value.endswith("]"):
                                                data = []
                                                for item in [x.strip() for x in value[1:-1].split(",")]:
                                                                data.append(self.processValue(item))
                                                value = list(data)
                                elif value.upper() == "NONE":
                                                value = None
                                elif value.upper() in ("FALSE", "NO", "OFF", "DISABLED"):
                                                value = False
                                elif value.upper() in ("TRUE", "YES", "ON", "ENABLED"):
                                                value = True
                                elif value.isdigit() or ((value[0:1] == "-" or value[0:1] == "+") and value[1:].isdigit()):
                                                if value[0] != "0":  # if this is zero padded it must be a string, so skip
                                                                value = int(value)
                                elif value.startswith("0x") or value.startswith("0X"):
                                                value = int(value, 16)
                                elif value.startswith("0o") or value.startswith("0O"):
                                                value = int(value, 8)
                                elif value.startswith("0b") or value.startswith("0B"):
                                                value = int(value, 2)
                                else:
                                                try:
                                                                value = float(value)
                                                except ValueError:
                                                                pass
                                return value
 
                def getEnigmaInfoList(self):
                                return sorted(self.immutableList)
 
                def getEnigmaConfList(self):  # not used by us
                                return []
 
                def getItemsList(self):
                                return sorted(list(self.boxInfo.keys()))
 
                def getItem(self, item, default=None):
                                if item in self.boxInfo:
                                                value = self.boxInfo[item]
                                elif item in SystemInfo:
                                                value = SystemInfo[item]
                                else:
                                                value = default
                                return value
 
                def setItem(self, item, value, immutable=False, forceOverride=False):
                                if item in self.immutableList and not forceOverride:
                                                print("[BoxInfo] Error: Item '%s' is immutable and can not be %s!" % (item, "changed" if item in self.boxInfo else "added"))
                                                return False
                                if immutable and item not in self.immutableList:
                                                self.immutableList.append(item)
                                self.boxInfo[item] = value
                                SystemInfo[item] = value
                                return True
 
                def deleteItem(self, item, forceOverride=False):
                                if item in self.immutableList and not forceOverride:
                                                print("[BoxInfo] Error: Item '%s' is immutable and can not be deleted!" % item)
                                elif item in self.boxInfo:
                                                del self.boxInfo[item]
                                                return True
                                return False
 
 
BoxInfo = BoxInformation()

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users