Package: slreq
Superclasses:
Work with link objects
When you establish a traceable association between artifacts, Simulink®
Requirements™ creates an slreq.Link
object to store source and
destination data of the link.
link = slreq.createLink(
creates an src
, dest
)slreq.Link
object link
with source and
destination artifacts specified by src
and
dest
respectively. The slreq.Link
object is
stored in the Link set file that belongs to src
.
outLinks = slreq.outLinks(
returns an
array of src
)slreq.Link
objects outLinks
that contains
the outgoing links from the source artifact src
.
inLinks = slreq.inLinks(
returns an
array of dest
)slreq.Link
objects inLinks
that contains
the incoming links to the destination artifact dest
.
destination | Get link destination artifact |
getAttribute | Get link custom attributes |
isResolved | Check if the link is resolved |
isResolvedDestination | Check if the link destination is resolved |
isResolvedSource | Check if the link source is resolved |
linkSet | Return parent link set |
remove | Delete links |
setAttribute | Set link custom attributes |
setDestination | Set requirement link destination |
setSource | Set requirement link source |
source | Get link source artifact |
% Create a link between the current Simulink Object and a requirement link1 = slreq.createLink(gcb, REQ) link1 = Link with properties: Type: 'Implement' Description: 'Plant Specs' Keywords: [0×0 char] Rationale: '' CreatedOn: 02-Sep-2017 15:49:28 CreatedBy: 'Jane Doe' ModifiedOn: 21-Oct-2017 11:34:12 ModifiedBy: 'John Doe' Comments: [0×0 struct] % Create a link between a requirement and the current Stateflow object link2 = slreq.createLink(REQ, sfgco);
% Get the handle to a requirements set myReqSet = slreq.find('Type', 'ReqSet', 'Name', 'Design_Spec'); % Get the handle to a requirement in myReqSet myReq = find(myReqSet, 'Type', 'Requirement', 'Id', 'R1.1'); % Query incoming links to myReq inLinks = slreq.inLinks(myReq);
% Load a link set and get link sources myLinkSet = slreq.load('c5.slx'); allSrcs = myLinkSet.sources(); % Get outgoing links myLink = slreq.outLinks(allSrcs(1));