#pragma once
#include "stdafx.h"
#include <deque>
using namespace std;

class CMeterParam
{
public:
	CMeterParam(void);
	~CMeterParam(void);

//Attributes
public:
	DMM_DATA m_DMMData;
	DMM_DATA m_DMMRelData;
	int m_nDevIndex;
	BOOL m_bRun;
	int m_recordid;
	deque<FullData> m_DequeFullData;
	ULONG m_nDequeDataLen;//
	short m_nCurDIV;
	double m_dbMaxScale;
	double m_dbMinScale;
	int m_nInterval;
	int m_nCurDataIndex;
	DWORD m_nPreTime;
	BOOL m_bSaveToBmp;
	CString m_strSaveFileName;
	short m_nCommType;
	short m_nCOMPort;
public:
	int SearchDevice();
	ULONG GetDequeFullData(FullData* pstrData,int startid=0);
	ULONG GetDequeDataValues(double* pstrData,int startid=0);
protected:
	void RecordData();
	int GetCurDIV(double dbValue);
private:
	HANDLE m_hDequeEvent;

//Operations
public:
	USHORT HDGetDMMData();
	void HDSetDMMType(short nType);

	void HDSetVDCAUTOV();
	void HDSetVACAUTOV();

	void HDSetADCAUTOMA();
	void HDSetAACAUTOMA();

	void HDSetVDCManual60mV();
	void HDSetVACManual60mV();

	void HDSetADCMAManual60mA();
	void HDSetAACMAManual60mA();

	void HDSetOHMAUTO();
	void HDSetOHMManual();

	void HDSetRel();
	void HDExitRel();

	void HDSetVDCManualDIV(short nDIV);
	void HDSetVACManualDIV(short nDIV);

	void HDSetADCManualDIV(short nDIV);
	void HDSetAACManualDIV(short nDIV);

	void HDSetOHMDIV(short nDIV);

	void HDSetADCA();
	void HDSetAACA();
//
	BOOL HDOpenCOM();
	void HDCloseCOM();

	BOOL HDDevConnect();
public:
	void ClearDataDeque();
protected:

private:

};

