Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Center the cursor on the Waveform Graph?

I have a waveform graph where the user can adjust the scale on both the X and Y axes.  The "problem" that I am having is that if the scale's range is set too far from where the cursor is at, the cursor will be off screen and not selectable.  So, I am trying to center the cursor to the scale when the scale is changed or via a button.  Here is the code that I have written for one of the Cursor plots:

 

 Select Case setBlueCursor
            Case 1
                blueCursorPt.Plot = plotInlineTorque
                inlineTorqueMax = yAxisInlineTorque.Range.Maximum
                inlineTorqueMin = yAxisInlineTorque.Range.Minimum
                blueCursorStartY = (inlineTorqueMax + inlineTorqueMin) / 2
                blueCursorStartX = (XAxis.Range.Maximum + XAxis.Range.Minimum) / 2
                blueCursorPt.YPosition = blueCursorStartY
                blueCursorPt.XPosition = blueCursorStartX

 This code will center the cursor like I want but then I can't move the cursor after that as it is "stuck" at the position that I have coded it.  The problem appears to be with the last two lines of code here.   I do not know of any other way to do this though.  I have tried the "moveCursor" method but the end result ends the same way, with the cursor stuck in the center and can't move.  Any help on a solution?  Is there a better, easier way to do this?  I'm new to Measurement Studio and .NET. 

 

Thank you

 

0 Kudos
Message 1 of 2
(4,436 Views)

This code works.  It appears that I was calling the subroutine that this code is located in over and over in another part of my program. 

0 Kudos
Message 2 of 2
(4,405 Views)