Main Content

systemcomposer.rptgen.finder.DictionaryResult Class

Namespace: systemcomposer.rptgen.finder
Superclasses: mlreportgen.finder.Result (MATLAB Report Generator)

Search result for dictionaries

Since R2022b

Description

Search result object for information about a dictionary in a System Composer™ architecture model.

The systemcomposer.rptgen.finder.DictionaryResult class is a handle class.

Creation

result = DictionaryResult creates a search result object for a dictionary that you find by using a systemcomposer.rptgen.finder.DictionaryFinder object.

Note

The find method of the systemcomposer.rptgen.finder.DictionaryFinder class creates a search result object for each dictionary that it finds. You do not need to create this object yourself.

Properties

expand all

Universal unique identifier (UUID) of result element, returned as a string.

Data Types: string

Name of dictionary, returned as a string.

Data Types: string

Type of dictionary, returned as "Model" for model dictionaries or "Dictionary" for reference dictionaries.

Data Types: string

Interfaces in dictionary, returned as an array of strings.

Data Types: string

Tag to associate with result, specified as a string. You can use this property to attach additional information to a result. You can set this property to any value that meets your requirements.

Data Types: string

Examples

collapse all

Use the DictionaryFinder, DictionaryResult, InterfaceFinder, and InterfaceResult classes to create a report that finds all dictionaries and interfaces in a given architecture model.

import mlreportgen.report.*
import slreportgen.report.*
import systemcomposer.rptgen.finder.*

Open the scKeylessEntrySystem project.

prj = openProject("scKeylessEntrySystem");
model_name = "KeylessEntryArchitecture";
mdl = systemcomposer.loadModel(model_name);

Create a report and append a title page and table of contents.

dataReport = slreportgen.report.Report(OutputPath=model_name + "_ArchitectureDataReport", ...
    CompileModelBeforeReporting=false);
append(dataReport,TitlePage(Title="Architectural Data in " + model_name));
append(dataReport,TableOfContents);

Create a chapter to contain all sections related to dictionaries.

dictionaryChapter = Chapter(Title="Dictionaries");

Find all dictionaries linked to the architecture model.

dictionaryFinder = DictionaryFinder(model_name);

while hasNext(dictionaryFinder)
    dictionary = next(dictionaryFinder);
    dictionarySection = Section(Title="Dictionary: " + dictionary.Name);
    append(dictionarySection, dictionary);    

Find all interfaces in the dictionary.

    interfaces = dictionary.Interfaces;
    for i=1:length(interfaces)
        interfaceFinder = InterfaceFinder(model_name);
        interfaceFinder.Filter = interfaces(i);
        interface = find(interfaceFinder);

Create a section for each interface in the dictionary.

        interfaceSection = Section(Title="Interface: " + interface.InterfaceName);
        append(interfaceSection, interface);
        append(dictionarySection, interfaceSection);
    end

    append(dictionaryChapter,dictionarySection);
end

Append the chapter to the report and view the generated report.

append(dataReport,dictionaryChapter);
close(dataReport);
rptview(dataReport);

Version History

Introduced in R2022b