46 lines
1.4 KiB
C
46 lines
1.4 KiB
C
|
|
#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();
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // CONFIGCMDPARSER_H
|