![]() |
Custom SmartDashboard Widget
I have been trying to get a basic custom widget working on the SmartDashboard for a couple weeks now, but I've gotten very lost in the changes they've made in the API since 2012. Right now, I am just trying to create a widget that reads and writes to its associated NetworkTable (it's being created from a putData(Subsystem s) call). However, I am not able to read or write from the NetworkTable through any diplomatic means. I've tried extending Widget and AbstractTableWidget, with no luck on either. I don't even get a setValue() method call or a valueChanged() call.
If anyone has created their own widget on SmartDashboard for 2013 code, please help! |
Re: Custom SmartDashboard Widget
I haven't made a widget personally, but the people who made SmartDashboard have made quite a few! Here's CheckBox from the SmartDashboard source code:
Code:
package edu.wpi.first.smartdashboard.gui.elements; |
Re: Custom SmartDashboard Widget
AbstractTableWidget is fairly easy to get started with, because it binds NetworkTables variables to your objects of type StringTableField, NumberTableField, BooleanTableField or BooleanTableCheckBox. You don't need to write any NetworkTables code. The sending data and receiving data happens automatically if there is a change.
I found it helpful to look at how the PIDEditor was implemented in SmartDashboard. I made a few extensions that extended PIDEditor. You can see them here: http://forums.usfirst.org/showthread.php?t=20437 |
| All times are GMT -5. The time now is 09:50. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi