Skip to content

Conversation

@lizlooney
Copy link
Collaborator

Update MechanismBlock.checkMechanism to update port blocks.

If necessary, existing port blocks are reconnected to the appropriate input and new port blocks are created for empty input sockets.

Fixes #286

If necessary, existing port blocks are reconnected to the appropriate input and new port blocks are created for empty input sockets.
@lizlooney lizlooney requested a review from alan412 November 22, 2025 21:55

// Regenerate mrc_parameters and create new inputs if necessary.
this.mrcParameters = [];
let i = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of handling i separately, do a forEach like this: components.forEach((component, index) => {

});

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here, i is not the index for components, it is the index for this.mrcParameters. I've renamed it to parametersIndex to make that more clear.

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 80b3cf3 into wpilibsuite:main Nov 24, 2025
1 check passed
@lizlooney lizlooney deleted the pr_issue_286 branch November 24, 2025 19:01
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.

Port blocks need to be updated if a mechanism changes

2 participants