Main Content

isFilteredIn

Class: slreq.Reference
Namespace: slreq

Check filtered referenced requirements

Since R2022b

Syntax

tf = isFilteredIn(ref)

Description

tf = isFilteredIn(ref) checks if the referenced requirement, ref, is filtered in the Requirements Editor or Requirements Perspective and returns 1 if the referenced requirement is not filtered and 0 if the referenced requirement is filtered.

Input Arguments

expand all

Referenced requirement, specified as a slreq.Reference object.

Examples

expand all

This example shows how to check if a referenced requirement is filtered.

Load the crs_req requirement set.

rs = slreq.open("crs_req");

Find the requirement with Summary set to Overview.

ref = find(rs,Summary="Overview");

Check if the referenced requirement is filtered.

tf = isFilteredIn(ref)
tf = logical
   1

Create a filter called ContainerReqs. Use the ReqFilter property to define a filter that displays only requirements with Type set to Container.

myView = slreq.View.create("ContainerReqs");
myView.ReqFilter = "{'ReqType','Container'};"
myView = 
  View with properties:

          Name: 'ContainerReqs_0'
     ReqFilter: '{'ReqType','Container'};'
    LinkFilter: ''
          Host: ''

Apply the filter, then check if the referenced requirement is filtered.

activate(myView)
tf = isFilteredIn(ref)
tf = logical
   0

Clear the loaded requirement sets and close the Requirements Editor.

slreq.clear;

Tips

  • To check if a requirement is filtered, use the isFilteredIn method of slreq.Requirement. To check if a justification is filtered, use the isFilteredIn method of slreq.Justification. To check if a link is filtered, use the isFilteredIn method of slreq.Link.

Version History

Introduced in R2022b