mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -16,7 +16,7 @@
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
#include "wpi/util/sendable/SendableRegistry.hpp"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi;
|
||||
|
||||
DigitalOutput::DigitalOutput(int channel) {
|
||||
m_pwmGenerator = HAL_kInvalidHandle;
|
||||
@@ -26,12 +26,12 @@ DigitalOutput::DigitalOutput(int channel) {
|
||||
m_channel = channel;
|
||||
|
||||
int32_t status = 0;
|
||||
std::string stackTrace = wpi::GetStackTrace(1);
|
||||
std::string stackTrace = wpi::util::GetStackTrace(1);
|
||||
m_handle = HAL_InitializeDIOPort(channel, false, stackTrace.c_str(), &status);
|
||||
FRC_CheckErrorStatus(status, "Channel {}", channel);
|
||||
|
||||
HAL_ReportUsage("IO", channel, "DigitalOutput");
|
||||
wpi::SendableRegistry::Add(this, "DigitalOutput", channel);
|
||||
wpi::util::SendableRegistry::Add(this, "DigitalOutput", channel);
|
||||
}
|
||||
|
||||
DigitalOutput::~DigitalOutput() {
|
||||
@@ -62,7 +62,7 @@ int DigitalOutput::GetChannel() const {
|
||||
return m_channel;
|
||||
}
|
||||
|
||||
void DigitalOutput::Pulse(units::second_t pulseLength) {
|
||||
void DigitalOutput::Pulse(wpi::units::second_t pulseLength) {
|
||||
int32_t status = 0;
|
||||
HAL_Pulse(m_handle, pulseLength.value(), &status);
|
||||
FRC_CheckErrorStatus(status, "Channel {}", m_channel);
|
||||
@@ -142,7 +142,7 @@ void DigitalOutput::SetSimDevice(HAL_SimDeviceHandle device) {
|
||||
HAL_SetDIOSimDevice(m_handle, device);
|
||||
}
|
||||
|
||||
void DigitalOutput::InitSendable(wpi::SendableBuilder& builder) {
|
||||
void DigitalOutput::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("Digital Output");
|
||||
builder.AddBooleanProperty(
|
||||
"Value", [=, this] { return Get(); },
|
||||
|
||||
Reference in New Issue
Block a user