11-25-2010 02:40 PM
Hi all
I have two questions
1)
I have a Graph control which has two cursors , cursor no 1 and cursor no 2. The range of X
and Y axes is from -20 to +20 each. I dont want to plot any waveform on this Graph.
I just want to place the cursors on the specific points within the range of x and y axes.
In this case, i am using
SetGraphCursor(PanelHandle,PANEL_GRAPH, 1 , 10.0,5.0); // Cursor number 1
When i run the program, the cursor does not move to the ( 10 , 5 ). Why is it so?
I have tried the Graph as a control and indicator mode , but the cursor does not move to the specifed position.Why?
2)
If the cursor 1 reaches to the certain position on the graph then i want that cursor 2 also reaches to that position by moving slowly and gradually on the graph and finally reaches the cursor 1 position. I want that it reaches the cursor 1 position in 5 seconds.
How is it possible?
Any Help will be greatly appreciated.
11-25-2010 04:36 PM - edited 11-25-2010 04:41 PM
A1: Which mode have you set the cursors? If you set them to SNAP_TO_POINT you are not likely to be able to move them as there is no plot on the graph. Set them to FREE_FORM instead. Does the function returns any error?
A2: you can use SetGraphCursor () to assign the cursor a specific position. You could for example set a timer callback that periodically moves the cursor until it reaches the desired position
11-26-2010 02:27 PM
Hi Roberto,
My problem 1 is solved, as far as problem 2 is concerned , can you send me an example which does that?
Thanks.
11-27-2010 02:36 AM
Here there is a little sample project that moves one graph cursor to reach the second one. It may be improved a lot: for example it can be modified to move the cursor a fixed lengh each step (now it splits the calculated routed in a fixed number of steps so that for long routes you see the cursor moving in steps, for short ones you see a more fluid movement). Consider it a conceptual framework that you may adapt to your actual problem.
Hope it may help you.