📄 cdtprotocoldlg.h
字号:
// CDTProtocolDlg.h : header file
//
#if !defined(AFX_CDTPROTOCOLDLG_H__5DF24A1A_04AB_416C_B6DE_811EBF38EF9D__INCLUDED_)
#define AFX_CDTPROTOCOLDLG_H__5DF24A1A_04AB_416C_B6DE_811EBF38EF9D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CCDTProtocolDlg dialog
#define CDTS_IDLE 0
#define CDTS_SYNC 1
#define CDTS_CTRL 2
#define CDTS_INFO 3
#define CDTC_A_FRAME 0x61
#define CDTC_B_FRAME 0xc2
#define CDTC_C_FRAME 0xb3
#define CDTC_D1_FRAME 0xf4
#define CDTC_D2_FRAME 0x85
#define CDTC_E_FRAME 0x26
#define CDTC_YK_SELECT 0x61
#define CDTC_YK_EXECUTE 0xc2
#define CDTC_YK_CANCEL 0xb3
#define CDTC_YT_SELECT 0xf4
#define CDTC_YT_EXECUTE 0x85
#define CDTC_YT_CANCEL 0x26
#define CDTC_SET_CMD 0x57
#define CDTC_SET_TIME 0x7a
#define CDTC_SET_TIME_CHK 0x0b
#define CDTC_POLL_CLOCK 0x4c
#define CDTC_RESET_CMD 0x3d
#define CDTC_BROAD_CMD 0x9e
#define CDTF_YC_MIN 0x00
#define CDTF_YC_MAX 0x7f
#define CDTF_SOE_LOW 0x80
#define CDTF_SOE_HIGH 0x81
#define CDTF_CLOCK_RETL 0x84
#define CDTF_CLOCK_RETH 0x85
#define CDTF_YC_SUM_MIN 0x86
#define CDTF_YC_SUM_MAX 0x89
#define CDTF_FREQ 0x8a
#define CDTF_RESET_CMD 0x8b
#define CDTF_BROAD_CMD 0x8c
#define CDTF_WATER_MIN 0x8d
#define CDTF_WATER_MAX 0x92
#define CDTF_YM_MIN 0xa0
#define CDTF_YM_MAX 0xdf
#define CDTF_YK_SELECT 0xe0
#define CDTF_YK_VERIFY 0xe1
#define CDTF_YK_EXECUTE 0xe2
#define CDTF_YK_CANCEL 0xe3
#define CDTF_YT_SELECT 0xe4
#define CDTF_YT_VERIFY 0xe5
#define CDTF_YT_EXECUTE 0xe6
#define CDTF_YT_CANCEL 0xe7
#define CDTF_SET_CMD 0xe8
#define CDTF_STATION_STATE 0xec
#define CDTF_SET_TIME_CHK 0xed
#define CDTF_SET_TIME_LOW 0xee
#define CDTF_SET_TIME_HIGH 0xef
#define CDTF_YX_MIN 0xf0
#define CDTF_YX_MAX 0xff
typedef struct
{
BOOL bYxData[512];
float fYcData[256];
DWORD dwYmData[64];
} struCDTData;
#include "Yk.h"
#include "YcListCtrl.h"
class CCDTProtocolDlg : public CDialog, public CSerialCom
{
// Construction
public:
CCDTProtocolDlg(CWnd* pParent = NULL); // standard constructor
static DWORD WINAPI ThreadRun( PVOID lpParam );
virtual void OnRun();
virtual void StartRun();
// Dialog Data
//{{AFX_DATA(CCDTProtocolDlg)
enum { IDD = IDD_CDTPROTOCOL_DIALOG };
CButton m_btnClear;
CButton m_btnStopShow;
CButton m_btnAddFile;
CButton m_btnClose;
CButton m_btnYTCtrl;
CButton m_btnYKCtrl;
CButton m_btnSetTime;
CButton m_btnReset;
CButton m_btnOpen;
CButton m_btnColorSet;
CRichEditEx m_ctrlTxMsg;
CRichEditEx m_ctrlRxMsg;
CTabCtrl m_tabCtrl;
//}}AFX_DATA
CListCtrl m_listYX;
CYcListCtrl m_listYC;
CListCtrl m_listYM;
CListCtrl m_listCOS;
CListCtrl m_listSOE;
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCDTProtocolDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
void OnYkSelect( BYTE YkNo, BYTE YkCmd );
void OnYkExec( void );
void OnYkCancel( void );
protected:
HICON m_hIcon;
BOOL m_bsizeInit;
BOOL m_bshowNeed;
int m_nNeedCount;
int m_nState;
BYTE m_nFrameType;
BOOL m_bIsYxFrame;
struColorParam m_paramcolor;
CYk m_Ykdlg;
CImageList m_ImageList;
void OnCreateListCtrl();
void OnSetWindowsPos();
BOOL ReadColorParam();
void WriteColorParam();
void GetYXListItem( int nIdex, CString& strItem );
void DisplayRxData( BYTE* pBuf, COLORREF color, BOOL IsCheck = TRUE, BOOL IsHead = FALSE );
private:
struCDTData m_cdtData;
SYSTEMTIME soetime;
BYTE m_YKnum;
void OnProcessReceiveSlaveData( BYTE* pBuf, int len );
void OnProcessYXData( BYTE* pBuf );
void OnProcessYCData( BYTE* pBuf );
void OnProcessYMData( BYTE* pBuf );
void OnProcessCOSData( BYTE* pBuf );
void OnProcessSOEData( BYTE* pBuf );
void OnProcessYKVerify( BYTE* pBuf );
// Generated message map functions
//{{AFX_MSG(CCDTProtocolDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnBtnOpen();
afx_msg void OnBtnClose();
afx_msg void OnBtnColorset();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnSelchangeTabCtrl(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchangingTabCtrl(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBtnAddFile();
afx_msg void OnBtnStopShow();
afx_msg void OnBtnYkCtrl();
afx_msg void OnBtnSetTime();
afx_msg void OnBtnYtCtrl();
afx_msg void OnBtnReset();
afx_msg void OnBtnClear();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CDTPROTOCOLDLG_H__5DF24A1A_04AB_416C_B6DE_811EBF38EF9D__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -