wxPlotCtrl --- Custom data types using

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
igrms
In need of some credit
In need of some credit
Posts: 2
Joined: Fri May 05, 2006 4:15 pm

wxPlotCtrl --- Custom data types using

Post by igrms »

I have to write an application for viewing data plots (telemetry data). I think that wxPlotCtrl is much fit for my aims. Please give me the right way how to make my own data classes for using with wxPlotCtrl. And some more questions:
1. Could I use a multiscale mode (one X axis and many Y axises for each plot data).
2. Please tell me how to plot booleen data.

P. s. My appologies for my far not excellent english.
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Re: wxPlotCtrl --- Custom data types using

Post by upCASE »

Hi!
igrms wrote:I have to write an application for viewing data plots (telemetry data). I think that wxPlotCtrl is much fit for my aims. Please give me the right way how to make my own data classes for using with wxPlotCtrl. And some more questions:
1. Could I use a multiscale mode (one X axis and many Y axises for each plot data).
2. Please tell me how to plot booleen data.

P. s. My appologies for my far not excellent english.
As far as I know wxPlotCtrl uses a function parser to display the outcome of these functions. I'm not sure if wxPlotCtrl can be used for "static" data, like in your case the telemetry data), but I suppose you'll have to create a wxPlotCurve derived class and implement the GetY() method to return your data.
An IMHO simpler widget to use would be wxMathPlot (http://wxmathplot.sourceforge.net/).

About plotting boolean data: Maybe just declare false as 0 and true as 1.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
igrms
In need of some credit
In need of some credit
Posts: 2
Joined: Fri May 05, 2006 4:15 pm

Post by igrms »

Thank you for reply, upCASE. But my problem is not I couldn't use wxPlotCtrl for plotting my data. My problem is the "right way". wxPlotCtrl library has a wxPlotData class. It is a very power and usable class. There are functions from average calculating to FFT processing. But! It is more likely that the library was done for using "as is" and it is hard to add my own features that I need. There are many non virtual functions that must be virtual by my opinion. Of course I can override non virtual function or add new one (for example LoadBlahBlahBlah that can understand my own data types) but I have no idea how all that wxDynamicCasts will work in this case. I suppose the author knows the "right way" but I couldn't find it out from his source code! Frankly speaking I choose this library when I saw the example. Using that example I can easily load data from text file and scroll, zoom, ... and many many others.

Thank you for wxMathPlot link.
Post Reply