feat 添加存储路径配置

dev_lsy
liusiyang 2 months ago
parent 95326fd8f6
commit 1ef5102b93

@ -46,6 +46,7 @@ struct SystemConfigParam
std::string config_Root_Path; std::string config_Root_Path;
std::string save_Img_Root_Path; // 检测结果图保存根目录
int Use_CPU_StartIdx; // 使用 CPU 的开始核 int Use_CPU_StartIdx; // 使用 CPU 的开始核
int nWorkIdx; // 工位号 int nWorkIdx; // 工位号
@ -54,6 +55,7 @@ struct SystemConfigParam
{ {
Use_CPU_StartIdx = 0; Use_CPU_StartIdx = 0;
config_Root_Path = ""; config_Root_Path = "";
save_Img_Root_Path = "/home/aidlux/BOE/FOG/Detsave/";
nWorkIdx = 0; nWorkIdx = 0;
for(int i=0; i<4; i++) GPU_Device_ID_List[i] = -1; for(int i=0; i<4; i++) GPU_Device_ID_List[i] = -1;
} }

@ -841,7 +841,7 @@ void deal::ResultThread(int id)
if (true) if (true)
{ {
// 存图 // 存图
std::string savepath = "/home/aidlux/BOE/FOG/Detsave/"; std::string savepath = m_system_param.save_Img_Root_Path;
saveImg(savepath, dealResult); saveImg(savepath, dealResult);
// saveImg("/home/aidlux/BOE/ResultImg/", dealResult); // saveImg("/home/aidlux/BOE/ResultImg/", dealResult);
} }
@ -850,7 +850,7 @@ void deal::ResultThread(int id)
// 存 检测统计 日志 // 存 检测统计 日志
mutex_DetResult_.lock(); mutex_DetResult_.lock();
m_DetResult.print(false); m_DetResult.print(false);
std::string strlog = "/home/aidlux/BOE/FOG/Detsave/"; std::string strlog = m_system_param.save_Img_Root_Path;
if (m_strCurDate != "") if (m_strCurDate != "")
{ {
strlog += m_strCurDate; strlog += m_strCurDate;
@ -942,6 +942,10 @@ bool deal::ReadSystemConfig(const std::string &strPath)
m_system_param.Use_CPU_StartIdx = root["Use_CPU_StartIdx"].asInt(); m_system_param.Use_CPU_StartIdx = root["Use_CPU_StartIdx"].asInt();
m_system_param.nWorkIdx = root["Detect_Work_Idx"].asInt(); m_system_param.nWorkIdx = root["Detect_Work_Idx"].asInt();
m_system_param.config_Root_Path = root["Config_Root_Path"].asString(); m_system_param.config_Root_Path = root["Config_Root_Path"].asString();
if (root.isMember("Save_Img_Root_Path"))
{
m_system_param.save_Img_Root_Path = root["Save_Img_Root_Path"].asString();
}
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
m_system_param.GPU_Device_ID_List[i] = -1; m_system_param.GPU_Device_ID_List[i] = -1;

Loading…
Cancel
Save