Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

select subset data from waveformgraph

Hello,
I'm using MStudio 8 with VS2005, and I would like to know if it is possible (and in case how to do it Smiley Wink)
to select a subset of data displayed in a waveformgraph control.
For example, I load data into "array", use plot.plotY(array) method and get the graph.
Now I would like to select with the mouse a subset, either clicking at both boundaries or
using the zoom capabilities of waveformGraph control, then extract the selected interval
from "array" and perform some calculation (mean, average, fft, etc.) on those data.

I looked for some properties like X and Y coordinates for the old picturebox, but
I didn't find anything.
Is there another (and maybe better) solution ?

Thank you in advance,
  Stefano67

0 Kudos
Message 1 of 5
(5,025 Views)
Hi Stefano,
 
How I currently do this is to have 2 cursors.  You can move the cursors to encompass the area of the waveform that you are interested in and obtain the values from the getcurrentindex property for each cursor.  You can then use array.copy to create a new array containing only the data between the cursors and then perform your Stats on this array.
 
Make sure that the start point is less then the end point so you must check on which cursor is left or right.
 
StevieB  
Message 2 of 5
(5,005 Views)
Hi StevieB,
 
I'm trying to achieve the same result as Stefano. Where is the getcurrentindex property and the array.copy on LabView? Is it on the Control Palette? I'm currently using LabView 8.0.
 
Thank you,
Sammy
0 Kudos
Message 3 of 5
(4,994 Views)

Sammy,

I'm sorry but I don't have LabView so I cannot say how it would be done in Labview.

The answer for Stefano was for a Waformgraph in MeasurementStudio8 and Visual Studio 2005.  The getcurrentindex is a property of the Cursor class.  Array.copy is a method of the VS2005 Array class.

Regards

Steve

 

 

 

 

 

0 Kudos
Message 4 of 5
(4,988 Views)
Very good solution, fast and simple.  Smiley Wink  Actually I use only one cursor and move this one to chose boundaries.
Thanks Steve.

Bye

Message Edited by Stefano67 on 07-20-2006 08:42 AM

0 Kudos
Message 5 of 5
(4,984 Views)