553 lines
17 KiB
C++
553 lines
17 KiB
C++
// SprinkIsometryDlg.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include <DbEquipment.h>
|
|
#include <XRect.h>
|
|
|
|
#include "SprinklerByLineDlg.h"
|
|
#include <PipeWireMonitor.h>
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
extern BOOL GetIsometryInsPt(XPoint ptS, XPoint ptE, double nXDist, double nYDist, double nAngle, double row_dist, double col_dist, XPointList &lstInsPt, int &iRow, int &iCol);
|
|
extern void ModifyRect(XRect &rect);
|
|
//**************************************************************************
|
|
// 等距喷头
|
|
//**************************************************************************
|
|
void SprinklerIsometry()
|
|
{
|
|
CString csDwb = g_csDwbPath + _T("TwtSys");
|
|
XString xsTmp, xsTmp2, xsTmp3, xsTmp4, xsTmp5;
|
|
XString xsTmp6, xsTmp7, xsTmp8;//zxl 2011.12.19 add 增加水喷雾喷头
|
|
if(LoadDwbBlock(csDwb, _T("00000125"), xsTmp) != RTNORM)
|
|
return;
|
|
if(LoadDwbBlock(csDwb, _T("00000128"), xsTmp2) != RTNORM)
|
|
return;
|
|
if (LoadDwbBlock(csDwb, _T("00000283"), XString()) != RTNORM) // cet 2011.2.28 add 剖切时需要的图块
|
|
{
|
|
return;
|
|
}
|
|
if (LoadDwbBlock(csDwb, _T("00000529"), xsTmp6) != RTNORM)//zxl 2011.12.19 add 增加水喷雾喷头
|
|
{
|
|
return;
|
|
}
|
|
if (LoadDwbBlock(csDwb, _T("00000540"), xsTmp7) != RTNORM) // cet 2013.1.5 add 直立型水幕
|
|
{
|
|
return;
|
|
}
|
|
if (LoadDwbBlock(csDwb, _T("00000541"), xsTmp8) != RTNORM) // cet 2013.1.5 add 下垂型水幕
|
|
{
|
|
return;
|
|
}
|
|
|
|
if(g_bBlk3D){
|
|
if(LoadDwbBlock(csDwb, _T("00000365"), xsTmp3) != RTNORM)
|
|
return;
|
|
if(LoadDwbBlock(csDwb, _T("00000366"), xsTmp4) != RTNORM)
|
|
return;
|
|
if(LoadDwbBlock(csDwb, _T("00000367"), xsTmp5) != RTNORM)
|
|
return;
|
|
}
|
|
|
|
int nOsMode=0;
|
|
xg_getvar(_T("OSMODE"), &nOsMode);
|
|
nOsMode &= ~0x4000;
|
|
nOsMode |= OS_INT|OS_NEA;
|
|
XPushVar<int> vOsMode(_T("OSMODE"), nOsMode);
|
|
XPushVar<int> vOrthoMode(_T("ORTHOMODE"), 0); //f8
|
|
CSprinkIsometryDlg dlg(acedGetAcadFrame());
|
|
{
|
|
CTemporaryResourceOverride vTemp;
|
|
dlg.Create(IDD_SPRINKLER_ISOMETRY, acedGetAcadFrame());
|
|
dlg.ShowWindow(SW_SHOW);
|
|
acedGetAcadDwgView()->SetFocus();
|
|
}
|
|
|
|
CString m_csSysBlk1 = _T("TWTSYS(00000283)");
|
|
CString m_csSysBlk2 = _T("TWTSYS(00000530)");//水喷雾 系统 zxl 2011.12.19 add
|
|
|
|
//zxl 2011.11.29 del
|
|
// InitPipeLayer(LAY_PIPE_SPRINKLE);
|
|
|
|
InitLayer(LAY_EQUIP_SPRINKLE);
|
|
|
|
while(1){
|
|
XPointList lstPt;
|
|
// double nXDist(0), nYDist(0);
|
|
XPoint ptStart, ptEnd;
|
|
int nOsMode;
|
|
xg_getvar(_T("OSMODE"), &nOsMode);
|
|
nOsMode &= ~0x4000;
|
|
nOsMode |= OS_INT|OS_NEA|OS_END;
|
|
XPushVar<int> vOsMode(_T("OSMODE"), nOsMode);
|
|
//提示用户输入起始点
|
|
int iRet;
|
|
XString sKeyword;
|
|
INITGET_BEG(0, _T("S"));
|
|
iRet = ads_getpoint(NULL,_T("\n请输入起始点[选取行向线(S)]<退出>:"), ptStart);
|
|
ptStart = Ucs2Wcs(ptStart);
|
|
INITGET_END();
|
|
if(iRet == RTCAN || iRet == RTNONE)
|
|
break;
|
|
|
|
//提示用户从当前屏幕选择行向线
|
|
if(iRet == RTKWORD){
|
|
ads_getinput(sKeyword);
|
|
TCHAR cKey = sKeyword[0];
|
|
if(cKey==_T('S')){
|
|
double s_angle(0);
|
|
int err_value=get_line_angle(s_angle);
|
|
if(err_value == RTNORM){
|
|
s_angle = s_angle*180/PI;
|
|
dlg.m_nAngle = s_angle;
|
|
dlg.UpdateData(FALSE);
|
|
}
|
|
else if(err_value == RTERROR)
|
|
break;
|
|
//提示用户输入起始点
|
|
if(ads_getpoint(NULL,_T("\n请输入起始点:"),ptStart) != RTNORM)
|
|
break;
|
|
ptStart = Ucs2Wcs(ptStart);
|
|
}
|
|
}
|
|
TSprinklerJig jig(&dlg, ptStart, dlg.m_nCol2Wall, dlg.m_nRow2Wall);
|
|
jig.SetPrompt(_T("\n请输入终点<退出>:"));
|
|
int nKeyIdx;
|
|
if(jig.DoIt(&nKeyIdx) != RTNORM){
|
|
dlg.DestroyWindow();
|
|
return;
|
|
}
|
|
|
|
InitPipeLayer(dlg.GetPipeLayer());//zxl 2011.11.29 add
|
|
|
|
ptEnd = jig.GetPickPoint();
|
|
int iRow, iCol;
|
|
GetIsometryInsPt(ptStart, ptEnd, dlg.m_nRow2Wall, dlg.m_nCol2Wall, dlg.m_nAngle + Radian2Angle(Ucs2Wcs(0.0)), dlg.m_nXDist, dlg.m_nYDist, lstPt, iRow, iCol);
|
|
XPushVar<int> vOsMode2(_T("OSMODE"), 0);
|
|
int len = lstPt.Length();
|
|
for(int i=0;i<len;i++){
|
|
XPoint pt = *lstPt[i];
|
|
TDbEquipment *pEquip = new TDbEquipment;
|
|
if(dlg.m_bNoBreak == 2){
|
|
pEquip->SetBlock2d(GetBlkIdByName(xsTmp2));
|
|
pEquip->SetHidePipe(TRUE);
|
|
pEquip->SetPipeLength(250);
|
|
pEquip->SetBlock3d(GetBlkIdByName(xsTmp5));
|
|
pEquip->SetSysBlock(m_csSysBlk1);
|
|
}
|
|
else if (dlg.m_bNoBreak == 3)//zxl 2011.12.19 add 增加水喷雾喷头
|
|
{
|
|
pEquip->SetBlock2d(GetBlkIdByName(xsTmp6));
|
|
pEquip->SetHidePipe(TRUE);
|
|
pEquip->SetPipeLength(-250);
|
|
pEquip->SetBlock3d(GetBlkIdByName(xsTmp3));
|
|
pEquip->SetSysBlock(m_csSysBlk2);
|
|
}
|
|
else if (dlg.m_bNoBreak == 4) // cet 2013.1.5 add 增加直立型水幕
|
|
{
|
|
pEquip->SetHidePipe(TRUE);
|
|
pEquip->SetPipeLength(250);
|
|
pEquip->SetSysBlock(_T("TWTSYS(00000542)"));
|
|
pEquip->SetBlock2d(GetBlkIdByName(xsTmp7));
|
|
pEquip->SetBlock3d(GetBlkIdByName(xsTmp4));
|
|
}
|
|
else if (dlg.m_bNoBreak == 5) // cet 2013.1.5 add 增加下垂型水幕
|
|
{
|
|
pEquip->SetHidePipe(TRUE);
|
|
pEquip->SetPipeLength(-250);
|
|
pEquip->SetSysBlock(_T("TWTSYS(00000542)"));
|
|
pEquip->SetBlock2d(GetBlkIdByName(xsTmp8));
|
|
pEquip->SetBlock3d(GetBlkIdByName(xsTmp3));
|
|
}
|
|
else{
|
|
pEquip->SetBlock2d(GetBlkIdByName(xsTmp));
|
|
if(dlg.m_bNoBreak == 0){ //上喷
|
|
pEquip->SetHidePipe(TRUE);
|
|
pEquip->SetPipeLength(250);
|
|
pEquip->SetBlock3d(GetBlkIdByName(xsTmp4));
|
|
pEquip->SetSysBlock(m_csSysBlk1);
|
|
}
|
|
else if(dlg.m_bNoBreak == 1){
|
|
pEquip->SetHidePipe(FALSE);
|
|
pEquip->SetBlock3d(GetBlkIdByName(xsTmp3));
|
|
pEquip->SetPipeLength(-250);
|
|
pEquip->SetSysBlock(m_csSysBlk1);
|
|
}
|
|
}
|
|
pt.z = dlg.m_nEle * 1000;
|
|
pEquip->SetLocation(pt);
|
|
double nAng = Wcs2Ucs(A2R(dlg.m_nAngle));
|
|
pEquip->SetAngle(nAng);
|
|
pEquip->SetNumber(_T("CIRCLE-1"));
|
|
pEquip->SetScale(g_nSprinklerRadius);
|
|
//pEquip->SetSysBlock(m_csSysBlk1);
|
|
pEquip->setLayer(LAY_EQUIP_SPRINKLE);
|
|
pEquip->setColor(AcCmColor()); //随层
|
|
AddToCurrentSpace(pEquip, Adesk::kTrue);
|
|
Entity entLast;
|
|
entLast.GetLast();
|
|
WriteXdata(entLast, _T("HYDRANT_RADIUS"), dlg.m_csRadius);
|
|
|
|
if(dlg.m_iConPipe == 2) //不接线
|
|
continue;
|
|
}
|
|
XRect rect(ptStart, ptEnd, dlg.m_nAngle + Radian2Angle(Ucs2Wcs(0.0)));
|
|
ModifyRect(rect);// 矩形构造不正确,重新构造 zxl 2014.01.08 add
|
|
ads_polar(ptStart, rect.x_angle, dlg.m_nRow2Wall, ptStart);
|
|
ads_polar(ptStart, rect.y_angle, dlg.m_nCol2Wall, ptStart);
|
|
|
|
int count(0), count2(0);
|
|
double nAng(0), nAng2(0), nDist(0), nDist2(0);
|
|
if(dlg.m_iConPipe == 0){ //行向接线
|
|
count = iCol;
|
|
count2 = iRow;
|
|
nAng = rect.y_angle;
|
|
nDist = dlg.m_nYDist;
|
|
nAng2 = rect.x_angle;
|
|
nDist2 = dlg.m_nXDist;
|
|
}
|
|
else if(dlg.m_iConPipe == 1){ //列向接线
|
|
count = iRow;
|
|
count2 = iCol;
|
|
nAng = rect.x_angle;
|
|
nDist = dlg.m_nXDist;
|
|
nAng2 = rect.y_angle;
|
|
nDist2 = dlg.m_nYDist;
|
|
}
|
|
XPoint ptTmp1(ptStart), ptTmp2;
|
|
//之所以强制调用一下反应器是因为当行列过多的时候,管线无法断线,不知为什么
|
|
TPipePerDocData *pData = GetCurPipeDocData();
|
|
pData->ApplyUpdates();
|
|
for(int m=0;m<count;m++){
|
|
if(m > 0)
|
|
ads_polar(ptTmp1, nAng, nDist, ptTmp1);
|
|
ads_polar(ptTmp1, nAng2, (count2 - 1)*nDist2, ptTmp2);
|
|
TDbPipe *pPipe = new TDbPipe;
|
|
ptTmp1.z = dlg.m_nEle * 1000;
|
|
ptTmp2.z = dlg.m_nEle * 1000;
|
|
pPipe->SetStartPoint(ptTmp1);
|
|
pPipe->SetEndPoint(ptTmp2);
|
|
|
|
//zxl 2011.11.29 modify
|
|
// pPipe->setLayer(LAY_PIPE_SPRINKLE);
|
|
// pPipe->setLinetype(GetPipeWireLayLineType(LAY_PIPE_SPRINKLE));
|
|
pPipe->setLayer(dlg.GetPipeLayer());
|
|
pPipe->setLinetype(GetPipeWireLayLineType(dlg.GetPipeLayer()));
|
|
|
|
pPipe->SetPipeWeight(g_nPipeWidth[8]);
|
|
pPipe->SetDnDiameter(g_iDefaultPipeDn);
|
|
pPipe->SetModelType(TPipeSys::kModel);
|
|
|
|
//zxl 2011.12.12 modify
|
|
//pPipe->SetSysType(TPipeSys::kSprinkle);
|
|
if (dlg.GetPipeLayer().Compare(LAY_PIPE_SPRINKLE) == 0)
|
|
{
|
|
pPipe->SetSysType(TPipeSys::kSprinkle);
|
|
}
|
|
else if (dlg.GetPipeLayer().Compare(LAY_PIPE_SPRINKLE2) == 0)
|
|
{
|
|
pPipe->SetSysType(TPipeSys::kSprinkle2);
|
|
}
|
|
else
|
|
{
|
|
pPipe->SetSysType(TPipeSys::kSprinkle3);
|
|
}
|
|
|
|
pPipe->SetRadius(g_nPipeRadius[8]);
|
|
pPipe->setColor(AcCmColor()); //随层
|
|
AddToCurrentSpace(pPipe, Adesk::kTrue);
|
|
|
|
}
|
|
|
|
|
|
} // while end
|
|
|
|
dlg.DestroyWindow();
|
|
SHads_command(RTSTR, _T(".REDRAW"), RTNONE);
|
|
}
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CSprinkIsometryDlg dialog
|
|
|
|
IMPLEMENT_DYNAMIC(CSprinkIsometryDlg, CModelessDialog)
|
|
double CSprinkIsometryDlg::m_nXDist = 3600;
|
|
double CSprinkIsometryDlg::m_nYDist = 3600;
|
|
double CSprinkIsometryDlg::m_nRow2Wall = 1800;
|
|
double CSprinkIsometryDlg::m_nCol2Wall = 1800;
|
|
double CSprinkIsometryDlg::m_nEle = 0;
|
|
int CSprinkIsometryDlg::m_bNoBreak = 1;
|
|
int CSprinkIsometryDlg::m_iConPipe = 0;
|
|
int CSprinkIsometryDlg::m_nPipeType = 0;
|
|
|
|
CSprinkIsometryDlg::CSprinkIsometryDlg(CWnd* pParent /*=NULL*/)
|
|
: CModelessDialog(CSprinkIsometryDlg::IDD, pParent), m_spinAngle(5), m_spinCol(100), m_spinRow(100), m_spinRow2Wall(100), m_spinCol2Wall(100)
|
|
{
|
|
//{{AFX_DATA_INIT(CSprinkIsometryDlg)
|
|
m_nAngle = 0.0;
|
|
m_bDrawCir = FALSE;
|
|
m_csRadius = _T("2.12");
|
|
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
|
|
|
|
void CSprinkIsometryDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CModelessDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CSprinkIsometryDlg)
|
|
DDX_Control(pDX, IDC_EDIT_COLNUM2WALL, m_editCol2Wall);
|
|
DDX_Control(pDX, IDC_EDIT_COLNUM, m_editCol);
|
|
DDX_Control(pDX, IDC_EDIT_ANGLE, m_editAngle);
|
|
DDX_Control(pDX, IDC_EDIT_ROWNUM, m_editRow);
|
|
DDX_Control(pDX, IDC_EDIT_ROW2WALL, m_editRow2Wall);
|
|
DDX_Control(pDX, IDC_EDIT_ELE, m_editEle);
|
|
DDX_Control(pDX, IDC_SPIN_ROW2WALL, m_spinRow2Wall);
|
|
DDX_Control(pDX, IDC_SPIN_COL2WALL, m_spinCol2Wall);
|
|
DDX_Control(pDX, IDC_SPIN_COL, m_spinCol);
|
|
DDX_Control(pDX, IDC_SPIN_ROW, m_spinRow);
|
|
DDX_Control(pDX, IDC_SPIN_ANGLE, m_spinAngle);
|
|
DDX_Text(pDX, IDC_EDIT_ANGLE, m_nAngle);
|
|
DDX_Check(pDX, IDC_CHECK_DRAW, m_bDrawCir);
|
|
DDX_CBString(pDX, IDC_COMBO_RADIUS, m_csRadius);
|
|
DDX_Text(pDX, IDC_EDIT_ROWNUM, m_nXDist);
|
|
DDX_Text(pDX, IDC_EDIT_COLNUM, m_nYDist);
|
|
DDX_CBIndex(pDX, IDC_COMBO_PIPE, m_iConPipe);
|
|
DDX_Radio(pDX, IDC_RADIO_POS1, m_bNoBreak);
|
|
DDX_Text(pDX, IDC_EDIT_ELE, m_nEle);
|
|
DDX_Text(pDX, IDC_EDIT_ROW2WALL, m_nRow2Wall);
|
|
DDX_Text(pDX, IDC_EDIT_COLNUM2WALL, m_nCol2Wall);
|
|
DDX_CBIndex(pDX, IDC_COMBO_PIPETYPE, m_nPipeType);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CSprinkIsometryDlg, CModelessDialog)
|
|
//{{AFX_MSG_MAP(CSprinkIsometryDlg)
|
|
ON_WM_CLOSE()
|
|
ON_BN_CLICKED(IDC_CHECK_DRAW, OnCheckDraw)
|
|
ON_CBN_SELCHANGE(IDC_COMBO_PIPETYPE, OnSelchangeComboPipetype)
|
|
ON_CBN_KILLFOCUS(IDC_COMBO_RADIUS, OnKillfocusComboRadius)
|
|
ON_EN_KILLFOCUS(IDC_EDIT_ANGLE, OnKillfocusEditAngle)
|
|
ON_EN_KILLFOCUS(IDC_EDIT_COLNUM, OnKillfocusEditColnum)
|
|
ON_EN_KILLFOCUS(IDC_EDIT_COLNUM2WALL, OnKillfocusEditColnum2wall)
|
|
ON_EN_KILLFOCUS(IDC_EDIT_ELE, OnKillfocusEditEle)
|
|
ON_EN_KILLFOCUS(IDC_EDIT_ROW2WALL, OnKillfocusEditRow2wall)
|
|
ON_EN_KILLFOCUS(IDC_EDIT_ROWNUM, OnKillfocusEditRownum)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CSprinkIsometryDlg message handlers
|
|
|
|
void CSprinkIsometryDlg::OnClose()
|
|
{
|
|
CModelessDialog::OnClose();
|
|
acedPostCommand(_T("\33\33"));
|
|
}
|
|
|
|
BOOL CSprinkIsometryDlg::OnInitDialog()
|
|
{
|
|
CModelessDialog::OnInitDialog();
|
|
m_editCol.SetDataType(CRealEdit::eInteger);
|
|
m_editRow.SetDataType(CRealEdit::eInteger);
|
|
m_editAngle.SetDataType(CRealEdit::eInteger);
|
|
m_editEle.SetDataType(CRealEdit::eReal);
|
|
m_editCol2Wall.SetDataType(CRealEdit::eReal);
|
|
m_editRow2Wall.SetDataType(CRealEdit::eReal);
|
|
|
|
m_spinAngle.SetRange(0,360);
|
|
m_spinCol.SetRange(0,9000);
|
|
m_spinRow.SetRange(0,9000);
|
|
m_spinRow2Wall.SetRange(0,9000);
|
|
m_spinCol2Wall.SetRange(0,9000);
|
|
OnCheckDraw();
|
|
|
|
OnSelchangeComboPipetype(); //zxl 2011.11.29 add
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnCheckDraw()
|
|
{
|
|
UpdateData();
|
|
CWnd *pWnd1 = GetDlgItem(IDC_COMBO_RADIUS);
|
|
pWnd1->EnableWindow(m_bDrawCir);
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnSelchangeComboPipetype()
|
|
{
|
|
UpdateData(TRUE);
|
|
if (m_nPipeType == 0)
|
|
{
|
|
m_sPipeLayer = LAY_PIPE_SPRINKLE;
|
|
}
|
|
else if (m_nPipeType == 1)
|
|
{
|
|
m_sPipeLayer = LAY_PIPE_SPRINKLE2;
|
|
}
|
|
else if (m_nPipeType == 2)
|
|
{
|
|
m_sPipeLayer = LAY_PIPE_SPRINKLE3;
|
|
}
|
|
}
|
|
|
|
CString CSprinkIsometryDlg::GetPipeLayer()
|
|
{
|
|
return m_sPipeLayer;
|
|
}
|
|
|
|
bool IsStrAllNum(CString csText)
|
|
{
|
|
CString sText = csText.SpanIncluding(_T("0123456789.-e"));
|
|
if ((sText.Find(_T("."), 0) == 0 || sText.Find(_T("-"), 0) == 0) && _tstof(csText) == 0)
|
|
{
|
|
return false;
|
|
}
|
|
// 小数点可以出现在中间,但只能出现一次
|
|
int nIndex = sText.Find(_T("."), 0);
|
|
if (nIndex >= 0)
|
|
{
|
|
nIndex = sText.Find(_T("."), ++nIndex);
|
|
}
|
|
|
|
// 负号可以出现在起始处,但只能出现一次
|
|
int nIndex2 = sText.Find(_T("-"));
|
|
if (nIndex2 == 0)
|
|
{
|
|
nIndex2 = sText.Find(_T("-"), 1);
|
|
}
|
|
|
|
if (csText == sText && nIndex < 0 && nIndex2 <= 0)// 全是数字
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnKillfocusComboRadius()
|
|
{
|
|
CString csData = m_csRadius;
|
|
CEdit *pWnd = (CEdit *)GetDlgItem(IDC_COMBO_RADIUS);
|
|
if (pWnd == NULL)
|
|
{
|
|
return;
|
|
}
|
|
CString sText;
|
|
pWnd->GetWindowText(sText);
|
|
double dNewData = _tstof(sText);
|
|
if (dNewData <= 0 || !IsStrAllNum(sText))
|
|
{
|
|
m_csRadius = csData;
|
|
UpdateData(FALSE);
|
|
acedGetAcadDwgView()->SetFocus();
|
|
pWnd->SetFocus();
|
|
pWnd->SetSel(0, -1);
|
|
}
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnKillfocusEditAngle()
|
|
{
|
|
double dData = m_nAngle;
|
|
CString sText;
|
|
m_editAngle.GetWindowText(sText);
|
|
m_nAngle = _tstof(sText);
|
|
if (sText.IsEmpty() || !IsStrAllNum(sText))
|
|
{
|
|
m_nAngle = dData;
|
|
UpdateData(FALSE);
|
|
acedGetAcadDwgView()->SetFocus();
|
|
m_editAngle.SetFocus();
|
|
m_editAngle.SetSel(0, -1);
|
|
}
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnKillfocusEditColnum()
|
|
{
|
|
double dData = m_nYDist;
|
|
CString sText;
|
|
m_editCol.GetWindowText(sText);
|
|
m_nYDist = _tstof(sText);
|
|
if (m_nYDist <= 0 || !IsStrAllNum(sText))
|
|
{
|
|
m_nYDist = dData;
|
|
UpdateData(FALSE);
|
|
acedGetAcadDwgView()->SetFocus();
|
|
m_editCol.SetFocus();
|
|
m_editCol.SetSel(0, -1);
|
|
}
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnKillfocusEditColnum2wall()
|
|
{
|
|
double dData = m_nCol2Wall;
|
|
CString sText;
|
|
m_editCol2Wall.GetWindowText(sText);
|
|
m_nCol2Wall = _tstof(sText);
|
|
if (m_nCol2Wall <= 0 || !IsStrAllNum(sText))
|
|
{
|
|
m_nCol2Wall = dData;
|
|
UpdateData(FALSE);
|
|
acedGetAcadDwgView()->SetFocus();
|
|
m_editCol2Wall.SetFocus();
|
|
m_editCol2Wall.SetSel(0, -1);
|
|
}
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnKillfocusEditEle()
|
|
{
|
|
double dData = m_nEle;
|
|
CString sText;
|
|
m_editEle.GetWindowText(sText);
|
|
m_nEle = _tstof(sText);
|
|
if (sText.IsEmpty() || !IsStrAllNum(sText))
|
|
{
|
|
m_nEle = dData;
|
|
UpdateData(FALSE);
|
|
acedGetAcadDwgView()->SetFocus();
|
|
m_editEle.SetFocus();
|
|
m_editEle.SetSel(0, -1);
|
|
}
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnKillfocusEditRow2wall()
|
|
{
|
|
double dData = m_nRow2Wall;
|
|
CString sText;
|
|
m_editRow2Wall.GetWindowText(sText);
|
|
m_nRow2Wall = _tstof(sText);
|
|
if (m_nRow2Wall <= 0 || !IsStrAllNum(sText))
|
|
{
|
|
m_nRow2Wall = dData;
|
|
UpdateData(FALSE);
|
|
acedGetAcadDwgView()->SetFocus();
|
|
m_editRow2Wall.SetFocus();
|
|
m_editRow2Wall.SetSel(0, -1);
|
|
}
|
|
}
|
|
|
|
void CSprinkIsometryDlg::OnKillfocusEditRownum()
|
|
{
|
|
double dData = m_nXDist;
|
|
CString sText;
|
|
m_editRow.GetWindowText(sText);
|
|
m_nXDist = _tstof(sText);
|
|
if (m_nXDist <= 0 || !IsStrAllNum(sText))
|
|
{
|
|
m_nXDist = dData;
|
|
UpdateData(FALSE);
|
|
acedGetAcadDwgView()->SetFocus();
|
|
m_editRow.SetFocus();
|
|
m_editRow.SetSel(0, -1);
|
|
}
|
|
}
|