mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[ntcore] Rename constants to all caps style (#8676)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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), "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user