View Single Post
  #1   Spotlight this post!  
Unread 10-02-2015, 21:33
neelus neelus is offline
Registered User
FRC #0649
 
Join Date: Jan 2015
Location: Saratoga
Posts: 3
neelus is an unknown quantity at this point
Problems with SFX and Network Tables

Hi,
My team (649) has been messing around with SmartDashboard 2.0 and Network Tables for a bit now, and we have had no luck displaying to SFX or pulling from NetworkTable Client programs. This is what the client program looks like:

Code:
public class SFXTester implements ITableListener{
	NetworkTable table;
	
	public static void main(String[] args){
		new SFXTester().run();
	}
	
	public void run(){
		
		NetworkTable.setClientMode();
		NetworkTable.setIPAddress("10.6.49.2");
		
		table = NetworkTable.getTable("datatable");
		
		table.addTableListener(this);
		
		JFrame frame = new JFrame();
		JPanel panel = new JPanel();
		JTextField text = new JTextField();
		text.setText("THIS IS A QUALITY SENTENCE");
		
		frame.setSize(450,300);
		panel.setBackground(Color.CYAN);
		panel.add(text);
		
		frame.add(panel);
		
		frame.setTitle(table.getString("Test Input", ""));
		frame.setVisible(true);
		
		while (true){
			text.setText(table.getString("Text Input", "Nothing Found"));
		}
			
	}

	@Override
	public void valueChanged(ITable source, String key, Object value, boolean isNew) {
		System.out.println("Value Changed");
	}
}
And the robot program we are running gets the same "datatable" and pushes to it. When we try and pull, we get absolutely nothing. Can anyone help us with this?? A working example code would be super helpful.

Also, we made SFX pop up with the dashboard and it opens fine. When we call SmartDashboard.putData() with the data we want to display, nothing shows up...Even in test mode, and we are calling LiveWindow.run(), we see nothing on SFX. I haven't actually ever seen anything pop up on SFX...Any help would be appreciated

Thanks so much in advance!
Reply With Quote