You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
1.8 KiB

/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2022-03-16 17:09:11
* @LastEditors: xiewenji 527774126@qq.com
* @LastEditTime: 2025-09-23 17:42:47
*/
#ifndef _SYSTEMCOMMONDEFIN1_HPP_
#define _SYSTEMCOMMONDEFIN1_HPP_
#include <string>
// working:”检测”, ready:”就绪”, check: “自检”, bad: “故障”, close: “关闭”
// 系统运行状态定义
enum SYSTEMRUNTYPE_
{
SYSTEM_RUN_TYPE_null,
SYSTEM_RUN_TYPE_working, // ”检测”
SYSTEM_RUN_TYPE_ready, // ”就绪”
SYSTEM_RUN_TYPE_check, // “自检”
SYSTEM_RUN_TYPE_bad, // “故障”
SYSTEM_RUN_TYPE_close, // “关闭”
SYSTEM_RUN_TYPE_count,
};
//
// 检测状态 离线检测 在线检测
enum CHECKIMGTRUNTYP_
{
CHECK_TYPE_ONLING, // 在线检测
CHECK_TYPE_OFFLING, // 离线检测
};
//------------------------config file define----------------------------------------
#define FILE_SYSTEM_RUN_CONFIG "../data/system_param.json"
// #define MAX_GPU_NUM 2
struct SystemConfigParam
{
std::string config_Root_Path;
int Use_CPU_StartIdx; // 使用 CPU 的开始核
int nWorkIdx; // 工位号
int GPU_Device_ID_List[4]; // GPU 设备 ID 数组,最大 4 个,没有的设置 -1
SystemConfigParam()
{
Use_CPU_StartIdx = 0;
config_Root_Path = "";
nWorkIdx = 0;
for(int i=0; i<4; i++) GPU_Device_ID_List[i] = -1;
}
bool valid()
{
if (config_Root_Path.size() &&
Use_CPU_StartIdx >= 0)
{
return true;
}
return false;
}
};
enum THREAD_CPU_
{
THREAD_CPU_Main_Det,
THREAD_CPU_Main_readImg,
THREAD_CPU_Main_saveImg,
THREAD_CPU_CheckSo,
THREAD_CPU_Count,
};
struct CPU_ID_INFO_
{
int startIdx;
int num;
CPU_ID_INFO_()
{
startIdx = 0;
num = 0;
}
void set(int sidx, int num)
{
this->startIdx = sidx;
this->num = num;
}
};
#endif //_CORELOGICFACTORY_HPP_