2025-07-23 01:35:14 +08:00
|
|
|
#ifndef CONFIGCMDPARSER_H
|
|
|
|
|
#define CONFIGCMDPARSER_H
|
|
|
|
|
|
|
|
|
|
#include "VrConfigCmd.h"
|
|
|
|
|
#include "IVrShareMem.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
class ConfigCmdParser
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ConfigCmdParser();
|
|
|
|
|
~ConfigCmdParser();
|
|
|
|
|
|
|
|
|
|
// 解析命令行参数
|
|
|
|
|
bool ParseCommandLine(int argc, char* argv[], ConfigCmdData& configData);
|
|
|
|
|
|
|
|
|
|
// 发送配置命令到共享内存
|
|
|
|
|
bool SendConfigCommand(const ConfigCmdData& configData);
|
|
|
|
|
|
|
|
|
|
// 解析具体的配置命令
|
|
|
|
|
bool ParseCameraExpose(const std::vector<std::string>& params, ConfigCmdData& configData);
|
|
|
|
|
bool ParseCameraGain(const std::vector<std::string>& params, ConfigCmdData& configData);
|
|
|
|
|
bool ParseCameraFrameRate(const std::vector<std::string>& params, ConfigCmdData& configData);
|
|
|
|
|
bool ParseCameraSwing(const std::vector<std::string>& params, ConfigCmdData& configData);
|
|
|
|
|
bool ParseAlgoParam(const std::vector<std::string>& params, ConfigCmdData& configData);
|
|
|
|
|
bool ParseCalibParam(const std::vector<std::string>& params, ConfigCmdData& configData);
|
|
|
|
|
|
|
|
|
|
// 显示帮助信息
|
|
|
|
|
void ShowHelp();
|
|
|
|
|
|
|
|
|
|
// 显示版本信息
|
|
|
|
|
void ShowVersion();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
IVrShareMem* m_pShareMem;
|
|
|
|
|
|
|
|
|
|
// 辅助函数
|
|
|
|
|
bool InitializeSharedMemory();
|
|
|
|
|
void CleanupSharedMemory();
|
|
|
|
|
std::vector<std::string> SplitString(const std::string& str, char delimiter);
|
|
|
|
|
bool IsNumber(const std::string& str);
|
|
|
|
|
std::string GetCurrentTimestamp();
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-14 00:17:41 +08:00
|
|
|
#endif // CONFIGCMDPARSER_H
|