systemcomposer.view.ElementGroup - Architecture view element group - MATLAB (original) (raw)

Main Content

Architecture view element group

Since R2021a

Description

An ElementGroup object is used to manage element groups in architecture views for a System Composer™ model.

Properties

expand all

Name of element group, specified as a character vector.

Example: 'NewElementGroup'

Data Types: char

Universal unique identifier, specified as a character vector.

Example: '91d5de2c-b14c-4c76-a5d6-5dd0037c52df'

Data Types: char

Object Functions

Examples

collapse all

Use a keyless entry system architecture model to programmatically create views.

Import the namespace with queries.

import systemcomposer.query.*

Open the Simulink® project file for the keyless entry system.

openProject("scKeylessEntrySystem");

Load the example model into System Composer™.

model = systemcomposer.loadModel("KeylessEntryArchitecture");

Hardware Component Review Status View

Create a view that selects all hardware components in the architecture model and groups them using the ReviewStatus property.

1. Construct a query to select all hardware components.

hwCompQuery = HasStereotype(IsStereotypeDerivedFrom("AutoProfile.HardwareComponent"));

2. Use the query to create a view.

model.createView("Hardware Component Review Status",... Select=hwCompQuery,... GroupBy={'AutoProfile.BaseComponent.ReviewStatus'},... IncludeReferenceModels=true,... Color="purple");

3. To open the Architecture Views Gallery the Modeling section, click Architecture Views.

Hardware component review status component diagram view.

FOB Locater System Supplier View

Create a view with components from the FOB Locater System and group them using existing and new view components for the suppliers. In this example, you will use element groups, groupings of components in a view, to programmatically populate a view.

1. Create a view architecture.

fobSupplierView = model.createView("FOB Locater System Supplier Breakdown",... Color="lightblue");

2. Add a subgroup called Supplier D. Add the FOB Locater Module to the view element subgroup.

supplierD = fobSupplierView.Root.createSubGroup("Supplier D"); supplierD.addElement("KeylessEntryArchitecture/FOB Locater System/FOB Locater Module");

3. Create a new subgroup for Supplier A.

supplierA = fobSupplierView.Root.createSubGroup("Supplier A");

4. Add each of the FOB Receivers to the view element subgroup.

FOBLocaterSystem = model.lookup("Path","KeylessEntryArchitecture/FOB Locater System");

Find all the components which contain the name Receiver.

receiverCompPaths = model.find(... contains(Property("Name"),"Receiver"),... FOBLocaterSystem.Architecture);

supplierA.addElement(receiverCompPaths)

FOB locater system supplier view component diagram.

More About

expand all

Term Definition Application More Information
View 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. Create Custom Views Using Architecture Views GalleryModeling System Architecture of Keyless Entry System
Element group An element group is a grouping of components in a view. Use element groups to programmatically populate a view. Create Architecture Views InteractivelyCreate Architecture Views Programmatically
Query A query is a specification that describes certain constraints or criteria to be satisfied by model elements. Use queries to search elements with constraint criteria and to filter views. Find Elements in Model Using Queries
Component diagram 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. Inspect Components in Custom Architecture Views
Hierarchy diagram You can visualize a hierarchy diagram as a view with components, ports, reference types, component stereotypes, and stereotype properties. Component hierarchy diagrams display components in tree form with parents above children. In a component hierarchy view, each referenced model is represented as many times as it is used. Architecture hierarchy diagrams display unique component architecture types and their relationships using composition connections. In an architecture hierarchy view, each referenced model is represented only once. Display Component Hierarchy and Architecture Hierarchy Using Views

Version History

Introduced in R2021a

See Also

Tools

Functions

Objects

Topics