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

Use more idiomatic C# under the hood #115

Merged
merged 6 commits into from
Feb 6, 2017
Merged

Use more idiomatic C# under the hood #115

merged 6 commits into from
Feb 6, 2017

Conversation

msoucy
Copy link
Contributor

@msoucy msoucy commented Feb 4, 2017

Also makes some small tweaks to the public interface to make things more convenient

Copy link
Member

@ThadHouse ThadHouse left a comment

Choose a reason for hiding this comment

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

Can you move the InitDefaultCommand change into a separate PR? That is a slightly major change from upstream WPILib. I would be willing to PR this there, as it is probably a good change, but wouldn't want to merge here until that happens.

Copy link
Member

@ThadHouse ThadHouse left a comment

Choose a reason for hiding this comment

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

Can you also move the SendableChooser change to a separate PR? Just like the command one, I want to match WPILib. We've actually been talking about major updates to the whole SmartDashboard interface, so that will definitely be a part of those changes.

@ThadHouse
Copy link
Member

Other than those 2 requested changes, everything else is good. Get those 2 portions into separate PR's and I'll merge the rest of them.

Includes `DSAtached`, being renamed to `DSAttached` with a deprecated property in place temporarily.
Quite a few methods are simple accessors that can be better summarized in one expression
Use `Math.Abs` to make the logic easier to read - the time savings from not doing a function call are probably not worth the legibility
No sense in manually rewriting the try-catch when `lock` does the same thing more succinctly
A joystick's button can now be accessed via `myJoystick[Joystick.ButtonType.Trigger]` etc. All similar accessors forward to the indexer.
Instead of lockstep lists, use a dictionary.
@msoucy
Copy link
Contributor Author

msoucy commented Feb 4, 2017

I've removed the "default to no command" commit... which apparently github review didn't appreciate. It's a separate branch, which will be made as a PR soon.

The SendableChooser changes bring it more in line with upstream WPILib - according to wpilibsuite/allwpilib@15e58ac it uses a hashmap currently

@ThadHouse
Copy link
Member

Oh I had forgotten we had actually merged that change. I thought it was still open. My bad.

@msoucy
Copy link
Contributor Author

msoucy commented Feb 5, 2017

Is there anything else that needs to be done for this?

@ThadHouse
Copy link
Member

I'll merge this tonight when I get home. I won't do a release until next weekend. I'm trying to match up with the WPILib release schedule, and I think we are planning on a release this weekend.

@ThadHouse ThadHouse merged commit aefadc6 into robotdotnet:master Feb 6, 2017
@msoucy msoucy deleted the idiomatic-cs branch February 7, 2017 00:27
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