www.pudn.com > GpsSimulation.rar > RyxGpsDoc.cpp


// RyxGpsDoc.cpp : implementation of the CRyxGpsDoc class 
// 
 
#include "stdafx.h" 
#include "RyxGps.h" 
 
#include "RyxGpsDoc.h" 
 
#include "MainFrm.h" 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CRyxGpsDoc 
 
IMPLEMENT_DYNCREATE(CRyxGpsDoc, CDocument) 
 
BEGIN_MESSAGE_MAP(CRyxGpsDoc, CDocument) 
	//{{AFX_MSG_MAP(CRyxGpsDoc) 
	ON_COMMAND(ID_SV1, OnSv1) 
	ON_COMMAND(ID_SV2, OnSv2) 
	ON_UPDATE_COMMAND_UI(ID_SV2, OnUpdateSv2) 
	ON_UPDATE_COMMAND_UI(ID_SV1, OnUpdateSv1) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CRyxGpsDoc construction/destruction 
 
CRyxGpsDoc::CRyxGpsDoc() 
{ 
	// TODO: add one-time construction code here 
 
} 
 
CRyxGpsDoc::~CRyxGpsDoc() 
{ 
} 
 
BOOL CRyxGpsDoc::OnNewDocument() 
{ 
	if (!CDocument::OnNewDocument()) 
		return FALSE; 
	m_ReveiverID=1; 
	lstrcpy(m_buffer,"start here!"); 
	return TRUE; 
} 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CRyxGpsDoc serialization 
 
void CRyxGpsDoc::Serialize(CArchive& ar) 
{ 
	if (ar.IsStoring()) 
	{ 
		// TODO: add storing code here 
	} 
	else 
	{ 
		// TODO: add loading code here 
	} 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CRyxGpsDoc diagnostics 
 
#ifdef _DEBUG 
void CRyxGpsDoc::AssertValid() const 
{ 
	CDocument::AssertValid(); 
} 
 
void CRyxGpsDoc::Dump(CDumpContext& dc) const 
{ 
	CDocument::Dump(dc); 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CRyxGpsDoc commands 
 
int CRyxGpsDoc::GetWordPos(int order) //order is 0 based 
{ 
	BOOL bBlank=TRUE; 
	int  i; 
	int  iWordNum=0; 
	for(i=0;im_wndStatusBar.SetPaneText(1," 当前的接收机:  SV1"); 
} 
 
void CRyxGpsDoc::OnSv2()  
{ 
	// TODO: Add your command handler code here 
	m_ReveiverID=2; 
	CMainFrame *pFrame=(CMainFrame *)AfxGetMainWnd(); 
	pFrame->m_wndStatusBar.SetPaneText(1," 当前的接收机:  SV2"); 
} 
 
void CRyxGpsDoc::OnUpdateSv2(CCmdUI* pCmdUI)  
{ 
	// TODO: Add your command update UI handler code here 
	pCmdUI->SetRadio(m_ReveiverID==2); 
} 
 
void CRyxGpsDoc::OnUpdateSv1(CCmdUI* pCmdUI)  
{ 
	// TODO: Add your command update UI handler code here 
	pCmdUI->SetRadio(m_ReveiverID==1); 
}