ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Arrow Indicator

Hello all,
I'm looking for some ideas to a problem....

 

I'm creating an instruction .vi that has a text box, a picture box, and a continue button.  The Text Box will instruct users to make several connections.  The Picture Box will show a picture of the product the user will interact with, and the continue button is an acknowledgement that the user did what they were supposed to and the software can progress.

 

I want to create arrows to display on the picture box to point out Switches, LEDs, Test Points....whatever the user actually needs interact with.
Because I can have multiple arrows on a test point, I want to be able to place the arrows, and turn them on or off as needed.  I also need the arrows to be labeled.

So I was thinking I have a few options....
1) I edit the picture in paint and create multiple versions that only show the arrows needed when they are needed.  I then call the specific picture for each instruction.

2) I create some code that draws arrows each time the .vi is ran.  There would be a setup phase where I select locations within the picture box, the code figures out the "best" direction for the arrow, and I set the Arrow Name.  Then there would be a run time phase where my instruction .vi says I need Arrow_1, and the Instruction .vi references the data from the setup phase and re-draws Arrow_1 on the picture.

3) Some kind of custom control (or something else) that is boolean (ON = display, OFF = invisible) that will show the Arrow, Text, and has a Background Color for the text. where all these pieces appear and disappear?

 

Pros and Cons:

#1 That'll work, but that's a lot of pictures, doesn't seem like a good programmer's solution, is not very re-usable.

 

#2 I like it, but I think it'll take me a decent amount of up front work that I don't have time for right now on this project.  I'll probably take a crack at it for the next project though.  I want something simpler for right now.  I see a lot of trial and error determining the "best" location for arrow direction.

 

#3 I can create a custom control where the off state hides the indicator and all parts of the control, and the on state shows all parts of the control.

If I use the Boolean Text, I can't provide a background color for the text

If I use the Label, I can't hide or show it as the control activates or de-activates

If I just use a different image where the background color block already exists as a part of the image, it doesn't look right because it doesn't re-size based on the text

I'd like to use the label text as the visible text because then when I copy and paste I wouldn't have to change the label text and the boolean text.

It sounds like an XControl might be my best bet for this where I hide/show all properties and set the background color through a property node?

 

Are there any simpler ideas that I'm over looking?  I haven't used XControls before and I'm not sure if that's practical either.

 

Thanks for the help and direction.

  

0 Kudos
Message 1 of 5
(2,549 Views)

Since all arrows seem to be on the picture indicator, just keep the static picture in a shift register and add decorations by modifying it for display. (Create a subVI that draws a simple arrow in a given picture based on origin, direction, color, width, etc.).

 

Message 2 of 5
(2,537 Views)

One possibility is to customize a gauge indicator, making everything invisible except the pointer.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 5
(2,507 Views)
0 Kudos
Message 4 of 5
(2,502 Views)

Thank you all for your help.

Ultimately I went with dropping customized boolean controls.  In the .vi with the picture, when I set the control true or false, I also set the label.visible property true or false. This works for now (I don't have too many arrows).  Next time around I'm planning to create a more robust vi that'll draw on the picture.

 

I forgot / didn't see the label itself had a visible property.  NI helped me out with that.

 

Thanks again! 

0 Kudos
Message 5 of 5
(2,445 Views)