setDestination

Класс: slreq.Link
Пакет: slreq

Установите место назначения ссылки требования

Синтаксис

setDestination(myLink,dest)

Описание

setDestination(myLink,dest) устанавливает целевой артефакт ссылки dest для slreq.Link объект myLink.

Входные параметры

развернуть все

Обработайте к ссылке в виде slreq.Link объект.

Артефакт, чтобы служить местом назначения ссылки в виде Simulink Requirements связываемый элемент. Смотрите Связываемые Элементы.

Примеры

Установите блоки 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
Для просмотра документации необходимо авторизоваться на сайте