Contenuto principale

systemcomposer.profile.Style

Style for stereotype

Since R2026a

    Description

    A Style object represents stereotype styles in a profile for a System Composer™ model.

    Creation

    Add a stereotype to a profile using the addStereotype function. Then, modify the ElementStyle property of the Stereotype object using a Style object.

    profile = systemcomposer.profile.Profile.createProfile("profileName");
    addStereotype(profile,"stereotypeName");

    Properties

    expand all

    Stereotype from which style inherits properties, specified as a systemcomposer.profile.Stereotype object.

    Element color, specified as a 1-by-3 uint32 row vector in the form [Red Green Blue].

    Example: [206 232 246]

    Data Types: uint32

    Connector line style, specified as a character vector or string. Options include:

    • "Default"

    • "Dot"

    • "Dash"

    • "Dash Dot"

    • "Dash Dot Dot"

    This property is valid only for connector stereotypes.

    Data Types: char | string

    Icon name for stereotype, specified as a string. Options include:

    • "default"

    • "application"

    • "channel"

    • "controller"

    • "database"

    • "devicedriver"

    • "memory"

    • "network"

    • "plant"

    • "sensor"

    • "subsystem"

    • "transmitter"

    This property is only valid for component stereotypes. Use the AppliesTo property to set the element a stereotype applies to.

    Data Types: string

    Examples

    collapse all

    Create a profile for latency characteristics, and save the profile.

    profile = systemcomposer.profile.Profile.createProfile("LatencyProfile");
    
    latencybase = profile.addStereotype("LatencyBase");
    latencybase.addProperty("latency",Type="double");
    latencybase.addProperty("dataRate",Type="double",DefaultValue="10");
    
    connLatency = profile.addStereotype("ConnectorLatency",...
    Parent="LatencyProfile.LatencyBase");
    connLatency.addProperty("secure",Type="boolean");
    connLatency.addProperty("linkDistance",Type="double");
    
    nodeLatency = profile.addStereotype("NodeLatency",...
    Parent="LatencyProfile.LatencyBase");
    nodeLatency.addProperty("resources",Type="double",DefaultValue="1");
    
    portLatency = profile.addStereotype("PortLatency",...
    Parent="LatencyProfile.LatencyBase");
    portLatency.addProperty("queueDepth",Type="double");
    portLatency.addProperty("dummy",Type="int32");
    
    profile.save

    Specify the LatencyProfile.NodeLatency stereotype as a component stereotype.

    nodeLatency.AppliesTo = "Component";

    Get the systemcomposer.profile.Style object from the nodeLatency stereotype. Then, apply a stereotype color and icon to the Style object.

    nodeLatency.ElementStyle.Color = [0 100 255];
    nodeLatency.ElementStyle.Icon = "application";
    profile.save

    Any components with the nodeLatency stereotype are styled with the specified color and icon.

    Create a model, apply the profile to the model, and add a component. Apply the stereotype on the component. Then, open the Profile Editor.

    modelName = "archModel";
    arch = systemcomposer.createModel(modelName);
    systemcomposer.openModel(modelName);
    arch.applyProfile("LatencyProfile");
    newComponent = addComponent(arch.Architecture,"Component");
    newComponent.applyStereotype("LatencyProfile.NodeLatency");
    systemcomposer.profile.editor(profile)

    More About

    expand all

    Version History

    Introduced in R2026a