📄 operationtooldlg.h
字号:
// OperationToolDlg.h : header file
//
//{{AFX_INCLUDES()
//}}AFX_INCLUDES
#if !defined(AFX_OPERATIONTOOLDLG_H__D639D5BD_19F9_4AD2_A6EA_0E577E074541__INCLUDED_)
#define AFX_OPERATIONTOOLDLG_H__D639D5BD_19F9_4AD2_A6EA_0E577E074541__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// COperationToolDlg dialog
#include "serialport.h"
//Measure Unit used
const CString MeasureUnit[]={"ppm"," % ","ppb","oC","mg","ug","mA","V","oF","uSv/h","uR/h","CPS"};
//Sensor Information
typedef struct SensorInformation
{
BYTE ID;
CString Name;
CString unit;
int DataLen;
int Point;
BOOL Installed;
BOOL Enabled;
}SENSORINFORMATION, *LPSENSORINFORMATION;
class COperationToolDlg : public CDialog
{
// Construction
public:
COperationToolDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(COperationToolDlg)
enum { IDD = IDD_OPERATIONTOOL_DIALOG };
CComboBox m_cbItem;
CComboBox m_cbTeam;
CRichEditCtrl m_recSlaveSponse;
int m_nCount;
int m_nTeam;
int m_nItem;
int m_nValue;
CString m_strSlaveSponse;
CString m_strInInformation;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COperationToolDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
//function
protected:
void mf_DispMsg(CString I_strMsg,int I_nClear=0); //display the result and clear the result
void mf_AddTeamName(); //Add team name
void mf_AddBasicInstrument(); //Add basic instrument to item(0x2020--0x2026)
void mf_AddSensorInformation(); //Add sensor Information(0x2030--0x203D)
void mf_AddMiscellaneousInformation(); //Add Miscellaneous Information(0x2040--0x2048)
void mf_AddOperationParameters(); //Add Operation parameters(0x2050--0x206E)
void mf_AddSlaveDataStored(); //Add Data stored in slaves(0x2080--0x2085)
void mf_AddSetSensorValue(); //Set sensors' value(0x2220--0x222A)
void mf_AddSetOperationPara(); //Set operation parameter(0x2240--0x226E)
void mf_AddCommandSlaveOperation();//commands to request slave to do(0x2280--0x228A)
void mf_AddCommandSpecialFunction();//commands to special functions(0x6020--0x6027)
//Do all 0x21XX commands
void mf_Deal21Proc(short int I_nCMDS, short int I_nPacketLen, BYTE *I_pbyDataS);
void mf_Deal23Proc(short int I_nCMDS, short int I_nPacketLen, BYTE *I_pbyDataS);
void mf_Deal61Proc(short int I_nCMDS, short int I_nPacketLen, BYTE *I_pbyDataS);
void mf_Deal71Proc(short int I_nLength, BYTE *I_pDataS);
//do detail commands
void mf_Deal212XProc(BYTE I_byCMDS, short I_nPacLen, BYTE *I_pbyDataS);
void mf_Deal213XProc(BYTE I_byCMDS, short I_nPacLen, BYTE *I_pbyDataS);
void mf_Deal214XProc(BYTE I_byCMDS, short I_nPacLen, BYTE *I_pbyDataS);
void mf_Deal215XProc(BYTE I_byCMDS, short I_nPacLen, BYTE *I_pbyDataS);
void mf_Deal218XProc(BYTE I_byCMDS, short I_nPacLen, BYTE *I_pbyDataS);
void mf_Deal2184(CByteArray& I_abyByte);
//Combining initial packet
UINT mf_CombineInitPac(BYTE *O_pbyInitPac, BYTE I_byWireless, BYTE I_byInit2Flag, int I_nToolVer=2);
//Combining formal Type III packet
UINT mf_CombineVerPac(BYTE *O_pbyVerPac, int I_nCMDH, int I_nPacLen, BYTE *I_pbyDataH);
//Demodem Initial packet
BYTE mf_DemInitPac(BYTE *I_pbyInitResPac);
//Demodem formal Type III packet
void mf_DemVerPac(BYTE *I_pbyVerResPac, short int &O_nCMDS, short int &O_nPacLen, BYTE *O_pbyDataS);
//Split packet into relevant data
void mf_SplitPacket(BYTE *I_pbyReceivePacket);
//Save datalog
BOOL mf_SaveDataLog(const char *I_szName, CString I_Str);
// Clear datalog
BOOL mf_ClearFile(const char *I_szName);
//save extern memory
BOOL mf_SaveMemory(const char *I_szName, CByteArray &I_abybyteArray);
//Write command and get data; used in repeated environment
BOOL mf_RepeatReadData(short &O_nReadDataCount, BYTE *O_pbyReadData);
//input command and get data
BOOL mf_ParseCommand(int I_nCMD, int I_nInDataCount, BYTE *I_pbyDataH, BYTE *O_pbyReceivePac);
//set pc communication mode
BOOL mf_SetPCMode();
//make the first row red
void mf_ChangeFormat();
//data
private:
COperationToolApp *m_theApp;
short int m_nParaCount;
short int m_nCMDH12;
BYTE m_abyDataH[VERPACKETMAX];
int m_nComPort; //current using com
CSerialPort m_ComDev; //define a COM device
int m_nSensornumber; //total used sensors
SENSORINFORMATION m_SensorInf[8]; //maximized 8 sensors
long m_lDatalogLength; //length of datalog , get from get_sizedatalog
//data
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(COperationToolDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnConvert();
afx_msg void OnSelchangeTeam();
afx_msg void OnSelchangeItem();
afx_msg void OnNext();
afx_msg void OnInitial();
afx_msg void OnComSetup();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnCancel();
afx_msg void OnOpenFile();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OPERATIONTOOLDLG_H__D639D5BD_19F9_4AD2_A6EA_0E577E074541__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -