mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Use new NetworkTables across WPILib (C++ and Java).
Also make sure table listeners stop listening in their destructors. This might be better handled by moving the table itself into ITableListener and providing cleanup functionality there. A submodule is used to pull in ntcore. Change-Id: I3031c1a768595cf0f8754c47e15cd423e2dbcce5
This commit is contained in:
committed by
Brad Miller (WPI)
parent
f65e697107
commit
f89c5e150f
@@ -6,7 +6,6 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "SmartDashboard/SendableChooser.h"
|
||||
#include "networktables2/type/StringArray.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -54,14 +53,14 @@ void *SendableChooser::GetSelected() {
|
||||
}
|
||||
|
||||
void SendableChooser::InitTable(std::shared_ptr<ITable> subtable) {
|
||||
StringArray keys;
|
||||
std::vector<std::string> keys;
|
||||
m_table = subtable;
|
||||
if (m_table != nullptr) {
|
||||
std::map<std::string, void *>::iterator iter;
|
||||
for (iter = m_choices.begin(); iter != m_choices.end(); iter++) {
|
||||
keys.add(iter->first);
|
||||
keys.push_back(iter->first);
|
||||
}
|
||||
m_table->PutValue(kOptions, keys);
|
||||
m_table->PutValue(kOptions, nt::Value::MakeStringArray(std::move(keys)));
|
||||
m_table->PutString(kDefault, m_defaultChoice);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user