-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wpilib] Add on/off, forward/reverse/off boolean methods to Solenoid and DoubleSolenoids #7079
base: main
Are you sure you want to change the base?
Conversation
/format |
/format |
ff092a3
to
f93bacc
Compare
…llwpilib into solenoid-booleans
/format |
@rzblue Anything left on this one. |
wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DoubleSolenoidSim.java
Show resolved
Hide resolved
@@ -50,16 +50,44 @@ public SolenoidSim(PneumaticsModuleType moduleType, int channel) { | |||
* | |||
* @return the solenoid output | |||
*/ | |||
public boolean getOutput() { | |||
public boolean get() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto re: deprecation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment re: deprecating getOutput in favor of isOn instead
@rzblue Okay I think I've made the requested changes. |
/format |
any remaining changes needed on this one? |
Anything left to do on this one @rzblue ? |
wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SolenoidSim.java
Outdated
Show resolved
Hide resolved
@@ -50,16 +50,44 @@ public SolenoidSim(PneumaticsModuleType moduleType, int channel) { | |||
* | |||
* @return the solenoid output | |||
*/ | |||
public boolean getOutput() { | |||
public boolean get() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment re: deprecating getOutput in favor of isOn instead
@rzblue do I need to deprecate the set and get methods in Solenoid itself and the get and set methods for DoubleSolenoid? |
…llwpilib into solenoid-booleans
DoubleSolenoid/DoubleSolenoidSim Get and Set should be left, I suggested deprecating GetOutput on solenoid/solenoidsim because it was identical to IsOn, and IsOn is clearer. Set should not be deprecated. |
@rzblue |
This PR is intended to make it easier to use the Java (::) operator for Solenoids and Double Solenoids for command based programming in regards to Triggers and Boolean Suppliers and provides an option to not use lambdas in those cases. It also provides void methods to turn solenoids on/off or forward/reverse/off in the case of double solenoids. Thereby reducing the need to pass in a boolean argument.