-
Notifications
You must be signed in to change notification settings - Fork 8
Pr private components in mechanism #221
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
Pr private components in mechanism #221
Conversation
We were not on the same page about components in mechanisms. I thought that the components in mechanisms (before your PR) were private components. It looks like you thought the components in mechanisms were public components. Can you elaborate specifically about problems with using components in mechanisms that you found and fixed? I think we should get on the same page about what we have now (before your PR) and what we need. I'm still working on a PR to fix some things here, but I'm trying to figure out the difference between "Components" and "AllComponents". |
I understand now why you thought of components as public components. It's because they are when they are in a robot. So I understand why the new code in mrc_mechanism_component_holder.ts is all about adding private components. |
I thought we had agreed that you should be able to have public components in a mechanism so we can have students follow the progression:
|
Yes! Now I remember that! |
…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.
Regular and private components in mechanism
This adds the ability to have private components in mechanisms.
While doing this, I found some problems with using components in mechanisms so I fixed those as well.