Contenido principal

saveToDictionary

Save interfaces to dictionary

    Description

    saveToDictionary(model,dictionaryName) saves all locally defined interfaces to a shared dictionary, and links the model to the shared dictionary with a .sldd extension.

    example

    saveToDictionary(dictionary,dictionaryName) saves all locally defined interfaces to a shared dictionary with an SLDD extension.

    saveToDictionary(___,CollisionResolutionOption=collision) specifies a collision resolution option collision in addition to the input arguments in previous syntaxes.

    Examples

    collapse all

    Create a model and a shared dictionary. Add an interface to the model's interface dictionary, and add an element. Save all interfaces defined in the model to the shared dictionary.

    arch = systemcomposer.createModel("newModel");
    dictionary = systemcomposer.createDictionary("myInterfaces.sldd");
    interface = addInterface(arch.InterfaceDictionary,"newSignal");
    element = addElement(interface,"newElement",Type="double");
    saveToDictionary(arch,"myInterfaces")

    Input Arguments

    collapse all

    Architecture model, specified as a systemcomposer.arch.Model object.

    Data dictionary, specified as a systemcomposer.interface.Dictionary object. For information on how to create a data dictionary, see createDictionary.

    Dictionary name, specified as a character vector or string. If a dictionary with this name does not exist, one will be created.

    Example: "myInterfaces"

    Data Types: char | string

    Option to resolve interface collisions between the local model data dictionary and the shared data dictionary linked to the model, specified as one of these values:

    • systemcomposer.interface.CollisionResolution.USE_MODEL prioritizes interface duplicates using the local interfaces defined in the model.

    • systemcomposer.interface.CollisionResolution.USE_DICTIONARY prioritizes interface duplicates using the interfaces defined in the shared dictionary.

    Note

    If interface collisions are present and you do not specify a value for the CollisionResolutionOption name-value argument, the saveToDictionary function generates an error and prompts specification.

    Example: saveToDictionary(arch,"MyInterfaces",CollisionResolutionOption=systemcomposer.interface.CollisionResolution.USE_DICTIONARY)

    Data Types: enum

    More About

    collapse all

    Version History

    Introduced in R2019b

    See Also

    Functions

    Objects

    Blocks

    Tools