Update wpilibc to use new NetworkTables package and interfaces.

This commit is contained in:
Peter Johnson
2017-09-02 00:17:43 -07:00
parent 4e80570c4c
commit 040a8c6bcc
74 changed files with 937 additions and 721 deletions

View File

@@ -8,23 +8,25 @@
#pragma once
#include <memory>
#include <string>
#include <llvm/StringRef.h>
#include "Buttons/Button.h"
#include "networktables/NetworkTable.h"
#include "networktables/NetworkTableEntry.h"
namespace frc {
class NetworkButton : public Button {
public:
NetworkButton(const std::string& tableName, const std::string& field);
NetworkButton(std::shared_ptr<ITable> table, const std::string& field);
NetworkButton(llvm::StringRef tableName, llvm::StringRef field);
NetworkButton(std::shared_ptr<nt::NetworkTable> table, llvm::StringRef field);
virtual ~NetworkButton() = default;
virtual bool Get();
private:
std::shared_ptr<ITable> m_netTable;
std::string m_field;
nt::NetworkTableEntry m_entry;
};
} // namespace frc

View File

@@ -11,6 +11,7 @@
#include <string>
#include "SmartDashboard/Sendable.h"
#include "networktables/NetworkTableEntry.h"
namespace frc {
@@ -43,12 +44,13 @@ class Trigger : public Sendable {
void CancelWhenActive(Command* command);
void ToggleWhenActive(Command* command);
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_pressedEntry;
};
} // namespace frc