mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Update wpilibc to use new NetworkTables package and interfaces.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "ErrorBase.h"
|
||||
#include "SmartDashboard/NamedSendable.h"
|
||||
#include "tables/ITableListener.h"
|
||||
#include "networktables/NetworkTableEntry.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -49,7 +49,7 @@ class Subsystem;
|
||||
* @see CommandGroup
|
||||
* @see Subsystem
|
||||
*/
|
||||
class Command : public ErrorBase, public NamedSendable, public ITableListener {
|
||||
class Command : public ErrorBase, public NamedSendable {
|
||||
friend class CommandGroup;
|
||||
friend class Scheduler;
|
||||
|
||||
@@ -160,14 +160,17 @@ class Command : public ErrorBase, public NamedSendable, public ITableListener {
|
||||
|
||||
public:
|
||||
std::string GetName() const override;
|
||||
void InitTable(std::shared_ptr<ITable> subtable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
void InitTable(std::shared_ptr<nt::NetworkTable> subtable) override;
|
||||
std::shared_ptr<nt::NetworkTable> GetTable() const override;
|
||||
std::string GetSmartDashboardType() const override;
|
||||
void ValueChanged(ITable* source, llvm::StringRef key,
|
||||
std::shared_ptr<nt::Value> value, bool isNew) override;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<ITable> m_table;
|
||||
std::shared_ptr<nt::NetworkTable> m_table;
|
||||
|
||||
private:
|
||||
nt::NetworkTableEntry m_runningEntry;
|
||||
nt::NetworkTableEntry m_isParentedEntry;
|
||||
NT_EntryListener m_runningListener = 0;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -54,7 +54,7 @@ class PIDCommand : public Command, public PIDOutput, public PIDSource {
|
||||
std::shared_ptr<PIDController> m_controller;
|
||||
|
||||
public:
|
||||
void InitTable(std::shared_ptr<ITable> subtable) override;
|
||||
void InitTable(std::shared_ptr<nt::NetworkTable> subtable) override;
|
||||
std::string GetSmartDashboardType() const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class PIDSubsystem : public Subsystem, public PIDOutput, public PIDSource {
|
||||
std::shared_ptr<PIDController> m_controller;
|
||||
|
||||
public:
|
||||
void InitTable(std::shared_ptr<ITable> subtable) override;
|
||||
void InitTable(std::shared_ptr<nt::NetworkTable> subtable) override;
|
||||
std::string GetSmartDashboardType() const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "SmartDashboard/NamedSendable.h"
|
||||
#include "SmartDashboard/SmartDashboard.h"
|
||||
#include "networktables/NetworkTable.h"
|
||||
#include "networktables/NetworkTableEntry.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -42,8 +43,8 @@ class Scheduler : public ErrorBase, public NamedSendable {
|
||||
|
||||
void UpdateTable();
|
||||
std::string GetSmartDashboardType() const;
|
||||
void InitTable(std::shared_ptr<ITable> subTable);
|
||||
std::shared_ptr<ITable> GetTable() const;
|
||||
void InitTable(std::shared_ptr<nt::NetworkTable> subTable);
|
||||
std::shared_ptr<nt::NetworkTable> GetTable() const;
|
||||
std::string GetName() const;
|
||||
std::string GetType() const;
|
||||
|
||||
@@ -67,7 +68,10 @@ class Scheduler : public ErrorBase, public NamedSendable {
|
||||
std::vector<std::string> commands;
|
||||
std::vector<double> ids;
|
||||
std::vector<double> toCancel;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
std::shared_ptr<nt::NetworkTable> m_table;
|
||||
nt::NetworkTableEntry m_namesEntry;
|
||||
nt::NetworkTableEntry m_idsEntry;
|
||||
nt::NetworkTableEntry m_cancelEntry;
|
||||
bool m_runningCommandsChanged = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "ErrorBase.h"
|
||||
#include "SmartDashboard/NamedSendable.h"
|
||||
#include "networktables/NetworkTableEntry.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -42,12 +43,16 @@ class Subsystem : public ErrorBase, public NamedSendable {
|
||||
|
||||
public:
|
||||
std::string GetName() const override;
|
||||
void InitTable(std::shared_ptr<ITable> subtable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
void InitTable(std::shared_ptr<nt::NetworkTable> subtable) override;
|
||||
std::shared_ptr<nt::NetworkTable> GetTable() const override;
|
||||
std::string GetSmartDashboardType() const override;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<ITable> m_table;
|
||||
std::shared_ptr<nt::NetworkTable> m_table;
|
||||
nt::NetworkTableEntry m_hasDefaultEntry;
|
||||
nt::NetworkTableEntry m_defaultEntry;
|
||||
nt::NetworkTableEntry m_hasCommandEntry;
|
||||
nt::NetworkTableEntry m_commandEntry;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user