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