LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hiding all the cursors

Solved!
Go to solution

Dear all,

I am using around 16 cursors on my graph.

At some time i want to hide all the cursors. 

Is there any way to set the position of all the cursors at a single go rather than setting position of each cursor individually ?

 

Thanks,

Ritesh

0 Kudos
Message 1 of 10
(4,718 Views)
I'm afraid you have to do them one at a time.
0 Kudos
Message 2 of 10
(4,703 Views)

Ohhh .. dats really sad to hear that .:smileysad:

 

Ok.. 

Now is there any way to know which cursor i have selected? Like when i click on a cursor, i should get the name of the coursor on which i clicked.

 

 

Thanks,

Ritesh

0 Kudos
Message 3 of 10
(4,699 Views)
You can use the "Cursor Grab" event.
Message 4 of 10
(4,696 Views)

smercurio_fc wrote:
You can use the "Cursor Grab" event.

"Cursor Grab" event works fine, but i dont know how to use it in my application.

In my application, i either select the Plot or the Cursor. Cursor being given the higher priority.

I select the Plot with a "Mouse Down" event and using the Invoke Node "Get Plot at Position".

 

On a Mouse Down event i first want to see if any Cursor has been grabbed. If true, it should not execute "Get Plot at Position". and if false, it should see if there's any plot has been selected.

 

How to go about it ??

 

Thanks,

Ritesh

0 Kudos
Message 5 of 10
(4,678 Views)

I have to do something similar in a program at the moment. I haven't written the code yet, but I was intending to:

1) create an array of references for the graphs (cursors can't be anywhere else)

2) pump the array through a for loop and create an array of cursor lists

3) pump the cursor list array through another for loop and set the cursor colours to transparent, rather than move them.

 

This sound like an idea you could use? (all fits in 1 subVI running from the array of references too, so tidy on the main BD).

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 6 of 10
(4,668 Views)

Events happen in sequence, and the Mouse Down event occurs before the Cursor Grab event. Thus, there is no way to know in the Mouse Down event if you're going to have a Cursor Grab event, as I don't know of a way to view the event queue. There's two possibilities that come to mind:

  1. In your Mouse Down event select your plot and keep track of the selected plot. If you get the Cursor Grab event then you can deselect the plot and do whatever it is that you want to do with your cursor.
  2. Set up a producer-consumer loop. Your producer loop responds to events and adds actions to your own queue. In this case you would place Mouse Down event occurrence "on hold". If you don't see the Cursor Grab event within, say, 10-20 msec, then all you have is a Mouse Down event and you can add the action to handle the Mouse Down event onto your queue and let the consumer loop process it. If you do see the Cursor Grab event then you place the Cursor Grab event information onto the queue instead. 
Message 7 of 10
(4,652 Views)

Will this work? It still hides them one at a time, but does it quickly and easily.

 

 

 

😎

 

 

Message Edited by LabViewGuruWannabe on 10-24-2008 09:49 AM
Download All
Message 8 of 10
(4,647 Views)
Solution
Accepted by topic author LVCoder

We seem to be talking about several different questions here. Smiley Wink

 

The original question was how to hide all the cursors, and whether there was a way to do this en masse, or whether you had to use a loop. That question has already been answered several times: you have to use a loop.

 

The second question was how to determine whether a user clicking on the graph indicated that the user was selecting a cursor. That has also been answered by the fact that you use the Cursor Grab event.

 

The third question is how to distinguish between a user clicking on a plot, thereby indicating that they want to select a plot, and the user was just trying to grab a cursor.I provided a response to this in reply #7, but don't know if there's a more efficient method. I would love to hear if there is though.

Message Edited by smercurio_fc on 10-24-2008 09:58 AM
Message 9 of 10
(4,641 Views)

Hi All,

Thanks alot for your Solutions.

 

I am using for loop to hide all the cursors and its just working perfectly.

 

And for choosing between the Cursor Grab or the Plot Selection, i used the first method as suggested by smercurio_fc, and that is also working our fine.

I didn't try the 2nd method(the one using queues).

 

Just want to know if the 2nd method will be faster or slower than the 1st to execute.

 

Thanks,

Ritesh

0 Kudos
Message 10 of 10
(4,619 Views)