mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Split Sendable into NT and non-NT portions (#3432)
The non-NT portion has been moved to wpiutil. The NT portion has been moved to ntcore (as NTSendable). SendableBuilder similarly split and moved. SendableRegistry moved to wpiutil. In C++, SendableHelper also moved to wpiutil. This enables use of Sendable from wpimath and also enables moving several classes from wpilib to wpimath.
This commit is contained in:
@@ -5,9 +5,8 @@
|
||||
#include "frc/ADXL345_SPI.h"
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
|
||||
#include "frc/smartdashboard/SendableBuilder.h"
|
||||
#include "frc/smartdashboard/SendableRegistry.h"
|
||||
#include <networktables/NTSendableBuilder.h>
|
||||
#include <wpi/sendable/SendableRegistry.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -38,7 +37,7 @@ ADXL345_SPI::ADXL345_SPI(SPI::Port port, ADXL345_SPI::Range range)
|
||||
HAL_Report(HALUsageReporting::kResourceType_ADXL345,
|
||||
HALUsageReporting::kADXL345_SPI);
|
||||
|
||||
SendableRegistry::GetInstance().AddLW(this, "ADXL345_SPI", port);
|
||||
wpi::SendableRegistry::GetInstance().AddLW(this, "ADXL345_SPI", port);
|
||||
}
|
||||
|
||||
void ADXL345_SPI::SetRange(Range range) {
|
||||
@@ -115,7 +114,7 @@ ADXL345_SPI::AllAxes ADXL345_SPI::GetAccelerations() {
|
||||
return data;
|
||||
}
|
||||
|
||||
void ADXL345_SPI::InitSendable(SendableBuilder& builder) {
|
||||
void ADXL345_SPI::InitSendable(nt::NTSendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("3AxisAccelerometer");
|
||||
auto x = builder.GetEntry("X").GetHandle();
|
||||
auto y = builder.GetEntry("Y").GetHandle();
|
||||
|
||||
Reference in New Issue
Block a user