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

commands with parameters but without parameter presets do not generate properly #257

Open
sciencewhiz opened this issue Oct 11, 2020 · 2 comments

Comments

@sciencewhiz
Copy link
Collaborator

No description provided.

@bradamiller
Copy link
Contributor

If a command takes a parameter and a SmartDashboard button is automatically created for it, the parameter is missing from the new. So the DriveInches command constructor takes a number of inches, but it generated this:
SmartDashboard.putData("DriveInches", new DriveInches( m_chassis ));
instead of:
SmartDashboard.putData("DriveInches", new DriveInches(inches, m_chassis ));

Adding a preset caused it to generate the correct code.

@sciencewhiz
Copy link
Collaborator Author

Without having a preset, there isn't any compilable code that could be generated for the Smartdashboard call. So, the only option is to not generate the smartdashboard call for that command, or have a validation that would cause an error if it is put to SmartDashboard with a parameter without a parameter preset.

Best I can tell this has been this way ever since parameters were introduced, so it's low on my priority list.

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

No branches or pull requests

2 participants