ViewPortChanging event

Jan 18, 2010 at 7:43 AM
Edited Jan 18, 2010 at 7:44 AM

Plot contains extremly large set of points.

I want to filter out most of points but filtering should be performed in other (not GUI) thread. So I want to decide which points should be plotted every time ViewPort is going to change.

Let me explain, why I need this feature.

We have signals with the sampling rates of about 100kHz. And the measurements can last up to an hour. If I push all the points to the plotter it just hangs. Otherwise (few points) signal details are lost when user zooms the plot. So I need the way to know when user wants to see the details and plot the appropriate points.

 

Jan 20, 2010 at 4:21 AM

Does listening to the PropertyChanged event on the Viewport not give you what you want?

plotter.Viewport.PropertyChanged += new EventHandler<ExtendedPropertyChangedEventArgs>(Viewport_PropertyChanged);

        void Viewport_PropertyChanged(object sender, ExtendedPropertyChangedEventArgs e) {
            Console.WriteLine("Viewport_PropertyChanged: " + e.PropertyName + " old value=" + e.OldValue + "new value=" + e.NewValue);
        }

 

void Viewport_PropertyChanged(object sender, ExtendedPropertyChangedEventArgs e) {
     Console.WriteLine("Viewport_PropertyChanged: " + e.PropertyName + " old value=" + e.OldValue + "new value=" + e.NewValue);
}

Anytime the Visible rectangle changes, the PropertyChanged event is fired.  Perhaps then you can only display the points within the Visible DataRect?
Similarly, you can listen to plotter.Viewport.BeginPanning and plotter.Viewport.EndPanning, if the user is dragging the plot...
Sorry if this is not sufficient for your needs.
E.
Jan 20, 2010 at 5:46 AM

Not entirely, I guess.

>.Anytime the Visible rectangle changes, the PropertyChanged event is fired.

The event is fired and Plotter will redraw old points, then I add new points and Plotter will redraw again. Not a criminal of course, but this differs a little from desirable behavior. I want to change points before rendering.