Skip to content

Conversation

lizlooney
Copy link

Regular and private components in mechanism.

…chanism so it can create the port parameters.
Since the mrc_mechanism_component_holder block can't change once it has been
placed on the workspace, the code can be simplified.
…hods.

The mechanismId (and mrcMechanismId) is set to the id of the mechanism so if the mechanism is renamed (in the robot), we update it.

Added mrcComponentNames and mrcMapComponentNameToId. These are filled in during mrcOnLoad and are used to populate the component name dropdown field.
Added privateComponents to module content.
We can use this to get the private components from a mechanism without having to
use a headless blockly workspace to process the blocks.
Added code to upgrade projects to version 0.0.2, which involves updating the
mrc_mechanism_component_holder block in the robot and adding privateComponents
in module content.
storageModuleContent.makeModuleContentText.

Made some methods private where possible.

Modified getAllComponentsFromMechanism so it gets the private components from a
mechanism's module content without having to use a headless blockly workspace to
process the mechanism's blocks.
…to call

getAllComponentsFromMechanism so it can create the port parameters.

Simplified getComponentsCategory to call getAllComponentsFromWorkspace for both robot and mechanism modules and added comments explaining why.
Copy link
Owner

@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 b4a1834 into alan412:pr_private_components_in_mechanism Sep 9, 2025
1 check passed
@lizlooney lizlooney deleted the pr_private_components_in_mechanism branch September 9, 2025 15:22
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