Go to Post I got dragged into FIRST against my will, and it was the best thing that's ever happened to me. - Liz C [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 13-02-2014, 16:19
Aero Aero is offline
consumes pizza, produces code
AKA: Ari Lotter
FRC #0865 (Warp7)
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2013
Location: Toronto
Posts: 30
Aero is on a distinguished road
Unhappy Can I loop through a NetworkTable?

Hey! I'm trying to get NetworkTables working, and I have a list of things I want to send to the driver station. So I'm putting values into a Subtable on the robot, and trying to read them on the DS.

Is there a way to loop through every value in an ITable (which NetworkTables extends)? I assume there is, because the TableViewer program can do it (I compiled it but can't figure it out)

Here's the code I use for putting the info into the NetworkTable.

Code:
public void sendSubsystemInfo() {
        Vector list = Warp7Robot.subsystem.subsystemList;
        NetworkTable subtable = (NetworkTable) table.getSubTable("Subsystems");

        for (int i = 0; i < list.size(); i++) {
            Subsystem s = (Subsystem) list.elementAt(i);
            subtable.putBoolean(s.getName(), s.isEnabled());
        }
    }

Last edited by Aero : 13-02-2014 at 18:34.
Reply With Quote
 


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 13:38.

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