You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
1.7 KiB
C++
90 lines
1.7 KiB
C++
// circleguidence.cpp : 实现文件
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "circleguidence.h"
|
|
#include "afxdialogex.h"
|
|
|
|
|
|
// CCircleGuidence 对话框
|
|
|
|
IMPLEMENT_DYNAMIC(CCircleGuidence, CBCGPDialog)
|
|
|
|
CCircleGuidence::CCircleGuidence(CWnd* pParent /*=NULL*/)
|
|
: CBCGPDialog(CCircleGuidence::IDD, pParent)
|
|
{
|
|
EnableVisualManagerStyle(TRUE, TRUE);
|
|
}
|
|
|
|
CCircleGuidence::~CCircleGuidence()
|
|
{
|
|
|
|
}
|
|
|
|
void CCircleGuidence::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CBCGPDialog::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_EDIT_ALT, m_Altitude);
|
|
DDX_Control(pDX, IDC_EDIT_RADIUS, m_Radius);
|
|
DDX_Control(pDX, IDC_COMBO_DIRECTION, m_Direction);
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CCircleGuidence, CBCGPDialog)
|
|
ON_BN_CLICKED(IDOK, &CCircleGuidence::OnBnClickedOk)
|
|
END_MESSAGE_MAP()
|
|
|
|
BOOL CCircleGuidence::OnInitDialog()
|
|
{
|
|
CBCGPDialog::OnInitDialog();
|
|
CenterWindow();
|
|
|
|
m_Direction.InsertString(0,"左盘");
|
|
m_Direction.InsertString(1,"右盘");
|
|
m_Direction.SetCurSel(0);
|
|
|
|
m_Altitude.SetWindowTextA("30");
|
|
m_Radius.SetWindowTextA("10");
|
|
|
|
return true;
|
|
}
|
|
|
|
// CCircleGuidence 消息处理程序
|
|
|
|
|
|
void CCircleGuidence::OnBnClickedOk()
|
|
{
|
|
double alt,radius;
|
|
|
|
CString cstr;
|
|
m_Altitude.GetWindowTextA(cstr);
|
|
alt = _ttof(cstr);
|
|
if (alt<=0 || alt>300)
|
|
{
|
|
BCGPMessageBox( _T( "高度值在0-300m之间!"));
|
|
return;
|
|
}
|
|
g_alt = alt;
|
|
|
|
m_Radius.GetWindowTextA(cstr);
|
|
radius = _ttof(cstr);
|
|
if (radius<2 || radius>300)
|
|
{
|
|
BCGPMessageBox( _T( "半径值在2-300m之间!"));
|
|
return;
|
|
}
|
|
g_radius = radius;
|
|
|
|
m_Direction.GetWindowTextA(cstr);
|
|
if (cstr == "左盘")
|
|
{
|
|
g_direction = -1;
|
|
}
|
|
else if(cstr == "右盘")
|
|
{
|
|
g_direction = 1;
|
|
}
|
|
|
|
CBCGPDialog::OnOK();
|
|
}
|