主要内容

SystemComposer.View.View

体系结构视图

    描述

    AView对象用于管理系统Composer™模型的体系结构视图。

    Creation

    使用createViewfunction.

    objView = createView(objModel)

    Properties

    展开全部

    视图名称, specified as a character vector.

    例子:'NewView'

    Data Types:char

    定义视图的根元素组,指定为SystemComposer.View.ElementGroup目的。

    视图所属的架构模型,指定为SystemComposer.arch.model目的。

    通用唯一标识符用于视图,指定为字符向量。

    例子:'91d5de2c-b14c-4c76-a5d6-5dd0037c52df'

    Data Types:char

    选择查询与视图相关联,指定为systemcomposer.query.Constraint目的。

    分组标准, specified as a string array of properties in the form'..'

    例子:{"AutoProfile.MechanicalComponent.mass","AutoProfile.MechanicalComponent.cost"}

    视图体系结构的颜色,指定为字符向量。颜色可以是名字'蓝色的','black', or'绿色', or it can be an RGB value encoded in a hexadecimal string:'#ff00ff'或者'#dddddd'。An invalid color results in an error.

    例子:color = get(objViewArchitecture,'Color')

    查看体系结构的描述, specified as a character vector.

    例子:description = get(objView,'Description')

    例子:set(objview,“描述”,描述)

    Data Types:char

    是否包括指定为逻辑的引用模型。

    例子:包括= get(objview,'includeFerenceModels')

    Data Types:logical

    Object Functions

    modifyQuery 修改架构查看查询和属性分组
    弹奏 重新运行的体系结构查看模型查询
    删除 Remove architecture view query
    破坏 Remove model element

    例子

    全部收缩

    Use a keyless entry system to programmatically create architecture views.

    1. Import the package with queries.

    importsystemcomposer.query.*

    2.为无钥匙进入系统打开万博1manbetxSimulink®项目文件。

    scKeylessEntrySystem

    3.将示例模型加载到System Composer™中。

    model = systemcomposer.loadModel("KeylessEntryArchitecture");

    示例1:硬件组件评论状态视图

    Create a filtered view that selects all hardware components in the architecture model and groups them using the评论斯塔图斯property.

    1. Construct a query to select all hardware components.

    hwCompQuery = HasStereotype(IsStereotypeDerivedFrom(“AutoProfile。HardwareComponent”);

    2.使用查询创建视图。

    model.Createview("Hardware Component Review Status",。。。Select=hwCompQuery,。。。通过...分组={'AutoProfile.basecomponent.reviewStatus'},,。。。includeferencemodels = true,。。。颜色=“紫色的”);

    3.打开架构查看画廊Viewssection, clickArchitecture Views

    model.openViews

    Example 2: FOB Locator System Supplier View

    Create a freeform view that manually pulls the components from the FOB Locator System and groups them using existing and new view components for the suppliers. In this example, you will useelement groups, groupings of components in a view, to programmatically populate a view.

    1.创建一个视图体系结构。

    fobsupplierview = model.Createview(“ FOB定位器系统供应商故障”,。。。颜色=“浅蓝”);

    2.添加一个称为的子组供应商d。添加FOB定位器模块to the view element subgroup.

    supplierD = fobSupplierView.Root.createSubGroup("Supplier D");supplierD.addElement(“ KeylessEnserryRarchitecture/fob定位器系统/FOB定位器模块”);

    3.创建一个新的子组供应商a

    suppliera = fobsupplierview.root.createsubgroup("Supplier A");

    4.添加每个FOB接收器以查看元素子组。

    foblocatorsystem = model.lookup("Path","KeylessEntryArchitecture/FOB Locator System");

    Find all the components which contain the name"Receiver"

    接收comppaths = model.find(。。。contains(Property(“姓名”),"Receiver"),。。。foblocatorsystem.Architecture);suppriera.addelement(接收库PPPATHS)

    5.保存模型。

    模型

    More About

    展开全部

    Version History

    在R2021a中引入