?? stestrview.cpp
字號:
// STestRView.cpp : implementation of the CSTestRView class
//
#include "stdafx.h"
#include "STestR.h"
#include "STestRDoc.h"
#include "STestRView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSTestRView
IMPLEMENT_DYNCREATE(CSTestRView, CRealView)
BEGIN_MESSAGE_MAP(CSTestRView, CRealView)
//{{AFX_MSG_MAP(CSTestRView)
ON_WM_TIMER()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSTestRView construction/destruction
CSTestRView::CSTestRView()
{
// TODO: add construction code here
}
CSTestRView::~CSTestRView()
{
}
BOOL CSTestRView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CSTestRView drawing
void CSTestRView::OnDraw(CDC* pDC)
{
CSTestRDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRealView::OnDraw(pDC);
}
/////////////////////////////////////////////////////////////////////////////
// CSTestRView printing
BOOL CSTestRView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CSTestRView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CSTestRView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CSTestRView diagnostics
#ifdef _DEBUG
void CSTestRView::AssertValid() const
{
CView::AssertValid();
}
void CSTestRView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CSTestRDoc* CSTestRView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSTestRDoc)));
return (CSTestRDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSTestRView message handlers
void CSTestRView::OnInitialUpdate()
{
CRealView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
SetViewCaption("電機實時曲線");
DeleteAllCurve();
AddCurve("電流曲線",0xFF);
SetTimer(1,1000,NULL);
}
void CSTestRView::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
int nData=rand()%50+100;
InputValue(0,(double)nData);
CRealView::OnTimer(nIDEvent);
}
void CSTestRView::OnDestroy()
{
CRealView::OnDestroy();
// TODO: Add your message handler code here
KillTimer(1);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -