mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Rename DoubleSolenoid.Value constants to all caps
This commit is contained in:
@@ -15,13 +15,13 @@ HatchSubsystem::HatchSubsystem()
|
||||
wpi::cmd::CommandPtr HatchSubsystem::GrabHatchCommand() {
|
||||
// implicitly require `this`
|
||||
return this->RunOnce(
|
||||
[this] { m_hatchSolenoid.Set(wpi::DoubleSolenoid::kForward); });
|
||||
[this] { m_hatchSolenoid.Set(wpi::DoubleSolenoid::FORWARD); });
|
||||
}
|
||||
|
||||
wpi::cmd::CommandPtr HatchSubsystem::ReleaseHatchCommand() {
|
||||
// implicitly require `this`
|
||||
return this->RunOnce(
|
||||
[this] { m_hatchSolenoid.Set(wpi::DoubleSolenoid::kReverse); });
|
||||
[this] { m_hatchSolenoid.Set(wpi::DoubleSolenoid::REVERSE); });
|
||||
}
|
||||
|
||||
void HatchSubsystem::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
@@ -30,6 +30,6 @@ void HatchSubsystem::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
// Publish the solenoid state to telemetry.
|
||||
builder.AddBooleanProperty(
|
||||
"extended",
|
||||
[this] { return m_hatchSolenoid.Get() == wpi::DoubleSolenoid::kForward; },
|
||||
[this] { return m_hatchSolenoid.Get() == wpi::DoubleSolenoid::FORWARD; },
|
||||
nullptr);
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ HatchSubsystem::HatchSubsystem()
|
||||
kHatchSolenoidPorts[0], kHatchSolenoidPorts[1]} {}
|
||||
|
||||
void HatchSubsystem::GrabHatch() {
|
||||
m_hatchSolenoid.Set(wpi::DoubleSolenoid::kForward);
|
||||
m_hatchSolenoid.Set(wpi::DoubleSolenoid::FORWARD);
|
||||
}
|
||||
|
||||
void HatchSubsystem::ReleaseHatch() {
|
||||
m_hatchSolenoid.Set(wpi::DoubleSolenoid::kReverse);
|
||||
m_hatchSolenoid.Set(wpi::DoubleSolenoid::REVERSE);
|
||||
}
|
||||
|
||||
void HatchSubsystem::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
@@ -26,6 +26,6 @@ void HatchSubsystem::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
// Publish the solenoid state to telemetry.
|
||||
builder.AddBooleanProperty(
|
||||
"extended",
|
||||
[this] { return m_hatchSolenoid.Get() == wpi::DoubleSolenoid::kForward; },
|
||||
[this] { return m_hatchSolenoid.Get() == wpi::DoubleSolenoid::FORWARD; },
|
||||
nullptr);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "subsystems/Intake.hpp"
|
||||
|
||||
wpi::cmd::CommandPtr Intake::IntakeCommand() {
|
||||
return RunOnce([this] { m_piston.Set(wpi::DoubleSolenoid::kForward); })
|
||||
return RunOnce([this] { m_piston.Set(wpi::DoubleSolenoid::FORWARD); })
|
||||
.AndThen(Run([this] { m_motor.SetDutyCycle(1.0); }))
|
||||
.WithName("Intake");
|
||||
}
|
||||
@@ -13,7 +13,7 @@ wpi::cmd::CommandPtr Intake::IntakeCommand() {
|
||||
wpi::cmd::CommandPtr Intake::RetractCommand() {
|
||||
return RunOnce([this] {
|
||||
m_motor.Disable();
|
||||
m_piston.Set(wpi::DoubleSolenoid::kReverse);
|
||||
m_piston.Set(wpi::DoubleSolenoid::REVERSE);
|
||||
})
|
||||
.WithName("Retract");
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
#include "subsystems/Intake.hpp"
|
||||
|
||||
void Intake::Deploy() {
|
||||
m_piston.Set(wpi::DoubleSolenoid::Value::kForward);
|
||||
m_piston.Set(wpi::DoubleSolenoid::Value::FORWARD);
|
||||
}
|
||||
|
||||
void Intake::Retract() {
|
||||
m_piston.Set(wpi::DoubleSolenoid::Value::kReverse);
|
||||
m_piston.Set(wpi::DoubleSolenoid::Value::REVERSE);
|
||||
m_motor.SetDutyCycle(0); // turn off the motor
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ void Intake::Activate(double velocity) {
|
||||
}
|
||||
|
||||
bool Intake::IsDeployed() const {
|
||||
return m_piston.Get() == wpi::DoubleSolenoid::Value::kForward;
|
||||
return m_piston.Get() == wpi::DoubleSolenoid::Value::FORWARD;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ void Robot::TeleopPeriodic() {
|
||||
* If a button is pressed, set the solenoid to the respective channel.
|
||||
*/
|
||||
if (m_stick.GetRawButtonPressed(kDoubleSolenoidForward)) {
|
||||
m_doubleSolenoid.Set(wpi::DoubleSolenoid::kForward);
|
||||
m_doubleSolenoid.Set(wpi::DoubleSolenoid::FORWARD);
|
||||
} else if (m_stick.GetRawButtonPressed(kDoubleSolenoidReverse)) {
|
||||
m_doubleSolenoid.Set(wpi::DoubleSolenoid::kReverse);
|
||||
m_doubleSolenoid.Set(wpi::DoubleSolenoid::REVERSE);
|
||||
}
|
||||
|
||||
// On button press, toggle the compressor with the mode selected from the
|
||||
|
||||
Reference in New Issue
Block a user