#pragma once

///
#define COMM_USB		0
#define COMM_COM		1
//DMM Type
#define DMM_VOLTAGE		0 //
#define DMM_CURRENT		1 //
#define DMM_OHM			2 //
#define DMM_DIODE		3 //
#define DMM_CONTI		4 //
#define DMM_CAP			5 //

//AC,DC,NULL
#define DMM_DC			0
#define DMM_AC			1
#define DMM_DCAC_NULL	2

//A mA
#define DMM_A	0
#define DMM_MA	1

//Auto Manual
#define DMM_AUTO	0
#define DMM_MANUAL	1

//Grid Range
#define V_DC_DIV	6
#define V_AC_DIV	5
#define A_DC_DIV	4
#define A_AC_DIV	4
#define R_DIV		6
#define C_DIV		5
#define D_DIV		1
//
#define MAX_DATA_LEN		1000
///////////////////////////STRUCT/////////////////////////////////////
typedef struct STRUCT_MSG
{
	USHORT nType;
	int nValue;
}HTMSG,*PHTMSG;

typedef struct STRUCT_DMM_DATA{
	short	nType;	
	BOOL	bOverflow;	
	float	flValue;	
	int		nDotPos;	
	int		nUnit;	
	int		nUnitType;	
	short	nDCAC;	
	short	nMode;
	BOOL	bRel;	
	short	nRange;	
	short	bAmA;	
	short	nBar;	
	short	nBarSign;
}DMM_DATA, *PDMM_DATA;

/////////////////////////////ENUM////////////////////////////////////
typedef enum ENUM_MSG{
	MSG_NULL = 0,
	MSG_SET_DMM_TYPE,
	MSG_SET_DMM_ACDC,
	MSG_SET_DMM_AUTOMANUAL,
	MSG_SET_DMM_REL,
	MSG_SET_DMM_DIV,
	MSG_SET_DMM_AMA,
	MSG_CLEAR_DATA,
	MSG_SAVE_DATA,
	MSG_RUN_STOP,
	MSG_SET_INTERVAL,
	MSG_SET_COM,
	MSG_SET_COMM_TYPE,
	MSG_SET_COM_PORT,
	MSG_SET_WRITEFILE,
	MSG_NUM
};

typedef enum ENUM_V_DC_DIV{
	MANUAL_DC_60MV = 0,
	MANUAL_DC_600MV,
	MANUAL_DC_6V,
	MANUAL_DC_60V,
	MANUAL_DC_600V,
	MANUAL_DC_800V,
	MANUAL_V_DC_DIV_NUM
};

typedef enum ENUM_V_AC_DIV{
	MANUAL_AC_60MV = 0,
	MANUAL_AC_600MV,
	MANUAL_AC_6V,
	MANUAL_AC_60V,
	MANUAL_AC_600V,
	MANUAL_V_AC_DIV_NUM
};

typedef enum ENUM_A_DIV{
	MANUAL_60MA = 0,
	MANUAL_600MA,
	MANUAL_A_DIV_NUM
};

typedef enum ENUM_OHM_DIV{
	MANUAL_600 = 0,
	MANUAL_6K,
	MANUAL_60K,
	MANUAL_600K,
	MANUAL_6M,
	MANUAL_60M,
	MANUAL_OHM_DIV_NUM
};

typedef struct STTRUCT_FullData {
        int year;
		int month;
		int day;
		int hour;
		int minute;
		int second;
		int millisecond;
		double value;
		char *unit;
        double timeOffset;
		int id;
		int	nUnit;	
		int	nUnitType;
		CString DT;
		CString humanValue;
} FullData;
