diff --git a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/NetworkTablesPlugin.java b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/NetworkTablesPlugin.java index 0951b68e6..fc931a32a 100644 --- a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/NetworkTablesPlugin.java +++ b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/NetworkTablesPlugin.java @@ -42,7 +42,7 @@ @Description( group = "edu.wpi.first.shuffleboard", name = "NetworkTables", - version = "2.3.0", + version = "2.3.1", summary = "Provides sources and widgets for NetworkTables" ) public class NetworkTablesPlugin extends Plugin { diff --git a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/sources/NetworkTableSourceType.java b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/sources/NetworkTableSourceType.java index 760422ebe..82a167604 100644 --- a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/sources/NetworkTableSourceType.java +++ b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/sources/NetworkTableSourceType.java @@ -16,6 +16,7 @@ import edu.wpi.first.networktables.NetworkTableEntry; import edu.wpi.first.networktables.NetworkTableEvent; import edu.wpi.first.networktables.NetworkTableInstance; +import edu.wpi.first.networktables.Topic; import java.util.EnumSet; import java.util.List; @@ -49,6 +50,18 @@ public NetworkTableSourceType(NetworkTablesPlugin plugin) { availableSourceIds.clear(); NetworkTableSource.removeAllCachedSources(); }); + } else if (event.is(NetworkTableEvent.Kind.kConnected)) { + FxUtils.runOnFxThread(() -> { + for (Topic topic : event.getInstance().getTopics()) { + String uri = toUri(topic.getName()); + if (!availableSources.containsKey(uri)) { + availableSources.put(uri, topic.genericSubscribe().get().getValue()); + } + if (!availableSourceIds.contains(uri)) { + availableSourceIds.add(uri); + } + } + }); } }); inst.addListener(