665 lines
20 KiB
C++
665 lines
20 KiB
C++
// DialNew2DTask.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "GeoMative.h"
|
|
#include "DialNew2DTask.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CDialNew2DTask dialog
|
|
extern CGeoMativeApp theApp;
|
|
extern int g_iUILanguage;
|
|
extern int g_iOnLineVersion;
|
|
CDialNew2DTask::CDialNew2DTask(CTaskDataOper* pTaskOper,CWnd* pParent /*=NULL*/)
|
|
: CDialog(CDialNew2DTask::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(CDialNew2DTask)
|
|
// NOTE: the ClassWizard will add member initialization here
|
|
//}}AFX_DATA_INIT
|
|
m_strTaskName = _T("");
|
|
m_strTestPlace = _T("");
|
|
m_strSptName = _T("");
|
|
m_strArray = _T("");
|
|
m_strTestType = _T("");
|
|
m_iTestType = -1;
|
|
m_iAR = -1;
|
|
m_iSptID = -1;
|
|
m_iStacking = -1;
|
|
m_iTxWave = -1;
|
|
m_iTxPeriod = -1;
|
|
m_iSAInterval = -1;
|
|
m_iCableLayout = -1;
|
|
m_iStatrLayer = 0;
|
|
m_iEndLayer = 0;
|
|
m_iStartElec = 0;
|
|
m_iEndElec = 0;
|
|
m_fEelcSpace = 1;
|
|
m_iSkipCable = 0;
|
|
m_iRollCnt = 0;
|
|
m_iTPmount = 0;
|
|
m_iNewTaskID = 0;
|
|
m_pTaskOper = pTaskOper;
|
|
m_ucSptType = 1;
|
|
}
|
|
|
|
|
|
void CDialNew2DTask::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CDialNew2DTask)
|
|
DDX_Control(pDX, IDC_2D_ELEC_SPACE, m_fEditESpace);
|
|
DDX_Control(pDX, IDC_2D_CROSS_HOLE_DISTANCE, m_fEditHoleSpace);
|
|
DDX_Control(pDX, IDC_COMBO_2D_TX_PERIOD, m_cmbTxPeriod);
|
|
DDX_Control(pDX, IDC_COMBO_2D_TEST_TYPE, m_cmbTestType);
|
|
DDX_Control(pDX, IDC_COMBO_2D_SKIP_CABLE, m_cmbSkipCable);
|
|
DDX_Control(pDX, IDC_COMBO_2D_SCRIPT, m_cmbSpt);
|
|
DDX_Control(pDX, IDC_COMBO_2D_ROLL, m_cmbRoll);
|
|
DDX_Control(pDX, IDC_COMBO_2D_CABLE_LAYOUT, m_cmbCLayout);
|
|
DDX_Control(pDX, IDC_COMBO_2D_ARRAY, m_cmbArray);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CDialNew2DTask, CDialog)
|
|
//{{AFX_MSG_MAP(CDialNew2DTask)
|
|
ON_CBN_SELCHANGE(IDC_COMBO_2D_ARRAY, OnSelchangeCombo2dArray)
|
|
ON_CBN_SELCHANGE(IDC_COMBO_2D_SCRIPT, OnSelchangeCombo2dScript)
|
|
ON_CBN_SELCHANGE(IDC_COMBO_2D_TEST_TYPE, OnSelchangeCombo2dTestType)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CDialNew2DTask message handlers
|
|
|
|
BOOL CDialNew2DTask::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
// TODO: Add extra initialization here
|
|
|
|
((CEdit*)(GetDlgItem(IDC_2D_TASK_NAME)))->SetLimitText(50);
|
|
((CEdit*)(GetDlgItem(IDC_2D_TEST_PLACE)))->SetLimitText(50);
|
|
if (LANG_ENUS == g_iUILanguage)
|
|
{
|
|
m_cmbTestType.AddString(_T("RES"));
|
|
m_cmbTestType.AddString(_T("IP"));
|
|
m_cmbTestType.AddString(_T("SP"));
|
|
}
|
|
else
|
|
{
|
|
m_cmbTestType.AddString(_T("电阻率"));
|
|
m_cmbTestType.AddString(_T("激电"));
|
|
m_cmbTestType.AddString(_T("自电"));
|
|
}
|
|
m_cmbTestType.SetCurSel(0);
|
|
|
|
std::vector<STQueryMediumInfo> vtMediumInfo;
|
|
vtMediumInfo.clear();
|
|
m_pTaskOper->QueryMediumInfo(1, vtMediumInfo);
|
|
|
|
int i = 0;
|
|
for (i = 0; i < vtMediumInfo.size(); i++)
|
|
{
|
|
m_cmbArray.AddString(vtMediumInfo[i].strMediumName);
|
|
m_cmbArray.SetItemData(i, vtMediumInfo[i].iMediumID);
|
|
}
|
|
GetDlgItem(IDC_2D_STACKING)->SetWindowText("1");
|
|
GetDlgItem(IDC_2D_TX_WAVE)->SetWindowText(_T("0+0-"));
|
|
GetDlgItem(IDC_2D_TX_WAVE)->EnableWindow(FALSE);
|
|
m_iTxWave = 6; //表示0+0-
|
|
|
|
m_vtCLayoutInfo.clear();
|
|
m_pTaskOper->QueryCmInfo(_T("Clayout"), m_vtCLayoutInfo);
|
|
for(i = 0; i < m_vtCLayoutInfo.size(); i++)
|
|
{
|
|
//默认电阻率,这里需要过滤掉激电的部分
|
|
if ((0 == (m_vtCLayoutInfo[i].iVal+1)%2) || m_vtCLayoutInfo[i].iVal > 3)
|
|
{
|
|
continue;
|
|
}
|
|
if ((theApp.m_iCableType > 0) && (m_cmbCLayout.GetCount() >0))
|
|
{
|
|
break;
|
|
}
|
|
m_cmbCLayout.AddString(m_vtCLayoutInfo[i].strCLable);
|
|
m_cmbCLayout.SetItemData(m_cmbCLayout.GetCount()-1, m_vtCLayoutInfo[i].iVal);
|
|
}
|
|
//
|
|
/* m_cmbTxPeriod.ResetContent();
|
|
m_cmbTxPeriod.AddString(_T("64 S"));
|
|
m_cmbTxPeriod.SetItemData(0, 0);
|
|
m_cmbTxPeriod.AddString(_T("32 S"));
|
|
m_cmbTxPeriod.SetItemData(1, 9);
|
|
i = 16;
|
|
int iIndex = 1;
|
|
CString strTxPeriod = _T("");
|
|
while(i > 0)
|
|
{
|
|
strTxPeriod.Empty();
|
|
strTxPeriod.Format(_T("%d S"), i);
|
|
m_cmbTxPeriod.AddString(strTxPeriod);
|
|
m_cmbTxPeriod.SetItemData(i+1, i);
|
|
i = i/2;
|
|
}
|
|
*/
|
|
CString strTxPeriod = _T("");
|
|
for (i = 1; i < 8; i++)
|
|
{
|
|
strTxPeriod.Empty();
|
|
if (i == 1)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
strTxPeriod.Format(_T("自动"));
|
|
else
|
|
strTxPeriod.Format(_T("Auto"));
|
|
}
|
|
else
|
|
{
|
|
strTxPeriod.Format(_T("%.0f S"), pow(2, i - 1));
|
|
}
|
|
|
|
m_cmbTxPeriod.AddString(strTxPeriod);
|
|
m_cmbTxPeriod.SetItemData(i-1, i);
|
|
}
|
|
//m_cmbTxPeriod.SetCurSel(-1);
|
|
//m_cmbTxPeriod.EnableWindow(FALSE);
|
|
m_cmbTxPeriod.EnableWindow(TRUE);
|
|
m_cmbTxPeriod.SetCurSel(0);
|
|
//起始电极和结束电极
|
|
GetDlgItem(IDC_2D_START_ELEC)->SetWindowText(_T("0"));
|
|
//GetDlgItem(IDC_2D_START_ELEC)->EnableWindow(FALSE);
|
|
GetDlgItem(IDC_2D_END_ELEC)->SetWindowText(_T("0"));
|
|
//GetDlgItem(IDC_2D_END_ELEC)->EnableWindow(FALSE);
|
|
//开始层苏和结束层数
|
|
GetDlgItem(IDC_2D_START_LAYER)->SetWindowText(_T("0"));
|
|
GetDlgItem(IDC_2D_START_LAYER)->EnableWindow(FALSE);
|
|
GetDlgItem(IDC_2D_END_LAYER)->SetWindowText(_T("0"));
|
|
GetDlgItem(IDC_2D_END_LAYER)->EnableWindow(FALSE);
|
|
|
|
m_cmbSkipCable.AddString(_T("0"));
|
|
m_cmbSkipCable.EnableWindow(FALSE);
|
|
m_cmbSkipCable.SetCurSel(0);
|
|
if (LANG_ENUS == g_iUILanguage)
|
|
{
|
|
GetDlgItem(IDC_STATIC_TASK_NAME)->SetWindowText("Task Name:");
|
|
GetDlgItem(IDC_STATIC_TEST_PLACE)->SetWindowText("Test Location:");
|
|
GetDlgItem(IDC_STATIC_TEST_TYPE)->SetWindowText("Method:");
|
|
GetDlgItem(IDC_STATIC_CABLE_LAYOUT)->SetWindowText("Cable Deployment:");
|
|
|
|
GetDlgItem(IDC_STATIC_ARRAY_TYPE)->SetWindowText("Array Type:");
|
|
GetDlgItem(IDC_STATIC_SCRIPT)->SetWindowText("Script:");
|
|
GetDlgItem(IDC_STATIC_STACKING)->SetWindowText("Stacking:");
|
|
|
|
GetDlgItem(IDC_STATIC_START_ELEC)->SetWindowText("Start Electrode:");
|
|
GetDlgItem(IDC_STATIC_END_ELEC)->SetWindowText("End Electrode:");
|
|
GetDlgItem(IDC_STATIC_START_LAYOUT)->SetWindowText("Start Layer:");
|
|
GetDlgItem(IDC_STATIC_END_LAYER)->SetWindowText("End Layer:");
|
|
|
|
GetDlgItem(IDC_STATIC_SKIP_CABLE)->SetWindowText("Skip Electrode:");
|
|
GetDlgItem(IDC_STATIC_ROLL)->SetWindowText("Rolling Along:");
|
|
GetDlgItem(IDC_STATIC_ELEC_SPACE)->SetWindowText("Electrode Spacing:");
|
|
|
|
GetDlgItem(IDC_STATIC_TX_WAVEFORM)->SetWindowText("Tx Waveform:");
|
|
GetDlgItem(IDC_STATIC_TX_PERIOD)->SetWindowText("Tx Period:");
|
|
GetDlgItem(IDC_STATIC_SA_INTERVAL)->SetWindowText("Sampleing Interval(ms):");
|
|
GetDlgItem(IDC_STATIC_CROSS_HOLE_DISTANCE)->SetWindowText(_T("Hole spacing:"));
|
|
m_cmbRoll.AddString(_T("Not Roll"));
|
|
GetDlgItem(IDOK)->SetWindowText("Create");
|
|
GetDlgItem(IDCANCEL)->SetWindowText("Cancel");
|
|
GetDlgItem(IDC_IF_TEST_GR)->SetWindowTextA("Grounding Resistance");
|
|
}
|
|
else
|
|
m_cmbRoll.AddString(_T("不滚动"));
|
|
m_cmbRoll.SetCurSel(0);
|
|
m_cmbRoll.EnableWindow(FALSE);
|
|
|
|
GetDlgItem(IDC_2D_SA_INTERVAL)->SetWindowText(_T("0"));
|
|
GetDlgItem(IDC_2D_ELEC_SPACE)->SetWindowText(_T("1.00"));
|
|
m_fEditESpace.SetIntLimitLen(5);
|
|
m_fEditESpace.SetDecLimitLen(2);
|
|
|
|
GetDlgItem(IDC_2D_CROSS_HOLE_DISTANCE)->SetWindowText(_T("2.00"));
|
|
m_fEditHoleSpace.SetIntLimitLen(5);
|
|
m_fEditHoleSpace.SetDecLimitLen(2);
|
|
|
|
((CEdit*)(GetDlgItem(IDC_2D_SA_INTERVAL)))->SetLimitText(7);
|
|
|
|
//默认测试接地电阻
|
|
((CButton*)GetDlgItem(IDC_IF_TEST_GR))->SetCheck(TRUE);
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CDialNew2DTask::OnSelchangeCombo2dArray()
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
int iSel = m_cmbArray.GetCurSel();
|
|
if (-1 != iSel)
|
|
{
|
|
m_cmbSpt.ResetContent();
|
|
std::vector<STQuerySptInfo> vtSptInfo;
|
|
vtSptInfo.clear();
|
|
int iAR = m_cmbArray.GetItemData(iSel);
|
|
m_pTaskOper->QuerySptByAR(iAR, vtSptInfo,1);
|
|
for (int i = 0; i < vtSptInfo.size(); i++)
|
|
{
|
|
m_cmbSpt.AddString(vtSptInfo[i].strSptName);
|
|
m_cmbSpt.SetItemData(i, vtSptInfo[i].iSptID);
|
|
}
|
|
|
|
if (AR_CROSS_HOLE_TYPE == iAR)
|
|
{
|
|
GetDlgItem(IDC_2D_CROSS_HOLE_DISTANCE)->ShowWindow(TRUE);
|
|
GetDlgItem(IDC_STATIC_CROSS_HOLE_DISTANCE)->ShowWindow(TRUE);
|
|
}
|
|
else
|
|
{
|
|
GetDlgItem(IDC_2D_CROSS_HOLE_DISTANCE)->ShowWindow(FALSE);
|
|
GetDlgItem(IDC_STATIC_CROSS_HOLE_DISTANCE)->ShowWindow(FALSE);
|
|
}
|
|
|
|
if (AR_CROSS_HOLE_GEOMATIVE == iAR
|
|
|| AR_CROSS_HOLE_GEOMATIVE_AM == iAR)
|
|
{
|
|
GetDlgItem(IDC_2D_START_ELEC)->EnableWindow(FALSE);
|
|
GetDlgItem(IDC_2D_END_ELEC)->EnableWindow(FALSE);
|
|
}
|
|
}
|
|
}
|
|
|
|
void CDialNew2DTask::OnSelchangeCombo2dScript()
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
int iSel = m_cmbSpt.GetCurSel();
|
|
if (-1 != iSel)
|
|
{
|
|
int iSptID = m_cmbSpt.GetItemData(iSel);
|
|
if (m_pTaskOper->Query2DSptInfo(iSptID, m_iStatrLayer, m_iEndLayer) && m_pTaskOper->QuerySptElecTpMount(iSptID, m_iEndElec, m_iTPmount))
|
|
{
|
|
m_iStartElec = 1;
|
|
GetDlgItem(IDC_2D_START_ELEC)->SetWindowText(_T("1"));
|
|
|
|
CString str = _T("");
|
|
str.Format(_T("%d"),m_iEndElec);
|
|
GetDlgItem(IDC_2D_END_ELEC)->SetWindowText(str);
|
|
|
|
str.Empty();
|
|
str.Format(_T("%d"),m_iStatrLayer);
|
|
GetDlgItem(IDC_2D_START_LAYER)->SetWindowText(str);
|
|
|
|
str.Empty();
|
|
str.Format(_T("%d"),m_iEndLayer);
|
|
GetDlgItem(IDC_2D_END_LAYER)->SetWindowText(str);
|
|
}
|
|
else
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("查询脚本信息失败"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Query script information failed"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void CDialNew2DTask::OnSelchangeCombo2dTestType()
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
m_cmbCLayout.ResetContent();
|
|
int i = 0;
|
|
if (1 == m_cmbTestType.GetCurSel())
|
|
{
|
|
GetDlgItem(IDC_2D_TX_WAVE)->SetWindowText(_T("+0-0"));
|
|
m_iTxWave = 1;
|
|
|
|
for(i = 0; i < m_vtCLayoutInfo.size(); i++)
|
|
{
|
|
//激电,这里需要过滤掉电阻率的部分
|
|
if ((0 == (m_vtCLayoutInfo[i].iVal)%2) || m_vtCLayoutInfo[i].iVal > 3)
|
|
{
|
|
continue;
|
|
}
|
|
if ((theApp.m_iCableType > 0) && (m_cmbCLayout.GetCount() >0))
|
|
{
|
|
break;
|
|
}
|
|
m_cmbCLayout.AddString(m_vtCLayoutInfo[i].strCLable);
|
|
m_cmbCLayout.SetItemData(m_cmbCLayout.GetCount()-1, m_vtCLayoutInfo[i].iVal);
|
|
}
|
|
|
|
CString strTxPeriod = _T("");
|
|
m_cmbTxPeriod.ResetContent();
|
|
for (i = 1; i < 8; i++)
|
|
{
|
|
strTxPeriod.Empty();
|
|
strTxPeriod.Format(_T("%.0f S"), pow(2, i - 1));
|
|
|
|
m_cmbTxPeriod.AddString(strTxPeriod);
|
|
m_cmbTxPeriod.SetItemData(i - 1, i);
|
|
}
|
|
m_cmbTxPeriod.EnableWindow(TRUE);
|
|
m_cmbTxPeriod.SetCurSel(0);
|
|
}
|
|
else
|
|
{
|
|
if (0 == m_cmbTestType.GetCurSel())
|
|
{
|
|
m_iTxWave = 6;
|
|
GetDlgItem(IDC_2D_TX_WAVE)->SetWindowText(_T("0+0-"));
|
|
for(i = 0; i < m_vtCLayoutInfo.size(); i++)
|
|
{
|
|
//电阻率,这里需要过滤掉激电的部分
|
|
if ((0 == (m_vtCLayoutInfo[i].iVal+1)%2) || m_vtCLayoutInfo[i].iVal > 3)
|
|
{
|
|
continue;
|
|
}
|
|
if ((theApp.m_iCableType > 0) && (m_cmbCLayout.GetCount() >0))
|
|
{
|
|
break;
|
|
}
|
|
m_cmbCLayout.AddString(m_vtCLayoutInfo[i].strCLable);
|
|
m_cmbCLayout.SetItemData(m_cmbCLayout.GetCount()-1, m_vtCLayoutInfo[i].iVal);
|
|
}
|
|
|
|
CString strTxPeriod = _T("");
|
|
m_cmbTxPeriod.ResetContent();
|
|
for (i = 1; i < 8; i++)
|
|
{
|
|
strTxPeriod.Empty();
|
|
if (i == 1)
|
|
{
|
|
strTxPeriod.Format(_T("自动"));
|
|
}
|
|
else
|
|
{
|
|
strTxPeriod.Format(_T("%.0f S"), pow(2, i - 1));
|
|
}
|
|
|
|
m_cmbTxPeriod.AddString(strTxPeriod);
|
|
m_cmbTxPeriod.SetItemData(i - 1, i);
|
|
}
|
|
m_cmbTxPeriod.EnableWindow(TRUE);
|
|
m_cmbTxPeriod.SetCurSel(0);
|
|
}
|
|
else
|
|
{
|
|
m_cmbTxPeriod.SetCurSel(-1);
|
|
m_cmbTxPeriod.EnableWindow(FALSE);
|
|
m_iTxWave = 2;
|
|
GetDlgItem(IDC_2D_TX_WAVE)->SetWindowText(_T("0"));
|
|
//SP在这里布线方式全部显示
|
|
for(i = 0; i < m_vtCLayoutInfo.size(); i++)
|
|
{
|
|
if ((theApp.m_iCableType > 0) && i>1)
|
|
{
|
|
continue;
|
|
}
|
|
if (m_vtCLayoutInfo[i].iVal > 3)
|
|
continue;
|
|
m_cmbCLayout.AddString(m_vtCLayoutInfo[i].strCLable);
|
|
m_cmbCLayout.SetItemData(m_cmbCLayout.GetCount()-1, m_vtCLayoutInfo[i].iVal);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
void CDialNew2DTask::OnOK()
|
|
{
|
|
|
|
// TODO: Add extra validation here
|
|
m_strTaskName.Empty();
|
|
GetDlgItem(IDC_2D_TASK_NAME)->GetWindowText(m_strTaskName);
|
|
if (m_strTaskName.IsEmpty())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("任务名不能为空"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Please input the name of task"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_strTestPlace.Empty();
|
|
GetDlgItem(IDC_2D_TEST_PLACE)->GetWindowText(m_strTestPlace);
|
|
m_iTestType = m_cmbTestType.GetCurSel();
|
|
if (-1 == m_iTestType)
|
|
{
|
|
if (LANG_ZHCN ==g_iUILanguage)
|
|
AfxMessageBox(_T("请选择测试方式"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Please select test method"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_cmbTestType.GetLBText(m_iTestType, m_strTestType);
|
|
|
|
int iSel = m_cmbCLayout.GetCurSel();
|
|
if (-1 == iSel)
|
|
{
|
|
if (LANG_ZHCN ==g_iUILanguage)
|
|
AfxMessageBox(_T("请选择电缆布线方式"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Please select the type of cable deployment"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_iCableLayout = m_cmbCLayout.GetItemData(iSel);
|
|
|
|
iSel = m_cmbArray.GetCurSel();
|
|
if (-1 == iSel)
|
|
{
|
|
if (LANG_ZHCN ==g_iUILanguage)
|
|
AfxMessageBox(_T("请选择装置类型"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Please select array type"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_iAR = m_cmbArray.GetItemData(iSel);
|
|
m_cmbArray.GetLBText(iSel, m_strArray);
|
|
|
|
iSel = m_cmbSpt.GetCurSel();
|
|
if (-1 == iSel)
|
|
{
|
|
if (LANG_ZHCN ==g_iUILanguage)
|
|
AfxMessageBox(_T("请选择测试脚本"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Please select test script"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_iSptID = m_cmbSpt.GetItemData(iSel);
|
|
m_cmbSpt.GetLBText(iSel, m_strSptName);
|
|
|
|
CString strTmp = _T("");
|
|
GetDlgItem(IDC_2D_STACKING)->GetWindowText(strTmp);
|
|
if (strTmp.IsEmpty())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("迭代次数的取值范围为1到255"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Number of stacking must between 1 and 255"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_iStacking = atoi(strTmp);
|
|
if (m_iStacking < 1 || m_iStacking > 255)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("迭代次数的取值范围为1到255"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Number of stacking must between 1 and 255"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_iTxPeriod = 0;
|
|
if (1 == m_iTestType || 0 == m_iTestType)
|
|
{
|
|
iSel = m_cmbTxPeriod.GetCurSel();
|
|
if (-1 == iSel)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("请选择发射周期"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Please select the launch cycle"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_iTxPeriod = m_cmbTxPeriod.GetItemData(iSel);
|
|
}
|
|
|
|
strTmp.Empty();
|
|
GetDlgItem(IDC_2D_ELEC_SPACE)->GetWindowText(strTmp);
|
|
if (strTmp.IsEmpty())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("电极间距不能为空"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Electrode spacing cannot be empty"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_fEelcSpace = atof(strTmp);
|
|
if (fabs(m_fEelcSpace) <=0.000001)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("电极间距不能为零"));
|
|
else
|
|
MessageBoxEx(NULL, _T("The value of pole space can not be zero"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
|
|
if (AR_CROSS_HOLE_TYPE == m_iAR)
|
|
{
|
|
strTmp.Empty();
|
|
GetDlgItem(IDC_2D_CROSS_HOLE_DISTANCE)->GetWindowText(strTmp);
|
|
if (strTmp.IsEmpty())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("孔间距不能为空"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Electrode spacing cannot be empty"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_fHoleSpace = atof(strTmp);
|
|
if (fabs(m_fHoleSpace) <= 0.000001)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("孔间距不能为零"));
|
|
else
|
|
MessageBoxEx(NULL, _T("The value of pole space can not be zero"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
|
|
if (m_fEelcSpace >= m_fHoleSpace)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("孔间距必须大于电极间距"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Hole spacing must be greater than electrode spacing"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
}
|
|
|
|
strTmp.Empty();
|
|
GetDlgItem(IDC_2D_SA_INTERVAL)->GetWindowText(strTmp);
|
|
if (strTmp.IsEmpty())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("采样间隔的值须在0到30000之间"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Sample value must be between 0 and 30000"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
m_iSAInterval = atoi(strTmp);
|
|
if (m_iSAInterval < 0 || m_iSAInterval > 30000)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("采样间隔的值须在0到30000之间"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Sample value must be between 0 and 30000"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
|
|
BYTE ucTestGRFlag = 1;
|
|
ucTestGRFlag = ((CButton*)GetDlgItem(IDC_IF_TEST_GR))->GetCheck();
|
|
|
|
//判断起始电极和结束电极是否越界
|
|
strTmp.Empty();
|
|
GetDlgItem(IDC_2D_START_ELEC)->GetWindowTextA(strTmp);
|
|
int iStartElec = atoi(strTmp);
|
|
if (iStartElec < m_iStartElec || iStartElec> m_iEndElec)
|
|
{
|
|
strTmp.Empty();
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
{
|
|
strTmp.Format(_T("起始电极必须在%d-%d之间"), m_iStartElec, m_iEndElec);
|
|
AfxMessageBox(strTmp);
|
|
}
|
|
else
|
|
{
|
|
strTmp.Format(_T("Starting electrode must be between %d and %d"), m_iStartElec, m_iEndElec);
|
|
MessageBoxEx(NULL, strTmp, STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
}
|
|
return;
|
|
}
|
|
|
|
strTmp.Empty();
|
|
GetDlgItem(IDC_2D_END_ELEC)->GetWindowTextA(strTmp);
|
|
int iEndElec = atoi(strTmp);
|
|
if (iEndElec < m_iStartElec || iEndElec > m_iEndElec)
|
|
{
|
|
strTmp.Empty();
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
{
|
|
strTmp.Format(_T("结束电极必须在%d-%d之间"), m_iStartElec, m_iEndElec);
|
|
AfxMessageBox(strTmp);
|
|
}
|
|
else
|
|
{
|
|
strTmp.Format(_T("End electrode must be between %d and %d"), m_iStartElec, m_iEndElec);
|
|
MessageBoxEx(NULL, strTmp, STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
}
|
|
return;
|
|
}
|
|
m_iStartElec = iStartElec;
|
|
m_iEndElec = iEndElec;
|
|
|
|
//跳过抽头和滚动目前暂不实现
|
|
m_iSkipCable = 0;
|
|
m_iRollCnt = 0;
|
|
|
|
m_stTaskParam.strSptName = m_strSptName;
|
|
m_stTaskParam.strTDName = m_strTaskName;
|
|
m_stTaskParam.strTestPlace = m_strTestPlace;
|
|
m_stTaskParam.fEspace = m_fEelcSpace;
|
|
m_stTaskParam.fHoleSpace = m_fHoleSpace;
|
|
m_stTaskParam.iAR = m_iAR;
|
|
m_stTaskParam.iCableLayout = m_iCableLayout;
|
|
m_stTaskParam.iEAmount = m_iEndElec - m_iStartElec + 1;
|
|
m_stTaskParam.iEndElec = m_iEndElec;
|
|
m_stTaskParam.iEndLayer = m_iEndLayer;
|
|
m_stTaskParam.iRollCnt = m_iRollCnt;
|
|
m_stTaskParam.iSAInterval = m_iSAInterval;
|
|
m_stTaskParam.iSkipCable = m_iSkipCable;
|
|
m_stTaskParam.iSptID = m_iSptID;
|
|
m_stTaskParam.iSptType = m_ucSptType;
|
|
m_stTaskParam.iStacking = m_iStacking;
|
|
m_stTaskParam.iStartElec = m_iStartElec;
|
|
m_stTaskParam.iStartLayer = m_iStatrLayer;
|
|
m_stTaskParam.iTestType = m_iTestType;
|
|
m_stTaskParam.iTxPeriod = m_iTxPeriod;
|
|
m_stTaskParam.iTxWave = m_iTxWave;
|
|
//在线二期新任务参数字段
|
|
m_stTaskParam.uiDevID = m_pTaskOper->m_uiDevID;
|
|
m_stTaskParam.ucTestGRFlag = ucTestGRFlag;
|
|
m_strTaskCN = m_pTaskOper->CreateTaskCN(m_stTaskParam.iTestType);
|
|
//if (EN_ON_LIEN_VERSION_1 == g_iOnLineVersion)
|
|
{
|
|
m_iNewTaskID = m_pTaskOper->Create2DTask(m_stTaskParam, m_strTaskCN);
|
|
if (m_iNewTaskID < 1)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
|
|
CDialog::OnOK();
|
|
} |