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

📄 myformview.cpp

📁 一个非常好的GPS应用软件
💻 CPP
字号:
// MyFormView.cpp : implementation file
//

#include "stdafx.h"
#include "GpsNav.h"
#include "MyFormView.h"

#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMyFormView



void AddCheckChar(const CString str,char *szBuf);
CString Format(const CString str);


IMPLEMENT_DYNCREATE(CMyFormView, CFormView)

CMyFormView::CMyFormView()
	: CFormView(CMyFormView::IDD)
{
	//{{AFX_DATA_INIT(CMyFormView)
	m_Position = _T("");
	m_Exe = _T("");
	//}}AFX_DATA_INIT
}

CMyFormView::~CMyFormView()
{
}

void CMyFormView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMyFormView)
	DDX_Control(pDX, IDC_EDITEXE, m_Ctr_Exe);
	DDX_Control(pDX, IDC_EDITzuobiao, m_Ctrl_Position);
	DDX_Text(pDX, IDC_EDITzuobiao, m_Position);
	DDX_Text(pDX, IDC_EDITEXE, m_Exe);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMyFormView, CFormView)
	//{{AFX_MSG_MAP(CMyFormView)
	ON_BN_CLICKED(IDC_EXE, OnExe)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyFormView diagnostics

#ifdef _DEBUG
void CMyFormView::AssertValid() const
{
	CFormView::AssertValid();
}

void CMyFormView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMyFormView message handlers



void CMyFormView::OnExe() 
{
	// TODO: Add your control notification handler code here

	CMainFrame * pfr=(CMainFrame * )AfxGetMainWnd();
	if(!pfr->bStart)
	{					
		CString str=("请先开始测量,以打开端口!");
		GetDlgItem(IDC_EDITzuobiao)->SetWindowText(str);
		//AfxMessageBox("请先开始测量!");
		return;
	}
	UpdateData(TRUE);

	char szBuf[512]="";
	CString sTemp="";
	sTemp=Format(m_Exe);
	AddCheckChar(sTemp,szBuf);

	pfr->m_pPort->WriteToPort(szBuf,sTemp.GetLength()+3);//,8);
	m_Ctr_Exe.SetSel(0,-1);
	GetDlgItem(IDC_EDITEXE)->SetFocus( );
	
}

void CMyFormView::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();

	m_Ctrl_Position.SetReadOnly( TRUE );

				
	CString str="小说明:\r\n";
	str+="I.本程序可以记录两种格式的数\r\n  据:\r\n";
	str+="  1.log文件 记录解算出来的坐\r\n    标等数据(文本格式)\r\n";
	str+="  2.mot文件 记录接收机输出的\r\n    所有数据(二进制格式)\r\n\r\n";
	str+="II.菜单中的命令\"记录数据\"指的\r\n  是.mot文件\r\n\r\n";
	str+="III.图像中蓝线表示线路,红+表\r\n  示当前点\r\n\r\n";
	str+="IV.快捷键:\r\n  F5--开始测量\r\n  F6--记录数据\r\n  F7--停止测量\r\n\r\n";

	str+="\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n";
	str+="\t    班级:200116101\r\n\t    姓名:易  鹏\r\n\t    学号:200131610271";
	GetDlgItem(IDC_EDITzuobiao)->SetWindowText(str);

	// TODO: Add your specialized code here and/or call the base class
	
}

⌨️ 快捷键说明

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