mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -10,14 +10,14 @@
|
||||
#include "wpi/util/StringExtras.hpp"
|
||||
#include "wpi/util/json.hpp"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi;
|
||||
|
||||
static constexpr std::string_view kSmartDashboardType = "line";
|
||||
|
||||
MechanismLigament2d::MechanismLigament2d(std::string_view name, double length,
|
||||
units::degree_t angle,
|
||||
wpi::units::degree_t angle,
|
||||
double lineWeight,
|
||||
const frc::Color8Bit& color)
|
||||
const wpi::Color8Bit& color)
|
||||
: MechanismObject2d{name},
|
||||
m_length{length},
|
||||
m_angle{angle.value()},
|
||||
@@ -26,9 +26,9 @@ MechanismLigament2d::MechanismLigament2d(std::string_view name, double length,
|
||||
}
|
||||
|
||||
void MechanismLigament2d::UpdateEntries(
|
||||
std::shared_ptr<nt::NetworkTable> table) {
|
||||
std::shared_ptr<wpi::nt::NetworkTable> table) {
|
||||
m_typePub = table->GetStringTopic(".type").PublishEx(
|
||||
nt::StringTopic::kTypeString, {{"SmartDashboard", kSmartDashboardType}});
|
||||
wpi::nt::StringTopic::kTypeString, {{"SmartDashboard", kSmartDashboardType}});
|
||||
m_typePub.Set(kSmartDashboardType);
|
||||
|
||||
m_colorEntry = table->GetStringTopic("color").GetEntry("");
|
||||
@@ -44,7 +44,7 @@ void MechanismLigament2d::UpdateEntries(
|
||||
void MechanismLigament2d::SetColor(const Color8Bit& color) {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
|
||||
wpi::format_to_n_c_str(m_color, sizeof(m_color), "#{:02X}{:02X}{:02X}",
|
||||
wpi::util::format_to_n_c_str(m_color, sizeof(m_color), "#{:02X}{:02X}{:02X}",
|
||||
color.red, color.green, color.blue);
|
||||
|
||||
if (m_colorEntry) {
|
||||
@@ -52,7 +52,7 @@ void MechanismLigament2d::SetColor(const Color8Bit& color) {
|
||||
}
|
||||
}
|
||||
|
||||
void MechanismLigament2d::SetAngle(units::degree_t angle) {
|
||||
void MechanismLigament2d::SetAngle(wpi::units::degree_t angle) {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
m_angle = angle.value();
|
||||
if (m_angleEntry) {
|
||||
|
||||
Reference in New Issue
Block a user