aimrt.module
Configuration Item Overview
The aimrt.module configuration item is mainly used to configure module loading information and special configurations of modules for various other components. This is an optional configuration item, with detailed configuration item descriptions as follows:
Node |
Type |
Optional |
Default Value |
Purpose |
|---|---|---|---|---|
pkgs |
array |
Optional |
[] |
Configuration for Pkg dynamic libraries to be loaded |
pkgs[i].path |
string |
Required |
“” |
Path of the Pkg dynamic library to be loaded |
pkgs[i].enable_modules |
string array |
Optional |
[] |
Module names to be loaded from this dynamic library. Cannot be used simultaneously with disable_modules option |
pkgs[i].disable_modules |
string array |
Optional |
[] |
Module names to be excluded from this dynamic library. Cannot be used simultaneously with enable_modules option |
modules |
array |
Optional |
[] |
Detailed module configurations |
modules[i].name |
string |
Required |
“” |
Module name |
modules[i].enable |
bool |
Optional |
True |
Whether to enable |
modules[i].log_lvl |
string |
Optional |
${aimrt.log.default_module_lvl} |
Module log level |
modules[i].cfg_file_path |
string |
Optional |
“” |
Custom module configuration file path |
When using, please note that under the aimrt.module node:
pkgis an array for Pkg dynamic libraries to be loaded.pkgs[i].pathconfigures the path of the Pkg dynamic library to be loaded. Duplicate Pkg paths are not allowed. If the Pkg file does not exist, the AimRT process will throw an exception.pkgs[i].enable_modulesandpkgs[i].disable_modulesconfigure modules to be loaded/excluded, with the following logic:If neither
enable_modulesnordisable_modulesis configured, all modules will be loaded;If only
enable_modulesis configured, all modules listed inenable_moduleswill be loaded;If only
disable_modulesis configured, all modules except those listed indisable_moduleswill be loaded;If both
enable_modulesanddisable_modulesare configured, all modules listed inenable_moduleswill be loaded, thedisable_modulesoption will be ignored, and a warning will be issued during initialization;
modulesis an array for configuring individual modules.modules[i].namerepresents the module name. Duplicate module names are not allowed.modules[i].log_lvlconfigures the module log level.If this item is not configured, the default value is the value configured in the
aimrt.log.default_module_lvlnode.For configurable log levels, please refer to the aimrt.log documentation.
modules[i].cfg_file_pathconfigures the custom module configuration file path. This configuration affects the result returned by theconfig_file_pathmethod of theconfiguratorcomponent in the Module interface, with the following rules:If this item is configured by the user, the
config_file_pathmethod of theconfiguratorcomponent will return the string content configured here;If this item is not configured by the user and there is no root node named after the module in the AimRT framework configuration file, the
config_file_pathmethod of theconfiguratorcomponent will return an empty string.If this item is not configured by the user but there is a root node named after the module in the AimRT framework configuration file, the
config_file_pathmethod of theconfiguratorcomponent will return a temporary configuration file path. This temporary configuration file will contain the content under the module-named node in the AimRT framework configuration file.
Usage Example
Here is a simple example:
aimrt:
module:
pkgs:
- path: /path/to/libxxx_pkg.so
enable_modules: [FooModule, BarModule]
modules:
- name: FooModule
enable: True
log_lvl: INFO
cfg_file_path: /path/to/foo_module_cfg.yaml
- name: BarModule
enable: True
log_lvl: WARN
BarModule:
foo_key: foo_val
bar_key: bar_val