mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Add metadata to all dashboard ".type" entries (#6799)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <networktables/NetworkTable.h>
|
||||
#include <networktables/NetworkTableInstance.h>
|
||||
#include <networktables/StringTopic.h>
|
||||
#include <wpi/json.h>
|
||||
#include <wpi/mutex.h>
|
||||
#include <wpi/sendable/Sendable.h>
|
||||
#include <wpi/sendable/SendableRegistry.h>
|
||||
@@ -16,6 +17,8 @@
|
||||
|
||||
using namespace frc;
|
||||
|
||||
static constexpr std::string_view kSmartDashboardType = "LW Subsystem";
|
||||
|
||||
namespace {
|
||||
struct Component {
|
||||
bool firstTime = true;
|
||||
@@ -207,8 +210,10 @@ void LiveWindow::UpdateValuesUnsafe() {
|
||||
comp.namePub.Set(cbdata.name);
|
||||
static_cast<SendableBuilderImpl&>(cbdata.builder).SetTable(table);
|
||||
cbdata.sendable->InitSendable(cbdata.builder);
|
||||
comp.typePub = nt::StringTopic{ssTable->GetTopic(".type")}.Publish();
|
||||
comp.typePub.Set("LW Subsystem");
|
||||
comp.typePub = nt::StringTopic{ssTable->GetTopic(".type")}.PublishEx(
|
||||
nt::StringTopic::kTypeString,
|
||||
{{"SmartDashboard", kSmartDashboardType}});
|
||||
comp.typePub.Set(kSmartDashboardType);
|
||||
|
||||
comp.firstTime = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user