mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +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
@@ -44,6 +44,7 @@ CANTalon::CANTalon(int deviceNumber, int controlPeriodMs)
|
||||
}
|
||||
|
||||
CANTalon::~CANTalon() {
|
||||
if (m_table != nullptr) m_table->RemoveTableListener(this);
|
||||
if (m_hasBeenMoved) return;
|
||||
Disable();
|
||||
}
|
||||
@@ -1275,9 +1276,10 @@ bool CANTalon::GetInverted() const { return m_isInverted; }
|
||||
*/
|
||||
void CANTalon::StopMotor() { Disable(); }
|
||||
|
||||
void CANTalon::ValueChanged(std::shared_ptr<ITable> source, const std::string& key,
|
||||
EntryValue value, bool isNew) {
|
||||
Set(value.f);
|
||||
void CANTalon::ValueChanged(ITable* source, llvm::StringRef key,
|
||||
std::shared_ptr<nt::Value> value, bool isNew) {
|
||||
if (!value->IsDouble()) return;
|
||||
Set(value->GetDouble());
|
||||
}
|
||||
|
||||
void CANTalon::UpdateTable() {
|
||||
|
||||
Reference in New Issue
Block a user