Jump to content


Photo

Memory Info Screen


  • Please log in to reply
8 replies to this topic

#1 Taapat

  • PLi® Core member
  • 2,341 posts

+120
Excellent

Posted 18 December 2014 - 23:34

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.



Re: Memory Info Screen #2 ims

  • PLi® Core member
  • 13,621 posts

+212
Excellent

Posted 19 December 2014 - 00:24

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 ?


Kdo nic nedělá, nic nezkazí!

Re: Memory Info Screen #3 ims

  • PLi® Core member
  • 13,621 posts

+212
Excellent

Posted 19 December 2014 - 13:03

Changed to 25 rows / col


Kdo nic nedělá, nic nezkazí!

Re: Memory Info Screen #4 Taapat

  • PLi® Core member
  • 2,341 posts

+120
Excellent

Posted 19 December 2014 - 14:08

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.



Re: Memory Info Screen #5 ims

  • PLi® Core member
  • 13,621 posts

+212
Excellent

Posted 19 December 2014 - 14:31

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

Kdo nic nedělá, nic nezkazí!

Re: Memory Info Screen #6 ims

  • PLi® Core member
  • 13,621 posts

+212
Excellent

Posted 19 December 2014 - 16:20

I will add it as parameter into skin


Kdo nic nedělá, nic nezkazí!

Re: Memory Info Screen #7 Taapat

  • PLi® Core member
  • 2,341 posts

+120
Excellent

Posted 19 December 2014 - 16:29

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



Re: Memory Info Screen #8 Taapat

  • PLi® Core member
  • 2,341 posts

+120
Excellent

Posted 19 December 2014 - 20:00

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"))


Re: Memory Info Screen #9 ims

  • PLi® Core member
  • 13,621 posts

+212
Excellent

Posted 20 December 2014 - 10:04

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

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

Kdo nic nedělá, nic nezkazí!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users