#pragma once

enum GroupItem
{
	CMD_GROUP_SYSTEM		= 0x01,		// 系统命令组
	CMD_GROUP_DETECT_PARAM	= 0x02,		// 检测参数命令
	CMD_GROUP_CAMERA_PARAM	= 0x03,		// 摄像头参数
	CMD_GROUP_CAPTURE_PARAM = 0x04,		// 图像采集命令
	CMD_GROUP_DETECT_RESULT = 0x05,		// 检测命令
	CMD_GROUP_TRAIN			= 0x06,		// 传输命令
	CMD_GROUP_CONF			= 0x07,		// 配置系统命令
	CMD_GROUP_DEBUG			= 0x08,		// 调试命令
	CMD_GROUP_SDK			= 0x09,		// SDK
	CMD_GROUP_UPDATE		= 0x0A,     // 系统升级
	CMD_GROUP_ENCRYPT		= 0x0C,		// 加密通信
};


enum ActionItem
{
	CMD_ACTION_SET		= 0x1,			// 配置
	CMD_ACTION_GET,						// 查询
	CMD_ACTION_CONTROL,					// 控制
	CMD_ACTION_RETURN,					// 返回
	CMD_ACTION_TEST,					// 测试
	CMD_ACTION_GETSTATUS,				// 返回系统状态
	CMD_ACTION_ERRO,					// 返回错误码
};

enum
{
	CMD_GROUP_SYSTEM_INIT				= 0x01,
	CMD_GROUP_SYSTEM_RELEASE			= 0x02,
	CMD_GROUP_SYSTEM_START				= 0x03,
	CMD_GROUP_SYSTEM_STOP				= 0x04,
	CMD_GROUP_SYSTEM_PAUSE				= 0x05,
	CMD_GROUP_SYSTEM_CONTINUE			= 0x06,
	CMD_GROUP_SYSTEM_STEP				= 0x07,
	CMD_GROUP_SYSTEM_CAMRESET			= 0x08,
	CMD_GROUP_SYSTEM_CAMDOWNLOADMAP		= 0x09,
	CMD_GROUP_SYSTEM_GETIMAGE			= 0x0a,
	CMD_GROUP_SYSTEM_DEBUGMOD			= 0x0b,
	CMD_GROUP_SYSTEM_STATUS				= 0x0c, // 获取系统状态
	CMD_GROUP_SYSTEM_VERSION			= 0x0d,
	CMD_GROUP_SYSTEM_GET_TYPE			= 0x0e, // 获取系统类型   // RecvData: int nType
	CMD_GROUP_SYSTEM_DEVICE_STATUS		= 0x10,	// Recv [byte]DeviceType+DeviceStatus
	CMD_GROUP_SYSTEM_DEVICE_STATUSEX	= 0x11,

	CMD_GROUP_SYSTEM_LOCALMAC			= 0x7a, // UnUse
	CMD_GROUP_SYSTEM_LOCALIP			= 0x7b, // UnUse
	CMD_GROUP_SYSTEM_NETCONF			= 0x7c, // 获取网络配置    // SendData:nullptr RecvData:[0-3 Src IP][4-7 Dest IP][8-13 SrcMac][14-19 DestMac][20-23 LocalIp][24-29 LocalMac]Length:30
	CMD_GROUP_SYSTEM_SELFCHECK			= 0x7d,
	CMD_GROUP_SYSTEM_ERRCODE			= 0x7e,
	CMD_GROUP_SYSTEM_CHARGE				= 0x7f,
	CMD_GROUP_SYSTEM_DEVNAME			= 0x80,
	CMD_GROUP_SYSTEM_KEY				= 0x81,


	//2.
	CMD_GROUP_DETECT_PARAM_DETECT_TYPE		= 0x01,
	CMD_GROUP_DETECT_PARAM_THRES			= 0x02,
	CMD_GROUP_DETECT_PARAM_ROI				= 0x03,
	CMD_GROUP_DETECT_PARAM_PRIVATE_STRUCT	= 0x04,
	CMD_GROUP_DETECT_PARAM_LASER_THRES		= 0x05,
	CMD_GROUP_DETECT_PARAM_QMATRIX			= 0x06,	// 设置Q矩阵
	CMD_GROUP_DETECT_PARAM_GET_ROI			= 0x07,	// 获取ROI

	//3.
	CMD_GROUP_CAMERA_PARAM_EYEIP			= 0x03, // 设置眼睛IP       data: IP Byte[4]
	CMD_GROUP_CAMERA_PARAM_EYEMAC			= 0x04, // 设置眼睛MAC      data: MAC Byte[6]
	CMD_GROUP_CAMERA_PARAM_DEV_IP			= 0x05, // 设置设备IP       data: IP Byte[4]
	CMD_GROUP_CAMERA_PARAM_RESET			= 0x0A,	// 重置
	CMD_GROUP_CAMERA_PARAM_GAP				= 0x0e,	// Gap操作
	CMD_GROUP_CAMERA_PARAM_GAIN				= 0x0f,	// Gap操作
	CMD_GROUP_CAMERA_FIX_DISTANCE			= 0x10,	// 偏心值


	//4.
	CMD_GROUP_CAPTURE_PARAM_TABLE			= 0x00,
	CMD_GROUP_CAPTURE_PARAM_AUTOEXPOSURE	= 0x10,
	CMD_GROUP_CAPTURE_PARAM_AWE				= 0x0d,
	CMD_GROUP_CAPTURE_PARAM_DENOISE			= 0x0f,
	CMD_GROUP_CAPTURE_PARAM_SETEDGE			= 0x11,
	CMD_GROUP_CAPTURE_PARAM_GETEXPOSURE		= 0x12,
	
	
	//6
	CMD_TRAIN_FLASH_READ		= 0x30,		//模拟相机flash数据读
	CMD_TRAIN_FLASH_WRITE		= 0x31,		//模拟相机flase数据写
	CMD_TRAIN_KEY_READ			= 0x32,		//模拟相机key数据读
	CMD_TRAIN_KEY_WRITE			= 0x33,		//模拟相机key数据写
	CMD_TRAIN_KERNEL_READ		= 0x34,		//模拟相机kernel数据读
	CMD_TRAIN_KERNEL_WRITE		= 0x35,		//模拟相机kernel数据写


	//7.
	CMD_GROUP_CONF_THIRDSERVERIP		= 0x01,     // 设置服务端IP data: IP String
	CMD_GROUP_CONF_LOCALIP				= 0x02,			// 设置3399IP data: IP String
	CMD_GROUP_CONF_SENDIMG				= 0x03,			// 设置是否传图 data: bool Or byte
	CMD_GROUP_CONF_INDENTINFO			= 0x04,
	CMD_GROUP_CONF_WIFICONF				= 0x05,			// 传输SSID\tPassword\tMAC\tType
	CMD_GROUP_CONF_RETURNINFO			= 0x06,
	CMD_GROUP_CONF_SETCPUINFO			= 0x07,
	CMD_GROUP_CONF_THIRDSERVERPORT		= 0x0a,
	CMD_GROUP_CONF_VERSION				= 0x0b,
	CMD_GROUP_CONF_SAVE_YML				= 0x0d,     // Save Machine Data data: yml data
	CMD_GROUP_CONF_GRAB_DIRECTION		= 0x10,     // Set Catch Direction  // send data: byte send length: 1
	CMD_GROUP_CONF_GET_GRAB_DIRECTION	= 0x11,     // Get Catch Direction  // recv data: int recv length: 4
	CMD_GROUP_CONF_ISENABLEEYEROI		= 0x12,     // Get Enable Eye Sensor ROI Status
	CMD_GROUP_CONF_ENABLEEYEROI			= 0x13,     //
	CMD_GROUP_CONF_GETEXPOSETHRESTYPE	= 0x14,
	CMD_GROUP_CONF_EXPOSETHRESTYPE		= 0x15,
	CMD_GROUP_CONF_GETEXPOSEEYETHRESVAL = 0x16,
	CMD_GROUP_CONF_EXPOSEEYETHRESVAL	= 0x17,
	CMD_GROUP_CONF_LASER_MARK			= 0x1d,
	CMD_GROUP_CONF_SAVE_PRIVATE_DATA	= 0x1f,		// Save Private Data 
	CMD_GROUP_CONF_CONFIG_SECOND_NETCARD_IP = 0x20,		// Config Second NetWork Adapter IP
	CMD_GROUP_CONF_DETECT_GANGUE_PARAM		= 0x21,
	CMD_GROUP_CONF_DEVNET					= 0x22,	//设备IP



	//8.
	CMD_GROUP_DEBUG_QMATRIXDATA			= 0x03,
	CMD_GROUP_DEBUG_AUTODETECT			= 0x07,
	CMD_GROUP_DEBUG_CODE				= 0x08,
	CMD_GROUP_DEBUG_ENABLE_RESULT_IMG	= 0x09,	//Enable Result Image (int Enable)
	CMD_GROUP_DEBUG_GETPNGIMAGE			= 0x0a,
	CMD_GROUP_DEBUG_WP_INFO				= 0x11,     // Workpiece standard data send data xls data
	CMD_GROUP_DEBUG_LOG_LEVEL			= 0x12,
	CMD_GROUP_DEBUG_OBJ_COUNT			= 0x16,		// config target object count


	//9
	CMD_GROUP_SDK_VERSION	= 0x1,		//版本信息
	CMD_GROUP_SDK_START		= 0x2,		//开始干活
	CMD_GROUP_SDK_END		= 0x3,		//结束干活

	// 0x0C
	CMD_ENCRYPT_VERSION	= 0x1,
	CMD_ENCRYPT_LOAD,
	CMD_ENCRYPT_RELEASE,
	CMD_ENCRYPT_RUN,
};

// 4.a 系统更新
enum
{
	CMD_GROUP_UPDATE_VERSION	= 0x1,      //版本信息
	CMD_GROUP_UPDATE_START		= 0x2,      //开始数据传输
	CMD_GROUP_UPDATE_DATA		= 0x3,      //数据
	CMD_GROUP_UPDATE_END		= 0x4,      //结束数据传输
	CMD_GROUP_UPDATE_RESET		= 0x5,      //系统重启
	CMD_GROUP_UPDATE_STATUS		= 0x6,      //系统更新状态
};

// 4.c SDK交互
typedef enum _CMD_GROUP_ENCRYPT_CMD_LIST_ENUM_
{
	CMD_GROUP_ENCRYPT_VERSION	= 0x1,      //版本信息
	CMD_GROUP_ENCRYPT_LOAD		= 0x2,      //加载库
	CMD_GROUP_ENCRYPT_RELEASE	= 0x3,      //释放库
	CMD_GROUP_ENCRYPT_RUN		= 0x4,      //运行函数
}CmdGroupEncryptCmdList;


struct SVrCMDAction
{
	unsigned int		nTimeStemp;
	int					nGroup;
	int					nItem;
	int					nAction;
};


