<< 点击显示目录 >> 主页 exOS使用助手 > exOS Automation Help > Development > exOS Package > Relation between the .exospkg and configuration elements |
为了让 AS 软件中的 exOS 技术软件包检测到 exOS 软件包,它会定位 .exospkg 文件。因此,所有有效的 exOS 软件包都必须包含 .exospkg 文件, 即使它是一个空文件。
.exospkg 文件是一个 XML 文件,只需将项目列表添加为附加节点即可。例如,如果要部署两个文件,语法如下
<ComponentPackage .. >
<File FileName="Linux\somefile.txt" ChangeEvent="Ignore"/>
<File FileName="Linux\someotherfile.txt" ChangeEvent="Ignore"/>
</ComponentPackage>
.exospkg用于在配置视图中填充 exOS 组件配置和 exOS 目标配置。
在选择 exOS 软件包、修改 .exospkg 文件或构建时, exOS 组件的 预定义设置 将使用 .exospkg 文件中的 值进行填充 。
配置或 用户特定设置 可添加到组件中,但这些 设置 与 .exospkg 文件 没有直接联系 。
在 exOS 目标配置元素中 选择 组件配置时 ,特定组件的数据连接将使用 .exospkg 文件中 的 数据模型实例 进行更新 。由于这很可能会在管理程序配置中添加一个新的共享内存分区,而 DatamodelInstance 是已编译程序的一部分,因此只有在选择 "组件配置"时才会 更新该设置 ,即不会在构建项目时 更新 。
该选择来自 DataModelInstance 条目、
<DataModelInstance Name="WaterTank_0"/>
共享内存 分区的名称通常与 DataModelInstance 相同,因此编辑器插件会自动填入该名称。当然,也可以在编辑器中通过为目标配置的可用分区下拉菜单更改该值,但也可以通过 .exospkg 文件 中 的SharedMemory 属性 指定应填充的共享内存分区 。
<DataModelInstance Name="WaterTank_0" SharedMemory="WaterTank_SHM"/>
如果应用程序需要一定大小的 共享内 存分区,例如, 如果要通信大型结构,则 可以使用SharedMemorySize 属性来设置共享内存分区的大小。否则,默认情况下会为应用程序分配 200kB 的区域。
<DataModelInstance Name="WaterTank_0" SharedMemorySize="1000000"/>
在选择 "组件配置"(Component Configuration)时,也可以将端口设置为某个特定值,但这只适用于非常特殊的情况,即不能使用默认的 49001 端口及以后的端口。否则,exOS 编辑器插件将确保所有套接字连接都使用单独的端口,因此每个新组件都有一个唯一的端口号。
<DataModelInstance Name="WaterTank_0" SharedMemory="WaterTank_SHM" Port="1000"/>
同样,在选择 " 组件配置"后可以更改预定义设置 , 在配置更改之前,.exospkg 文件 不会更新 这些设置 。
在大多数情况下,exOS 软件包定义了要传输到目标系统的文件。这里需要注意的是,.exospkg 文件用于查找 exOS 组件配置元素的来源。因此,所有文件引用都相对于 .exospkg 文件的位置。在下面的例子中,watertank 可执行文件位于 Linux 子文件夹中。
如果您的组件需要额外的 .deb 文件,例如,Linux 源依赖于某个库,则可将该库检索为 .deb 软件包并添加到 exOS 软件包中。有关此主题的更多信息,请参阅安装Linux 软件包。
.exospkg 文件还有一个 "构建 "部分。更多相关信息,请进一步查看源代码包部分。
In order for the exOS Technology Package in Automation Studio to detect an exOS Package, it locates the .exospkg file. Therefore, all valid exOS Packages must contain an .exospkg file, even if it was an empty one.
The .exospkg file is an XML file where a list of items is simply added as additional nodes. For example, if two files should be deployed, the syntax would be
<ComponentPackage .. >
<File FileName="Linux\somefile.txt" ChangeEvent="Ignore"/>
<File FileName="Linux\someotherfile.txt" ChangeEvent="Ignore"/>
</ComponentPackage>
The .exospkg is used to populate the exOS Component configuration and the exOS Target configuration in the Configuration View.
At the time of selecting the exOS Package, when modifying the .exospkg file or when building, the Predefined settings of the exOS Component are populated with values from the .exospkg file.
Configuration-, or User-specific settings can be added to the component, which have no direct link to the .exospkg file.
When selecting the Component Configuration in the exOS Target configuration element, the data connection for the specific component is updated with the DatamodelInstance from the .exospkg file. As this will most likely add a new shared memory partition in the Hypervisor configuration, and the DatamodelInstance is part of the compiled program, this setting is only updated when selecting the Component Configuration, i.e. not when building the project.
This selection comes from the DataModelInstance entry,
<DataModelInstance Name="WaterTank_0"/>
The Shared Memory partition typically has the same name as the DataModelInstance, and therefore is automatically populated with that name by the editor-plugin. It is, of course, possible to change this value in the editor by a dropdown menu of available partitions configured for the target, but it is also possible to specify the shared memory partition that should be populated via the SharedMemory attribute in the .exospkg file.
<DataModelInstance Name="WaterTank_0" SharedMemory="WaterTank_SHM"/>
If the application requires a certain size of the Shared Memory section, for example if it is communicating large structures, the SharedMemorySize attribute can be used to set the size of the shared memory partition. Otherwise, applications are assigned an area of 200kB by default.
<DataModelInstance Name="WaterTank_0" SharedMemorySize="1000000"/>
Also the Port can be specifically set to a certain value when selecting the Component Configuration, but this should only be done in very special cases, where the default ports 49001 and onwards cannot be used. Otherwise, the exOS editor plugin will make sure that all socket connections are using separate ports, and every new component thus gets a unique port number.
<DataModelInstance Name="WaterTank_0" SharedMemory="WaterTank_SHM" Port="1000"/>
Again, the predefined settings can be changed after selecting the Component Configuration and will not be updated from the .exospkg file until the configuration has changed.
In most cases, exOS Packages define files to be transferred to the target system. An important remark here is that the .exospkg file is used to locate sources for the exOS Component configuration element. Therefore, all file references are relative to the location of the .exospkg file. In the case below, the watertank executable is located in the subfolder Linux.
If addidtional .deb files are needed for your component, for example, the Linux sources depend on a certain library, this library can be retrieved as .deb package and added to the exOS package. Please see Installing Linux Packages for more information on this topic.
The .exospkg file also has a Build section. Check out the source package section further down for more on that.