I noticed in the example from 6328 custom widgets were using glyphs from the shuffleboard. How is the accomplished. There is no selector for glyphs in the dashboard. There doesn’t seem to be a way to set it in code?
I’m not entirely sure what you’re referring to. Could you clarify what glyphs you’re talking about? Some info that may be relevant:
We used Shuffleboard in 2023, and that layout file (posted on GitHub) includes glyphs in the titles of most of the widgets as shown in the screenshot below. Note that most of these are built-in widgets. The glyph is editable in the widget settings if you right click and choose “Edit Properties”. As far as I know, this feature isn’t available in Elastic (which we used in 2024).
In the realm of “custom widgets”, we used a custom widget with Shuffleboard to display persistent alerts. This includes symbols (glyphs?) for different alert priorities, as shown below. Elastic has an equivalent widget built-in, and our custom widget will be integrated as a built-in Shuffleboard widget starting next year.
That’s what I was referring too, my bad. How did you push these symbols to elastic. I’m not seeing it in the example code.
Once the 2025 WPILib beta is released, you’ll be able to use the Alert class.
Awesome.
On another note. I have a simple sendable subsystem setup using initSendable and I’m using the ShuffleBoard api to push it to elastic. I’m using the positioning setup and its not showing up on Elastic in the position I set in code, but it does on shuffleboard.
Here is my code for shuffleboard
Shuffleboard.getTab("AIR CANNONS")
.add("AIR CANNON 0", airCannon0)
.withSize(2, 5)
.withPosition(0, 0);
Shuffleboard.selectTab("AIR CANNON");
and for the initSendable in the subsystem
@Override
public void initSendable(SendableBuilder builder) {
String on = "ON";
String off = "OFF";
builder.addStringProperty(
"VALVE STATE",
() -> isOn.getAsBoolean() ? on : off,
null);
builder.addIntegerProperty(
"MODULE CANID",
() -> moduleNumber,
null);
builder.addIntegerProperty(
"SOLENOID CHANNEL",
solenoid::getChannel,
null);
builder.addBooleanProperty(".hasDefault", () -> getDefaultCommand() != null, null);
builder.addStringProperty(
"default",
() -> getDefaultCommand() != null ? getDefaultCommand().getName() : "none",
null);
builder.addBooleanProperty(".hasCommand", () -> getCurrentCommand() != null, null);
builder.addStringProperty(
"command",
() -> getCurrentCommand() != null ? getCurrentCommand().getName() : "none",
null);
}
That’s interesting, how is it showing up on Elastic?
It’s showing in the widgets list, but not populating in the spot I sent it to.
Oh I see, there isn’t a known widget implementation for the custom sendable, so Elastic won’t add any widget to the tab. What shuffleboard does in this scenario is it displays the sendable data in a NetworkTables Tree widget, which Elastic doesn’t have.
What I recommend doing is putting everything into a list layout, which should have a nicer appearance, and gives you more control over each property.