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

📄 rtdlg.h

📁 本程序采用VC++和MySql编写的田间信息自动采集系统
💻 H
字号:
// RTDlg.h : header file
//

#if !defined(AFX_RTDLG_H__2CFA35D0_AC47_478F_B3E9_94E3E6DD8C1E__INCLUDED_)
#define AFX_RTDLG_H__2CFA35D0_AC47_478F_B3E9_94E3E6DD8C1E__INCLUDED_

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

#include "OScopeCtrl.h"
#include "Digistring.h"
#include "Tools.h"
#include "CTime"
#include "CTRDM.h"
#include "DLGComSet.h"
#include "DlgRemoteSet.h"
#include "ComSetDM.h"
#include "RemoteSetDM.h"
#include "DlgViewCom.h"
// Added by ClassView

typedef struct RTDATA
{
	// 备用参数5
	double m_fStandby_5;
	// 备用参数4
	double m_fStandby_4;
	// 备用参数3
	double m_fStandby_3;
	// 备用参数2
	double m_fStandby_2;
	// 备用参数1
	double m_fStandby_1;
	// 光照
	double m_fIllumination;
	//湿度
	double m_fHumidity;
	//风速
	double m_fWindSpeed;
	//降雨量
	double m_fRainFall;
	//温度
	double m_fTemperature;
	//时间
	CString m_sTime ;
	//采集器设备编号
	CString  m_sADCode;
}RtData;
/////////////////////////////////////////////////////////////////////////////
// CRTDlg dialog

class CRTDlg : public CDialog
{

// Construction
public:
	CRTDlg(CWnd* pParent = NULL);	// standard constructor
	HANDLE hCommDev;

    
    int vcon,vconcount;
	CString	m_sMes3;
// Dialog Data
	//{{AFX_DATA(CRTDlg)
	enum { IDD = IDD_RT_DIALOG };
	CDigistring	m_ctrlLedDate;
	CDigistring	m_ctrlLedTime;
	CDigistring	m_ctrlLedW;
	CDigistring	m_ctrlLedT;
	CDigistring	m_ctrlLedL;
	CDigistring	m_ctrlLedR;
	CDigistring	m_ctrlLedH;
	CStatic	m_ctrlOffOnIcon;
	CButton	m_ctrlStartButton;
	CString	m_strComStatu;
	CString	m_strModemStatu;
	CString	m_strStatu;
	BOOL	m_bAuto;
	CTime	m_cSelectD1;
	CTime	m_cSelectD2;
	CTime	m_cSelectT1;
	CTime	m_cSelectT2;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;
	HICON m_hOffIcon;
	HICON m_hOnIcon;
    
	BOOL m_bStarted;
	CString m_sRemoteSet;
	COScopeCtrl m_OScopeCtrl_T;
	COScopeCtrl m_OScopeCtrl_R;
	COScopeCtrl m_OScopeCtrl_W;
	COScopeCtrl m_OScopeCtrl_H;
	COScopeCtrl m_OScopeCtrl_L;

	CString	m_strYear;
	CString	m_strMonth;
	CString	m_strDay;
	CString	m_strHour;
	CString	m_strMin;
	CString	m_strSec;

	// Generated message map functions
	//{{AFX_MSG(CRTDlg)
	afx_msg LONG OnGetRemoteSet(WPARAM ch, LPARAM mark);
	afx_msg LONG OnGetComSet(WPARAM ch, LPARAM mark);
	afx_msg LONG OnGetStopSet(WPARAM ch, LPARAM mark);
	afx_msg LONG OnGetDataSet(WPARAM ch, LPARAM mark);
	afx_msg LONG OnGetParitySet(WPARAM ch, LPARAM mark);
	afx_msg LONG OnGetBaundSet(WPARAM ch, LPARAM mark);
	afx_msg LONG OnGetHandSet(WPARAM ch, LPARAM mark);
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonStart();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnRemoteSet();
	afx_msg void OnRemoteBook();
	afx_msg void OnComSet();
	afx_msg void OnComLook();
	afx_msg void OnRemoteAuto();
	afx_msg void OnBUTTONSelect();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	CDlgViewCom dlgViewCom;
	void ResponseColector(BOOL bMark);
	void ParesRtData(CString sData);
	RtData theRtData;
	void CheckData(CString s);
	void ParseData();
	CComSetDM comSetDM;
    CRemoteSetDM remoteDM;
	CCTRDM theCTRDM;
	CTime	m_dNowTime;
	CCustResultSet theResult;
	CFile mFile;
	CString m_sTxt;
	CBrush m_brush;
	CString m_sSetSendTime;    
	CDLGComSet  m_cDlgCom;
    CDlgRemoteSet m_cDlgRemote;
//	CString m_sEndTime;
	CString m_sStartTime;
	DWORD dwBytesWritten;
	CTools Tools;
	void UpdateLen(int tempInt,BOOL m_bStart);
	BOOL Save();
	BOOL InitParam();

	CString	m_sStopBits;
	CString	m_sPort;
	CString	m_sParity;
	CString	m_sDataBits;
	CString m_sBaudRate;
	CString m_sResponse;
	CString m_sHand;
	
};

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

#endif // !defined(AFX_RTDLG_H__2CFA35D0_AC47_478F_B3E9_94E3E6DD8C1E__INCLUDED_)

⌨️ 快捷键说明

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