Go to Post FIRST may very well be the healthiest drug on the market. - Herodotus [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-22-2016, 10:28 PM
peterl peterl is offline
Registered User
AKA: Peter Laser
FRC #1592 (Bionic Tigers)
 
Join Date: Oct 2014
Rookie Year: 2013
Location: United States
Posts: 16
peterl is an unknown quantity at this point
Question Need help with Network Tables

I have no experience with Network Tables. I need to send an 2d array to a LabVIEW dashboard using network tables, and I don't quite know where to start.

Code:
public java.lang.Boolean[] getBooleanArray(java.lang.String key,
                                           java.lang.Boolean[] defaultValue)
I found that on the Java Docs on: https://team2168.org/javadoc/

If someone used Network Tables to comunicate to a dashboard last year and could post that code, I think I could gain a further understanding of network tables from that.
Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-23-2016, 02:05 PM
fireXtract fireXtract is offline
MegaHertz_Lux
FRC #2847 (Mega Hertz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: fmt
Posts: 42
fireXtract is an unknown quantity at this point
Re: Need help with Network Tables

For my usage I use:
Code:
	public NetworkTable table = NetworkTable.getTable("locationOfItem");
			actualVariable = table.getNumberArray("arrayItem", defaultValue);
			SmartDashboard.putNumber("displayName", actualVariable[0]);
This uses arrays, but you could use it with just numbers by using different getNumber with table.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-23-2016, 11:27 PM
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Need help with Network Tables

We just got support for 1D arrays this year, I don't think 2D arrays are currently viable (unless the above poster's solution works for you)

if you ABSOLUTELY need a table, and you can do some data processing on the dashboard (not familiar with configuring the lv dashboard), than you can always send the data as a string encoded with the raw bytes of the 2D array
__________________
FRC Team 1684 - Head Programmer (2013-2016)
FRC Team 5460 - Programming Mentor (2015-2016)

FIRST in Michigan - Technical Crew (2015-continuing)
Reply With Quote
  #4   Spotlight this post!  
Unread 02-24-2016, 10:32 AM
peterl peterl is offline
Registered User
AKA: Peter Laser
FRC #1592 (Bionic Tigers)
 
Join Date: Oct 2014
Rookie Year: 2013
Location: United States
Posts: 16
peterl is an unknown quantity at this point
Re: Need help with Network Tables

Quote:
Originally Posted by Arhowk View Post
We just got support for 1D arrays this year, I don't think 2D arrays are currently viable (unless the above poster's solution works for you)

if you ABSOLUTELY need a table, and you can do some data processing on the dashboard (not familiar with configuring the lv dashboard), than you can always send the data as a string encoded with the raw bytes of the 2D array
I didn't realize that. If I can send 2 1D arrays, I can combine them to create a 2D Array. I will see about trying fireXtract's method.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-24-2016, 12:22 PM
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Need help with Network Tables

Quote:
Originally Posted by peterl View Post
I didn't realize that. If I can send 2 1D arrays, I can combine them to create a 2D Array. I will see about trying fireXtract's method.
It depends on the scope of your project. If it is a static amount of arrays than yes you could always just use 5 different 1D arrays.
__________________
FRC Team 1684 - Head Programmer (2013-2016)
FRC Team 5460 - Programming Mentor (2015-2016)

FIRST in Michigan - Technical Crew (2015-continuing)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:58 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi