00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #if !defined(AFX_CONTROLPANELVIEW_H__A65BC073_A580_49D8_8D97_128E70CCB1E9__INCLUDED_)
00014 #define AFX_CONTROLPANELVIEW_H__A65BC073_A580_49D8_8D97_128E70CCB1E9__INCLUDED_
00015
00016 #if _MSC_VER > 1000
00017 #pragma once
00018 #endif // _MSC_VER > 1000
00019
00020
00021 #include "../common/I2CBridge.h"
00022 #include "MainFrm.h"
00023
00025
00026
00027 class CControlPanelView : public CListView
00028 {
00029 protected:
00030 CControlPanelView();
00031 DECLARE_DYNCREATE(CControlPanelView)
00032
00033
00034 public:
00035
00036
00037 public:
00038 CMainFrame* GetMainFrame();
00039 void PrintLine(CString str);
00040 void PrintHexBuffer(const BYTE *pBuffer, int Length);
00041 void PrintTransaction(const U2C_TRANSACTION &Transaction, bool bPrintBuffer);
00042 void PrintError(CString strFunName, U2C_RESULT ErrorCode);
00043 void IncIndent() {m_indent++;};
00044 void DecIndent() {m_indent--;};
00045 void EnableControls(bool bEnable);
00046
00047
00048 protected:
00049 CString U2cResult2Str(U2C_RESULT res);
00050
00051
00052
00053
00054 public:
00055 virtual void OnInitialUpdate();
00056 virtual BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE);
00057 protected:
00058 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00059
00060
00061
00062 protected:
00063 virtual ~CControlPanelView();
00064 #ifdef _DEBUG
00065 virtual void AssertValid() const;
00066 virtual void Dump(CDumpContext& dc) const;
00067 #endif
00068
00069
00070 protected:
00071
00072 afx_msg void OnSize(UINT nType, int cx, int cy);
00073 afx_msg void OnClearLog();
00074 afx_msg void OnAutoscroll();
00075 afx_msg void OnUpdateAutoscroll(CCmdUI* pCmdUI);
00076 afx_msg void OnUpdateI2cFrequency(CCmdUI* pCmdUI);
00077
00078 DECLARE_MESSAGE_MAP()
00079 private:
00080 int m_indent;
00081 BOOL m_bAutoscroll;
00082 bool m_bControlsEnabled;
00083
00084 };
00085
00087
00088
00089
00090
00091 #endif // !defined(AFX_CONTROLPANELVIEW_H__A65BC073_A580_49D8_8D97_128E70CCB1E9__INCLUDED_)