2025-11-26 22:44:38 +08:00

41 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "ConfigManager.h"
#include "VrLog.h"
// LapWeld 应用的 ConfigManager 实现
// 所有通用功能都在 BaseConfigManager 中实现
// 这里只实现 LapWeld 特定的功能
// 重写 LoadConfigFromFile 以适配 LapWeld 的 IVrConfig API
// LapWeld 使用返回值方式ConfigResult LoadConfig(const std::string& filePath)
bool ConfigManager::LoadConfigFromFile(const std::string& filePath)
{
if (!m_pVrConfig) {
LOG_ERROR("VrConfig instance not available\n");
return false;
}
try {
// LapWeld 使用返回值方式
ConfigResult configResult = m_pVrConfig->LoadConfig(filePath);
// 使用基类的公共逻辑应用配置
return _ApplyLoadedConfig(configResult, filePath);
} catch (const std::exception& e) {
LOG_ERROR("Failed to load configuration from file %s: %s\n", filePath.c_str(), e.what());
return false;
}
}
// 示例:如果需要自定义标定参数处理
/*
bool ConfigManager::OnCalibParamCommand(const CalibConfigParam& param)
{
LOG_INFO("LapWeld specific calibration handling for camera %d\n", param.cameraIndex);
// 实现 LapWeld 特定的标定逻辑
return true;
}
*/