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.

A view shows 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. Switch between a component diagram, component hierarchy, or architecture hierarchy. For software architectures, you can switch to a class diagram view.

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.

A component diagram represents 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 architecture, see Modeling 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 to Modeling > Architecture Views to open the Architecture Views Gallery.

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

  3. Select New > View to create a new view.

  4. In View Properties on the right pane, in the Name box, enter a name for this view, for example, Software Component Review. Choose a Color and enter a Description, if necessary.

    A new view called software component review.

  5. In the bottom pane on View Configurations, from the Filter tab, click Add Component Filter to add new form-based criterion to a component filter.

  6. From the Select list, select Components. From the Where list, select Stereotype. Select isa. In the text box, from the list select AutoProfile.SoftwareComponent.

    The view configurations filter query display with a component filter.

  7. Select Apply Apply.

    An architecture view is created using the query in the Component Filter box. The view is filtered to select all components with the AutoProfile.SoftwareComponent stereotype applied to them.

    The updated view after applying the component query.

  8. Select Add Component Filter. From the Select list, select Components. From the Where list, select Name. Select ~contains. In the text box, enter "Door Lock". Select the Auto Apply check box so that future changes are applied without selecting Apply.

    The view configurations filter query display with two component filters.

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

    View filtered without door lock components.

  10. From the Add Port Filter list, select the option Hide 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 the Port Filter box. The view is filtered to hide unconnected ports.

    The updated view after applying the port query.

  12. Delete the port filter. Pause on the constraint and select the delete button.

Add Group By Criteria to Filtered Views

  1. In the View Configurations pane, select Grouping.

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

  3. From the list, select AutoProfile.BaseComponent.ReviewStatus.

  4. Click Add Group By again.

  5. From the list, select AutoProfile.SoftwareComponent.ImplementationLanguage.

  6. Click Apply.

    The grouped view.

Edit Views Interactively

With the Architecture Views Gallery tool, you can edit and rearrange your view layout interactively.

  • Click and drag components anywhere inside or outside the views canvas. Resize components inside and outside the views canvas. The views canvas expands to accommodate the moves.

  • Move and resize a parent component with its children. Rearrange child components inside a parent component. After moving a child component, the parent component expands to accommodate the change.

  • When a moved or resized component partially overlaps another component, the system is highlighted to indicate an incorrect final state.

  • Click and drag around a region to select multiple components and manipulate them together.

  • Double-click a component on the Model Components browser to add the component to the diagram. Right-click a component on the Model Components browser for additional options.

  • Undo or redo interactive edits on the views canvas.

Follow these steps to add or delete elements from a view using the Model Components browser.

  1. To add more components to the view, drag and drop components from Model Components. Drag and drop the Lighting System component to the Software Component Review view. Alternatively, click Add on the toolstrip. You can also press Ctrl+I to add component instantiations to your view when you select them.

    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? Click OK to proceed.

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

    You can press Delete to delete components from the view.

  2. Observe that the Lighting System component 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 to Requirement > Requirements Manager. A Requirements Toolbox™ license is required. The Requirement Links tab appears at the bottom of the Software Component Review view.

  2. Select the Lighting Controller component and observe the linked requirement Automatically turn off headlights.

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

  3. Select the requirement Automatically turn off headlights to open the Requirements Editor to view or modify requirement links.

  4. In the Architecture Views Gallery, navigate to Requirement > Open Requirements Editor if the Requirements Editor is not open already.

  5. Select the Should unlock door requirement.

  6. Return to the Architecture Views Gallery. In the Software Component Review view, select the Lighting Controller component.

  7. Navigate to Requirement > Link to selected requirement. The new requirement Should unlock door is added.

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

  8. To remove a requirement link, select delete and confirm deletion.

Add Custom Clauses to Component Filters and Port Filters

  1. Select New > View to create a new view.

  2. In View Properties on the right pane, in the Name box, enter a name for this view, for example, Hardware Component View. Choose a Color and enter a Description, if necessary.

  3. In the bottom pane on View Configurations, from the Filter tab, select from the list Add Component Filter > Add Custom Component Filter to enter a constraint by which to filter. In the box, enter contains(Property('Name'),'Dashboard').

  4. In the bottom pane on View Configurations, from the Filter tab, select from the list Add Port Filter > Add Custom Port Filter to enter a constraint by which to filter. In the box, enter contains(Property('Name'),'sound').

  5. Select Apply apply.

    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, see systemcomposer.query.Constraint.

See Also

Objects

Functions

Tools

Related Topics