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

Chooser - Update Selected Value #6

Merged

Conversation

AustinShalit
Copy link
Member

closes #2

If the selected value in networktables is null and we have a selected value. Update networktables. If we do not have a selected value, use the default. If there is no default, use the first option.


if (source.getString(SELECTED) == null) {
source.putString(SELECTED, source.getString(DEFAULT, choices.get(0)));
}
Copy link
Member

Choose a reason for hiding this comment

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

I think you need to use the getString(key, defaultValue) override. The robot by default does not set the key, so this would end up throwing an exception. source.getString(SELECTED, null) == null should work.

@ThadHouse
Copy link
Member

Also the intellij changes should be a separate PR.

@333fred
Copy link
Member

333fred commented Sep 1, 2016

When you do move the intellij changes, just ignore all of .idea/, not just parts of it. No IDE-specific configs should be making it into our repos.

@AustinShalit
Copy link
Member Author

This is ready for review.

@ThadHouse
Copy link
Member

Code looks good to me, other then we are going to want all these commits squashed into 1 before merging. I don't have a Rio to test with however, but this should work.

@AustinShalit
Copy link
Member Author

Do you want me to squash or is the GitHub squash ok?

Tested on a RIO -- works as expected.

@PeterJohnson PeterJohnson merged commit f932af1 into wpilibsuite:master Sep 5, 2016
@AustinShalit AustinShalit deleted the sendableChooserUpdateSelected branch November 29, 2016 14:45
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.

Sendable chooser values changes when robot starts
4 participants