Skip to content
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

Converting Subsystem to Simulink Function from inside existing Simulink Function #2

Closed
stephen99scott opened this issue Jun 24, 2020 · 1 comment · Fixed by #3
Closed
Assignees
Labels
bug Something isn't working

Comments

@stephen99scott
Copy link
Member

'Convert Subsystem' functionality is not showing up in the Simulink context menu when trying to convert a subsystem which is located inside of an existing Simulink Function.

@stephen99scott stephen99scott added the bug Something isn't working label Jun 24, 2020
@stephen99scott stephen99scott self-assigned this Jun 24, 2020
@stephen99scott
Copy link
Member Author

I believe it was due to the conditional logic in getSLModuleTool (sl_customization.m).

The 'Convert Subsystem' schema was only being called if none of the selected blocks were Simulink Functions; however, when selecting a block inside of a Simulink Function, any(selectedFcns) would be true, causing the code not to reach the elseif for the 'Convert Subsystem' functionality.

if isempty(gcbs)
schemaFcns{end+1} = @FcnCreatorSchema;
schemaFcns{end+1} = @GuidelineSchema;
schemaFcns{end+1} = @InterfaceSchema;
elseif any(selectedFcns) && ~isempty(gcbs)
schemaFcns{end+1} = @ChangeFcnScopeSchema;
schemaFcns{end+1} = @FcnCreatorLocalSchema;
elseif isSubsystem(gcbs)
schemaFcns{end+1} = @ConvToSimFcnSchema;
end

I added this commit which should fix this issue.
0f1f7b1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant