Main Content

本页采用了机器翻译。点击此处可查看英文原文。

parent

类: slreq.Requirement
命名空间: slreq

查找需求的父项

语法

parentObj = parent(req)

说明

parentObj = parent(req) 返回 slreq.Requirement 对象 req 的父对象 parentObj

输入参数

全部展开

需求指定为 slreq.Requirement 对象。

输出参量

全部展开

需求 req 的父级,作为 slreq.Requirement 对象或 slreq.ReqSet 对象返回。

示例

查找需求的父对象

% Load a requirement set file and add two new requirements
 
rs = slreq.load('C:\MATLAB\My_Requirements_Set_1.slreqx');
req1 = add(rs, 'Id', '5', 'Summary' , 'Additional Requirement'); 
req2 = add(req1, 'Id', '5.1', 'Summary' , 'Additional Child Requirement');

% Find the parent of req2
parentReq1 = parent(req2)

parentReq1 = 

  Requirement with properties:

             Id: '5'
        Summary: 'Additional Requirement'
       Keywords: [0×0 char]
    Description: ''
      Rationale: ''
            SID: 10
      CreatedBy: 'John Doe'
      CreatedOn: 05-Oct-2007 16:09:38
     ModifiedBy: 'Jane Doe'
     ModifiedOn: 21-Dec-2016 11:10:05
       Comments: [0×0 struct]

% Find the parent of req1
parentReq2 = parent(req1)

parentReq2 = 

  ReqSet with properties:

             Description: ''
                    Name: 'My_Requirements_Set_1'
                Filename: 'C:\MATLAB\My_Requirements_Set_1.slreqx'
                Revision: 6
                   Dirty: 1
    CustomAttributeNames: {}

版本历史记录

在 R2018a 中推出