主要内容

分析模型依赖性

Examine models, subsystems, and libraries referenced directly or indirectly by the model using the Dependency Analyzer. Use the dependency graph to identify all required files and products. To package, share, or put your design under source control, create a project from your model. For more details, see从依赖关系图创建项目

Open and Explore Dependency Graph

1.打开sldemo_mdlref_depgraphmodel.

2. To open the model dependency graph, on theModeling选项卡,单击向下箭头以展开Designsection. UnderDependencies, 点击Dependency Analyzer

依赖关系分析仪使用Model Hierarchy默认情况下查看。要切换到模型实例视图Viewssection, click模型实例。有关更多详细信息,请参阅模型依赖性视图

After you run the first dependency analysis, subsequent analyses incrementally update the results. The Dependency Analyzer determines which files changed since the last analysis and updates the dependency data for those files. To perform a complete analysis, in the Dependency Analyzer, select分析>重新分析所有

要分析附加组件内的依赖项,请选择分析>附加组件。For more details about available options, see分析范围

3.查看依赖项水平布置Layoutsection, click水平的

4.在依赖图图中,双击一个框以打开Simulink®编辑器中的相应模型。金宝app

5. To see more information about how two files are related, select their dependency arrow. In theProperties窗格,在Details部分,您可以看到您正在检查的文件的完整路径,依赖关系类型以及依赖性的何处。

6. To open the file and highlight where the dependency is introduced, in theDetails部分,单击下面的链接受影响

例如,打开sldemo_mdlref_depgraphmodel and highlight where the dependency tosldemo_mdlref_houseis introduced, select the dependency arrow betweensldemo_mdlref_depgraphsldemo_mdlref_house。在里面Propertiespane on the right, under受影响, 点击house

模型依赖性视图

You can explore model dependencies using the model hierarchy or the model instances views.

模型层次结构视图

TheModel Hierarchy视图显示了顶部模型引用的模型,子系统,库和数据字典文件。

  • 即使在模型中多次引用一次引用一次,引用文件也仅在视图中出现一次。

  • Blue boxes represent model files, red boxes represent libraries, and yellow boxes represent subsystem references. Arrows represent dependencies. For example, the arrows in this example indicate that theAERO_GUIDANCEmodel references two libraries:aerospace金宝appsimulink_need_slupdate

  • An arrow from a library that points to itself indicates that the library references itself. Blocks in the library reference other blocks in that same library. The example view shows that the librariesaerospace金宝appsimulink_need_slupdate自己参考。

  • Dark red boxes represent protected models (。slxp文件)。您不能打开或编辑受保护的引用模型。看Reference Protected Models from Third Parties

模型实例视图

The模型实例view shows every reference to a model in a model reference hierarchy with the top model at the root of the hierarchy. Boxes represent the top model and its references. SeeModel References

  • 如果模型层次结构多次引用相同的模型,则引用模型在实例视图中多次出现,一次用于每个引用。此示例图显示了模型参考层次结构sldemo_mdlref_depgraph包含两个对模型的引用sldemo_mdlref_F2C

  • Yellow boxes represent accelerated-mode instances, red boxes represent normal-mode instances, purple boxes represent processor-in-the-loop mode instances, and green boxes represent software-in-the-loop mode instances. SeeChoose Simulation Modes for Model Hierarchies

    前面的示例图表明,references tosldemo_mdlref_F2Coperates in normal mode and the other operates in accelerated mode.

  • The Dependency Analyzer detects when a simulation mode is overridden and appends(覆盖)到模拟模式。如果将引用模型配置为以正常模式运行,并且以加速器模式运行,则其仿真模式将被覆盖。当另一个以加速器模式直接或间接引用它的模型时,就会发生这种情况。

查找所需的产品下载188bet金宝搏

To find required products and add-ons for a file in your design, select a box in the dependency graph. The Dependency Analyzer shows the list of required products by your selection in the下载188bet金宝搏section in theProperties窗格。

要查找整个设计所需的附加组件,请单击图形背景以清除所有选择。检查产品清单下载188bet金宝搏下载188bet金宝搏section in theProperties窗格。

To highlight files that use a certain product in the graph, for example金宝app®, 在里面下载188bet金宝搏section, in thePropertiespane, point to product and click the magnifying glass icon

要浏览这些文件,请在搜索框中使用箭头(例如,文件使用"产品名称").

要撤消突出显示,请关闭搜索框。

To investigate further, you can list the files that use a product and examine where in these files the dependency is introduced. In the下载188bet金宝搏section, in theProperties窗格,指向产品,然后单击搜索文件夹图标

出口依赖性分析Results

要导出依赖关系图中显示的所有文件,请单击图形背景以清除所有文件上的选择。在依赖分析仪工具条中出口section, click出口。Select from the available options:

  • 导出到工作区- 将文件路径保存到工作空间中的变量。

  • Generate Dependency Report- 在可打印报告(HTML,Word或PDF)中保存依赖性分析结果。

  • Package As Archive— Export files in the graph as an archive.

  • 另存为GraphMl- 将依赖关系分析结果保存为GraphMl文件。

  • 另存为图像- 将依赖性分析结果保存为图像。

您还可以导出图中的文件子集。选择文件,然后单击出口。菜单显示选择了多少个文件。依赖项分析仪仅导出所选文件。

Note

When you usePackage As Archive,依赖项分析仪包括所选文件及其所有依赖项在存档中。

从依赖关系图创建项目

To package, share, or put your design under source control, create a project from your model. You can create a project from the model dependency graph.

要从依赖关系图中显示的所有文件中创建一个项目,请单击图形背景。此操作清除了所有选定的文件。

  1. 在依赖分析仪工具条中出口section, click创建项目

  2. 在里面新项目window, click创造

    The Dependency Analyzer creates a project and reloads the graph.

您还可以从图中的文件子集创建一个项目。选择文件,然后单击创建项目。The Dependency Analyzer includes the selected files and all their dependencies in the project.

Related Examples

More About