Skip to content

Conversation

lizlooney
Copy link
Collaborator

No description provided.

@lizlooney lizlooney requested a review from alan412 March 15, 2025 04:02
@lizlooney lizlooney marked this pull request as draft March 19, 2025 06:49
…nction block.

Handle case where a component name collides with a variable name.
Added getComponentNames method to the editor class so the mrc_call_python_function blocks can populate the component name dropdown fields.
Added robot parameter to OpMode init method.
Modified mrc_class_method_def so it generates the call to super().__init__() for __init__ methods.
Save the component names and types in the files.
Added blocks to component_samples_category.ts.
@lizlooney lizlooney marked this pull request as ready for review March 21, 2025 05:09
@lizlooney
Copy link
Collaborator Author

This is ready for review now.

Copy link
Collaborator

@alan412 alan412 left a comment

Choose a reason for hiding this comment

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

Why do you create variables for each component used? It seems like we should just be self.robot.frontTouch.is_pressed() so it is clear it is part of the robot instead of self.frontTouch.is_pressed()

@lizlooney
Copy link
Collaborator Author

Thanks for your review comments. PTAL.

@lizlooney lizlooney marked this pull request as draft March 24, 2025 19:47
@lizlooney
Copy link
Collaborator Author

Change code generation to use self.robot..

@lizlooney lizlooney marked this pull request as ready for review March 25, 2025 05:01
@lizlooney
Copy link
Collaborator Author

OK. Now this is ready for another review.

@lizlooney
Copy link
Collaborator Author

Why do you create variables for each component used? It seems like we should just be self.robot.frontTouch.is_pressed() so it is clear it is part of the robot instead of self.frontTouch.is_pressed()

Done.

@lizlooney
Copy link
Collaborator Author

Why do you create variables for each component used? It seems like we should just be self.robot.frontTouch.is_pressed() so it is clear it is part of the robot instead of self.frontTouch.is_pressed()

Done.

Screenshot 2025-03-25 at 2 12 10 PM

@lizlooney lizlooney requested a review from alan412 March 25, 2025 21:14
Copy link
Collaborator

@alan412 alan412 left a comment

Choose a reason for hiding this comment

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

LGTM

@lizlooney lizlooney merged commit 407a909 into wpilibsuite:main Mar 26, 2025
1 check passed
@lizlooney lizlooney deleted the pr_sample_component_led_stick branch March 26, 2025 03:10
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