-
Notifications
You must be signed in to change notification settings - Fork 617
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 |
@rzblue |
This has been sitting for a bit. Anything that needs to happen on my end. |
wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SolenoidSim.java
Outdated
Show resolved
Hide resolved
Anything else? |
Solenoid.get should be deprecated in Java as well. |
Typically, I don't like deprecating items this close to release, as there's no time for feedback during beta. Particularly since there isn't really a problem with the old methods, my recommendation would be not to deprecate them. With that being said, deprecation notice should be more clear that isOn is exactly the same as get, and the C++ ones should also use the doxygen deprecated annotation |
Okay. So remove the deprecations across the board? |
I just want to make sure I've got it clear before I start editing some more |
To sum up:
|
Hows this? |
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.