mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Add .type metadata to preferences table (#701)
Allows shuffleboard to automatically discover the type, instead of inflexibly hardcoding it
This commit is contained in:
committed by
Peter Johnson
parent
a70687aaec
commit
237b2df82f
@@ -22,6 +22,7 @@ static llvm::StringRef kTableName{"Preferences"};
|
||||
|
||||
Preferences::Preferences()
|
||||
: m_table(nt::NetworkTableInstance::GetDefault().GetTable(kTableName)) {
|
||||
m_table->GetEntry(".type").SetString("RobotPreferences");
|
||||
m_listener = m_table->AddEntryListener(
|
||||
[=](nt::NetworkTable* table, llvm::StringRef name,
|
||||
nt::NetworkTableEntry entry, std::shared_ptr<nt::Value> value,
|
||||
|
||||
@@ -63,6 +63,7 @@ public class Preferences {
|
||||
*/
|
||||
private Preferences() {
|
||||
m_table = NetworkTableInstance.getDefault().getTable(TABLE_NAME);
|
||||
m_table.getEntry(".type").setString("RobotPreferences");
|
||||
// Listener to set all Preferences values to persistent
|
||||
// (for backwards compatibility with old dashboards).
|
||||
m_table.addEntryListener(
|
||||
|
||||
Reference in New Issue
Block a user