[ntcore] Rename constants to all caps style (#8676)

This commit is contained in:
Peter Johnson
2026-03-15 20:44:45 -07:00
committed by GitHub
parent 86dd3ca2b7
commit ab7e4766f6
99 changed files with 736 additions and 732 deletions

View File

@@ -292,7 +292,7 @@ public final class DriverStation {
table
.getStringTopic(".type")
.publishEx(
StringTopic.kTypeString, "{\"SmartDashboard\":\"" + kSmartDashboardType + "\"}")
StringTopic.TYPE_STRING, "{\"SmartDashboard\":\"" + kSmartDashboardType + "\"}")
.set(kSmartDashboardType);
gameData = table.getStringTopic("GameData").publish();
gameData.set("");

View File

@@ -111,7 +111,7 @@ public abstract class RobotBase implements AutoCloseable {
// wait for the NT server to actually start
try {
int count = 0;
while (inst.getNetworkMode().contains(NetworkTableInstance.NetworkMode.kStarting)) {
while (inst.getNetworkMode().contains(NetworkTableInstance.NetworkMode.STARTING)) {
Thread.sleep(10);
count++;
if (count > 100) {
@@ -126,7 +126,7 @@ public abstract class RobotBase implements AutoCloseable {
inst.addConnectionListener(
false,
event -> {
if (event.is(NetworkTableEvent.Kind.kConnected)) {
if (event.is(NetworkTableEvent.Kind.CONNECTED)) {
HAL.reportUsage("NT/" + event.connInfo.remote_id, "");
}
});

View File

@@ -208,7 +208,7 @@ public class MechanismLigament2d extends MechanismObject2d {
table
.getStringTopic(".type")
.publishEx(
StringTopic.kTypeString, "{\"SmartDashboard\":\"" + kSmartDashboardType + "\"}");
StringTopic.TYPE_STRING, "{\"SmartDashboard\":\"" + kSmartDashboardType + "\"}");
m_typePub.set(kSmartDashboardType);
if (m_angleEntry != null) {

View File

@@ -230,7 +230,7 @@ public class SendableBuilderImpl implements NTSendableBuilder {
m_typePub =
m_table
.getStringTopic(".type")
.publishEx(StringTopic.kTypeString, "{\"SmartDashboard\":\"" + type + "\"}");
.publishEx(StringTopic.TYPE_STRING, "{\"SmartDashboard\":\"" + type + "\"}");
}
m_typePub.set(type);
}

View File

@@ -67,7 +67,7 @@ public final class Preferences {
m_table
.getStringTopic(".type")
.publishEx(
StringTopic.kTypeString, "{\"SmartDashboard\":\"" + kSmartDashboardType + "\"}");
StringTopic.TYPE_STRING, "{\"SmartDashboard\":\"" + kSmartDashboardType + "\"}");
m_typePublisher.set(kSmartDashboardType);
// Subscribe to all Preferences; this ensures we get the latest values
@@ -87,7 +87,7 @@ public final class Preferences {
m_listener =
NetworkTableListener.createListener(
m_tableSubscriber,
EnumSet.of(NetworkTableEvent.Kind.kImmediate, NetworkTableEvent.Kind.kPublish),
EnumSet.of(NetworkTableEvent.Kind.IMMEDIATE, NetworkTableEvent.Kind.PUBLISH),
event -> {
if (event.topicInfo != null) {
Topic topic = event.topicInfo.getTopic();