Update for jart/json.cpp change

This commit is contained in:
Peter Johnson
2026-03-29 15:38:18 -07:00
parent de3e211fdb
commit 9ca93fa190
120 changed files with 1240 additions and 1087 deletions

View File

@@ -87,10 +87,8 @@ struct MatchDataSender {
std::shared_ptr<wpi::nt::NetworkTable> table =
wpi::nt::NetworkTableInstance::GetDefault().GetTable("FMSInfo");
MatchDataSenderEntry<wpi::nt::StringTopic> typeMetaData{
table,
".type",
kSmartDashboardType,
{{"SmartDashboard", kSmartDashboardType}}};
table, ".type", kSmartDashboardType,
wpi::util::json::object("SmartDashboard", kSmartDashboardType)};
MatchDataSenderEntry<wpi::nt::StringTopic> gameData{table, "GameData", ""};
MatchDataSenderEntry<wpi::nt::StringTopic> eventName{table, "EventName", ""};
MatchDataSenderEntry<wpi::nt::IntegerTopic> matchNumber{table, "MatchNumber",

View File

@@ -29,7 +29,7 @@ void MechanismLigament2d::UpdateEntries(
std::shared_ptr<wpi::nt::NetworkTable> table) {
m_typePub = table->GetStringTopic(".type").PublishEx(
wpi::nt::StringTopic::TYPE_STRING,
{{"SmartDashboard", kSmartDashboardType}});
wpi::util::json::object("SmartDashboard", kSmartDashboardType));
m_typePub.Set(kSmartDashboardType);
m_colorEntry = table->GetStringTopic("color").GetEntry("");

View File

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

View File

@@ -32,7 +32,7 @@ struct Instance {
wpi::nt::StringPublisher typePublisher{
table->GetStringTopic(".type").PublishEx(
wpi::nt::StringTopic::TYPE_STRING,
{{"SmartDashboard", kSmartDashboardType}})};
wpi::util::json::object("SmartDashboard", kSmartDashboardType))};
wpi::nt::MultiSubscriber tableSubscriber{
wpi::nt::NetworkTableInstance::GetDefault(),
{{fmt::format("{}/", table->GetPath())}}};