[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

@@ -55,7 +55,7 @@ class MatchDataSenderEntry {
const std::shared_ptr<wpi::nt::NetworkTable>& table, std::string_view key,
typename Topic::ParamType initialVal,
wpi::util::json topicProperties = wpi::util::json::object())
: publisher{Topic{table->GetTopic(key)}.PublishEx(Topic::kTypeString,
: publisher{Topic{table->GetTopic(key)}.PublishEx(Topic::TYPE_STRING,
topicProperties)},
prevVal{initialVal} {
publisher.Set(initialVal);

View File

@@ -28,7 +28,7 @@ MechanismLigament2d::MechanismLigament2d(std::string_view name, double length,
void MechanismLigament2d::UpdateEntries(
std::shared_ptr<wpi::nt::NetworkTable> table) {
m_typePub = table->GetStringTopic(".type").PublishEx(
wpi::nt::StringTopic::kTypeString,
wpi::nt::StringTopic::TYPE_STRING,
{{"SmartDashboard", kSmartDashboardType}});
m_typePub.Set(kSmartDashboardType);

View File

@@ -85,7 +85,7 @@ void SendableBuilderImpl::ClearProperties() {
void SendableBuilderImpl::SetSmartDashboardType(std::string_view type) {
if (!m_typePublisher) {
m_typePublisher = m_table->GetStringTopic(".type").PublishEx(
wpi::nt::StringTopic::kTypeString, {{"SmartDashboard", type}});
wpi::nt::StringTopic::TYPE_STRING, {{"SmartDashboard", type}});
}
m_typePublisher.Set(type);
}

View File

@@ -31,7 +31,7 @@ struct Instance {
wpi::nt::NetworkTableInstance::GetDefault().GetTable(kTableName)};
wpi::nt::StringPublisher typePublisher{
table->GetStringTopic(".type").PublishEx(
wpi::nt::StringTopic::kTypeString,
wpi::nt::StringTopic::TYPE_STRING,
{{"SmartDashboard", kSmartDashboardType}})};
wpi::nt::MultiSubscriber tableSubscriber{
wpi::nt::NetworkTableInstance::GetDefault(),

View File

@@ -220,7 +220,7 @@ RobotBase::RobotBase() {
connListenerHandle =
inst.AddConnectionListener(false, [&](const wpi::nt::Event& event) {
if (event.Is(wpi::nt::EventFlags::kConnected)) {
if (event.Is(wpi::nt::EventFlags::CONNECTED)) {
auto connInfo = event.GetConnectionInfo();
HAL_ReportUsage(fmt::format("NT/{}", connInfo->remote_id), "");
}