mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21: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
@@ -91,6 +91,7 @@ DoubleSolenoid::~DoubleSolenoid() {
|
||||
m_allocated->Free(m_moduleNumber * kSolenoidChannels + m_forwardChannel);
|
||||
m_allocated->Free(m_moduleNumber * kSolenoidChannels + m_reverseChannel);
|
||||
}
|
||||
if (m_table != nullptr) m_table->RemoveTableListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,13 +156,14 @@ bool DoubleSolenoid::IsRevSolenoidBlackListed() const {
|
||||
return (blackList & m_reverseMask) ? 1 : 0;
|
||||
}
|
||||
|
||||
void DoubleSolenoid::ValueChanged(std::shared_ptr<ITable> source, const std::string &key,
|
||||
EntryValue value, bool isNew) {
|
||||
void DoubleSolenoid::ValueChanged(ITable* source, llvm::StringRef key,
|
||||
std::shared_ptr<nt::Value> value,
|
||||
bool isNew) {
|
||||
if (!value->IsString()) return;
|
||||
Value lvalue = kOff;
|
||||
std::string *val = (std::string *)value.ptr;
|
||||
if (*val == "Forward")
|
||||
if (value->GetString() == "Forward")
|
||||
lvalue = kForward;
|
||||
else if (*val == "Reverse")
|
||||
else if (value->GetString() == "Reverse")
|
||||
lvalue = kReverse;
|
||||
Set(lvalue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user