Skip to content

Commit fa97dda

Browse files
authored
Robot now shows ports for a component (#141)
* Robot now shows ports for a component * Add a comment to getComponentsBlocks
1 parent bdcda8d commit fa97dda

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/toolbox/hardware_category.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ export function getHardwareCategory(currentModule: commonStorage.Module) {
4949
name: 'Hardware',
5050
contents: [
5151
getRobotMechanismsBlocks(currentModule),
52-
getComponentsBlocks(currentModule),
52+
getComponentsBlocks(currentModule, false),
5353
]
5454
};
5555
}
5656
if (currentModule.moduleType === commonStorage.MODULE_TYPE_MECHANISM) {
57-
return getComponentsBlocks(currentModule);
57+
return getComponentsBlocks(currentModule, true);
5858
}
5959
// Return default empty category if module type doesn't match
6060
return {
@@ -239,14 +239,16 @@ function getRobotMethodsBlocks(currentModule: commonStorage.Module) {
239239
};
240240
}
241241

242-
function getComponentsBlocks(currentModule: commonStorage.Module) {
242+
// This is called when the user is editing a mechanism or the robot and allows
243+
// the user to add a component or use an existing component.
244+
function getComponentsBlocks(currentModule: commonStorage.Module, hideParams : boolean) {
243245
const contents = [];
244246

245247
// Add the "+ Component" category
246248
contents.push({
247249
kind: 'category',
248250
name: '+ Component',
249-
contents: getAllPossibleComponents(true)
251+
contents: getAllPossibleComponents(hideParams)
250252
});
251253

252254
// Get components from the current workspace

0 commit comments

Comments
 (0)