Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Cpu Usage fur Core2duo/Core2quad (https://www.delphipraxis.net/97956-cpu-usage-fur-core2duo-core2quad.html)

Razor 19. Aug 2007 18:14


Cpu Usage fur Core2duo/Core2quad
 
This is fairly impossible i tried carbon cpu commponents and adcpuusage component all show error on core2duo.
Is there any special way for this,if so please tell.

Thanks!

Razor 21. Aug 2007 22:34

Re: Cpu Usage fur Core2duo/Core2quad
 
Obviosly if i waited you guys to respond it wouldnt happen but it did and i figured out :lol:

Delphi-Quellcode:
 unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxCpu40Nv, ExtCtrls, StdCtrls, ComCtrls,cxCpu40;

type
  TForm1 = class(TForm)
    ProgressBar1: TProgressBar;
    ProgressBar2: TProgressBar;
    ProgressBar3: TProgressBar;
    ProgressBar4: TProgressBar;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Timer1: TTimer;
    cxCpu402: TcxCpu40;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if cxCpu402.Available.Available=1 then  begin
ProgressBar1.position:=cxCpu[1].Usage.Value.Asnumber;        //single core processors
 Label1.Visible:=true;

 ProgressBar1.Visible:=true;

 end;
if cxCpu402.Available.Available=2 then    begin

ProgressBar1.position:=cxCpu[1].Usage.Value.Asnumber;
ProgressBar2.position:=cxCpu[2].Usage.Value.Asnumber;
  ProgressBar1.Visible:=true;
  ProgressBar2.Visible:=true;
 Label1.Visible:=true;                                                          //dual core processors
 Label2.Visible:=true;

    end;
if cxCpu402.Available.Available=4 then   begin

ProgressBar1.position:=cxCpu[1].Usage.Value.Asnumber;
ProgressBar2.position:=cxCpu[2].Usage.Value.Asnumber;
ProgressBar3.position:=cxCpu[3].Usage.Value.Asnumber;
ProgressBar4.position:=cxCpu[4].Usage.Value.Asnumber;

  ProgressBar1.Visible:=true;
  ProgressBar2.Visible:=true;
  ProgressBar3.Visible:=true;
  ProgressBar4.Visible:=true;

 Label1.Visible:=true;
 Label2.Visible:=true;
 Label3.Visible:=true;                                                          //quad core processors
 Label4.Visible:=true;

    end;


end;



end.

Matze 22. Aug 2007 08:44

Re: Cpu Usage fur Core2duo/Core2quad
 
Liste der Anhänge anzeigen (Anzahl: 1)
Your code snippet is useless. I attached the unit you are using that anybody will be able to get the same results.

Delphi-Quellcode:
{********************************************************************************************************}
{                                                                                                        }
{ Carbonsoft cxCpu Processor Detection Toolkit Release 4                                                 }
{                                                                                                        }
{ Copyright © 1995-2004 Kev French, Carbonsoft. All rights reserved.                                    }
{ [url]http://www.carbonsoft.com/cxcpu/[/url]                                                                      }
{                                                                                                        }
{ IMPORTANT INFORMATION                                                                                 }
{ This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy       }
{ of this license, visit [url]http://creativecommons.org/licenses/by-sa/1.0/[/url] or send a letter to Creative    }
{ Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.                                      }
{                                                                                                        }
{ You are free:                                                                                         }
{   - to copy, distribute, display, and perform the work                                                }
{   - to make derivative works                                                                          }
{   - to make commercial use of the work                                                                }
{                                                                                                        }
{ Under the following conditions:                                                                       }
{   - Attribution. You must give the original author credit                                             }
{   - Share Alike. If you alter, transform, or build upon this work, you may distribute the             }
{                  resulting work only under a license identical to this one                            }
{                                                                                                        }
{ - For any reuse or distribution, you must make clear to others the license terms of this work         }
{ - Any of these conditions can be waived if you get permission from the author.                        }
{                                                                                                        }
{ For more information please contact [email]licensing@carbonsoft.com[/email]                                          }
{                                                                                                        }
{********************************************************************************************************}
Source from: krugle.com

Razor 22. Aug 2007 09:19

Re: Cpu Usage fur Core2duo/Core2quad
 
Liste der Anhänge anzeigen (Anzahl: 1)
You can't say its useless,+ you provided wrong stuff you must attach adcpuusage.pas :wink:

negaH 22. Aug 2007 10:40

Re: Cpu Usage fur Core2duo/Core2quad
 
Matthias provide wrong stuff for your code snippet ?

Regards, Hagen

Muetze1 22. Aug 2007 10:41

Re: Cpu Usage fur Core2duo/Core2quad
 
Zitat:

Zitat von Razor
You can't say its useless,+ you provided wrong stuff you must attach adcpuusage.pas :wink:

You are wrong. Your code is usesless without the unit posted by Matze. You provided unused stuff. Where in your uses clauses are you using the adcpuusage.pas? Where?

Delphi-Quellcode:
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxCpu40Nv, ExtCtrls, StdCtrls, ComCtrls,cxCpu40;
You only use cxCPU40xx unit - posted by Matze...

Will you ever learn to getting down and stop being snooty?

Razor 22. Aug 2007 10:43

Re: Cpu Usage fur Core2duo/Core2quad
 
Ok i just wanted to say he could accually post the accuall package couse carbon softs component doesnt provide cpu usage,Alexey's Dynnikov Adcpuusage does the thing ;).


cxCpu40Nv> uses his (adcpuusage.pas) component.Cxcpu is only there for core detection.
Compile,test and see! :wink:

Afterall i made the code snippet so,little respect please.. :wink:

markusj 22. Aug 2007 11:02

Re: Cpu Usage fur Core2duo/Core2quad
 
Hmm, maybe it would be not absolutely senseless, if you attach the needed units ... your code may be nice, but no person could use it without having those units ... so matze did some of _your_ work ... code without the corresponding units is nearly worthless ...

Regards
Markus

PS: which kind of tool are you coding? it seems that you collect lots of informations about hardware-analysis!

Razor 22. Aug 2007 11:05

Re: Cpu Usage fur Core2duo/Core2quad
 
He added a unit now he did almost whole work,is this a joke :lol:

Yes i am colecting lots of information about hardware,i am doing a tool that will contain what the best tools nowadays contain,its still a secret.

If i posted the picture right now it would be a havoc.But i wont :lol:

OlafSt 22. Aug 2007 11:51

Re: Cpu Usage fur Core2duo/Core2quad
 
Hmm... Still a secret, huh ?

Up till now I haven't seen anything spectacular now - but I'm always ready for a surprise :thumb:


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:42 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz