mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
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.
33 lines
1020 B
C++
33 lines
1020 B
C++
// Copyright (c) FIRST and other WPILib contributors.
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
#include "frc/shuffleboard/SendableCameraWrapper.h"
|
|
|
|
#include <functional>
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include <wpi/DenseMap.h>
|
|
#include <wpi/sendable/SendableBuilder.h>
|
|
#include <wpi/sendable/SendableRegistry.h>
|
|
|
|
namespace frc {
|
|
namespace detail {
|
|
std::shared_ptr<SendableCameraWrapper>& GetSendableCameraWrapper(
|
|
CS_Source source) {
|
|
static wpi::DenseMap<int, std::shared_ptr<SendableCameraWrapper>> wrappers;
|
|
return wrappers[static_cast<int>(source)];
|
|
}
|
|
|
|
void AddToSendableRegistry(wpi::Sendable* sendable, std::string name) {
|
|
wpi::SendableRegistry::GetInstance().Add(sendable, name);
|
|
}
|
|
} // namespace detail
|
|
|
|
void SendableCameraWrapper::InitSendable(wpi::SendableBuilder& builder) {
|
|
builder.AddStringProperty(
|
|
".ShuffleboardURI", [this] { return m_uri; }, nullptr);
|
|
}
|
|
} // namespace frc
|