Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Want to have a performance meter on my frame... :o

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Want to have a performance meter on my frame... :o
#2407
Posted by: 2003-07-25 00:19:20
Hello
For my wx application I need to have a component of type Performance Meter like in Windows (when you do Alt+Ctrl+Del there is a widget that shows the CPU activity).
What is the best way to do it with wxWindows? Is there an existing widget for it that could display my own values?
Thanks for your help!
Message2. Re: Want to have a performance meter on my frame... :o
#2408
Posted by: 2003-07-25 16:35:18
Maybe have a look at wxGauge for a progressbar.
Check out wxPlot (should be in the contrib dir) for plotting a graph. I used wxPlot and I guess for what you are trying you should think about modifying it.

upcase
Message3. Re: Want to have a performance meter on my frame... :o
#2409
Posted by: 2003-07-25 21:19:13
Thanks, I will have a look ! I did not know this component. Anyway I thought about using the wxGauge widgets and displaying them on a canvas perhaps but it is a bit tricky no?
Message4. Re: Want to have a performance meter on my frame... :o
#2411
Posted by: 2003-07-26 04:18:20
Using and displaying a wxGauge is just as hard as displaying any other wx widget :)

wxPlot may be a bit harder to use, because as far as I remember it uses an array of values to display stuff, so you would have to gather information first, then display it.

upcase
Message5. Re: Want to have a performance meter on my frame... :o
#2412
Posted by: 2003-07-28 16:28:07
I found nothing about wxPlot but on wxPlotWindow and wxPlotCurve. I think they are the right components. I will try with it and I hope it matches what I need because I want to refresh the data too, i.e. displaying new values in real-time.
Message6. Re: Want to have a performance meter on my frame... :o
#2413
Posted by: 2003-07-29 04:17:48
Yep, these are the components I mentioned. The window is for displaying the data, while the curve actually stores the data of one curve.
Problem with that is, that normally it should be used for static data, meaning you should gather up the needed values, store them and create a curve from it.
But it can also work realtime. I used it once when I made a little simulation showing two populations (one hunting and eating the other). The user can bring up a little window showing the current stats of both populations which get actualized with a step of 10 generarion cycles.
I guess it might be a good idea not to make the update cycle too small. I allways wanted to update the plotting code a bit, so one could change colours and use it as a real realtime window.... But time is running out at the moment. ;)
Maybe I'll upload the source for my app someday, when I find the time to *beautify* it.

upcase
Message7. Re: Want to have a performance meter on my frame... :o
#2421
Posted by: 2003-07-30 19:57:00
thanks. And if you have time to beautify it it would be nice ;)
Moreover I wanted to try the demo of wxPlot (http://www.wxwindows.org/technote/plotting.htm) but I have errors on Linking. Something must failed, a library or I don't know what. If somebody can help, thanks in advance!
Message8. Re: Want to have a performance meter on my frame... :o
#2422
Posted by: 2003-07-30 21:28:20
There should be a sample for plotting in the contrib dir (something like WXDIR/contrib/samples/wxPlot).
After compiling the wxPlot lib try to compile this one (using the same options you used for the lib like FINAL=1). If this does the job, link to this lib in your other project.
I noticed that sometimes the order of libs makes a difference. Try linking to wxmsw first, then wxPlot.

upcase
Message9. Problem with plot demo at linking
#2426
Posted by: 2003-07-31 20:27:37
thanks for helping me, but in contrib I have just:
WXDIRcontribsamplesplot.cpp
This file does not launch an application and there is no workspace or project defined for it. (I am working with Visual Studio on windows, with wxWindows 2.4.1). So I see no way to compile a lib for wxPlot.
Anyway I don't say that compiling a lib for wxPlot is needed, I just tell that compiling the demo for wxPlot generates errors at linking and perhaps something is missing or the project settings are not correct.
I really need to make this demo runs !!
thanks for any help...
Message10. Re: Want to have a performance meter on my frame... :o
#2428
Posted by: 2003-07-31 21:32:25
Weird...
I got a dsp, dsw and VC makfile in my WX/contrib/src/plot and WX/contrib/samples/plot. Both compiled just fine and work...

upcase
Message11. Re: Want to have a performance meter on my frame... :o
#2429
Posted by: 2003-07-31 22:03:33
I have installed wxWindows 2.2.9 and the directory "plot" is included in the samples !! it was not the case for the 2.4.1, too bad, I don't know why. should works now, thanks!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0