필터 지우기
필터 지우기

Open Simulink Editor "Requirements Manager" App programmatically

조회 수: 6 (최근 30일)
Francesco Mecocci
Francesco Mecocci 2021년 10월 6일
댓글: Francesco Mecocci 2021년 10월 6일
Hello,
Is it possible to open programmatically an app, for example the Requirements Manager, in a Simulink model using a command line command?
I am trying to enter into the Requirements perspective view automatically, and opening the Requirements Manager is one way to do it.
Thank you
  댓글 수: 4
Alex Howard
Alex Howard 2021년 10월 6일
Hi Francesco, it sounds like you're trying to open the Requirements Manager app in a Simulink model by using the MATLAB command line.
You can use slreq.openRequirementsManager(model) where model is the name of the Simulink model, specified as a string scalar or character vector. The model must be open. For example, you can open a model called vdp and then open the Requirements Manager app in the model:
open_system("vdp")
slreq.openRequirementsManager("vdp")
You can also close the Requirements Manager app in a Simulink model at the command line. The model must be open. For example:
slreq.closeRequirementsManager("vdp")
Francesco Mecocci
Francesco Mecocci 2021년 10월 6일
Hi Alex! Thank you very much for your answer! I managed to do exactly what I needed, that was opening the requirements manager in order to then generate a web view which contained the requirements! Before, I did not not manage just by activating the option 'requirements' in slwebview().
This is the code I used, where I added the middle command you suggested. Thank you!
set_param(libraryModel, 'Lock', 'off');
slreq.openRequirementsManager(libraryModel)
slwebview(libraryModel, ...
'OptionalViews', {'requirements'},...
'SearchScope', 'All', ...
'LookUnderMasks', 'all', ...
'FollowLinks', 'on', ...
'FollowModelReference', 'on',...
'PackageFolder',myfolder,...
'PackagingType','both',...
'ViewFile',false )

댓글을 달려면 로그인하십시오.

답변 (1개)

C B
C B 2021년 10월 6일
slvnvdemo_fuelsys_officereq;
blk_with_req = ['slvnvdemo_fuelsys_officereq/fuel rate controller/'...
'Airflow calculation']
reqts = rmi('get', blk_with_req);
reqts.description = 'Mass airflow estimation';
addpath(fullfile(matlabroot,'toolbox','slrequirements',...
'slrequirementsdemos','fuelsys_req_docs'))
rmi('set', blk_with_req, reqts);
new_req = rmi('createempty');
new_req.doc = 'fuelsys_requirements2.htm';
new_req.description = 'New requirement';
rmi('cat', blk_with_req, new_req);
rmi('report', 'slvnvdemo_fuelsys_officereq');
  댓글 수: 1
Francesco Mecocci
Francesco Mecocci 2021년 10월 6일
Thanks for your answer, however I cannot achieve exactly what I need with the above commands. I have added further details to the question now. I'm after a command that opens the requirements perspective and/or the requirements manager APP.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Verification, Validation, and Test에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by