⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 irdlg.h

📁 Evc 4.0写的
💻 H
字号:
// IRDlg.h : header file
//

#if !defined(AFX_IRDLG_H__57F36A22_357F_49B3_8A50_CE96C1B0C798__INCLUDED_)
#define AFX_IRDLG_H__57F36A22_357F_49B3_8A50_CE96C1B0C798__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "Serial.h"

#include <Afxtempl.h>

DWORD WINAPI ThreadProc(PVOID pArg);

const LPCTSTR ENERGYFILEPATH = _T("\\ResidentFlash\\cEnergy.dat");
const LPCTSTR EVENTRFILEPATH = _T("\\ResidentFlash\\cEventR.dat");
const LPCTSTR EVENTQFILEPATH = _T("\\ResidentFlash\\cEventQ.dat");
const LPCTSTR EVENTKFILEPATH = _T("\\ResidentFlash\\cEventK.dat");

const LPCTSTR S_XL1FILEPATH = _T("\\ResidentFlash\\cS_xl1.dat");
const LPCTSTR S_XL2FILEPATH = _T("\\ResidentFlash\\cS_xl2.dat");
const LPCTSTR TYPEFILEPATH = _T("\\ResidentFlash\\cType.dat");
const LPCTSTR TYPE1FILEPATH = _T("\\ResidentFlash\\cType1.dat");

const LPCTSTR XHFILEPATH = _T("\\ResidentFlash\\cXh.dat");
/*
const LPCTSTR ENERGYFILEPATH = _T("\\My Documents\\cEnergy.dat");
const LPCTSTR EVENTRFILEPATH = _T("\\My Documents\\cEventR.dat");
const LPCTSTR EVENTQFILEPATH = _T("\\My Documents\\cEventQ.dat");
const LPCTSTR EVENTKFILEPATH = _T("\\My Documents\\cEventK.dat");

const LPCTSTR S_XL1FILEPATH = _T("\\My Documents\\cS_xl1.dat");
const LPCTSTR S_XL2FILEPATH = _T("\\My Documents\\cS_xl2.dat");
const LPCTSTR TYPEFILEPATH = _T("\\My Documents\\cType.dat");
const LPCTSTR TYPE1FILEPATH = _T("\\My Documents\\cType1.dat");

const LPCTSTR XHFILEPATH = _T("\\My Documents\\cXh.dat");
*/
/////////////////////////////////////////////////////////////////////////////
// CFileExamDlg dialog

#pragma pack(push,1)
typedef struct _CEnergy
{
   TCHAR Bh[13];  
   TCHAR cbTime[20]; 
   TCHAR eTotal[10];    
   TCHAR eRate1[10]; 
   TCHAR eRate2[10]; 
   TCHAR eRate3[10]; 
   TCHAR eRate4[10];
}CEnergy;

typedef   struct   _TUserMessage1
{
   TCHAR Bh[13];  //学生编号
   TCHAR cbTime[20]; //学生姓名
   TCHAR r1st[12];    //学生性别
   TCHAR r1nd[12]; //出生日期
   TCHAR r2st[12];    //学生性别
   TCHAR r2nd[12]; //出生日期
   TCHAR r3st[12];    //学生性别
   TCHAR r3nd[12]; //出生日期
   TCHAR r4st[12];    //学生性别
   TCHAR r4nd[12]; //出生日期
   TCHAR r5st[12];    //学生性别
   TCHAR r5nd[12]; //出生日期
   TCHAR r6st[12];    //学生性别
   TCHAR r6nd[12]; //出生日期
   TCHAR r7st[12];    //学生性别
   TCHAR r7nd[12]; //出生日期
   TCHAR r8st[12];    //学生性别
   TCHAR r8nd[12]; //出生日期
   TCHAR r9st[12];    //学生性别
   TCHAR r9nd[12]; //出生日期
   TCHAR r10st[12];    //学生性别
   TCHAR r10nd[12]; //出生日期
}CEventR;



#pragma pack(pop)

/////////////////////////////////////////////////////////////////////////////
// CIRDlg dialog

class CIRDlg : public CDialog
{
// Construction
public:
	CIRDlg(CWnd* pParent = NULL);	// standard constructor
	BOOL dataflag;
	BOOL Flag;
	BYTE *RtnData;
    BYTE *RtnBh;

	BYTE SaveData[256];
//	BYTE *TEST;
	CSerial* m_CSerial;
	DWORD dwThreadId;
	HANDLE hThreadProc;
	BOOL Connected;

	BYTE dataLength;
    BYTE ACKFLAG;

	BOOL CIRDlg::Disconnect(void);
	BOOL CIRDlg::Connect(void);
	BOOL CIRDlg::SecondStep(unsigned char *Buf);
	BOOL CIRDlg::FirstStep(void);
	BOOL GetParam(unsigned char *DATA);
	void CIRDlg::Packet(unsigned char *Buf);
	BOOL CIRDlg::SendData(BYTE* Buffer);
	void CIRDlg::ShowRecv(unsigned char *RECV,int Length);

    BOOL ReadCommand(unsigned char *Bh,unsigned char *Bs);
	BOOL WriteCommand(unsigned char *Bh,unsigned char *Bs,unsigned char *Data,unsigned char Len,unsigned char nLen);
	BOOL GetParam_Read(unsigned char *DATA,unsigned char *Bs,unsigned char *Bh);
	BOOL GetParam_Write(unsigned char *DATA,unsigned char *Bs,unsigned char *Bh,unsigned char Len,unsigned char nLen);
	unsigned char PacketCS(unsigned char *Buf,unsigned char Len);
	void StrToChar(CString temp,unsigned char *tt);


	BOOL ExchangeBh(CString Bh,unsigned char *Bh1);
// Dialog Data
	//{{AFX_DATA(CIRDlg)
	enum { IDD = IDD_IR_DIALOG };
		// NOTE: the ClassWizard will add data members here
	
	CString	m_Bh;
	CString m_Bh1;

	CString	m_CbTime;
	CString	m_Total;
	CString	m_Rate1;
	CString	m_Rate2;
    CString	m_Rate3;
	CString	m_Rate4;
	//}}AFX_DATA

    
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CIRDlg)
	public:
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
private:
	//	CList<CEnergy,CEnergy&> m_lstEnergy;
	CString  FormatTime(CString temp);
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CIRDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnButtonConnect();
	afx_msg void OnButtonDisconnect();
	afx_msg void OnButtonSend();
	afx_msg void OnButton1();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_IRDLG_H__57F36A22_357F_49B3_8A50_CE96C1B0C798__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -