Log in

View Full Version : Creating custom controls to the SmartDashboard SFX


Brrch
20-02-2015, 14:42
I tried to add my custom control to the SmartDashboard SFX. I only understood how this was done using FXML, but when I tried to create a custom control using Java and this tutorial (http://wpilib.screenstepslive.com/s/4485/m/26401/l/255416-creating-a-custom-control-using-java) I got stuck, because it seems I don't have the required components (The tutorial might be out of date).
My question is, what is the simplest way to create my custom control (with multiple variables)?

Arhowk
20-02-2015, 19:16
It would be easier for you to post what you're having trouble with since that tutorial is pretty much all that's available in terms of what you're asking.

Also, have you just considered making a custom JavaFX dashboard using NetworkTables? Much easier, IMO.

Brrch
21-02-2015, 03:08
I want the control to be added to the Smartdashboard itself and not to a new window. Is it possible with Networktables?

Ben Wolsieffer
21-02-2015, 11:57
You might be better off working with the old SmartDashboard. It is written in Java (not JRuby), so the source is actually is actually readable (sorry, I don't like Ruby) and it has better documentation. I was able to figure out how to make widgets by looking at the already existing ones and adapting them.

Arhowk
21-02-2015, 12:03
I want the control to be added to the Smartdashboard itself and not to a new window. Is it possible with Networktables?

Hm? NetworkTables is a standalone application built for creating custom components (dashboards, controller drivers, etc). When you build a project with the SmartDashboard sources, NetworkTables is already included as well as the code to integrate with the SmartDashboard. As stated before, if you want to add a dashboard control you have to either follow the link you posted for sFX or http://firstforge.wpi.edu/sf/wiki/do/viewPage/projects.smartdashboard/wiki/Extensions for the old SmartDashboard.

You might be better off working with the old SmartDashboard. It is written in Java (not JRuby), so the source is actually is actually readable (sorry, I don't like Ruby)
Hey I like ruby, but combining Java with Ruby and JRuby is another story, if it would've stuck to just javaFX than it would've been nicer IMO.