Main Content

Create Architecture Views Interactively

The structural hierarchy of a system typically differs from the hierarchy of the functional requirements of a system. With architecture views in System Composer™, you can view a system based on different hierarchies.

Aviewshows a customizable subset of elements in a model. Views can be filtered based on stereotypes or names of components, ports, and interfaces, along with the name, type, or units of an interface element. Create views by adding elements manually. Views create a simplified way to work with complex architectures by focusing on certain parts of the architectural design.

You can use different types of views to represent the system:

  • 操作视图demonstrate how a system will be used and should be integrated with requirements analysis.

  • Functional viewsfocus on what the system must do to operate.

  • Physical viewsshow how the system is constructed and configured.

A viewpoint represents a stakeholder perspective that specifies the contents of the view.

For example, you can author a system using requirements. A view allows you to better understand what components you need to satisfy your requirements while not necessarily focusing on the structure.

This example uses the architecture model for a keyless entry system to create component diagram views.

Acomponent diagramrepresents a view with components, ports, and connectors based on how the model is structured.

Component diagrams allow you to programmatically or manually add and remove components from the view.

For more information on the keyless entry system architecture, seeModeling System Architecture of Keyless Entry System.

Create Filtered Views with Component Filters and Port Filters

  1. In the MATLAB®Command Window, enter this command.

    scKeylessEntrySystem
    The architecture model opens in System Composer.

  2. Navigate toModeling>Architecture Viewsto open theArchitecture Views Gallery.

    The Architecture Views Gallery shows the option to create a new view.

  3. SelectNew>Viewto create a new view.

  4. InView Propertieson the right pane, in theNamebox, enter a name for this view, for example,Software Component Review. Choose aColorand enter aDescription, if necessary.

    A new view called software component review.

  5. In the bottom pane, selectView Configurations>Filter>Add Component Filterto add a form-based criterion to a component filter.

  6. From theSelectlist, selectComponents. From theWherelist, selectStereotype. Selectisa. In the text box, from the list selectAutoProfile.SoftwareComponent.

    The view configurations filter query display with a component filter.

  7. SelectApplyApply.

    An architecture view is created using the query in theComponent Filterbox. The view is filtered to select all components with theAutoProfile.SoftwareComponentstereotype applied to them.

    The updated view after applying the component query.

  8. SelectAdd Component Filter. From theSelectlist, selectComponents. From theWherelist, selectName. Select~contains. In the text box, enter"Door Lock". Select theAuto Applycheck box so that future changes are applied without selectingApply.

    The view configurations filter query display with two component filters.

  9. An architecture view is created using the additional query in theComponent Filterbox. The view is filtered to select all components not named"Door Lock".

    View filtered without door lock components.

  10. From theAdd Port Filterlist, select the optionHide Unconnected Ports.

    The view configurations filter query display with two component filters and a port filter.

  11. An architecture view is created using the additional query in thePort Filterbox. The view is filtered to hide unconnected ports.

    The updated view after applying the port query.

  12. 删除the port filter. Pause on the constraint and select thedeletebutton.

Add Group By Criteria to Filtered Views

  1. In the View Configurations pane, selectGrouping.

  2. To choose a property enumeration for grouping, clickAdd Group By.

  3. From the list, selectAutoProfile.BaseComponent.ReviewStatus.

  4. ClickAdd Group Byagain.

  5. From the list, selectAutoProfile.SoftwareComponent.ImplementationLanguage.

  6. ClickApply.

    The grouped view.

Interactively Add and Remove Elements from Views

  1. To add more components to the view, drag and drop components fromModel Components. Drag and drop theLighting Systemcomponent to theSoftware Component Reviewview. Alternatively, clickAddon the toolstrip. You can also pressCtrl+Ito add component instantiations to your view when they are selected.

    Note

    Interactively adding and removing elements from your view with an associated query is not supported. You will receive a warning message: Remove associated query? PressOKto proceed.

    The display on the views editor shows clicking and dragging the lighting system component into the view.

    You can press删除to delete components from the view.

  2. Observe that theLighting Systemcomponent has been added to the view.

    The view now includes the lighting system component.

    This view is now considered a freeform view.

Add or Remove Requirements Links from Views

  1. Navigate toRequirement>Requirements Manager. A Requirements Toolbox™ license is required. TheRequirement Linkstab appears at the bottom of theSoftware Component Reviewview.

  2. Select theLighting Controllercomponent and observe the linked requirementAutomatically turn off headlights.

    The automatically turn off headlights requirement link appears below the view.

  3. Select the requirementAutomatically turn off headlightsto open the Requirements Editor to view or modify requirement links.

  4. In theArchitecture Views Gallery, navigate toRequirement>Open Requirements Editorif the Requirements Editor is not open already.

  5. Select theShould unlock doorrequirement.

  6. Return to theArchitecture Views Gallery. In theSoftware Component Reviewview, select theLighting Controllercomponent.

  7. Navigate toRequirement>Link to selected requirement. The new requirementShould unlock dooris added.

    The requirement links in the views gallery show that 'Should unlock door' has been added.

  8. To remove a requirement link, selectdeleteand confirm deletion.

Add Custom Clauses to Component Filters and Port Filters

  1. SelectNew>Viewto create a new view.

  2. InView Propertieson the right pane, in theNamebox, enter a name for this view, for example,Hardware Component View. Choose aColorand enter aDescription, if necessary.

  3. In the bottom pane, underView Configurations>Filter, select from the listAdd Component Filter>Add Custom Component Filterto enter a constraint by which to filter. In the box, entercontains(Property('Name'),'Dashboard').

  4. In the bottom pane, underView Configurations>Filter, select from the listAdd Port Filter>Add Custom Port Filterto enter a constraint by which to filter. In the box, entercontains(Property('Name'),'sound').

  5. SelectApplyapply.

    Hardware component view with component filter and port filter constraints applied.

    The view is filtered using the constraints in the custom filters. For more information on structuring constraints, seesystemcomposer.query.Constraint.

Related Topics