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
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
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Inputs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!