Documentation

使用Simuli万博1manbetxnk项目

这个例子展示了如何使用一个仿真软件项目t万博1manbetxo manage the files within your design. Starting with an existing project that is already checked into source control, this example shows how to find and manage the files within your project. A common workflow illustrated by this example is fulfilling a change request for your design.

Setting Up the Example Files and Opening the Simulink Project Tool

1.运行以下命令以创建和打开项目文件的工作副本。

万博1manbetxsimulink.modelmanagement.project.projectDemo('机体',,,,'svn');rebuild_s_functions('no_progress_dialog');
为项目创建沙箱。在“/tmp/bml.batserve.048566/work/projects/slexamples/airframe”中创建了示例文件。/set_up_project.m用'GCC'构建。MEX成功完成。

该项目示例将文件复制到新文件夹,以便您可以编辑它们并在SVN版本控制下使用它们。

Simu万博1manbetxlink项目工具打开并加载已经在版本控制下的项目。

The project is configured to run some startup tasks.

查看项目快捷方式

2.单击快捷方式管理以查看启动任务和其他快捷方式。万博1manbetx也可以从项目快捷方式工具条选项卡访问Simulink项目快捷键。

3.单击项目用户界面右上方的列表按钮,以将快捷方式视为文件列表。

You can use shortcuts to run startup or shutdown tasks, and to easily find files within a large project.

在此示例中,您可以检查以下任务的快捷方式:

  • Some files are set as "Run at Start Up" shortcuts. Startup shortcut files are automatically run (.m files), loaded (.mat files) and opened (Simulink models) when you open the project. You can use these shortcuts to set up the environment for your project. In this example, the file set_up_project.m creates a "work" folder that is not part of the project, and defines where to create the slprj folder. Open the file to view how it works. The following lines use the Simulink Project API to get the current project:

project = simulinkproject; projectRoot = project.RootFolder;
  • “在关闭时运行”快捷方式在当前项目关闭之前运行。在此示例中,文件clean_up_project.m重置set_up_project.m进行的环境更改。

  • You can use shortcuts to make scripts easier to find in a large project. The script that regenerates S-Functions is a shortcut so that a new user of the project can easily find it.

  • 您可以使用快捷方式在项目中更容易找到顶级模型或模型。在此示例中,顶级模型SLProject_F14是一个快捷方式。

查看源控制信息

单击项目根节点以查看有关当前项目正在使用的源控制工具的信息。此示例项目在SVN版本控制工具的控制之下。

有关单个文件的源控制信息(例如修改后,已签出),请参见文件管理视图中的SVN列。

使用快捷方式

4. Click the shortcut "F14 Model" on the Project Shortcuts toolstrip tab to open the root model for this project.

5. Click the shortcut "Rebuild Project's S-functions" on the Project Shortcuts toolstrip tab to generate the S-Function.

To create new shortcuts, select the Files view, right-click a file in the project and select a shortcut group from the "Create Shortcut" menu. Go to the Shortcut Management view to set an existing shortcut to "Run at Startup" or "Run at Shutdown".

使用依赖分析

Run a file dependency analysis on the files within your project to check that all the files that are required by the project are stored with in it.

6. Click the Dependency Analysis node.

7. On the Dependency Analysis tab, click the Analyze button.

8.查看依赖性节点中报告的文件。如果检测到问题,则所有其他结果都会被过滤掉。要查看文件依赖关系分析的所有结果,请单击工具栏中的警告图标,以关闭“仅显示问题文件”过滤器。

您可以从文件依赖性分析的结果中看到S-unction二进制项目时间段是该项目所需的时间段,但目前却不是该项目的一部分。

9.单击“依赖关系”表中的时间段,以查看该项目中的位置。在此示例中,它由f14_airframe.slx使用。

You may want to add binary files to your project or, as in this project, provide a utility script that regenerates them from the source code that is part of the project.

10.右键单击时间网,然后选择“添加外部文件”。下次运行依赖关系分析时,此文件将不会标记为问题文件。

Modifying Files

You can open files for editing from the Simulink Project by double-clicking, or by right-clicking and selecting "Open".

11.尝试打开并更改一个实用程序MATLAB文件或Simulink模型之一。万博1manbetx

Using The Modified Files View

12.单击修改后的文件节点以查看您在沙箱中修改的文件。

You can use the comparison tool from the project to understand the changes you have made, perhaps as part of a peer-review process.

13.右键单击修改后的文件视图中的文件,然后选择“与祖先进行比较”。

这可以使用MATLAB比较工具启动适当的比较,将文件中文件的修改版本与存储在版本控制工具中的祖先进行比较。如果选择Simulink型号,并万博1manbetx且已安装了Simulink®报告Generator™,则可以进行Simulink XML比较。

14. Click the "Commit Modified Files" button to commit your changes to Source Control.

存储在.simulinkProject文件夹中的文万博1manbetx件是您的更改生成的内部元数据文件。元数据允许您在不进行检查的情况下将标签添加到文件中。您无需直接查看元数据文件。您不需要查看这些文件,但是可以显示它们,以便您了解所有要投入到源控制系统的文件。

查看项目信息

Click the project tree node "Project: Simulink Project Airframe Example" to see information about the currently open project, including a description and the location of the project root folder. You can use the check box to set the current working folder to the project root when you open the project. Alternatively, you can use a project shortcut that uses the Simulink Project API to configure the current working folder when the project is first opened. For example, a project startup shortcut might set the "work" folder as the current working folder when the project is first opened.

查看源控制信息

单击项目根节点以查看有关当前项目正在使用的源控制工具的信息。此示例项目在SVN版本控制工具的控制之下。

有关单个文件的源控制信息(例如修改后,已签出),请参见文件管理视图中的SVN列。

使用项目文件视图

In the Files view, use the Project Files view to manage the files within your project. Only the files that are in your project are shown.

在“文件”视图中,单击“项目文件”视图按钮,然后选择所有文件视图以查看沙箱中的所有文件。这显示了项目root下的所有文件,而不仅仅是项目中的文件。此视图对于将文件添加到沙箱中存在的项目中很有用,但尚不是项目的一部分。

In any file view, click the List button at the top right to view the files as a list.

单击右上角的“ COG”图标操作按钮以自定义视图并对文件进行排序。

右键单击文件视图的标题行到组文件。

更多信息

Simulink Project documentation

Was this topic helpful?