First of all, this is not another thread asking for help with the example scope application. The example scope application does not behave the way a real oscilloscope would. Take an analog oscilloscope for example, the trace reaches the end of the 'plot' and wraps back to the left hand side and begins drawing again; the example oscilloscope will continue scrolling and increment the time scale to the right infinitely.
So what am I getting at, what am I trying to do? I'm developing a scope emulator with a normalized time scale; one similar to a hardware oscilloscope. The behavior I'm looking for is best described as one you would see with a digital hardware oscilloscope (analog doesn't do large time/div well) where the traces sweep from left to right and do what I call the snake eating its tail. When the head reaches the right side of the plot, it should appear on the left and begin drawing over the oldest points.
I've been experimenting with a qwt_plot and a qwt_plot_curve but what I've found is a few new unwanted behaviors when I manipulate the data I'm putting into the plot curve:
-If I treat the samples as a vector, when I try to wrap the data points to start back at the beginning of the plot, I end up with a line between the last point on the right side of the screen and the latest point on the left side of the screen.
-If I treat the samples as a ring buffer, I reach the right side of the plot and 'wrap' I pop the first sample off from the vector and pre-pend the next, I end up with an undesired line between the latest point and the 'second' point which is 1 time scale behind the latest point. I think that might be wordy; I don't want a line between the head and the tail.
I've been looking through the qwt documentation for a module that I could re-implement to behave the way I want it to but I've come up empty. The documentation is great, but there descriptions of each class is a little lacking to truly understand what I could expand the classes to do.
Thanks for taking the time to read this,
Jay
Bookmarks