LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I display 2D array as a table on the front panel that user can delete sub-arrays

Solved!
Go to solution

Hi guys and gals.

 

This is my first post here, so go easy on me. I promise I have been using my best GoogleFu I have before posting here.

 

I am a self taught LabView hobbyist. I have been working on a User Interface for my Robot SAGAR. See some of my work so far (girlfriend used it as a class project, but we both worked together on it, which got me hooked on LV in the first place):

 

 

 

 

Now I am working on using LV and Google earth as a mission planner right now.

 

My question is this. I have a 2D array that stores the Lat/Lon of each waypoint. I's like to have that displayed on my

front panel as a table, with WP # (the 1st dimension array index), Lat and Lon all on line, like this.

17519iEC635785F92F3CDF

More importantly, have the user able to select a full waypoint (or just the WP number would be ok ) and delete it either using del key or some other button on the panel.

 

I'm at a loss on how to do this. Ideas?

Thanks for the help!

0 Kudos
Message 1 of 7
(9,915 Views)
Solution
Accepted by madsci1016

Cure little robot.

 

You said you were using a table. I'd suggest using a multicolumn listbox. This way you can change the selection mode to "Highlight Entire Row". As for responding to the user pressing the delete key you can just use an event structure. See attached simple example. Note that some keyboard may label the Backspace key as "Delete". If you want to respond to this one, then you need to also see if the Char value is 8, which is the code for that key.

Message 2 of 7
(9,902 Views)

Wow, this looks just like i wanted. Thanks

 

Anyway to get it to use a 2D array of Long Ints instead of strings?

0 Kudos
Message 3 of 7
(9,813 Views)

@madsci1016 wrote:

Wow, this looks just like i wanted. Thanks

 

Anyway to get it to use a 2D array of Long Ints instead of strings?


No.  List box is text only.  You can convert to numbers by using the string convert functions, like Fract/Exp String to Number.

- tbob

Inventor of the WORM Global
Message 4 of 7
(9,805 Views)

I figured, just wanted to make sure to save any cpu cycles.

 

Thanks guys.

0 Kudos
Message 5 of 7
(9,798 Views)

 


@madsci1016 wrote:

Wow, this looks just like i wanted. Thanks

 

Anyway to get it to use a 2D array of Long Ints instead of strings?


I'm not sure why you'd want integers for floating point numbers. The latitude and longitude numbers are floats, not integers. You can build a 2D array of numbers in the same way.

 

Message 6 of 7
(9,794 Views)

Oops, I meant I had them as double, and not int. 

 

 

 

I'm actually going to change my main VI to handle strings instead of double, since every loop i'm feeding them into the Google Earth API as strings anyway, so this would optimize my code. The only converting would take place would be when i read in the mouse position GPS coordinates.

0 Kudos
Message 7 of 7
(9,789 Views)