主要内容

copySimulationSettings

类: sltest.testmanager.TestCase
命名空间: sltest.testmanager

复制等效性测试用例中的仿真设置

语法

copySimulationSettings(tc,fromSimIndex,toSimIndex)

说明

copySimulationSettings(tc,fromSimIndex,toSimIndex) 将等效性测试用例内的仿真设置从一个仿真编号复制到另一个仿真编号。此函数仅适用于等效性测试用例类型。

输入参数

全部展开

您要在其中复制仿真设置的等效性测试用例,指定为 sltest.testmanager.TestCase 对象。

您要从中复制设置的仿真编号,指定为整数 12。这是源仿真。

您要将设置复制到的仿真编号,指定为整数 12。这是目标仿真。

示例

全部展开

% Open the model for this example
openExample('sldemo_absbrake');

% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'equivalence','Equivalence Test Case');

% Remove the default test suite
tsDel = getTestSuiteByName(tf,'New Test Suite 1');
remove(tsDel);

% Assign the system under test to the test case
% for Simulation 1 and Simulation 2
setProperty(tc,'Model','sldemo_absbrake','SimulationIndex',1);
setProperty(tc,'Model','sldemo_absbrake','SimulationIndex',2);

% Change simulation stop time in Simulation 1
setProperty(tc,'StopTime',100,'SimulationIndex',1);

% Copy simulation setting to Simulation 2
copySimulationSettings(tc,1,2);

版本历史记录

在 R2015b 中推出