diff --git a/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/source/StreamDiscoverer.java b/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/source/StreamDiscoverer.java index 2cd43e7fa..8da769f83 100644 --- a/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/source/StreamDiscoverer.java +++ b/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/source/StreamDiscoverer.java @@ -34,7 +34,8 @@ public final class StreamDiscoverer implements AutoCloseable { * @param cameraName the name of the camera to discover streams for */ public StreamDiscoverer(NetworkTable publisherTable, String cameraName) { - streamsSub = publisherTable.getSubTable(cameraName).getStringArrayTopic(STREAMS_KEY).subscribe(emptyStringArray, PubSubOption.hidden(true)); + streamsSub = publisherTable.getSubTable(cameraName).getStringArrayTopic(STREAMS_KEY) + .subscribe(emptyStringArray, PubSubOption.hidden(true)); streamsListener = publisherTable.getInstance().addListener( streamsSub, EnumSet.of( diff --git a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/RecorderController.java b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/RecorderController.java index 8eb03befd..77ad0fd74 100644 --- a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/RecorderController.java +++ b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/RecorderController.java @@ -57,8 +57,8 @@ public RecorderController(NetworkTableInstance ntInstance, String fileNameFormatKey, Recorder recorder) { startStopControlSub = ntInstance.getBooleanTopic(startStopKey).subscribe(false, PubSubOption.hidden(true)); - fileNameFormatSub = - ntInstance.getStringTopic(fileNameFormatKey).subscribe(Recorder.DEFAULT_RECORDING_FILE_NAME_FORMAT, PubSubOption.hidden(true)); + fileNameFormatSub = ntInstance.getStringTopic(fileNameFormatKey) + .subscribe(Recorder.DEFAULT_RECORDING_FILE_NAME_FORMAT, PubSubOption.hidden(true)); this.recorder = recorder; this.markerGenerator = new MarkerGenerator(ntInstance, recorder); } diff --git a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/TabGenerator.java b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/TabGenerator.java index a37ebd73c..2a067de9a 100644 --- a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/TabGenerator.java +++ b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/TabGenerator.java @@ -76,7 +76,8 @@ final class TabGenerator { public void start() { // Make sure all tabs exist if they're defined, even if they're empty NetworkTable rootMetaTable = inst.getTable(METADATA_TABLE_NAME); - tabsSubscriber = rootMetaTable.getStringArrayTopic(TABS_ENTRY_KEY).subscribe(new String[] {}, PubSubOption.hidden(true)); + tabsSubscriber = rootMetaTable.getStringArrayTopic(TABS_ENTRY_KEY) + .subscribe(new String[] {}, PubSubOption.hidden(true)); tabsListener = inst.addListener(tabsSubscriber, EnumSet.of(NetworkTableEvent.Kind.kValueAll, NetworkTableEvent.Kind.kImmediate), event -> { for (String tabName : event.valueData.value.getStringArray()) { @@ -100,7 +101,8 @@ public void start() { } }); - metadataSubscriber = new MultiSubscriber(inst, new String[] {METADATA_TABLE_NAME + "/"}, PubSubOption.hidden(true)); + metadataSubscriber = + new MultiSubscriber(inst, new String[] {METADATA_TABLE_NAME + "/"}, PubSubOption.hidden(true)); metadataListener = inst.addListener( metadataSubscriber, EnumSet.of(NetworkTableEvent.Kind.kValueAll, NetworkTableEvent.Kind.kImmediate), diff --git a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/util/NetworkTableUtils.java b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/util/NetworkTableUtils.java index 9d21345df..6cc613f08 100644 --- a/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/util/NetworkTableUtils.java +++ b/plugins/networktables/src/main/java/edu/wpi/first/shuffleboard/plugin/networktables/util/NetworkTableUtils.java @@ -39,6 +39,13 @@ public static String topicNameForEvent(NetworkTableEvent event) { } } + /** + * Gets the data type associated with the given network table type string. + * + * @param typeString the network table type string to get the data type for + * + * @return the data type most closely associated with the given type string + */ public static DataType dataTypeForTypeString(String typeString) { if ("boolean".equals(typeString)) { return DataTypes.Boolean; @@ -46,7 +53,7 @@ public static DataType dataTypeForTypeString(String typeString) { return DataTypes.Number; } else if ("string".equals(typeString) || "json".equals(typeString)) { return DataTypes.String; - } else if ("raw".equals(typeString)) { + } else if ("raw".equals(typeString) || "msgpack".equals(typeString) || "protobuf".equals(typeString)) { return DataTypes.ByteArray; } else if ("boolean[]".equals(typeString)) { return DataTypes.BooleanArray;