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.
107 lines
2.3 KiB
C++
107 lines
2.3 KiB
C++
// setmultiroutedlg.cpp : 实现文件
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "setmultiroutedlg.h"
|
|
#include "afxdialogex.h"
|
|
|
|
|
|
// SetMultiRouteDlg 对话框
|
|
|
|
IMPLEMENT_DYNAMIC(SetMultiRouteDlg, CBCGPDialog)
|
|
|
|
SetMultiRouteDlg::SetMultiRouteDlg(CWnd* pParent /*=NULL*/)
|
|
: CBCGPDialog(SetMultiRouteDlg::IDD, pParent)
|
|
{
|
|
EnableVisualManagerStyle(TRUE, TRUE);
|
|
|
|
numPoints = 0;
|
|
selectHPtNumber = 0;
|
|
}
|
|
|
|
SetMultiRouteDlg::~SetMultiRouteDlg()
|
|
{
|
|
}
|
|
|
|
void SetMultiRouteDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CBCGPDialog::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_COMBO_HPT, m_HPtCombobox);
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(SetMultiRouteDlg, CBCGPDialog)
|
|
ON_BN_CLICKED(IDOK, &SetMultiRouteDlg::OnBnClickedOk)
|
|
ON_CBN_SELCHANGE(IDC_COMBO_HPT, &SetMultiRouteDlg::OnCbnSelchangeComboHpt)
|
|
END_MESSAGE_MAP()
|
|
|
|
BOOL SetMultiRouteDlg::OnInitDialog()
|
|
{
|
|
CBCGPDialog::OnInitDialog();
|
|
CenterWindow();
|
|
GetDlgItem( IDC_EDIT_AZIMUTH )->SetWindowTextA("0");
|
|
GetDlgItem( IDC_EDIT_LINEINTERVAL )->SetWindowTextA("30");
|
|
GetDlgItem( IDC_EDIT_HEIGHTINTERVAL )->SetWindowTextA("10");
|
|
GetDlgItem( IDC_EDIT_LINENUMBER )->SetWindowTextA("3");
|
|
|
|
CString str;
|
|
for (int i=1;i<=numPoints;++i)
|
|
{
|
|
str.Format("%d",i);
|
|
m_HPtCombobox.InsertString(i,str);
|
|
}
|
|
m_HPtCombobox.SetCurSel(0);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
// SetMultiRouteDlg 消息处理程序
|
|
|
|
|
|
void SetMultiRouteDlg::OnBnClickedOk()
|
|
{
|
|
CString cstr;
|
|
((CEdit*)GetDlgItem(IDC_EDIT_AZIMUTH))->GetWindowTextA(cstr);
|
|
azmuth = _ttof(cstr);
|
|
if (azmuth<0 || azmuth>360)
|
|
{
|
|
BCGPMessageBox("方位角范围为[0,360]!");
|
|
}
|
|
((CEdit*)GetDlgItem(IDC_EDIT_LINEINTERVAL))->GetWindowTextA(cstr);
|
|
lineInterval = _ttof(cstr);
|
|
if (lineInterval<0 )
|
|
{
|
|
BCGPMessageBox("航线间隔必须大于0!");
|
|
}
|
|
((CEdit*)GetDlgItem(IDC_EDIT_HEIGHTINTERVAL))->GetWindowTextA(cstr);
|
|
heightInterval = _ttof(cstr);
|
|
if (heightInterval<0 || heightInterval > 100)
|
|
{
|
|
BCGPMessageBox("高度间隔为[0,100]!");
|
|
}
|
|
((CEdit*)GetDlgItem(IDC_EDIT_LINENUMBER))->GetWindowTextA(cstr);
|
|
numLine = _ttof(cstr);
|
|
if (numLine<1 || numLine > 10)
|
|
{
|
|
BCGPMessageBox("航线数为[1,10]!");
|
|
}
|
|
|
|
this->OnOK();
|
|
}
|
|
|
|
void SetMultiRouteDlg::SetPointNumber(int num)
|
|
{
|
|
numPoints = num;
|
|
}
|
|
|
|
int SetMultiRouteDlg::GetHPointNumber()
|
|
{
|
|
return selectHPtNumber;
|
|
}
|
|
|
|
|
|
void SetMultiRouteDlg::OnCbnSelchangeComboHpt()
|
|
{
|
|
selectHPtNumber = m_HPtCombobox.GetCurSel();
|
|
}
|