Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-11

More testing please

32 messages · 11 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter

I've updated CPU Graph with some nice (IMO) changes:

http://cache.getlazarus.org/images/cpu-graph-sizes.png

Version 1.0.2 is available at:

http://www.getlazarus.org/apps/cpugraph/

Changes:
-------------

* You can now move the window by clicking and dragging.
* You can now size the window using the corners.
* The widow layout automatically changes based on size.
* Graph lines can be toggled on and off by clicking on the color box next to the CPU.
* Compositing now detected correctly and rendering is adjusted accordingly.
* Minor alteration to tray icons which hopefully works on more configurations.

If anyone cares to test this version I'd appreciate it. Suggestions are welcomed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/909c1205/attachment.html>

Reply by email

Michael Van Canneyt
to Anthony Walter
Anthony Walter wrote
Changes: ------------- * You can now move the window by clicking and dragging.

Check.

* You can now size the window using the corners.

Check. Nice mechanism, BTW.

* The widow layout automatically changes based on size.

Check.

* Graph lines can be toggled on and off by clicking on the color box next to the CPU.

Check.

* Compositing now detected correctly and rendering is adjusted accordingly.

Check.

* Minor alteration to tray icons which hopefully works on more configurations.

Nice job !

Michael.

Reply by email

Paul Michell
to Anthony Walter: I've updated CPU Graph with some nice (IMO) changes:…

Moving and sizing works well here (Kubuntu 64 15.04), still no Tray Icon though.

Anthony Walter wrote 30 lines
I've updated CPU Graph with some nice (IMO) changes: http://cache.getlazarus.org/images/cpu-graph-sizes.png Version 1.0.2 is available at: http://www.getlazarus.org/apps/cpugraph/ Changes: ------------- * You can now move the window by clicking and dragging. * You can now size the window using the corners. * The widow layout automatically changes based on size. * Graph lines can be toggled on and off by clicking on the color box next to the CPU. * Compositing now detected correctly and rendering is adjusted accordingly. * Minor alteration to tray icons which hopefully works on more configurations. If anyone cares to test this version I'd appreciate it. Suggestions are welcomed. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/cdaaf202/attachment.html>

Reply by email

Michael Van Canneyt
to Paul Michell
Paul Michell wrote
Moving and sizing works well here (Kubuntu 64 15.04), still no Tray Icon though.

Probably Plasma 5 ?
That's probably the new tray icon protocol as used in Unity on Ubuntu.

Michael.

Reply by email

Andrea Mauri
to Paul Michell: Moving and sizing works well here (Kubuntu 64 15.04), still no Tray Icon though.…

not working on ubuntu 14.04 64 bit on virtualbox
I got
The program 'cpugraph' received an X Window System error. This probably reflects a bug in the program.
The error was 'BadAccess (attempt to access private resource denied)'. (Details: serial 282 error_code 10 request_code 33 minor_code 0)

   (Note to programmers: normally, X errors are reported asynchronously;
    that is, you will receive the error a while after causing it.
    To debug your program, run it with the --sync command line
    option to change this behavior. You can then get a meaningful
    backtrace from your debugger if you break on the gdk_x_error()

function.)

I cannot download the 32bit since the link is not working http://cache.getlazarus.org/debs/cpugraph_1.0.1-2-i386.deb

Il 09/11/2015 13:59, Paul Michell ha scritto:

Show quoted text 42 lines
Moving and sizing works well here (Kubuntu 64 15.04), still no Tray Icon though. On 09/11/15 12:42, Anthony Walter wrote: > I've updated CPU Graph with some nice (IMO) changes: > > http://cache.getlazarus.org/images/cpu-graph-sizes.png > > Version 1.0.2 is available at: > > http://www.getlazarus.org/apps/cpugraph/ > > Changes: > ------------- > > * You can now move the window by clicking and dragging. > * You can now size the window using the corners. > * The widow layout automatically changes based on size. > * Graph lines can be toggled on and off by clicking on the color box > next to the CPU. > * Compositing now detected correctly and rendering is adjusted > accordingly. > * Minor alteration to tray icons which hopefully works on more > configurations. > > If anyone cares to test this version I'd appreciate it. Suggestions > are welcomed. > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Alexsander Rosa
to Paul Michell: Moving and sizing works well here (Kubuntu 64 15.04), still no Tray Icon though.…

Same here (no tray icon), Ubuntu 14.04 without Unity. Maybe a UI (or key) to bring up the menu?

2015-11-09 10:59 GMT-02:00 Paul Michell :

Show quoted text 43 lines
Moving and sizing works well here (Kubuntu 64 15.04), still no Tray Icon though. On 09/11/15 12:42, Anthony Walter wrote: I've updated CPU Graph with some nice (IMO) changes: http://cache.getlazarus.org/images/cpu-graph-sizes.png Version 1.0.2 is available at: http://www.getlazarus.org/apps/cpugraph/ Changes: ------------- * You can now move the window by clicking and dragging. * You can now size the window using the corners. * The widow layout automatically changes based on size. * Graph lines can be toggled on and off by clicking on the color box next to the CPU. * Compositing now detected correctly and rendering is adjusted accordingly. * Minor alteration to tray icons which hopefully works on more configurations. If anyone cares to test this version I'd appreciate it. Suggestions are welcomed. -- _______________________________________________ Lazarus mailing ://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Atenciosamente, Alexsander da Rosa -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/d92de42f/attachment.html>

Reply by email

Anthony Walter
to Anthony Walter: I've updated CPU Graph with some nice (IMO) changes:…

There was a typo on the 32bit deb:

http://cache.getlazarus.org/debs/cpugraph_1.0.2-1-i386.deb

Thanks for testing. Regarding people who still don't see the tray icon, if you run the following in terminal does it find anything?

find /usr/lib -name libappindi*

Does it find "libappindicator.so.1" or some other version or none at all? -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/763931c2/attachment.html>

Reply by email

Graeme Geldenhuys
to Anthony Walter: I've updated CPU Graph with some nice (IMO) changes:…
Anthony Walter wrote
I've updated CPU Graph with some nice (IMO) changes: http://cache.getlazarus.org/images/cpu-graph-sizes.png

There seems to be a rendering bug in your graph. See attached screenshot. The dotted lines go outside the graph client area.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot-1.png Type: image/png Size: 10088 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/e0cb8f3e/attachment-0001.png>

Reply by email

Anthony Walter
to Alexsander Rosa: Same here (no tray icon), Ubuntu 14.04 without Unity. Maybe a UI (or key) to bring up the…

Alexsander, okay I added the tray icon menu as the forums popup menu, so in the next version users will be able to right click the window and get the same menu options.

I guess I need to add libappindicator1 to the deb depends section and that will fix these tray icon problems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/086f99b2/attachment.html>

Reply by email

Graeme Geldenhuys
to Anthony Walter: Graeme, wow that's some attention to detail there. Fixed! TY -------------- next part…
Anthony Walter wrote
Graeme, wow that's some attention to detail there. Fixed! TY

:-) It's from developing pixel perfect fpGUI widgets since 2006. ;-)

If you want more minor anomalies... probably nobody else would notice either, so you can probably ignore these. :)

1.
The graph title and axis are rendering with mono anti-aliasing, but the CPU legends are rendered in RGB/LCD anti-aliasing.

2.
I also noticed that in some of the graphs the dotted lines aren't as sharp as other graphs. This is a common "line alignment" or "half-a-pixel" anti-aliasing issue. With xmag you can see the blurry ones actually have two lines drawn at different opacities. This issue only occurs on pure horizontal or vertical lines. With AggPas (I don't know your graphics backend) you can fix that by pixel-aligning pure horizontal and vertical lines, giving you always sharp/crisp looking lines.

Here is an article explaining it.

http://web.archive.org/web/20150315034509/http://antigrain.com/tips/line_alignment/line_alignment.agdoc.html#PAGE_LINE_ALIGNMENT

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Anthony Walter
to Graeme Geldenhuys: :-) It's from developing pixel perfect fpGUI widgets since 2006. ;-) If you want more…

Greame, thanks. I know all about pixel alignment. I was using a method (last version) to correctly align the graph lines to the pixels. The involved drawing on Y at the a 0.5 pixel offset and making the pen 1 pixel. I also had to offset each row an even number of pixels, which wasn't a problem since I fixed the grid height to fit correctly.

This time however the grid height is variable and I didn't add code to snap it's height to a value evenly divisible by 5 (there are five rows). I really didn't think it was that important of an issueand am instead using something like "Y := Grid.Y + Row * Grid.Height / 5". The lines will render a slightly different shades/thicknesses if they might fall on uneven pixels, but they are so colored so light (on my monitor anyways) that I thought it was good enough, but you noticed.

I'll consider fixing it in the next revision. Thanks. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/ba9e6b7f/attachment.html>

Reply by email

Anthony Walter
to Anthony Walter

I just thought I'd add a note. In my Cross.Code library, the ISurface implementation I've written provides automatic pixel alignment methods for filling/stroking certain shapes with consideration to pen widths:

https://github.com/sysrpl/Cross.Codebot/blob/master/source/codebot.graphics.linux.surfacecairo.pas#L1805

The problem is it's limited to horizontal/vertical shapes (Rectangle, RoundRectangle), and not lines (which can be draw at any angle). the Grid box is a rectangle, so it get the smooth edge, where as the Grid lines are ... well lines.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/56dae82e/attachment.html>

Reply by email

Anthony Walter
to Anthony Walter: I've updated CPU Graph with some nice (IMO) changes:…

Thanks for the feedback everyone I've posted a new version 1.0.3 which addresses the following:

http://cache.getlazarus.org/debs/cpugraph_1.0.3-1-amd64.deb http://cache.getlazarus.org/debs/cpugraph_1.0.3-1-i386.deb

Changes:
-------------

* App indicators are marked as a dependency. This should fix all remaining tray icon problems.
* Added right click context menu to the main form which is the same as tray menu.
* Fixed grid line pixels per Greames remarks (thank you for noticing).
* Fixed a minor issue which checks for nil before terminating cpu monitoring thread (it shouldn't have been an issue since thread is always created).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/cf0fe94b/attachment.html>

Reply by email

Victor Campillo
to Aradeonas: Very good and nice widget,Every thing works on Xubuntu except "Graph lines can be toggled…
Aradeonas wrote 8 lines
Very good and nice widget,Every thing works on Xubuntu except "Graph lines can be toggled on and off by clicking on the color box next to the CPU." maybe because my system have only one core Regards, Ara

On my system (Xubuntu) the on/off feature works fine, I have 8 cores and I can enable/disable all of them.

Regards

Victor Campillo

Reply by email

Victor Campillo
to Anthony Walter: Thanks for the feedback everyone I've posted a new version 1.0.3 which addresses the…
Anthony Walter wrote 18 lines
Thanks for the feedback everyone I've posted a new version 1.0.3 which addresses the following: http://cache.getlazarus.org/debs/cpugraph_1.0.3-1-amd64.deb http://cache.getlazarus.org/debs/cpugraph_1.0.3-1-i386.deb Changes: ------------- * App indicators are marked as a dependency. This should fix all remaining tray icon problems. * Added right click context menu to the main form which is the same as tray menu. * Fixed grid line pixels per Greames remarks (thank you for noticing). * Fixed a minor issue which checks for nil before terminating cpu monitoring thread (it shouldn't have been an issue since thread is always created).

With this new version I found a bug, the tray menu works fine but only until I use the right click context menu, I tried several times and if the right click menu is open only once then the tray menu stop working till the application is restarted.

Regards.

Victor Campillo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/4b5afd4a/attachment.html>

Reply by email

Anthony Walter
to Anthony Walter

Just some FYI on tray icons on most Ubuntu systems .. you can't get mouse click events on them. As a matter of fact you can't get any only thing you can do is assign a menu and respond to the clicks of the menu items. Here is some more information in this regards:

http://www.markshuttleworth.com/archives/347

Quote:

Some firm decisions

*3. Constrained behaviour* All the indicators will take the form of an indicator (icon or text), and a menu. Clicking on an indicator will open its menu. Keyboard navigation will always work, and left and right arrows will translate either into submenu navigation or flipping from indicator to indicator. The whole set of indicators on the panel will be navigable as a single menu, in essence. We won?t support ?right click? on indicators differently from ?left click?, and there?ll be no ability for arbitrary applications to define arbitrary behaviors to arbitrary events on indicators.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/b829c183/attachment.html>

Reply by email

Vincent Snijders
to Anthony Walter: Thanks for the feedback everyone I've posted a new version 1.0.3 which addresses the…

2015-11-09 20:08 GMT+01:00 Anthony Walter :

Show quoted text 20 lines
Thanks for the feedback everyone I've posted a new version 1.0.3 which addresses the following: http://cache.getlazarus.org/debs/cpugraph_1.0.3-1-amd64.deb http://cache.getlazarus.org/debs/cpugraph_1.0.3-1-i386.deb Changes: ------------- * App indicators are marked as a dependency. This should fix all remaining tray icon problems. * Added right click context menu to the main form which is the same as tray menu. * Fixed grid line pixels per Greames remarks (thank you for noticing). * Fixed a minor issue which checks for nil before terminating cpu monitoring thread (it shouldn't have been an issue since thread is always created).

I installed this version on Ubuntu 14.04.3 and got this: vincent at intel-nuc:~/tools$ cpugraph --sync
The program 'cpugraph' received an X Window System error. This probably reflects a bug in the program.
The error was 'BadAccess (attempt to access private resource denied)'. (Details: serial 472 error_code 10 request_code 33 minor_code 0)

  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/ffab17b5/attachment.html>

Reply by email

Aradeonas

Anthony here is a windows info version.I didnt saw your code so I wrote a very test version with some options, check it and if you want different or more tell me.It will compile with last fpc and Lazarus version or your nightly build.

Show quoted text 79 lines
unit Unit1; {$mode delphi} interface uses? Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,? ActiveX, ComObj, Variants, LCLIntf; { TForm1 } type? TForm1 = class(TForm)? ? ListBox1: TListBox;? ? ListBox2: TListBox;? ? procedure FormActivate(Sender: TObject);? ? procedure FormCreate(Sender: TObject);? private? public? ? procedure GetCPUInfo; procedure GetCPUUsage;? const? ? WbemUser = '';? ? WbemPassword = ''; WbemComputer = 'localhost';? ? wbemFlagForwardOnly = $00000020;? var FSWbemLocator: olevariant;? ? FWMIService: olevariant;? end; var? Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin? FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator');? FWMIService := FSWbemLocator.ConnectServer(WbemComputer, 'root\CIMV2', WbemUser, WbemPassword); end; procedure TForm1.FormActivate(Sender: TObject); begin? GetCPUInfo; while True do? begin? ? GetCPUUsage;? ? Application.ProcessMessages; end; end; procedure TForm1.GetCPUInfo; var? FWbemObjectSet: olevariant; FWbemObject: olevariant;? oEnum: IEnumvariant;? pCeltFetched: cardinal; begin? FWbemObjectSet := FWMIService.ExecQuery('SELECT * FROM Win32_Processor', 'WQL', wbemFlagForwardOnly); oEnum := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant; while oEnum.Next(1, FWbemObject, pCeltFetched) = 0 do? begin? ? with ListBox1.Items do? ? begin? ? ? Add(FWbemObject.Name); Add(FWbemObject.Caption);? ? ? Add(FWbemObject.Description); Add(FWbemObject.Manufacturer);? ? ? Add(FWbemObject.ProcessorId); Add(IntToStr(FWbemObject.NumberOfCores)); Add(IntToStr(FWbemObject.NumberOfLogicalProcessors)); Add(FWbemObject.Status);? ? end; FWbemObject := Unassigned;? end; FWbemObjectSet := FWMIService.ExecQuery('SELECT * FROM Win32_Processor', 'WQL', wbemFlagForwardOnly); oEnum := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant; while oEnum.Next(1, FWbemObject, pCeltFetched) = 0 do? begin ListBox1.Items.Add(IntToStr(FWbemObject.CurrentClockSpeed)); ListBox1.Items.Add(IntToStr(FWbemObject.MaxClockSpeed)); FWbemObject := Unassigned;? end; end; procedure TForm1.GetCPUUsage; var? FWbemObjectSet: olevariant; FWbemObject: olevariant;? oEnum: IEnumvariant;? pCeltFetched: cardinal;? Tick: int64; begin? Tick := GetTickCount;? FWbemObjectSet := FWMIService.ExecQuery('SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor', 'WQL', wbemFlagForwardOnly); oEnum := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant; ListBox2.Items.Clear;? while oEnum.Next(1, FWbemObject, pCeltFetched) = 0 do? begin? ? ListBox2.Items.Add(FWbemObject.Name + ' ?' + IntToStr(FWbemObject.PercentProcessorTime)); FWbemObject := Unassigned;? end;? self.Caption := IntToStr(GetTickCount - Tick); end; end.

PS. because list wont let me attach the project I will send you directly a sample one.

Regards, Ara

Regards, Ara

http://www.fastmail.com - Or how I learned to stop worrying and love email again -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151109/3f6ee267/attachment-0001.html>

Reply by email