Main Content

setDefaultStereotype

Set default stereotype for profile

    Description

    setDefaultStereotype(profile,name) sets the default stereotype with name name for a profile profile. The stereotype must apply to components.

    example

    Examples

    collapse all

    Create a profile for latency characteristics and save it.

    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

    Set the default stereotype.

    profile.setDefaultStereotype("NodeLatency")

    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)

    Get stereotypes on the root architecture.

    stereotypes = getStereotypes(arch.Architecture)
    stereotypes =
    
      1×1 cell array
    
        {'LatencyProfile.NodeLatency'}

    Input Arguments

    collapse all

    Profile, specified as a systemcomposer.profile.Profile object.

    Stereotype name, specified as a character vector or string. The name of the stereotype must be unique within the profile.

    Example: "electricalComponent"

    Data Types: char | string

    More About

    collapse all

    Version History

    Introduced in R2019a