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

📄 digitalpoweranalystview.h

📁 串行通讯程序,为电池分析仪与电脑通讯软件,效果不错.
💻 H
字号:
// ex31bView.h : interface of the CDigitalPowerAnalystView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_EX31BVIEW_H__A0805538_01E1_11D2_9E4D_00A0C9B1AF6D__INCLUDED_)
#define AFX_EX31BVIEW_H__A0805538_01E1_11D2_9E4D_00A0C9B1AF6D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "MainFrm.h"
#include "CommSetDlg.h"	// Added by ClassView
#include "AnalysisSetupDlg.h"	// Added by ClassView
#include "DataProcessDlg.h"	// Added by ClassView
#include "SYSTEMSetupDlg.h"	// Added by ClassView
#include "serialport.h"	// Added by ClassView
#include "DCodeDlg.h"	// Added by ClassView
class CDigitalPowerAnalystSet;
#define PROGRAMS        13
const char cs_basic_fmt[]	= {"%02i-%02i-%04i"};
const char cs_basic_fmtb[]  = {"%02i%02i%04i"};
const char cs_ni_fmt[]		= {":%02i%02i-%i%i-%02i%i-%i%i%i%i"};
const char cs_ni_fmtb[]     = {"%02i%02i%i%i%02i%i%i%i%i%i"};
const char cs_sla_fmt[]		= {":%02i%02i-%02i%i-%i%i%i%i"};
const char cs_sla_fmtb[]	= {"%02i%02i%02i%i%i%i%i%i"};
const char cs_trg_fmt[]		= {"-%i%03i"};
const char cs_trg_fmtb[]	= {"%i%03i"};

 
const char default0[]   = {"0000-00-000-0000"};
const char default0b[]  = {"0000000000000"};
const char default10[]  = {"1010-56-500-3646"};
const char default20[]  = {"1010-26-500-1646"};
const char default30a[] = {"0301-500-0756"};									/* SLA Gell */
const char default30b[] = {"0304-500-2154"};									/* SLA Hawker */
const char default40a[] = {"1010-505-3452"};                                    /* Li Coke */
const char default40b[] = {"1010-505-3657"};									/* Li Graphite */
const char default_cp[] = {"-0080"};
#define AUTO_PROG	0
/* used for converting C3/C4 adapter values */
const char c4_ni_fmt[]	= {"%02u-%02u-%03u:%04u-%02u-%03u-%04u-%u%03u"};
const char c4_sla_fmt[]	= {"%02u-%02u-%03u:%04u-%03u-%04u-%u%03u"};

class CDigitalPowerAnalystView : public CRecordView
{
	  typedef struct {
		unsigned char cmd;
		unsigned char station;
		unsigned char setup;
		char Databuf[256];
	}CommandFormat0;
	typedef struct {
		unsigned char cmd;
		unsigned char station;
		char  Databuf[256];
	}CommandFormat1;
	typedef struct {
		unsigned char cmd;
		char Databuf[256];
	}CommandFormat2;
	typedef union {                 
		unsigned char buf[256];
		CommandFormat0 FristStruct;  
		CommandFormat1 NextStruct;
		CommandFormat2 LastStruct;
	}ComData;
	typedef struct
			{
		CString  sDeviceType ;
		int  nStation;
		CString sBaterryName ;
		CString  nEventType ;
	}EVENT_INFO;

protected: // create from serialization only
	CDigitalPowerAnalystView();
	DECLARE_DYNCREATE(CDigitalPowerAnalystView)

public:
	//{{AFX_DATA(CDigitalPowerAnalystView)
	enum { IDD = IDD_DIGITALPOWERANALYST };
	CDigitalPowerAnalystSet* m_pSet;
	//}}AFX_DATA
	CListCtrl	m_ListCtrlStation;
	CStatic	m_StaticDataDisp;
	CStatic m_StaticPicture;
	CStatic m_StaticStation[5];
	CStatic m_STATICLCD;
	BOOL	m_CHECKStation1;
	BOOL	m_CHECKStation2;
	BOOL	m_CHECKStation3;
	BOOL	m_CHECKStation4;
	BOOL	m_CHECKStationALL;
	//}}AFX_DATA

// Attributes
public:
	CDigitalPowerAnalystDoc* GetDocument();
	CString	m_StationItem[5][15];
    long    m_StationVorC[5][3];
	CBrush pBrushClear;
	UINT m_nTimer;
// Operations
public:
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDigitalPowerAnalystView)
	public:
	virtual CRecordset* OnGetRecordset();
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL OnMove(UINT nIDMoveCommand);
	protected:
	virtual void OnDraw(CDC* pDC);
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CDigitalPowerAnalystView();






public:
	CStatic m_StaticLab;
	BOOL bClearData;
	void ClearLine();
	BOOL m_bTranStation;
	void DrawLine( int  nNumDot);
	void ChangLableTime(int FixedVol,int StepVol);
	CString m_CurrentLable[10];
	CString m_TimeLable[10];
	void ChangLabeCurrent(int FixedVol,int StepVol);
	void ChangeLable(int FixedVol,int StepVol);
	int CurStation;
	char checksum_in(long Len);
	UINT convert_cc_fromx2(c_code *ccode);
	UINT convert_cc_tox2(c_code *ccode);
UINT  cc_to_string(c_code *cc, char *start, char extend);//modefiy
 // RECT  RectPicture;
	c_code m_ccode;
	UINT string_to_cc(c_code *ccode, char *string);
	CDCodeDlg m_DCodeDlg;
	CString m_LabelVC[9];
	float m_STEPSCALEZ;
	float m_StepScaleY,m_StepScaleZ;
	long m_StandMinX;
	long m_StandMinY,m_StandMinZ;

	long m_StandMinYC;
	long m_StandMaxX,m_StandMaxY,m_StandMaxZ;
	long 	m_StepScaleX;
	CBrush m_BrushPicture;
	CPen penPicture;
	CPen penPictureV;
	//CString tmpStr;
    CRect rectPicture;
	   RECT oldRect;
  long nRecordNUM;	
	CClientDC* pDCPicture;//&m_StaticPicture);&m_StaticDataDisp


long nRecord[5];
	int nBottomPicture;
	int nTopPicture;
	int nLeftPicture ;
	int nRightPicture ;

	long m_nLineWindth;
	long m_nLineHeight;
	long m_lInterval;
	void WriteToPicture(int x,int y,int z=0);
	void WriteToPictureC(int x,int y);
	void GetDataTimes();
	CString m_BatteryID[5];
	unsigned char m_nSetup[5];
	int m_sProgram[5];
	int m_nCycleAll[5];
	unsigned char m_BatteryStatus[5];
	unsigned char m_StationOnLine[5];
    int nBottom[5];
	int nTop[5];
	int nLeft[5];
	int nRight[5];
    CRect rect[5];
	CRgn rectLcd;
	CRgn rectLine;

	CPoint MousePoint;
protected: // create from serialization only
	void  OnRecordDelete() ;
	void OnAdd();
	ComData m_ComData;
	EVENT_INFO m_EventInfo;
	void InintLst();
	void InsertVolumn(CListCtrl *pListCtrl, EVENT_INFO * pIn);
    UINT rgID[4] ;
	CPropertyPage m_pages[4];
	CSYSTEMSetupDlg m_SYSTEMSetupDlg;
	CDataProcessDlg m_DataProcessDlg;
	CAnalysisSetupDlg m_AnalysisSetupDlg;
	CCommSetDlg m_CommSetup;
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CDigitalPowerAnalystView)
	afx_msg void OnAnalysisSetup();
	afx_msg LONG OnCommunication(WPARAM ReadBuf, LPARAM BytesRead);
	afx_msg LONG OnCommAnaly(WPARAM CmdnStation, LPARAM nCycle);
	afx_msg void OnBatteryCheck();
	afx_msg void OnDATAProcess();
	afx_msg void OnDeviceSetup();
	afx_msg void OnSetupSerialPort();
	afx_msg void OnAutoCharge();
	afx_msg void OnAutoDischarge();
	afx_msg void OnSTATICStation1();
	afx_msg void OnSTATICStation2();
	afx_msg void OnSTATICStation3();
	afx_msg void OnSTATICStation4();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
 	afx_msg void OnStopTimer();
 	afx_msg void OnStartTimer(); 
	afx_msg void OnCHECKStation1();
	afx_msg void OnCHECKStation2();
	afx_msg void OnCHECKStation3();
	afx_msg void OnCHECKStation4();
	afx_msg void OnCHECKStationAll();
	afx_msg void OnClearData();
	afx_msg void OnUpdateRecordDelete(CCmdUI* pCmdUI);
	afx_msg void OnRecordUpdate();
	afx_msg void OnUpdateRecordUpdate(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	void WriteGrid(CStatic* m_StaticDataDisp);

};

#ifndef _DEBUG  // debug version in ex31bView.cpp
inline CDigitalPowerAnalystDoc* CDigitalPowerAnalystView::GetDocument()
   { return (CDigitalPowerAnalystDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_EX31BVIEW_H__A0805538_01E1_11D2_9E4D_00A0C9B1AF6D__INCLUDED_)

⌨️ 快捷键说明

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