912 lines
30 KiB
C++
912 lines
30 KiB
C++
// CrossHoleConfigDlg.cpp : 实现文件
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "GeoMative.h"
|
|
#include "crossHole/CCrossHoleConfig2DMainDlg.h"
|
|
#include "crossHole/C2DSimulationDlg.h"
|
|
#include "afxdialogex.h"
|
|
|
|
extern CGeoMativeApp theApp;
|
|
// CCrossHoleConfig2DMainDlg 对话框
|
|
|
|
IMPLEMENT_DYNAMIC(CCrossHoleConfig2DMainDlg, CDialog)
|
|
|
|
CCrossHoleConfig2DMainDlg::CCrossHoleConfig2DMainDlg(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CCrossHoleConfig2DMainDlg::IDD, pParent)
|
|
{
|
|
|
|
}
|
|
|
|
CCrossHoleConfig2DMainDlg::~CCrossHoleConfig2DMainDlg()
|
|
{
|
|
m_mapDatabaseABMNInfo.clear();
|
|
}
|
|
|
|
void CCrossHoleConfig2DMainDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_TAB_AR_CHANGE, m_tabChange);
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CCrossHoleConfig2DMainDlg, CDialog)
|
|
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_AR_CHANGE, &CCrossHoleConfig2DMainDlg::OnTcnSelchangeTabArChange)
|
|
ON_BN_CLICKED(ID_BTN_LOAD_GEOMETRY, &CCrossHoleConfig2DMainDlg::OnBnClickedBtnLoadGeometry)
|
|
ON_BN_CLICKED(ID_BTN_CREATE, &CCrossHoleConfig2DMainDlg::OnBnClickedBtnCreate)
|
|
ON_BN_CLICKED(ID_BTN_START_SIMULATION, &CCrossHoleConfig2DMainDlg::OnBnClickedBtnStartSimulation)
|
|
ON_BN_CLICKED(ID_BTN_STOP_SIMULATION, &CCrossHoleConfig2DMainDlg::OnBnClickedBtnStopSimulation)
|
|
ON_BN_CLICKED(ID_BTN_CLOSE, &CCrossHoleConfig2DMainDlg::OnBnClickedBtnClose)
|
|
ON_MESSAGE(WM_MSG_UPDATE_CROSSHOLEMAINWND_BTN, &CCrossHoleConfig2DMainDlg::OnMsgCrossHoleMainWndBtn)
|
|
ON_WM_DESTROY()
|
|
END_MESSAGE_MAP()
|
|
|
|
CCrossHoleConfig2DMainDlg* CCrossHoleConfig2DMainDlg::GetInstance()
|
|
{
|
|
static CCrossHoleConfig2DMainDlg crossHoleConfig;
|
|
return &crossHoleConfig;
|
|
}
|
|
// CCrossHoleConfig2DMainDlg 消息处理程序
|
|
BOOL CCrossHoleConfig2DMainDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
{
|
|
SetDlgItemText(ID_BTN_LOAD_GEOMETRY, _T("加载坐标"));
|
|
SetDlgItemText(ID_BTN_CREATE, _T("创建"));
|
|
SetDlgItemText(ID_BTN_START_SIMULATION, _T("开始模拟"));
|
|
SetDlgItemText(ID_BTN_STOP_SIMULATION, _T("停止模拟"));
|
|
SetDlgItemText(ID_BTN_CLOSE, _T("关闭"));
|
|
m_tabChange.InsertItem(0, _T("电极坐标"));
|
|
m_tabChange.InsertItem(1, _T("井下"));
|
|
m_tabChange.InsertItem(2, _T("地面"));
|
|
m_tabChange.InsertItem(3, _T("参数"));
|
|
}
|
|
else
|
|
{
|
|
m_tabChange.InsertItem(0, _T("Geometry"));
|
|
m_tabChange.InsertItem(1, _T("BoreHole"));
|
|
m_tabChange.InsertItem(2, _T("Surface"));
|
|
m_tabChange.InsertItem(3, _T("Setting"));
|
|
}
|
|
|
|
m_tabChange.SetCurSel(1);
|
|
// TODO: 在此添加额外的初始化
|
|
CRect rcDrawCtr;
|
|
GetDlgItem(IDC_STATIC_DRAWING_BOARD)->GetClientRect(&rcDrawCtr);
|
|
//m_DrawingBoardDlg.Create(IDD_DIALOG_DRAWING_BOARD, this);
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->Create(IDD_DIALOG_DRAWING_BOARD, GetDlgItem(IDC_STATIC_DRAWING_BOARD));
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->MoveWindow(&rcDrawCtr);
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
|
|
C2DSimulationDlg::GetInstance()->Create(IDD_DIALOG_SIMULATION_BOARD, GetDlgItem(IDC_STATIC_DRAWING_BOARD));
|
|
C2DSimulationDlg::GetInstance()->MoveWindow(&rcDrawCtr);
|
|
C2DSimulationDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
//CCrosshole2dDrawingBoardDlg::GetInstance()->Create(IDD_DIALOG_DRAWING_BOARD, this);
|
|
//CCrosshole2dDrawingBoardDlg::GetInstance()->MoveWindow(&rcDrawCtr);
|
|
|
|
CRect rect;
|
|
m_tabChange.GetClientRect(&rect);
|
|
rect.top = rect.top + 25;
|
|
rect.left = rect.left + 2;
|
|
rect.right = rect.right - 2;
|
|
rect.bottom = rect.bottom - 2;
|
|
COption2DGeometryDlg::GetInstance()->Create(IDD_DIALOG_OPTION_2D_GEOMETRY, &m_tabChange);
|
|
COption2DGeometryDlg::GetInstance()->MoveWindow(&rect);
|
|
|
|
COption2DBoreholeDlg::GetInstance()->Create(IDD_DIALOG_OPTION_2D_BOREHOLE, &m_tabChange);
|
|
COption2DBoreholeDlg::GetInstance()->MoveWindow(&rect);
|
|
|
|
COption2DSurfaceDlg::GetInstance()->Create(IDD_DIALOG_OPTION_2D_SURFACE, &m_tabChange);
|
|
COption2DSurfaceDlg::GetInstance()->MoveWindow(&rect);
|
|
|
|
COption2DSettingDlg::GetInstance()->Create(IDD_DIALOG_OPTION_2D_SETTING, &m_tabChange);
|
|
COption2DSettingDlg::GetInstance()->MoveWindow(&rect);
|
|
|
|
COption2DGeometryDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DBoreholeDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
COption2DSurfaceDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DSettingDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
|
|
GetDlgItem(ID_BTN_START_SIMULATION)->EnableWindow(FALSE);
|
|
GetDlgItem(ID_BTN_STOP_SIMULATION)->EnableWindow(FALSE);
|
|
|
|
m_pConnection = theApp.m_pConnection;
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// 异常: OCX 属性页应返回 FALSE
|
|
}
|
|
|
|
void CCrossHoleConfig2DMainDlg::OnTcnSelchangeTabArChange(NMHDR *pNMHDR, LRESULT *pResult)
|
|
{
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
int iSel = m_tabChange.GetCurSel();
|
|
switch (iSel)
|
|
{
|
|
case EN_OPTION_GEOMETRY:
|
|
{
|
|
COption2DGeometryDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
COption2DBoreholeDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DSurfaceDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DSettingDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
}
|
|
break;
|
|
case EN_OPTION_BOREHOLE:
|
|
{
|
|
COption2DGeometryDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DBoreholeDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
COption2DSurfaceDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DSettingDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
}
|
|
break;
|
|
case EN_OPTION_SURFACE:
|
|
{
|
|
COption2DGeometryDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DBoreholeDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DSurfaceDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
COption2DSettingDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
}
|
|
break;
|
|
case EN_OPTION_SETTING:
|
|
{
|
|
COption2DGeometryDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DBoreholeDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DSurfaceDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
COption2DSettingDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
*pResult = 0;
|
|
}
|
|
|
|
void CCrossHoleConfig2DMainDlg::ChangeTabPage(EN_TAB_PAGE pageType, std::vector<STBoreHolePoints> vecPoints, STBoreHoleParam stBoreholeParam)
|
|
{
|
|
if (vecPoints.size() <= 0)
|
|
{
|
|
ASSERT(vecPoints.size() > 0);
|
|
return;
|
|
}
|
|
|
|
switch (pageType)
|
|
{
|
|
case EN_OPTION_GEOMETRY:
|
|
break;
|
|
case EN_OPTION_BOREHOLE:
|
|
{
|
|
COption2DGeometryDlg::GetInstance()->AddCoordinatesPoints(EN_BOREHOLE_TYPE, vecPoints);
|
|
m_tabChange.SetCurSel(0);
|
|
COption2DGeometryDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
COption2DBoreholeDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
}
|
|
break;
|
|
case EN_OPTION_SURFACE:
|
|
{
|
|
COption2DGeometryDlg::GetInstance()->AddCoordinatesPoints(EN_SURFACE_TYPE, vecPoints);
|
|
m_tabChange.SetCurSel(0);
|
|
COption2DGeometryDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
COption2DSurfaceDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
COption2DGeometryDlg::GetInstance()->AddElecCoordinatesInfo(stBoreholeParam);
|
|
|
|
}
|
|
|
|
void CCrossHoleConfig2DMainDlg::OnBnClickedBtnLoadGeometry()
|
|
{
|
|
if (C2DSimulationDlg::GetInstance()->IsSimulating())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("正在模拟跑极不能操作"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Running is being simulated and cannot be operated"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
C2DSimulationDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
CFileDialog cfd(TRUE, _T(".geomative"), _T("*.geomative"), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, _T("geomative Files(*.geomative)|*.txt||"), NULL);
|
|
if (IDOK == cfd.DoModal())
|
|
{
|
|
CString strRawContent;
|
|
BOOL bRes = FALSE;
|
|
CStdioFile csf;
|
|
int i = 0;
|
|
UINT32 uiID = 1;//ID
|
|
UINT iExists = 0;
|
|
char* pCurContent = NULL;
|
|
STBoreHolePoints stPoints;
|
|
std::map<STWellPoints, std::vector<STBoreHolePoints>> mapBoreholePoints;//保存从Geomative文件读取到的borehole所有的点
|
|
std::vector<STBoreHolePoints> vecBoreholePoints;
|
|
std::vector<STBoreHolePoints> vecNoSortBoreholePoints;
|
|
std::vector<STBoreHolePoints> vecSurfacePoints;//保存从Geomative文件读取到的surface所有的点
|
|
bRes = csf.Open(cfd.GetPathName(), CStdioFile::modeReadWrite);
|
|
if (bRes)
|
|
{
|
|
while (csf.ReadString(strRawContent))
|
|
{
|
|
OutputDebugString(strRawContent+_T("\n"));
|
|
|
|
pCurContent = _tcstok(strRawContent.GetBuffer(), _T(","));
|
|
stPoints.uiID = uiID;
|
|
stPoints.uiElecID = atoi(pCurContent);
|
|
i = 0;
|
|
while ((pCurContent = _tcstok(NULL, _T(","))))
|
|
{
|
|
//x
|
|
if (i == 0)
|
|
{
|
|
stPoints.fX = atof(pCurContent);
|
|
}
|
|
//y
|
|
else
|
|
{
|
|
stPoints.fZ = atof(pCurContent);
|
|
}
|
|
i++;
|
|
}
|
|
|
|
//地表
|
|
if (stPoints.fZ >= -0.000001 && stPoints.fZ < 0.000001)
|
|
{
|
|
vecSurfacePoints.push_back(stPoints);
|
|
}
|
|
else
|
|
{
|
|
STWellPoints stWellPoint;
|
|
stWellPoint.fX = stPoints.fX;
|
|
stWellPoint.fY = stPoints.fY;
|
|
iExists = mapBoreholePoints.count(stWellPoint);
|
|
if (0 == iExists)
|
|
{
|
|
vecBoreholePoints.push_back(stPoints);
|
|
mapBoreholePoints[stWellPoint] = vecBoreholePoints;
|
|
vecBoreholePoints.clear();
|
|
}
|
|
else
|
|
{
|
|
mapBoreholePoints[stWellPoint].push_back(stPoints);
|
|
}
|
|
}
|
|
vecNoSortBoreholePoints.push_back(stPoints);
|
|
uiID++;
|
|
}
|
|
csf.Close();
|
|
}
|
|
|
|
COption2DGeometryDlg::GetInstance()->DeleteCoordinatesPoint();
|
|
//添加List列表
|
|
COption2DGeometryDlg::GetInstance()->AddNoSortCoordinatesFromFile(vecNoSortBoreholePoints);
|
|
|
|
//从Geomative文件加载的坐标传给画板和模拟窗口
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->DeleteCoordinatesPoint();
|
|
C2DSimulationDlg::GetInstance()->DeleteCoordinatesPoint();
|
|
if (mapBoreholePoints.size() > 0)
|
|
{
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->AddBoreholePointToVector(mapBoreholePoints);
|
|
C2DSimulationDlg::GetInstance()->AddBoreholePointToVector(mapBoreholePoints);
|
|
}
|
|
if (vecSurfacePoints.size() > 0)
|
|
{
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->AddSurfacePointsToVector(vecSurfacePoints);
|
|
C2DSimulationDlg::GetInstance()->AddSurfacePointsToVector(vecSurfacePoints);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
std::vector<int> CCrossHoleConfig2DMainDlg::CalcLValue(std::vector<STBoreHolePoints> vecPointBH1, std::vector<STBoreHolePoints> vecPointBH2)
|
|
{
|
|
std::vector<int> vecLValue;
|
|
UINT uiBH1 = 0, uiBH2 = 0;
|
|
uiBH1 = vecPointBH1.size();
|
|
uiBH2 = vecPointBH2.size();
|
|
if (0 == uiBH1 || 0 == uiBH2)
|
|
return vecLValue;
|
|
|
|
int iMinN = min(uiBH1, uiBH2);
|
|
//向正无穷取整
|
|
int iMaxL = iMinN / 3;
|
|
if (0 != iMinN % 3)
|
|
{
|
|
iMaxL++;
|
|
}
|
|
|
|
//向正无穷取整
|
|
int iMinL = iMinN / 10;
|
|
if (0 != iMinN % 10)
|
|
{
|
|
iMinL++;
|
|
}
|
|
|
|
//向正无穷取整
|
|
int iDL = iMinN / 15;
|
|
if (0 != iMinN % 15)
|
|
{
|
|
iDL++;
|
|
}
|
|
|
|
//向负无穷取整
|
|
int iN = (iMaxL - iMinL) / iDL;
|
|
|
|
int iL = 0;
|
|
OutputDebugString(_T("zm:CCrossHoleConfig2DMainDlg::GenerateTestPoints 生成L的取值:"));
|
|
for (int i = 0; i <= iN; i++)
|
|
{
|
|
iL = iMinL + i*iDL;
|
|
vecLValue.push_back(iL);
|
|
OutputDebugString("" + iL);
|
|
}
|
|
OutputDebugString("\n\n");
|
|
return vecLValue;
|
|
}
|
|
struct Points
|
|
{
|
|
UINT32 A;
|
|
UINT32 B;
|
|
UINT32 M;
|
|
UINT32 N;
|
|
Points()
|
|
{
|
|
memset(this, 0, sizeof(Points));
|
|
}
|
|
};
|
|
|
|
float CCrossHoleConfig2DMainDlg::GetUniSptXPos(int iA, int iB, int iM, int iN)
|
|
{
|
|
//16-39的区间为1维脚本和3维脚本,不支持
|
|
//在这里只支持2维脚本
|
|
// if (m_iAR > 16 && m_iAR < 39) //2D脚本装置类型
|
|
// {
|
|
// AfxMessageBox(_T("Universal script only supprot 2D script."));
|
|
// return -1;
|
|
// }
|
|
int iMin = 100000, iMax = 0, iTotalVal = 0;
|
|
int iDataArr[4] = { iA, iB, iM, iN };
|
|
int iNegativeCnt = 0;//非正整数的个数
|
|
for (int i = 0; i < 4; i++)
|
|
{
|
|
if (iDataArr[i] > 0)
|
|
{
|
|
if (iDataArr[i] > iMax)
|
|
{
|
|
iMax = iDataArr[i];
|
|
}
|
|
if (iDataArr[i] < iMin)
|
|
{
|
|
iMin = iDataArr[i];
|
|
}
|
|
iTotalVal += iDataArr[i];
|
|
}
|
|
else
|
|
iNegativeCnt++;
|
|
}
|
|
//如果全部是正整数(四级装置),则此时iTotalVal表示的是四个数的总和,那么需要剪掉最大的和最小的
|
|
if (0 == iNegativeCnt)
|
|
return (iTotalVal - iMin - iMax)*1.0 / 2;
|
|
|
|
//如果此时是三级装置,那么此时只需要减掉最小值即可
|
|
if (1 == iNegativeCnt)
|
|
return (iTotalVal - iMin)*1.0 / 2;
|
|
|
|
//如果是二级装置,则不需进行再处理
|
|
if (2 == iNegativeCnt)
|
|
return iTotalVal*1.0 / 2;
|
|
|
|
CString strErr;
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
{
|
|
strErr.Format(_T("GetUniSptXPos错误,负值%d"), iNegativeCnt);
|
|
AfxMessageBox(strErr);
|
|
}
|
|
else
|
|
{
|
|
strErr.Format(_T("GetUniSptXPos error,number of negative is %d"), iNegativeCnt);
|
|
MessageBoxEx(NULL, strErr, STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
void CCrossHoleConfig2DMainDlg::TwoBoreholeGenerateScript(std::vector<STBoreHolePoints> vecPointBH1, std::vector<STBoreHolePoints> vecPointBH2)
|
|
{
|
|
//两个孔,组合
|
|
CString strLog;
|
|
std::vector<int> vecLValue = CalcLValue(vecPointBH1, vecPointBH2);
|
|
std::vector<int>::iterator iter = vecLValue.begin();
|
|
std::vector<STBoreHolePoints>::iterator iterBH1 = vecPointBH1.begin();
|
|
std::vector<STBoreHolePoints>::iterator iterBH2 = vecPointBH2.begin();
|
|
int iBH1Size = vecPointBH1.size();
|
|
int iBH2Size = vecPointBH2.size();
|
|
int i = 0;
|
|
int j = 0;
|
|
double dK = 0.0;
|
|
float fAM = 0.0;
|
|
float fAM2 = 0.0;
|
|
float fBM = 0.0;
|
|
float fBM2 = 0.0;
|
|
float fAN = 0.0;
|
|
float fAN2 = 0.0;
|
|
float fBN = 0.0;
|
|
float fBN2 = 0.0;
|
|
STDatabaseABMNInfo stDatabaseABMNInfo;
|
|
map<int, STDatabaseABMNInfo> mapM;
|
|
map<int, map<int, STDatabaseABMNInfo>> mapB;
|
|
map<int, map<int, map<int, STDatabaseABMNInfo>>>::iterator iterFindA;
|
|
map<int, map<int, STDatabaseABMNInfo>>::iterator iterFindB;
|
|
map<int, STDatabaseABMNInfo>::iterator iterFindM;
|
|
//L取值
|
|
for (; iter != vecLValue.end(); iter++)
|
|
{
|
|
//遍历第一个孔的电极
|
|
for (i = 0; i < iBH1Size - *iter; i++)
|
|
{
|
|
//遍历第二个孔的电极
|
|
for (j = 0; j < iBH2Size - *iter; j++)
|
|
{
|
|
/*if (EN_SURFACE_TYPE == iterBH1->eType)
|
|
{
|
|
//直线
|
|
fAM = (iterBH1 + i + *iter)->fX-(iterBH1 + i)->fX;
|
|
fAM2 = fAM;//待确认,地表2AM
|
|
fBN = (iterBH2 + j)->fZ - (iterBH2 + j + *iter)->fZ;
|
|
fBN2 = -(iterBH2 + j)->fZ - (iterBH2 + j + *iter)->fZ;
|
|
|
|
//三角形
|
|
fBM = sqrt(pow((iterBH2 + j)->fZ, 2) + pow((iterBH1 + i + *iter)->fX - iterBH2->fX, 2));
|
|
fBM2 = sqrt(pow(-(iterBH2 + j)->fZ, 2) + pow((iterBH1 + i + *iter)->fX - iterBH2->fX, 2));
|
|
fAN = sqrt(pow((iterBH2 + j + *iter)->fZ, 2) + pow((iterBH1 + i)->fX - iterBH2->fX, 2));
|
|
fAN2 = sqrt(pow(-(iterBH2 + j + *iter)->fZ, 2) + pow((iterBH1 + i)->fX - iterBH2->fX, 2));
|
|
}
|
|
else*/
|
|
//生成脚本时,地表的坐标时添加在最后的,所以只有第二个孔为地表的情况
|
|
if (EN_SURFACE_TYPE == iterBH2->eType)
|
|
{
|
|
//直线
|
|
fAM = (iterBH1 + i)->fZ - (iterBH1 + i + *iter)->fZ;
|
|
fAM2 = -(iterBH1 + i)->fZ - (iterBH1 + i + *iter)->fZ;
|
|
fBN = (iterBH2 + j + *iter)->fX-(iterBH2 + j)->fX;
|
|
fBN2 = fBN;//待确认,地表2AM
|
|
|
|
//三角形
|
|
fBM = sqrt(pow(iterBH1->fX-(iterBH2+j)->fX, 2) + pow((iterBH1 + i + *iter)->fZ, 2));
|
|
fBM2 = sqrt(pow(iterBH1->fX - (iterBH2 + j)->fX, 2) + pow(-(iterBH1 + i + *iter)->fZ, 2));
|
|
fAN = sqrt(pow((iterBH1 + i)->fZ, 2) + pow((iterBH2 + j+*iter)->fX - iterBH1->fX, 2));
|
|
fAN2 = sqrt(pow(-(iterBH1 + i)->fZ, 2) + pow((iterBH2 + j + *iter)->fX - iterBH1->fX, 2));
|
|
}
|
|
else
|
|
{
|
|
//直线
|
|
fAM = (iterBH1 + i)->fZ - (iterBH1 + i + *iter)->fZ;
|
|
fAM2 = -(iterBH1 + i)->fZ - (iterBH1 + i + *iter)->fZ;
|
|
fBN = (iterBH2 + j)->fZ - (iterBH2 + j + *iter)->fZ;
|
|
fBN2 = -(iterBH2 + j)->fZ - (iterBH2 + j + *iter)->fZ;
|
|
|
|
//三角形
|
|
fBM = sqrt(pow((iterBH2 + j)->fZ - (iterBH1 + i + *iter)->fZ, 2) + pow(iterBH2->fX - iterBH1->fX, 2));
|
|
fBM2 = sqrt(pow(-(iterBH2 + j)->fZ - (iterBH1 + i + *iter)->fZ, 2) + pow(iterBH2->fX - iterBH1->fX, 2));
|
|
fAN = sqrt(pow((iterBH1 + i)->fZ - (iterBH2 + j + *iter)->fZ, 2) + pow(iterBH2->fX - iterBH1->fX, 2));
|
|
fAN2 = sqrt(pow(-(iterBH1 + i)->fZ - (iterBH2 + j + *iter)->fZ, 2) + pow(iterBH2->fX - iterBH1->fX, 2));
|
|
}
|
|
|
|
|
|
dK = 4 * 3.1415926/(1/fAM+1/fAM2-1/fBM-1/fBM2-1/fAN-1/fAN2+1/fBN+1/fBN2);
|
|
stDatabaseABMNInfo.uiAElecID = (iterBH1 + i)->uiElecID;
|
|
stDatabaseABMNInfo.uiNElecID = (iterBH2 + j + *iter)->uiElecID;
|
|
stDatabaseABMNInfo.uiMElecID = (iterBH1 + i + *iter)->uiElecID;
|
|
stDatabaseABMNInfo.uiBElecID = (iterBH2 + j)->uiElecID;
|
|
stDatabaseABMNInfo.iTrace = 1;//默认为1
|
|
stDatabaseABMNInfo.fK = dK;
|
|
stDatabaseABMNInfo.fSptXPos = GetUniSptXPos(stDatabaseABMNInfo.uiAElecID, stDatabaseABMNInfo.uiBElecID, stDatabaseABMNInfo.uiMElecID, stDatabaseABMNInfo.uiNElecID);
|
|
|
|
m_vecAllBoreholeABMNInfo.push_back(stDatabaseABMNInfo);
|
|
|
|
iterFindA = m_mapDatabaseABMNInfo.find(stDatabaseABMNInfo.uiAElecID);
|
|
mapB.clear();
|
|
mapM.clear();
|
|
if (iterFindA != m_mapDatabaseABMNInfo.end())
|
|
{
|
|
iterFindB = iterFindA->second.find(stDatabaseABMNInfo.uiBElecID);
|
|
if (iterFindB != iterFindA->second.end())
|
|
{
|
|
iterFindM = iterFindB->second.find(stDatabaseABMNInfo.uiMElecID);
|
|
if (iterFindM != iterFindB->second.end())
|
|
{
|
|
AfxMessageBox(_T("生成测点AB相同,存在M值相同\n"));
|
|
}
|
|
else
|
|
{
|
|
iterFindB->second.insert(make_pair(stDatabaseABMNInfo.uiMElecID, stDatabaseABMNInfo));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
mapM[stDatabaseABMNInfo.uiMElecID] = stDatabaseABMNInfo;
|
|
iterFindA->second.insert(make_pair(stDatabaseABMNInfo.uiBElecID, mapM));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
mapM[stDatabaseABMNInfo.uiMElecID] = stDatabaseABMNInfo;
|
|
mapB[stDatabaseABMNInfo.uiBElecID] = mapM;
|
|
m_mapDatabaseABMNInfo[stDatabaseABMNInfo.uiAElecID] = mapB;
|
|
}
|
|
m_uiTPamount++;
|
|
strLog.Format(_T("m_uiTPamount=%d,L=%d,A=%d(z=%f),B=%d(z=%f),M=%d(z=%f),N=%d(z=%f),k=%lf\n"),\
|
|
m_uiTPamount, *iter, (iterBH1 + i)->uiElecID, (iterBH1 + i)->fZ, (iterBH2 + j)->uiElecID, (iterBH2 + j)->fZ, (iterBH1 + i + *iter)->uiElecID, (iterBH1 + i + *iter)->fZ, (iterBH2 + j + *iter)->uiElecID, (iterBH2 + j + *iter)->fZ, dK);
|
|
OutputDebugString(strLog);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
//写入数据库
|
|
BOOL CCrossHoleConfig2DMainDlg::SaveTestPointToDB()
|
|
{
|
|
m_pConnection = theApp.m_pConnection;
|
|
m_pConnection->BeginTrans();
|
|
//将AMNB信息吸入数据库---------------begin------------------
|
|
_RecordsetPtr pRecSCID = NULL;
|
|
_CommandPtr pCmdIns = NULL;
|
|
pCmdIns.CreateInstance(_uuidof(Command));
|
|
pCmdIns->ActiveConnection = m_pConnection;
|
|
|
|
CString strSql, strCN, strCurTime;
|
|
CGUCodeCreator guCodeCreator;
|
|
strCN = guCodeCreator.GenerateGUIDCode();
|
|
|
|
m_uiEamount = COption2DGeometryDlg::GetInstance()->GetAllCoordinatesPointsCount();
|
|
|
|
//检查脚本是否已存在
|
|
pRecSCID.CreateInstance(_uuidof(Recordset));
|
|
strSql.Format(_T("select * from scon where Sname = '%s' and Stype=1"), m_strScriptName);
|
|
pRecSCID->Open(strSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
if ((long)VAL_ZERO != pRecSCID->GetRecordCount())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("脚本已经存在."));
|
|
else
|
|
MessageBoxEx(NULL, _T("Script has been alreay exists"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
pRecSCID->Close();
|
|
m_pConnection->RollbackTrans();
|
|
return FALSE;
|
|
}
|
|
pRecSCID->Close();
|
|
|
|
//Stype暂定二维
|
|
float fPoleDistance = COption2DGeometryDlg::GetInstance()->GetElectrodeDistance();
|
|
CString strPoleDistance;
|
|
strPoleDistance.Format(_T("%.2f"), COption2DGeometryDlg::GetInstance()->GetElectrodeDistance());
|
|
/*CString strPoleDistance,strTemp;
|
|
strPoleDistance.Empty();
|
|
std::vector<STBoreHoleParam> vecAllElecCoordinatesInfo = COption2DGeometryDlg::GetInstance()->GetAllElecCoordinatesInfo();
|
|
for (std::vector<STBoreHoleParam>::iterator iter = vecAllElecCoordinatesInfo.begin(); iter != vecAllElecCoordinatesInfo.end(); iter++)
|
|
{
|
|
//x,y,z,电极间距
|
|
strTemp.Empty();
|
|
strTemp.Format(_T("%.2f,%.2f,%.2f,%.2f;"), iter->fX, iter->fY, iter->fZ,iter->fElecSpacing);
|
|
strPoleDistance += strTemp;
|
|
}*/
|
|
SYSTEMTIME st;
|
|
GetLocalTime(&st);
|
|
strCurTime.Format(_T("%4d-%2d-%2d"), st.wYear, st.wMonth, st.wDay);
|
|
strSql.Format(_T("insert into scon(CN,Sname,Stype,Eamount,CHamount,TPamount,definer,DEdate,SCdesc,Rect,RectLoc,PoleDistance,PoleStep) "
|
|
"values('%s','%s',%d,%d,%d,%d,'%s',#%s#,'%s','%s', '%s', '%s', '%s')"),
|
|
strCN,
|
|
m_strScriptName,
|
|
1,//暂时只考虑2D,以后再考虑如何计算
|
|
m_uiEamount,
|
|
1,//目前二维都是得到的1,暂填
|
|
m_uiTPamount,
|
|
m_strOperator,//定义人暂时为空,是否需要支持
|
|
strCurTime,
|
|
m_strNote,//脚本描述
|
|
"",//pCreate3DSptDlg->GetRect(),
|
|
"",//pCreate3DSptDlg->GetPoleStart(),
|
|
strPoleDistance,//pCreate3DSptDlg->GetPoleDistance(),
|
|
"");//pCreate3DSptDlg->GetPoleStep());
|
|
pCmdIns->CommandText = strSql.AllocSysString();
|
|
pCmdIns->Execute(NULL, NULL, adCmdText);
|
|
|
|
//取得scon表中ID最大的ITEM
|
|
DWORD dwSConID = 0;
|
|
DWORD dwCHID = 0;
|
|
pRecSCID.CreateInstance(_uuidof(Recordset));
|
|
pRecSCID->Open(_T("select max(ID) as ID from scon"), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
if ((long)VAL_ZERO != pRecSCID->GetRecordCount())//返回1
|
|
{
|
|
dwSConID = (DWORD)pRecSCID->GetCollect(_T("ID")).ulVal;
|
|
}
|
|
pRecSCID->Close();
|
|
|
|
strSql.Format(_T("insert into channel(SCID,CHnumber,AR) values(%u,%d,%d) "),
|
|
dwSConID,
|
|
1,//pChannel->m_iChNumber
|
|
AR_CROSS_HOLE_GEOMATIVE);
|
|
pCmdIns->CommandText = strSql.AllocSysString();
|
|
pCmdIns->Execute(NULL, NULL, adCmdText);
|
|
|
|
strSql.Format(_T("select ID from channel where SCID = %d"), dwSConID);
|
|
pRecSCID->Open(strSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
if ((long)VAL_ZERO != pRecSCID->GetRecordCount())
|
|
{
|
|
dwCHID = (DWORD)pRecSCID->GetCollect(_T("ID")).ulVal;
|
|
}
|
|
pRecSCID->Close();
|
|
|
|
//多通道装置,排序
|
|
if (EN_MULTI_CHANNEL == theApp.m_ucIsMultiChannel)
|
|
{
|
|
map<int, map<int, map<int, STDatabaseABMNInfo>>>::iterator iterA = m_mapDatabaseABMNInfo.begin();
|
|
map<int, map<int, STDatabaseABMNInfo>>::iterator iterB;
|
|
map<int, STDatabaseABMNInfo>::iterator iterM;
|
|
int iTSN = 0;
|
|
for (; iterA != m_mapDatabaseABMNInfo.end(); iterA++)
|
|
{
|
|
for (iterB = iterA->second.begin(); iterB != iterA->second.end(); iterB++)
|
|
{
|
|
for (iterM = iterB->second.begin(); iterM != iterB->second.end(); iterM++)
|
|
{
|
|
strSql.Format(_T("insert into script2d(CHID,TSN,C1,C2,P1,P2,K,N,Layer,XPos) values(%u,%d,%d,%d,%d,%d,%f,%d,%d,%f) "),
|
|
dwCHID,
|
|
iTSN + 1,
|
|
iterM->second.uiAElecID,
|
|
iterM->second.uiBElecID,
|
|
iterM->second.uiMElecID,
|
|
iterM->second.uiNElecID,
|
|
iterM->second.fK,
|
|
iterM->second.iTrace,
|
|
iterM->second.iTrace,
|
|
iterM->second.fSptXPos);
|
|
OutputDebugString(strSql + _T("\n"));
|
|
pCmdIns->CommandText = strSql.AllocSysString();
|
|
try
|
|
{
|
|
pCmdIns->Execute(NULL, NULL, adCmdText);
|
|
}
|
|
catch (_com_error e)
|
|
{
|
|
//hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC)CBTHookProc, AfxGetInstanceHandle(), NULL);
|
|
AfxMessageBox((LPCTSTR)e.Description());
|
|
}
|
|
iTSN++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (0 == theApp.m_ucIsMultiChannel)//单通道,不需要排序
|
|
{
|
|
int iTestPointNum = m_vecAllBoreholeABMNInfo.size();
|
|
for (int i = 0; i < iTestPointNum; i++)
|
|
{
|
|
strSql.Format(_T("insert into script2d(CHID,TSN,C1,C2,P1,P2,K,N,Layer,XPos) values(%u,%d,%d,%d,%d,%d,%f,%d,%d,%f) "),
|
|
dwCHID,
|
|
i + 1,
|
|
m_vecAllBoreholeABMNInfo[i].uiAElecID,
|
|
m_vecAllBoreholeABMNInfo[i].uiBElecID,
|
|
m_vecAllBoreholeABMNInfo[i].uiMElecID,
|
|
m_vecAllBoreholeABMNInfo[i].uiNElecID,
|
|
m_vecAllBoreholeABMNInfo[i].fK,
|
|
m_vecAllBoreholeABMNInfo[i].iTrace,
|
|
m_vecAllBoreholeABMNInfo[i].iLayer,
|
|
m_vecAllBoreholeABMNInfo[i].fSptXPos);
|
|
OutputDebugString(strSql + _T("\n"));
|
|
pCmdIns->CommandText = strSql.AllocSysString();
|
|
try
|
|
{
|
|
pCmdIns->Execute(NULL, NULL, adCmdText);
|
|
}
|
|
catch (_com_error e)
|
|
{
|
|
//hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC)CBTHookProc, AfxGetInstanceHandle(), NULL);
|
|
AfxMessageBox((LPCTSTR)e.Description());
|
|
}
|
|
}
|
|
}
|
|
//将AMNB信息吸入数据库---------------end------------------
|
|
|
|
//将脚本电极坐标信息写入数据库---------begin--------------
|
|
std::vector<STBoreHolePoints> vecAllCoordinates = COption2DGeometryDlg::GetInstance()->GetAllCoordinatesPoints();
|
|
std::vector<STBoreHolePoints>::iterator iter = vecAllCoordinates.begin();
|
|
for (int i=1; iter != vecAllCoordinates.end(); iter++,i++)
|
|
{
|
|
strSql.Format(_T("insert into TCoordinatesInfo(SSN,ScriptCN,ElectrodeID,X,Y,Z) values(%d,'%s',%d,%f,%f,%f)"), i,strCN, iter->uiElecID, iter->fX, iter->fY, iter->fZ);
|
|
pCmdIns->CommandText = strSql.AllocSysString();
|
|
try
|
|
{
|
|
pCmdIns->Execute(NULL, NULL, adCmdText);
|
|
}
|
|
catch (_com_error e)
|
|
{
|
|
AfxMessageBox((LPCTSTR)e.Description());
|
|
}
|
|
}
|
|
//将脚本电极坐标信息写入数据库---------end--------------
|
|
|
|
m_pConnection->CommitTrans();
|
|
return TRUE;
|
|
}
|
|
|
|
void CCrossHoleConfig2DMainDlg::OnBnClickedBtnCreate()
|
|
{
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
if (C2DSimulationDlg::GetInstance()->IsSimulating())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("正在模拟跑极不能操作"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Running is being simulated and cannot be operated"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
C2DSimulationDlg::GetInstance()->ShowWindow(SW_HIDE);
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
|
|
m_vecAllBoreholeABMNInfo.clear();
|
|
int iMediumType = COption2DSettingDlg::GetInstance()->GetMediumType();
|
|
if (iMediumType < 0)
|
|
{
|
|
return;
|
|
}
|
|
|
|
m_strScriptName = COption2DSettingDlg::GetInstance()->GetScriptName();
|
|
if (m_strScriptName.IsEmpty())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("脚本名称不能为空"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Script name cannot be empty"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
|
|
m_strTimeInterval = COption2DSettingDlg::GetInstance()->GetTimeInterval();
|
|
if (m_strTimeInterval.IsEmpty())
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("时间间隔不能为空"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Time interval cannot be empty"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
|
|
m_strOperator = COption2DSettingDlg::GetInstance()->GetOperator();
|
|
m_strNote = COption2DSettingDlg::GetInstance()->GetNote();
|
|
|
|
m_uiTPamount = 0;
|
|
m_mapDatabaseABMNInfo.clear();
|
|
//先只生产脚本测点,其他的情况后面再加
|
|
//获取孔的数目
|
|
std::map<STWellPoints, std::vector<STBoreHolePoints>> mapBoreholePoint = COption2DGeometryDlg::GetInstance()->GetBoreholeCoordinates();
|
|
int iBHNum = mapBoreholePoint.size();
|
|
//获取地表的坐标
|
|
std::vector<STBoreHolePoints> vecSurface = COption2DGeometryDlg::GetInstance()->GetSurfaceCoordinates();
|
|
STWellPoints stWellPoint,stWellPoint1;
|
|
if (vecSurface.size() > 0)
|
|
{
|
|
if (0 == iMediumType)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("跨孔装置不需要地表"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Cross-hole devices do not require a surface"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
iBHNum++;
|
|
stWellPoint.fY = 0;
|
|
stWellPoint.fX = iBHNum;
|
|
mapBoreholePoint[stWellPoint] = vecSurface;
|
|
}
|
|
else
|
|
{
|
|
if (1 == iMediumType)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("井地井装置需要地表"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Well to well equipment requires surface"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
return;
|
|
}
|
|
}
|
|
|
|
CString strLog;
|
|
strLog.Format(_T("zm:当前井数目:%d\n"), iBHNum);
|
|
OutputDebugString(strLog);
|
|
if (iBHNum > 0)
|
|
{
|
|
if (iBHNum == 1)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("跨孔必须两孔或以上"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Span holes must be two or more"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
}
|
|
else
|
|
{
|
|
m_uiTPamount = 0;
|
|
//井 + 井
|
|
map<STWellPoints, vector<STBoreHolePoints>>::iterator iterWell = mapBoreholePoint.begin();
|
|
map<STWellPoints, vector<STBoreHolePoints>>::iterator iterWellEx = mapBoreholePoint.begin();
|
|
for (iterWell = mapBoreholePoint.begin(); iterWell != mapBoreholePoint.end(); iterWell++)
|
|
{
|
|
iterWellEx = iterWell;
|
|
iterWellEx++;
|
|
for (; iterWellEx != mapBoreholePoint.end(); iterWellEx++)
|
|
{
|
|
TwoBoreholeGenerateScript(iterWell->second, iterWellEx->second);
|
|
}
|
|
}
|
|
|
|
//写入数据库
|
|
BOOL bRes = SaveTestPointToDB();
|
|
if (bRes)
|
|
{
|
|
if (LANG_ZHCN == g_iUILanguage)
|
|
AfxMessageBox(_T("创建成功"));
|
|
else
|
|
MessageBoxEx(NULL, _T("Create success"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
|
//关闭当前窗口?更新到脚本列表
|
|
|
|
::SendMessage(AfxGetApp()->GetMainWnd()->m_hWnd, WM_REFRESH, (WPARAM)OP_SPT_SYN, (LPARAM)VAL_ZERO);
|
|
}
|
|
}
|
|
}
|
|
|
|
GetDlgItem(ID_BTN_START_SIMULATION)->EnableWindow(TRUE);
|
|
}
|
|
|
|
void CCrossHoleConfig2DMainDlg::OnBnClickedBtnStartSimulation()
|
|
{
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->ShowWindow(FALSE);
|
|
C2DSimulationDlg::GetInstance()->ShowWindow(SW_SHOW);
|
|
|
|
if (!m_strTimeInterval.IsEmpty())
|
|
{
|
|
m_strTimeInterval = COption2DSettingDlg::GetInstance()->GetTimeInterval();
|
|
}
|
|
C2DSimulationDlg::GetInstance()->SetTimeInterval(atoi(m_strTimeInterval));
|
|
C2DSimulationDlg::GetInstance()->SetSingleChannelSimulationRunMethod(m_vecAllBoreholeABMNInfo);
|
|
C2DSimulationDlg::GetInstance()->SetMultiChannelSimulationRunMethod(m_mapDatabaseABMNInfo);
|
|
C2DSimulationDlg::GetInstance()->StartSimulation();
|
|
GetDlgItem(ID_BTN_START_SIMULATION)->EnableWindow(FALSE);
|
|
GetDlgItem(ID_BTN_STOP_SIMULATION)->EnableWindow(TRUE);
|
|
GetDlgItem(ID_BTN_CLOSE)->EnableWindow(FALSE);
|
|
}
|
|
|
|
|
|
void CCrossHoleConfig2DMainDlg::OnBnClickedBtnStopSimulation()
|
|
{
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
C2DSimulationDlg::GetInstance()->StopSimulation();
|
|
GetDlgItem(ID_BTN_START_SIMULATION)->EnableWindow(TRUE);
|
|
GetDlgItem(ID_BTN_STOP_SIMULATION)->EnableWindow(FALSE);
|
|
GetDlgItem(ID_BTN_CLOSE)->EnableWindow(TRUE);
|
|
}
|
|
|
|
|
|
void CCrossHoleConfig2DMainDlg::OnBnClickedBtnClose()
|
|
{
|
|
CDialog::OnOK();
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
}
|
|
|
|
LRESULT CCrossHoleConfig2DMainDlg::OnMsgCrossHoleMainWndBtn(WPARAM wParam, LPARAM lParam)
|
|
{
|
|
OnBnClickedBtnStopSimulation();
|
|
return 0;
|
|
}
|
|
|
|
void CCrossHoleConfig2DMainDlg::OnDestroy()
|
|
{
|
|
OnBnClickedBtnStopSimulation();
|
|
|
|
//清空窗口信息
|
|
COption2DGeometryDlg::GetInstance()->DeleteCoordinatesPoint();
|
|
CCrosshole2dDrawingBoardDlg::GetInstance()->DeleteCoordinatesPoint();
|
|
|
|
CDialog::OnDestroy();
|
|
// TODO: 在此处添加消息处理程序代码
|
|
} |