SCRIPT namespace replacements

This commit is contained in:
PJ Reiniger
2025-11-07 20:00:05 -05:00
committed by Peter Johnson
parent ae6c043632
commit 9aca8e0fd6
2622 changed files with 22275 additions and 22275 deletions

View File

@@ -6,7 +6,7 @@
#include "wpi/units/voltage.hpp"
namespace frc {
namespace wpi {
/**
* Interface for motor controlling devices.
@@ -34,7 +34,7 @@ class MotorController {
*
* @param output The voltage to output.
*/
virtual void SetVoltage(units::volt_t output);
virtual void SetVoltage(wpi::units::volt_t output);
/**
* Common interface for getting the current set speed of a motor controller.
@@ -68,4 +68,4 @@ class MotorController {
virtual void StopMotor() = 0;
};
} // namespace frc
} // namespace wpi

View File

@@ -14,7 +14,7 @@
WPI_IGNORE_DEPRECATED
namespace frc {
namespace wpi {
/**
* Allows multiple MotorController objects to be linked together.
@@ -22,9 +22,9 @@ namespace frc {
class [[deprecated(
"Use PWMMotorController::AddFollower() or if using CAN motor controllers,"
"use their method of following.")]] MotorControllerGroup
: public wpi::Sendable,
: public wpi::util::Sendable,
public MotorController,
public wpi::SendableHelper<MotorControllerGroup> {
public wpi::util::SendableHelper<MotorControllerGroup> {
public:
/**
* Create a new MotorControllerGroup with the provided MotorControllers.
@@ -53,14 +53,14 @@ class [[deprecated(
MotorControllerGroup& operator=(MotorControllerGroup&&) = default;
void Set(double speed) override;
void SetVoltage(units::volt_t output) override;
void SetVoltage(wpi::units::volt_t output) override;
double Get() const override;
void SetInverted(bool isInverted) override;
bool GetInverted() const override;
void Disable() override;
void StopMotor() override;
void InitSendable(wpi::SendableBuilder& builder) override;
void InitSendable(wpi::util::SendableBuilder& builder) override;
private:
bool m_isInverted = false;
@@ -69,6 +69,6 @@ class [[deprecated(
void Initialize();
};
} // namespace frc
} // namespace wpi
WPI_UNIGNORE_DEPRECATED

View File

@@ -10,7 +10,7 @@
#include "wpi/units/time.hpp"
#include "wpi/util/mutex.hpp"
namespace frc {
namespace wpi {
/**
* The Motor Safety feature acts as a watchdog timer for an individual motor. It
@@ -41,14 +41,14 @@ class MotorSafety {
*
* @param expirationTime The timeout value.
*/
void SetExpiration(units::second_t expirationTime);
void SetExpiration(wpi::units::second_t expirationTime);
/**
* Retrieve the timeout value for the corresponding motor safety object.
*
* @return the timeout value.
*/
units::second_t GetExpiration() const;
wpi::units::second_t GetExpiration() const;
/**
* Determine if the motor is still operating or has timed out.
@@ -108,15 +108,15 @@ class MotorSafety {
static constexpr auto kDefaultSafetyExpiration = 100_ms;
// The expiration time for this object
units::second_t m_expiration = kDefaultSafetyExpiration;
wpi::units::second_t m_expiration = kDefaultSafetyExpiration;
// True if motor safety is enabled for this motor
bool m_enabled = false;
// The FPGA clock value when the motor has expired
units::second_t m_stopTime = Timer::GetFPGATimestamp();
wpi::units::second_t m_stopTime = Timer::GetFPGATimestamp();
mutable wpi::mutex m_thisMutex;
mutable wpi::util::mutex m_thisMutex;
};
} // namespace frc
} // namespace wpi

View File

@@ -21,7 +21,7 @@
#include "wpi/util/sendable/Sendable.hpp"
#include "wpi/util/sendable/SendableHelper.hpp"
namespace frc {
namespace wpi {
WPI_IGNORE_DEPRECATED
@@ -30,8 +30,8 @@ WPI_IGNORE_DEPRECATED
*/
class PWMMotorController : public MotorController,
public MotorSafety,
public wpi::Sendable,
public wpi::SendableHelper<PWMMotorController> {
public wpi::util::Sendable,
public wpi::util::SendableHelper<PWMMotorController> {
public:
PWMMotorController(PWMMotorController&&) = default;
PWMMotorController& operator=(PWMMotorController&&) = default;
@@ -58,7 +58,7 @@ class PWMMotorController : public MotorController,
*
* @param output The voltage to output.
*/
void SetVoltage(units::volt_t output) override;
void SetVoltage(wpi::units::volt_t output) override;
/**
* Get the recently set value of the PWM. This value is affected by the
@@ -76,7 +76,7 @@ class PWMMotorController : public MotorController,
* @return The voltage of the motor controller, nominally between -12 V and 12
* V.
*/
virtual units::volt_t GetVoltage() const;
virtual wpi::units::volt_t GetVoltage() const;
void SetInverted(bool isInverted) override;
@@ -128,7 +128,7 @@ class PWMMotorController : public MotorController,
*/
PWMMotorController(std::string_view name, int channel);
void InitSendable(wpi::SendableBuilder& builder) override;
void InitSendable(wpi::util::SendableBuilder& builder) override;
/// PWM instances for motor controller.
PWM m_pwm;
@@ -136,35 +136,35 @@ class PWMMotorController : public MotorController,
void SetSpeed(double speed);
double GetSpeed() const;
void SetBounds(units::microsecond_t maxPwm,
units::microsecond_t deadbandMaxPwm,
units::microsecond_t centerPwm,
units::microsecond_t deadbandMinPwm,
units::microsecond_t minPwm);
void SetBounds(wpi::units::microsecond_t maxPwm,
wpi::units::microsecond_t deadbandMaxPwm,
wpi::units::microsecond_t centerPwm,
wpi::units::microsecond_t deadbandMinPwm,
wpi::units::microsecond_t minPwm);
private:
bool m_isInverted = false;
std::vector<PWMMotorController*> m_nonowningFollowers;
std::vector<std::unique_ptr<PWMMotorController>> m_owningFollowers;
hal::SimDevice m_simDevice;
hal::SimDouble m_simSpeed;
wpi::hal::SimDevice m_simDevice;
wpi::hal::SimDouble m_simSpeed;
bool m_eliminateDeadband{0};
units::microsecond_t m_minPwm{0};
units::microsecond_t m_deadbandMinPwm{0};
units::microsecond_t m_centerPwm{0};
units::microsecond_t m_deadbandMaxPwm{0};
units::microsecond_t m_maxPwm{0};
wpi::units::microsecond_t m_minPwm{0};
wpi::units::microsecond_t m_deadbandMinPwm{0};
wpi::units::microsecond_t m_centerPwm{0};
wpi::units::microsecond_t m_deadbandMaxPwm{0};
wpi::units::microsecond_t m_maxPwm{0};
units::microsecond_t GetMinPositivePwm() const;
units::microsecond_t GetMaxNegativePwm() const;
units::microsecond_t GetPositiveScaleFactor() const;
units::microsecond_t GetNegativeScaleFactor() const;
wpi::units::microsecond_t GetMinPositivePwm() const;
wpi::units::microsecond_t GetMaxNegativePwm() const;
wpi::units::microsecond_t GetPositiveScaleFactor() const;
wpi::units::microsecond_t GetNegativeScaleFactor() const;
PWM* GetPwm() { return &m_pwm; }
};
WPI_UNIGNORE_DEPRECATED
} // namespace frc
} // namespace wpi