mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Add metadata to all dashboard ".type" entries (#6799)
This commit is contained in:
@@ -5,9 +5,12 @@
|
||||
#include "frc/smartdashboard/MechanismLigament2d.h"
|
||||
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/json.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
static constexpr std::string_view kSmartDashboardType = "line";
|
||||
|
||||
MechanismLigament2d::MechanismLigament2d(std::string_view name, double length,
|
||||
units::degree_t angle,
|
||||
double lineWeight,
|
||||
@@ -21,8 +24,9 @@ MechanismLigament2d::MechanismLigament2d(std::string_view name, double length,
|
||||
|
||||
void MechanismLigament2d::UpdateEntries(
|
||||
std::shared_ptr<nt::NetworkTable> table) {
|
||||
m_typePub = table->GetStringTopic(".type").Publish();
|
||||
m_typePub.Set("line");
|
||||
m_typePub = table->GetStringTopic(".type").PublishEx(
|
||||
nt::StringTopic::kTypeString, {{"SmartDashboard", kSmartDashboardType}});
|
||||
m_typePub.Set(kSmartDashboardType);
|
||||
|
||||
m_colorEntry = table->GetStringTopic("color").GetEntry("");
|
||||
m_colorEntry.Set(m_color);
|
||||
|
||||
Reference in New Issue
Block a user