Recent

Author Topic: Best way to represent square waves  (Read 8226 times)

ollopa

  • Newbie
  • Posts: 2
Best way to represent square waves
« on: February 06, 2010, 12:36:11 pm »
Hello,

I have some waveform data from a logic analyzer that I would like to load and display with Lazarus, but I'm not sure what the best component to use would be.  I don't have any experience working with graphics in Lazarus, so I'm seeking advice before fumbling around on my own. 

Here are some examples of the type of graphs I'd like to be able to draw:

http://www.ep.com.pl/antoniak/sla/sla_counter.gif
http://www.usbee.com/sxlanew.gif
http://www.hobbylab.us/Oscilloscope/Help/Images/FmLan.png

I don't think this should be too difficult.  I noticed there are some standard chart components that might work well.  I'm just hoping somebody can tell me if that's a good way to go or if maybe there is a better way.  I need to have the label for each waveform be to the left side of the chart area and the waveforms need to be stacked one on top of the other.  I'll also need to scroll and have a horizontal time axis. 

The last item that might not be as obvious in the examples I posted are the two vertical cursors for measuring the time interval between two data points.  I don't think cursors are a part of the standard charts and I'll need advice on how to implement them.

Thanks in advance to anyone who can offer suggestions   :)

-ollopa

mmab

  • Jr. Member
  • **
  • Posts: 89
Re: Best way to represent square waves
« Reply #1 on: February 06, 2010, 08:15:44 pm »

The component Tchart fits to your needs.
If you need a very speedy plotter, you could use hardware accelerated graphic lib. such as opengl, directx etc.



ollopa

  • Newbie
  • Posts: 2
Re: Best way to represent square waves
« Reply #2 on: February 07, 2010, 12:47:08 am »
Any suggestions for implementing cursors with Tchart?

mmab

  • Jr. Member
  • **
  • Posts: 89
Re: Best way to represent square waves
« Reply #3 on: February 07, 2010, 01:14:56 am »

Please look at Tchart paint procedure.
You can put cursors (vertical) lines using canvas.line procedure to the end of paint procedure.

It's not difficult to implement.



Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Best way to represent square waves
« Reply #4 on: March 17, 2010, 12:37:37 am »
Sorry for the late reply, I missed your post because TAChart was not mentioned in it.
If you still need help with using TAChart in your application, please use mailinglist
to ensure that your message will be noticed.

Quote
Please look at Tchart paint procedure.
You can put cursors (vertical) lines using canvas.line procedure to the end of paint procedure.

TAChart already has "TLine" series (which are different from "TLineSeries"),
that can draw vertical and horizontal lines on you chart, so there is no need to
modify the Paint method.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8611
  • FPC developer.
Re: Best way to represent square waves
« Reply #5 on: March 17, 2010, 05:26:46 am »
If you need speed, you might consider OpenGL.

If any of your work is open, please keep me informed.

Wodzu

  • Full Member
  • ***
  • Posts: 171
Re: Best way to represent square waves
« Reply #6 on: March 17, 2010, 07:23:10 am »
There is really no need for using OpenGL here. If you do not know it the learning curve might be just not worth the hassle.
TChart should be sufficient enough. If not, you can write your custom component with double buffering.

The things which you need, can be drawn like 100 FPS with fluent motion.

 

TinyPortal © 2005-2018