←  [EN] Enduser support

Forums

»

Memory Info Screen

Taapat's Photo Taapat 18 Dec 2014

Some suggestions about the new MemoryInfo Screen.
1. I think that it is better to use if "MemTotal" in name: and if "MemFree" in name: instead of if name.find("MemTotal") != -1: and if name.find("MemFree") != -1:.

 

2. Maybe can reduce the lmemtext and lmemvalue rows to the 23.
Is necessary a large screen in skyn to display 28 rows. Of course I do not know, maybe your receiver /proc/meminfo contains 56 rows of information. Then I understood why need 28 rows.

Quote

ims's Photo ims 19 Dec 2014

ad 1) may be, but it is legal condition too. imho

ad 2) use smaller font.

Question was not - how much lines has /proc/meminfo - but - optimal font size and filled whole screen in default PLi skin.

When I will using 23 rows, then I will to have this screen in 3 skins ugly.

 

I can go to 25 lines with font 20, no less. It is near. Ok ?

Quote

ims's Photo ims 19 Dec 2014

Changed to 25 rows / col

Quote

Taapat's Photo Taapat 19 Dec 2014

1) Yes it is legal condition, but a lot of times slower:

disks@Disks:~$ python -mtimeit -s 'a="aabbccdd"' 'if "cc" in  a: b=1'
10000000 loops, best of 3: 0.0746 usec per loop
disks@Disks:~$ python -mtimeit -s 'a="aabbccdd"' 'if a.find("cc") != -1: b=1'
1000000 loops, best of 3: 0.211 usec per loop

2) I understand that this number is for the whole screen in PLI default skin, but it can not be changed in the skin, so it is unusable in skins which are not used full screen.

If we use two columns for the data, perhaps more correct is data split in half?
For myself, I have already changed the number, I just wanted to draw your attention to this.

Quote

ims's Photo ims 19 Dec 2014

ad 1) changed

ad 2) changed to 25 (it is almost in center between 28 and wanted 23 :) ).

Why it is not useable in non full screen skins ? I have it for default skin whole on screen (will be merged latery). I want not adding menu for config this number... it is dummy info only

 

Btw, I see, that E2 vertical "center" in position does not count with title border.

 

Attached Files

  • Attached File  mids.png   365.15KB   7 downloads
Quote

ims's Photo ims 19 Dec 2014

I will add it as parameter into skin

Quote

Taapat's Photo Taapat 19 Dec 2014

Move the slider on top, and you'll see why I asked 23 :).
But in any case I do not think that for this is necessary config entry or complex code.
I agree that this is not very important. We need to arrange the best number of rows and that is all. if you say 25, ok let it be. For myself I can always change as I need.

Attached Files

Quote

Taapat's Photo Taapat 19 Dec 2014

And another small optimization. MemTotal and MemFree can be found in the first lines, so there is no need to look for them in all rows. Maybe better is move this check below if i < 25:

for line in open('/proc/meminfo','r'):
    ( name, size, units ) = line.strip().split()
    if i < 25:
        if "MemTotal" in name:
            mem = int(size)
        elif "MemFree" in name:
            free = int(size)
        ltext += "".join((name,"\n"))
        lvalue += "".join((size," ",units,"\n"))
    else:
        rtext += "".join((name,"\n"))
        rvalue += "".join((size," ",units,"\n"))
Quote

ims's Photo ims 20 Dec 2014

You can add into your skin into screen for MemoryInfo wanted number of rows with line:

<widget name="params" rowsincolumn="23"/>
Quote