?? mcdsdoc.cpp
字號:
// mcdsDoc.cpp : implementation of the CMcdsDoc class
//
#include "stdafx.h"
#include "mcds.h"
#include "mcdsDoc.h"
#include "GlobalVar.h"
#include "TimeLimitDlg.h"
#include "NumLimitDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMcdsDoc
IMPLEMENT_DYNCREATE(CMcdsDoc, CDocument)
BEGIN_MESSAGE_MAP(CMcdsDoc, CDocument)
//{{AFX_MSG_MAP(CMcdsDoc)
ON_COMMAND(ID_MENU_LIMITNUMBER, OnMenuLimitnumber)
ON_UPDATE_COMMAND_UI(ID_MENU_LIMITNUMBER, OnUpdateMenuLimitnumber)
ON_COMMAND(ID_MENU_LIMITTIME, OnMenuLimittime)
ON_UPDATE_COMMAND_UI(ID_MENU_LIMITTIME, OnUpdateMenuLimittime)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMcdsDoc construction/destruction
CMcdsDoc::CMcdsDoc()
{
// TODO: add one-time construction code here
for(int i=0;i<=255;i++)
{
data[i]=0;
}
lsSetROILeft=false;
lsSetROIRight=false;
}
CMcdsDoc::~CMcdsDoc()
{
}
BOOL CMcdsDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
for(int i=0;i<=255;i++)
{
data[i]=0;
// m_data[i]=0;
}
lsSetROILeft=false;
lsSetROIRight=false;
nNumInfo[20]="0";
nNumInfo[21]="255";
nNumInfo[22]="256";
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMcdsDoc serialization
void CMcdsDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
CString str;
str="文件頭";
ar<<str;
for(int i=0;i<=255;i++)
{
ar<<data[i]; //初始化計數緩沖區
}
}
else
{
// TODO: add loading code here
CString str;
ar>>str;
for(int i=0;i<=255;i++)
{
ar>>data[i]; //初始化計數緩沖區
}
}
}
/////////////////////////////////////////////////////////////////////////////
// CMcdsDoc diagnostics
#ifdef _DEBUG
void CMcdsDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CMcdsDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMcdsDoc commands
void CMcdsDoc::OnMenuLimitnumber()
{
// TODO: Add your command handler code here
CNumLimitDlg NumLimitDlg;
if(NumLimitDlg.DoModal()==IDOK)
{
lsUpdate[9]=true;
};
lsUpdate[2]=true;
UpdateAllViews(NULL);
}
void CMcdsDoc::OnUpdateMenuLimitnumber(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
cs.Lock();
pCmdUI->SetCheck(nNumInfo[2]=="計數");
cs.Unlock();
}
void CMcdsDoc::OnMenuLimittime()
{
// TODO: Add your command handler code here
CTimeLimitDlg TimeLimitDlg;
if(TimeLimitDlg.DoModal()==IDOK)
{
lsUpdate[7]=true;
};
lsUpdate[2]=true;
UpdateAllViews(NULL);
}
void CMcdsDoc::OnUpdateMenuLimittime(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
cs.Lock();
pCmdUI->SetCheck(nNumInfo[2]=="時間");
cs.Unlock();
}
BOOL CMcdsDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
// TODO: Add your specialized creation code here
return TRUE;
}
BOOL CMcdsDoc::OnSaveDocument(LPCTSTR lpszPathName)
{
// TODO: Add your specialized code here and/or call the base class
return CDocument::OnSaveDocument(lpszPathName);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -