Main Content

Link Blocks and Requirements

You can track requirements implementation by linking requirements to model elements that implement the requirements. Linking also enables change notification, so that you can review and act on changes to requirements or models.

In this tutorial, link requirements to a model by using the model requirements perspective. Visual elements highlight links between requirements and blocks.

  1. Open the example project by entering

    slreqCCProjectStart

    Opencrs_controllerfrom themodelsfolder.

  2. In the model canvas, click the perspectives control in the lower-right corner.

  3. Open the requirements perspective by clicking theRequirementsicon.

    The Requirements Browser appears at the bottom of the model canvas. When you select a requirement, the Property Inspector displays the requirement's properties.

  4. 将要求链接到模型元素:

    1. In the Requirements Browser, search forEnable Switch Detection

    2. Link to theenblInportblock by clicking and dragging the requirement to the block. An annotation template appears.

    3. Place the requirement annotation by clicking on the canvas. Create a link without an annotation by clicking outside the canvas.

  5. The block displays a link badge. To display information about the requirement, click the badge and selectShow

    ClickingShowdisplays the requirement ID, requirement summary, and link type. For information on link types, seeRequirement Links

    • 需求描述,双击the annotation.

    • To edit the requirement, right-click the annotation and select选择需求浏览器。编辑属性检查器中的需求属性。

  6. Exit the requirements perspective. Click the perspectives control and click the requirements icon.

Work with万博1manbetxAnnotations

Convert万博1manbetxAnnotations to Requirements

You can convert the annotations in your Simulink®models to requirements by using the context menu in the Requirements Perspective View and by using the API. Seeslreq.convertAnnotationfor more information on converting annotations to requirements by using the API.

通过在需求观点中使用上下文菜单将注释转换为要求:

  1. Open the Simulink model and enter the Requirements Perspective View.

  2. Select a requirement set from the Requirements Browser. This is the destination requirement set for the new requirement.

  3. Right click the annotation you want to convert to a requirement and clickConvert to Requirement

  4. The annotation is converted to a requirement and is linked to the system or subsystem at which the annotation was present.

Link Requirements to万博1manbetxAnnotations

Use the Requirements Perspective View to link requirements to text and area annotations on the Simulink Editor. To create a link, select a requirement and drag it onto the annotation. If you link requirements to an area annotation, a badge appears on the annotation to show that the link was created. You see badges only in the Requirements Perspective View. To see more information about the requirement, click the badge and selectShow