Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

setDestination

クラス: slreq.Link
名前空間: slreq

要件のリンク先の設定

R2019b 以降

構文

setDestination(myLink,dest)

説明

setDestination(myLink,dest) は、slreq.Link オブジェクト myLink のリンク先項目 dest を設定します。

入力引数

すべて展開する

リンクへのハンドル。slreq.Link オブジェクトとして指定します。

リンク先となる項目。Requirements Toolbox のリンク可能な項目として指定します。リンク可能な項目を参照してください。

Simulink ブロックをリンク先として設定

% Set the Gain block in model myModel as the destination for link myLink
setDestination(myLink, 'myModel/Gain');

Simulink Test オブジェクトをリンク先として設定

% Create a Simulink Test test file, test suite, and a test case
myTestfile = sltest.testmanager.TestFile('my_test_file.mldatx');
myTestsuite = sltest.testmanager.TestSuite(myTestfile,'My Test Suite');
myTestcase = sltest.testmanager.TestCase(myTestsuite,'equivalence','Equivalence Test Case');

% Create a link from the test case to requirement myReq
myLink = slreq.createLink(req, myTestcase);

% Set the link destination to the test suite
setDestination(myLink, myTestsuite);

Stateflow オブジェクトをリンク先として設定

% Get Stateflow Root Handle
rt = sfroot;

% Find the state with the name 'Intermediate'
myState = rt.find('-isa', 'Stateflow.State', 'Name', 'Intermediate');

% Set the destination for link myLink to myState
setDestination(myLink, myState);

Simulink データ ディクショナリ エントリをリンク先として設定

% Get handle to Simulink data dictionary entry
myDict = Simulink.data.dictionary.open('myDictionary.sldd');
dataSectObj = getSection(myDict,'Design Data');
myDictEntry = getEntry(dataSectObj,'myEntry');

% Set the destination for link myLink to myDictEntry
setDestination(myLink, myDictEntry);

バージョン履歴

R2019b で導入

参考