フィルターのクリア

Can I find/see the requirement I linked inside a test sequence that is inside a test harness in Simulink with Matlab script?

2 ビュー (過去 30 日間)
I tried using the line of code below...
sltest.testsequence.readStep([model,'/Test Sequence'],steps{g})
...hoping to catch the linked requirement inside the Test Sequence step. However I only get the struct with the fields:
Name:
Action:
IsWhenStep:
IsWhenSubStep:
Description:
TransitionCount:
Is there a way I could try to see the requirement just through Matlab Script?
  1 件のコメント
Nikhil Boddula
Nikhil Boddula 2021 年 5 月 27 日
Even I'm trying for the same. Please post line of code how to catch the linked requirement inside the Test Sequence step if you have got resolved.

サインインしてコメントする。

回答 (1 件)

Raymond Estrada
Raymond Estrada 2023 年 2 月 10 日
Here's how you can do this via existing APIs (using our do178CaseStudyStart demo)
%Block path to test sequence diagram
myTS = 'AHRS_Voter_Harness_HLR_12/Test Sequence';
%extract steps
myTS_steps = sltest.testsequence.findStep("AHRS_Voter_Harness_HLR_12/Test Sequence");
%Get the Stateflow object for the Test Sequence block
tsObj = root.find("-isa", "Stateflow.ReactiveTestingTableChart", "Path", "AHRS_Voter_Harness_HLR_12/Test Sequence");
%Loop through all steps to extract requirement information
for ii=1:length(myTS_steps)
state_step = tsObj.find('-isa', 'Stateflow.State', 'Name', myTS_steps{ii}); %Stateflow object for the step "chart"
outlinks = slreq.outLinks(state_step); %Get outlinks for the step "chart"
dest = arrayfun(@(x) x.destination, outlinks{ii,1}); %Get the destination information
%Example of packaging the data
reqInfo.(myTS_steps{ii}).path = state_step.Path;
reqInfo.(myTS_steps{ii}).stepContent = state_step.LabelString;
reqInfo.(myTS_steps{ii}).reqLinks = dest{ii,1};
end

カテゴリ

Help Center および File ExchangeTest Execution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by