slreq.generateTraceabilityDiagram
说明
slreq.generateTraceabilityDiagram(
创建一个源自 startingItem
)startingItem
的可追溯性图。如果指定项的可追溯性图已经打开,则该图将显示在前景中。
示例
根据需求创建可追溯性图
此示例显示如何从需求对象创建可追溯性图。
打开 ShortestPath
工程。加载shortest_path_func_reqs
需求集。
openProject("ShortestPath"); slreq.load("shortest_path_func_reqs");
打开 MATLAB® 代码文件 shortest_path.m
和 graph_unit_tests.m
。
open("shortest_path.m"); open("graph_unit_tests.m");
查找需求 2.1.1。
req = slreq.find(Type="Requirement",Index="2.1.1");
为Enable Switch Detection
需求创建可追溯性图。
slreq.generateTraceabilityDiagram(req)
从链接创建可追溯性图
此示例显示如何从链接对象创建可追溯性图。
打开 ShortestPath
工程。加载shortest_path_func_reqs
需求集。
openProject("ShortestPath"); rs = slreq.load("shortest_path_func_reqs");
获取 shortest_path
链接集的句柄。
myLinkSet = slreq.find(Type="LinkSet",Name="shortest_path");
返回链接集中的链接数组。获取链接集中第 10 个链接的句柄。
myLinks = getLinks(myLinkSet); myLink = myLinks(10);
从链接创建可追溯性图。
slreq.generateTraceabilityDiagram(myLink)
根据需求集创建可追溯性图
此示例显示如何根据需求集创建可追溯性图。
打开 ShortestPath
工程。加载shortest_path_tests_reqs
需求集。
openProject("ShortestPath"); rs = slreq.load("shortest_path_tests_reqs");
为shortest_path_tests_reqs
需求集创建可追溯性图。
slreq.generateTraceabilityDiagram(rs)
从链接集创建可追溯性图
此示例显示如何从链接集创建可追溯性图。
打开 ShortestPath
工程。加载shortest_path_tests_reqs
需求集。
openProject("ShortestPath"); rs = slreq.load("shortest_path_tests_reqs");
获取 graph_unit_tests
链接集的句柄。
ls = slreq.find(Type="LinkSet",Name="graph_unit_tests");
为链接集创建可追溯性图。
slreq.generateTraceabilityDiagram(ls)
关闭链接集和可追溯性图窗口。
输入参数
startingItem
— 图的起始项
slreq.Requirement
对象 | slreq.Reference
对象 | slreq.Justification
对象 | slreq.Link
对象 | slreq.ReqSet
对象 | slreq.LinkSet
对象 | 字符串标量 | 字符向量
版本历史记录
在 R2021b 中推出
另请参阅
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)