"MFF Config Viewer" is a Visual Studio Code extension that helps you automatically visualize the configuration value of the CM (Condition Macro) in your C++ code, specifically when using the Momenta function framework.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
A Visual Studio Code extension for visualizing MFF (Momenta Function Framework) configuration values directly in your C++ code.
一款 VS Code 插件,用于在 C++ 代码中直接可视化 MFF(Momenta Function Framework)配置值。
Features / 功能
CM (Condition Macro) Analysis / CM 宏分析: Hover over CM_ENABLE macros to instantly see whether a CM is enabled or disabled, along with its configuration values across all projects. 悬停在 CM_ENABLE 宏上即可查看该 CM 的启用状态及各项目配置值。
Unified Config Lookup / 统一配置查询: Supports searching unified configurations across all config files. Hover over any configuration variable to view its value. 支持跨所有配置文件搜索统一配置,悬停即可查看变量值。
CM Overwrite Detection / CM 覆写检测:
JSON-Level / JSON 层级: Checks if a CM exists in the cm.overwrite_map section of JSON config files. 检测 CM 是否存在于 JSON 配置文件的 cm.overwrite_map 中。
Node-Level / 节点层级: Searches common_condition.cpp for CM_DEF definitions to detect if a CM has a code-level overwrite implementation. 在 common_condition.cpp 中搜索 CM_DEF 定义,检测 CM 是否存在代码层级的覆写实现。
DirectCopy Config Path / 一键复制配置路径: Right-click on a config variable in C++ code to copy the full config path to clipboard. 右键点击 C++ 代码中的配置变量,一键复制完整配置路径。
Sidebar Settings Panel / 侧边栏设置面板: Input custom project and sub-project names for refined search filtering. 输入自定义项目名和子项目名进行精确过滤。
Cache Mode / 缓存模式: Caches file contents, parsed JSON, project folder paths, and workspace file search results to avoid redundant I/O. Significantly speeds up repeated hover lookups on the same configs. Use Refresh Config Content command to manually refresh when config files change. 缓存文件内容、解析后的 JSON、项目文件夹路径及工作区文件搜索结果,避免重复磁盘读取。对同一配置的重复悬停查询有显著加速效果。配置文件变更后可通过 Refresh Config Content 按钮手动刷新。
VAC (Vehicle Adaptation Configuration) / 车型适配配置支持: Resolves Config Service values based on vehicle_type and sub_vehicle_type from .cs_cache, displaying the adapted configuration for each vehicle variant. Shows resolution status (resolved/unresolved) and default vs Config Service value comparison. 基于 .cs_cache 中的 vehicle_type 和 sub_vehicle_type 解析 Config Service 值,展示各车型的适配配置。显示解析状态(已解析/未解析)及默认值与 Config Service 值的对比。
MUnit Support / 物理单位支持: Recognizes physical unit tags in bracket notation (e.g. field(meter), field(ms, cs)) and displays the unit alongside config values. Supported units include: meter, km, mm, mile, sec, ms, us, ns, mps, kmph, rad, deg, kg, gram, newton, kelvin, etc. 识别括号中的物理单位标签(如 field(meter)、field(ms, cs)),并在配置值旁显示对应单位。支持的单位包括:meter、km、mm、mile、sec、ms、us、ns、mps、kmph、rad、deg、kg、gram、newton、kelvin 等。
Multi-Node Support / 多节点支持: Supports mff_main, mff_aeb, and mff_hmi nodes. 支持 mff_main、mff_aeb、mff_hmi 节点。
Supported Macros / 支持的宏
Macro / 宏
Description / 描述
CM_ENABLE
CM condition enable/disable check / CM 条件启用/禁用检测
CM_VAL_ENABLE
Value-based CM condition check / 基于值的 CM 条件检测
CM_DEF
CM function definition in C++ / C++ 中的 CM 函数定义
ENABLE
Generic enable macro with path / 通用启用宏(含路径)
enable(...)
Config Service enable with parameters / 配置服务启用宏(含参数)
CFG_GET
Direct config value getter / 直接配置值获取
MREG_VALMEM_GET
Memory register value getter / 内存寄存器值获取
MREG_VAL_GET
Memory register value getter / 内存寄存器值获取
HMI_CFG_GET
HMI config value getter / HMI 配置值获取
Usage / 使用方法
Open a C++ file in a workspace containing MFF config files. 在包含 MFF 配置文件的工作空间中打开 C++ 文件。
Hover over a CM_ENABLE macro or configuration variable to see its values. 悬停在 CM_ENABLE 宏或配置变量上查看值。
Use the sidebar panel (Config Viewer > Settings) to specify a custom project or sub-project filter. 使用侧边栏面板(Config Viewer > Settings)指定自定义项目或子项目过滤。
Use the Command Palette to access additional commands: 通过命令面板使用以下命令:
MFF Config Viewer: Enable / Disable - Toggle the extension on or off. 开启或关闭插件。
ShowMeTheCM: Choose Projects - Select which projects to display configs for. 选择要显示配置的项目。