Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/toolbox/hardware_category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export function getHardwareCategory(currentModule: commonStorage.Module) {
name: 'Hardware',
contents: [
getRobotMechanismsBlocks(currentModule),
getComponentsBlocks(currentModule),
getComponentsBlocks(currentModule, false),
]
};
}
if (currentModule.moduleType === commonStorage.MODULE_TYPE_MECHANISM) {
return getComponentsBlocks(currentModule);
return getComponentsBlocks(currentModule, true);
}
// Return default empty category if module type doesn't match
return {
Expand Down Expand Up @@ -239,14 +239,16 @@ function getRobotMethodsBlocks(currentModule: commonStorage.Module) {
};
}

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

// Add the "+ Component" category
contents.push({
kind: 'category',
name: '+ Component',
contents: getAllPossibleComponents(true)
contents: getAllPossibleComponents(hideParams)
});

// Get components from the current workspace
Expand Down