Skip to content
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

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

narmstro2020
Copy link
Contributor

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.

@narmstro2020 narmstro2020 marked this pull request as ready for review September 14, 2024 15:21
@narmstro2020 narmstro2020 requested a review from a team as a code owner September 14, 2024 15:21
@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020 narmstro2020 reopened this Sep 21, 2024
@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020
Copy link
Contributor Author

@rzblue Anything left on this one.

@@ -50,16 +50,44 @@ public SolenoidSim(PneumaticsModuleType moduleType, int channel) {
*
* @return the solenoid output
*/
public boolean getOutput() {
public boolean get() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto re: deprecation

Copy link
Member

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

@narmstro2020
Copy link
Contributor Author

@rzblue Okay I think I've made the requested changes.

@narmstro2020
Copy link
Contributor Author

/format

@narmstro2020
Copy link
Contributor Author

any remaining changes needed on this one?

@narmstro2020
Copy link
Contributor Author

Anything left to do on this one @rzblue ?

wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.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() {
Copy link
Member

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

@narmstro2020
Copy link
Contributor Author

narmstro2020 commented Oct 10, 2024

@rzblue do I need to deprecate the set and get methods in Solenoid itself and the get and set methods for DoubleSolenoid?

@rzblue
Copy link
Member

rzblue commented Oct 11, 2024

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.

@narmstro2020
Copy link
Contributor Author

@rzblue
Okay. Sounds good. Let me know if I missed anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants