Skip to content

Conversation

@lizlooney
Copy link
Collaborator

Call the steps method after super.loop.

Changed the steps method name to _steps.

Let the user delete the loop method in an OpMode.

Fixes #298

Removed code from opmode.py that calls the steps method.

In mrc_class_method_def.ts:
Renamed classSpecific and getClassSpecificForInit to superInitParameters and getSuperInitParameters.

In mrc_steps.ts:
Added constant STEPS_METHOD_NAME and changed the steps method name to _steps.

In python.ts:
Added constant PERIODIC_METHOD_NAME.

In extended_python_generator.ts:
Changed finish method to add the code for calling the steps method to the end of the loop method.
Renamed getClassSpecificForInit to getSuperInitParameters.
@lizlooney lizlooney requested a review from alan412 November 12, 2025 07:58
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.

In addition to the other review comment, do we want to warn the user if they don't have a loop or steps in an opmode?

@lizlooney
Copy link
Collaborator Author

In addition to the other review comment, do we want to warn the user if they don't have a loop or steps in an opmode?

Done.

@lizlooney lizlooney requested a review from alan412 November 13, 2025 07:22
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.

Mostly looks good. A few minor things.

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

@alan412 alan412 merged commit 3fe6f5c into wpilibsuite:main Nov 14, 2025
1 check passed
@lizlooney lizlooney deleted the pr_issue_298 branch November 14, 2025 17:20
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.

Call steps method after super.loop

2 participants