11-23-2009 10:01 PM
11-24-2009 12:54 AM - edited 11-24-2009 12:56 AM
You will know the X positions of cursors. poll the data between these positions.
You can get the index of X positions, get the array subset of Y array from these indices
11-24-2009 03:56 AM
11-24-2009 05:53 AM
11-24-2009 09:43 AM - edited 11-24-2009 09:53 AM
Well, you say xy graph, so this might be a more complicated problem.
For a waveform graph it's trivial. Simply get the two cursor indices (property: cursor index) and apply them to array subset of the data. Is that all you need?
Here's how the above code would look like. using cursor.index instead of cursor.x elimnates the need to include scaling information.
For an xy graph, there could be multiple segments (e.g. imagine a spiral that passes the desired x range multiple times from both sides). This would neeed significantly more code for a general solution.
11-24-2009 09:57 AM
altenbach wrote:
Sorry, I made that code during the edit window of posting and run out of time. Of course N should be wired with a 2 to get only the first two cursors.
Personally, I would keep the two cursor indices in a shift regsiter and then update only the relevant one via event terminals.
11-24-2009 10:12 AM - edited 11-24-2009 10:13 AM
altenbach wrote:Personally, I would keep the two cursor indices in a shift regsiter and then update only the relevant one via event terminals.
Here's a quick draft how that would look like. (note that we might also want to adjust t0 so the x-values are retained correctly).