2026-10-04 00:04:20 +08:00
|
|
|
|
// PrincipleFeedDlg.cpp : implementation file
|
2026-09-28 15:28:50 +08:00
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
#include "AcDbObjectPtr.h"
|
|
|
|
|
|
#include "DbPipe.h"
|
|
|
|
|
|
#include "DbPipeValve.h"
|
|
|
|
|
|
#include "PickEntSet.h"
|
|
|
|
|
|
#include "DbEquipment.h"
|
|
|
|
|
|
#include "xtext.h"
|
|
|
|
|
|
#include "PrincipleFeedDlg.h"
|
|
|
|
|
|
#include "DistFloorDlg.h"
|
|
|
|
|
|
#include "SanitaryDangDlg.h"
|
|
|
|
|
|
#include "AecDbSymbElevation.h"
|
|
|
|
|
|
#include "GeCurveInline.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
|
#define new DEBUG_NEW
|
|
|
|
|
|
#undef THIS_FILE
|
|
|
|
|
|
static char THIS_FILE[] = __FILE__;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
extern AcDbObjectId InitLayer(const TCHAR *szLayer, AcDbDatabase *pDb = NULL);
|
|
|
|
|
|
|
|
|
|
|
|
extern TCHAR *LAY_CALC_TEXT;
|
|
|
|
|
|
extern TCHAR *LAY_PIPE_FEED;
|
|
|
|
|
|
extern TCHAR *LAY_EQ_FEED;
|
|
|
|
|
|
extern TCHAR *LAY_TWT;
|
|
|
|
|
|
extern TCHAR *LAY_TEXT;
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId InsElevation(XPoint pt, const TCHAR *szText, const TCHAR *szLayer, BOOL bRight = TRUE)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId id = InitLayer(LAY_TEXT);
|
|
|
|
|
|
AecXDbSymbElevation *pElev = new AecXDbSymbElevation;
|
|
|
|
|
|
pElev->SetLocation(pt);
|
|
|
|
|
|
pElev->SetLayoutRotation(GlobalFunc::Ucs2Wcs(0.0));
|
|
|
|
|
|
pElev->SetText(szText);
|
|
|
|
|
|
// zxl 2012.07.03 modify
|
|
|
|
|
|
//pElev->SetTextHeight(g_nTwtDimHeight);
|
|
|
|
|
|
pElev->SetTextHeight(g_Option::instance().g_nEleDimHeight);
|
|
|
|
|
|
|
|
|
|
|
|
pElev->SetBaseLine(FALSE);
|
|
|
|
|
|
pElev->SetLeader(FALSE);
|
|
|
|
|
|
// zxl 2012.07.03 modify
|
|
|
|
|
|
//pElev->SetTextStyleId(InitTwtTextStyle(g_csTwtDimStyle));
|
|
|
|
|
|
pElev->SetTextStyleId(GlobalFunc::InitTwtTextStyle(g_Option::instance().g_csEleDimStyle));
|
|
|
|
|
|
|
|
|
|
|
|
pElev->setLayer(pElev->GetDefaultLayer());
|
|
|
|
|
|
pElev->SetTextLayerId(id);
|
|
|
|
|
|
pElev->SetTextBaseLen(pElev->GetDefaultTextBaseLen()*1.1);
|
|
|
|
|
|
pElev->SetTextPoint(pElev->GetDefaultTextLocation());
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if (!bRight) //标高标注往左边绘制
|
2026-09-28 15:28:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
double dLen = pElev->GetBaseLen();
|
|
|
|
|
|
AcDbIntArray indices;
|
|
|
|
|
|
indices.append(1);
|
|
|
|
|
|
pElev->moveGripPointsAt(indices, AcGeVector3d(-dLen*GlobalFunc::DocGetPScale(), 0.0, 0.0));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
AcDbObjectId idRet = GlobalFunc::AddToModelSpace(pElev);
|
|
|
|
|
|
//AcDbObjectId idRet = pElev->AddToCSpace(Adesk::kTrue);
|
|
|
|
|
|
Entity ent;
|
|
|
|
|
|
ent.GetLast();
|
|
|
|
|
|
GlobalFunc::WriteXdata(ent, _T("TG-LAYER"), szLayer);
|
|
|
|
|
|
|
|
|
|
|
|
return idRet;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DrawFloorLine(XPoint p1, XPoint p2, const TCHAR *szPipeLayer, const TCHAR *szText, double nHeight, const TCHAR *szSerial = _T(""))
|
|
|
|
|
|
{
|
|
|
|
|
|
InitLayer(LAY_TWT);
|
|
|
|
|
|
GlobalFunc::InitTwtTextStyle(g_Option::instance().g_csTwtDimStyle);
|
|
|
|
|
|
GlobalFunc::PushVarStr clayer(_T("CLAYER"), LAY_TWT);
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//楼板线和字
|
2026-09-28 15:28:50 +08:00
|
|
|
|
//zxl 2013.05.27 add
|
|
|
|
|
|
ads_polar(p1, GlobalFunc::Ucs2Wcs(0.0 - PI), 5*GlobalFunc::DocGetPScale(), p1);
|
|
|
|
|
|
XLine line(p1, p2, 1);
|
|
|
|
|
|
XPoint ptTmp;
|
|
|
|
|
|
|
|
|
|
|
|
int ret = ptTmp & line;
|
|
|
|
|
|
|
|
|
|
|
|
line.Make();
|
|
|
|
|
|
Entity ent;
|
|
|
|
|
|
ent.GetLast();
|
|
|
|
|
|
GlobalFunc::WriteXdata(ent, _T("TG-LAYER"), szPipeLayer);
|
|
|
|
|
|
GlobalFunc::WriteXdata(ent, _T("PIPE-SERIAL"), (const TCHAR *)szSerial);
|
|
|
|
|
|
BOOL bLeft = TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
if (_tcsicmp(szText, _T("")) != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
XPoint ptText;
|
|
|
|
|
|
ads_polar(p1, PI/2, 50, ptText);
|
|
|
|
|
|
XText text(szText
|
|
|
|
|
|
, ptText
|
|
|
|
|
|
, g_Option::instance().g_nTwtDimHeight * GlobalFunc::DocGetPScale()
|
|
|
|
|
|
, g_Option::instance().g_nDimScale
|
|
|
|
|
|
, g_Option::instance().g_csTwtDimStyle, LAY_TEXT);
|
|
|
|
|
|
text.SetRotate(GlobalFunc::Ucs2Wcs(0.0));
|
|
|
|
|
|
text.TgDraw(AcGiDraw::kBottomLeft);
|
|
|
|
|
|
ent.GetLast();
|
|
|
|
|
|
GlobalFunc::WriteXdata(ent, _T("TG-LAYER"), szPipeLayer);
|
|
|
|
|
|
GlobalFunc::WriteXdata(ent, _T("PIPE-SERIAL"), (const TCHAR *)szSerial);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
bLeft = FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nHeight < -998)
|
|
|
|
|
|
return;
|
|
|
|
|
|
XPoint ptEle;
|
|
|
|
|
|
CString csEle;
|
|
|
|
|
|
csEle.Format(_T("%.3f"), nHeight);
|
|
|
|
|
|
ads_polar(p1, GlobalFunc::Ucs2Wcs(0.0), 15*GlobalFunc::DocGetPScale(), ptEle);
|
|
|
|
|
|
InsElevation(ptEle, csEle, szPipeLayer, bLeft);
|
|
|
|
|
|
|
|
|
|
|
|
ent.GetLast();
|
|
|
|
|
|
GlobalFunc::WriteXdata(ent, _T("PIPE-SERIAL"), (const TCHAR *)szSerial);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId InsEquipmentByName(const TCHAR *szName, XPoint pt, double nAng, const TCHAR *szLayer, BOOL bReversal, BOOL bHidePipe)
|
|
|
|
|
|
{
|
|
|
|
|
|
InitLayer(szLayer);
|
|
|
|
|
|
AcDbObjectId recordId = GlobalFunc::GetBlkIdByName(szName);
|
|
|
|
|
|
if (!recordId)
|
|
|
|
|
|
return recordId;
|
|
|
|
|
|
CDbEquipment *pEquip = new CDbEquipment;
|
|
|
|
|
|
pEquip->SetBlock2d(recordId);
|
|
|
|
|
|
pEquip->SetLocation(pt);
|
|
|
|
|
|
pEquip->SetScale(1);
|
|
|
|
|
|
pEquip->SetHidePipe(bHidePipe);
|
|
|
|
|
|
pEquip->SetSpare(0);
|
|
|
|
|
|
pEquip->SetDang(0);
|
|
|
|
|
|
pEquip->SetPipeLength(0);
|
|
|
|
|
|
pEquip->SetAngle(nAng);
|
|
|
|
|
|
pEquip->MirrorByY(bReversal);
|
|
|
|
|
|
pEquip->setLayer(szLayer);
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pEquip->setColor(AcCmColor()); //随层
|
2026-09-28 15:28:50 +08:00
|
|
|
|
AcDbObjectId id = GlobalFunc::AddToCurrentSpace(pEquip, Adesk::kTrue);
|
|
|
|
|
|
return id;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CString GetValveLayBySys(TPipeSys::SysType sys)
|
|
|
|
|
|
{
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_FEED;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_HEADFEED;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_HEADBACK;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_DIRT;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USELESS;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_RAIN;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USED;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_FIRE;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_FIRE;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_SPRINKLE;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_COAGULATE;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_DRINK;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_PRESSDIRT;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_PRESSUSELESS;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_PRESSRAIN;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USER1;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USER2;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USER3;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USER4;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USER5;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USER6;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USER7;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_USER8;
|
|
|
|
|
|
extern TCHAR *LAY_VALVE_OTHER;
|
|
|
|
|
|
|
|
|
|
|
|
CString csRet;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if (sys == TPipeSys::kFeedWater || sys == TPipeSys::kFeedWater2 || sys == TPipeSys::kFeedWater3) // cet 2011.12.6 modify 增加中高区
|
2026-09-28 15:28:50 +08:00
|
|
|
|
csRet = LAY_VALVE_FEED;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
else if (sys == TPipeSys::kHeatFeedWater || sys == TPipeSys::kHeatFeedWater2 || sys == TPipeSys::kHeatFeedWater3) // cet 2011.12.6 modify 增加中高区
|
2026-09-28 15:28:50 +08:00
|
|
|
|
csRet = LAY_VALVE_HEADFEED;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
else if (sys == TPipeSys::kHeatBackWater || sys == TPipeSys::kHeatBackWater2 || sys == TPipeSys::kHeatBackWater3) // cet 2011.12.6 modify 增加中高区
|
2026-09-28 15:28:50 +08:00
|
|
|
|
csRet = LAY_VALVE_HEADBACK;
|
|
|
|
|
|
else if (sys == TPipeSys::kDirtWater)
|
|
|
|
|
|
csRet = LAY_VALVE_DIRT;
|
|
|
|
|
|
else if (sys == TPipeSys::kUselessWater)
|
|
|
|
|
|
csRet = LAY_VALVE_USELESS;
|
|
|
|
|
|
else if (sys == TPipeSys::kRainWater)
|
|
|
|
|
|
csRet = LAY_VALVE_RAIN;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
else if (sys == TPipeSys::kUsedWater || sys == TPipeSys::kUsedWater2 || sys == TPipeSys::kUsedWater3) // cet 2011.12.6 modify 增加中高区
|
2026-09-28 15:28:50 +08:00
|
|
|
|
csRet = LAY_VALVE_USED;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
else if (sys == TPipeSys::kFireFighting || sys == TPipeSys::kFireFighting2 || sys == TPipeSys::kFireFighting3) // cet 2011.12.6 modify 增加中高区
|
2026-09-28 15:28:50 +08:00
|
|
|
|
csRet = LAY_VALVE_FIRE;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
else if (sys == TPipeSys::kSprinkle || sys == TPipeSys::kSprinkle2 || sys == TPipeSys::kSprinkle3) // cet 2011.12.6 modify 增加中高区
|
2026-09-28 15:28:50 +08:00
|
|
|
|
csRet = LAY_VALVE_SPRINKLE;
|
|
|
|
|
|
else if (sys == TPipeSys::kCoagulate)
|
|
|
|
|
|
csRet = LAY_VALVE_COAGULATE;
|
|
|
|
|
|
else if (sys == TPipeSys::kDrink)
|
|
|
|
|
|
csRet = LAY_VALVE_DRINK;
|
|
|
|
|
|
else if (sys == TPipeSys::kPressDirt)
|
|
|
|
|
|
csRet = LAY_VALVE_PRESSDIRT;
|
|
|
|
|
|
else if (sys == TPipeSys::kPressUseless)
|
|
|
|
|
|
csRet = LAY_VALVE_PRESSUSELESS;
|
|
|
|
|
|
else if (sys == TPipeSys::kPressRain)
|
|
|
|
|
|
csRet = LAY_VALVE_PRESSRAIN;
|
|
|
|
|
|
else if (sys == TPipeSys::kCivilFeed)
|
|
|
|
|
|
csRet = LAY_VALVE_USER1;
|
|
|
|
|
|
else if (sys == TPipeSys::kCycleFeed)
|
|
|
|
|
|
csRet = LAY_VALVE_USER2;
|
|
|
|
|
|
else if (sys == TPipeSys::kOther)
|
|
|
|
|
|
csRet = LAY_VALVE_OTHER;
|
|
|
|
|
|
else if (sys == TPipeSys::kUser3) // cet 2011.12.1 add user3-user8
|
|
|
|
|
|
{
|
|
|
|
|
|
csRet = LAY_VALVE_USER3;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sys == TPipeSys::kUser4)
|
|
|
|
|
|
{
|
|
|
|
|
|
csRet = LAY_VALVE_USER4;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sys == TPipeSys::kUser5)
|
|
|
|
|
|
{
|
|
|
|
|
|
csRet = LAY_VALVE_USER5;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sys == TPipeSys::kUser6)
|
|
|
|
|
|
{
|
|
|
|
|
|
csRet = LAY_VALVE_USER6;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sys == TPipeSys::kUser7)
|
|
|
|
|
|
{
|
|
|
|
|
|
csRet = LAY_VALVE_USER7;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (sys == TPipeSys::kUser8)
|
|
|
|
|
|
{
|
|
|
|
|
|
csRet = LAY_VALVE_USER8;
|
|
|
|
|
|
}
|
|
|
|
|
|
return csRet;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double GetValveWidth(const TCHAR *szBlockName)
|
|
|
|
|
|
{
|
|
|
|
|
|
XPointList lstPt;
|
|
|
|
|
|
AcDbBlockTableRecord *pRecord = NULL;
|
|
|
|
|
|
AcDbBlockTable *pBlockTable = NULL;
|
|
|
|
|
|
acdbCurDwg()->getBlockTable(pBlockTable, AcDb::kForRead);
|
|
|
|
|
|
AcDbBlockTableRecordIterator *pIterator = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if (Acad::eOk != pBlockTable->getAt(szBlockName, pRecord, AcDb::kForRead)) {
|
|
|
|
|
|
pBlockTable->close();
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (pBlockTable)
|
|
|
|
|
|
pBlockTable->close();
|
|
|
|
|
|
pRecord->newIterator(pIterator);
|
|
|
|
|
|
if (pRecord)
|
|
|
|
|
|
pRecord->close();
|
|
|
|
|
|
|
|
|
|
|
|
for (pIterator->start(); !pIterator->done(); pIterator->step()) {
|
|
|
|
|
|
AcDbEntity *pEnt;
|
|
|
|
|
|
pIterator->getEntity(pEnt, AcDb::kForRead);
|
|
|
|
|
|
AcDbPoint *pPoint = NULL;
|
|
|
|
|
|
if (pPoint = AcDbPoint::cast(pEnt)) {
|
|
|
|
|
|
AcGePoint3d ptIns = pPoint->position();
|
|
|
|
|
|
lstPt.NewAppend(ptIns);
|
|
|
|
|
|
}
|
|
|
|
|
|
pEnt->close();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (pIterator)
|
|
|
|
|
|
delete pIterator;
|
|
|
|
|
|
if (lstPt.Length() != 2)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
XPoint pt1 = *lstPt[0];
|
|
|
|
|
|
XPoint pt2 = *lstPt[1];
|
|
|
|
|
|
return ads_distance(pt1, pt2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId InsValveByName(const TCHAR *szName, XPoint pt, const TCHAR *szPipeLay, BOOL bHorizontal = FALSE)
|
|
|
|
|
|
{
|
|
|
|
|
|
TPipeSys::SysType sys = GlobalFunc::GetPipeSysByLayer(szPipeLay);
|
|
|
|
|
|
CString csLay = GetValveLayBySys(sys);
|
|
|
|
|
|
InitLayer(csLay);
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId recordId = GlobalFunc::GetBlkIdByName(szName);
|
|
|
|
|
|
if (!recordId)
|
|
|
|
|
|
return recordId;
|
|
|
|
|
|
double nWidth = GetValveWidth(szName);
|
|
|
|
|
|
CDbPipeValve *pValve = new CDbPipeValve;
|
|
|
|
|
|
pValve->SetBlock2d(recordId);
|
|
|
|
|
|
pValve->SetLocation(pt);
|
|
|
|
|
|
pValve->SetWidth(nWidth);
|
|
|
|
|
|
pValve->SetFlangeDn(nWidth/2);
|
|
|
|
|
|
pValve->setLayer(csLay);
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pValve->setColor(AcCmColor()); //随层
|
2026-09-28 15:28:50 +08:00
|
|
|
|
pValve->SetSysType(sys);
|
|
|
|
|
|
AcDbObjectId id = GlobalFunc::AddToCurrentSpace(pValve, Adesk::kTrue);
|
|
|
|
|
|
return id;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId InsValveByName(const TCHAR *szName, XPoint pt, const TCHAR *szPipeLay, XPoint ptPipeS, XPoint ptPipeE)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
TPipeSys::SysType sys = GlobalFunc::GetPipeSysByLayer(szPipeLay);
|
|
|
|
|
|
CString csLay = GetValveLayBySys(sys);
|
|
|
|
|
|
InitLayer(csLay);
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId recordId = GlobalFunc::GetBlkIdByName(szName);
|
|
|
|
|
|
if (!recordId)
|
|
|
|
|
|
return recordId;
|
|
|
|
|
|
XVector3D vectBase(ptPipeE.x - ptPipeS.x, ptPipeE.y - ptPipeS.y, 0);
|
|
|
|
|
|
vectBase.Normalize();
|
|
|
|
|
|
int iQuadrant = 0;
|
|
|
|
|
|
if (vectBase.y < -0.000001
|
2026-10-04 00:04:20 +08:00
|
|
|
|
||(vectBase.y<0.000001&&vectBase.y>=-0.000001&&vectBase.x<0)) { //管线逆向绘制
|
2026-09-28 15:28:50 +08:00
|
|
|
|
vectBase.x = -vectBase.x;
|
|
|
|
|
|
vectBase.y = -vectBase.y;
|
|
|
|
|
|
iQuadrant = 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double nWidth = GetValveWidth(szName);
|
|
|
|
|
|
CDbPipeValve *pValve = new CDbPipeValve;
|
|
|
|
|
|
pValve->SetBlock2d(recordId);
|
|
|
|
|
|
pValve->SetDirection(vectBase);
|
|
|
|
|
|
pValve->SetQuadrant(iQuadrant);
|
|
|
|
|
|
pValve->SetLocation(pt);
|
|
|
|
|
|
pValve->SetWidth(nWidth);
|
|
|
|
|
|
pValve->SetFlangeDn(nWidth/2);
|
|
|
|
|
|
pValve->setLayer(csLay);
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pValve->setColor(AcCmColor()); //随层
|
2026-09-28 15:28:50 +08:00
|
|
|
|
pValve->SetSysType(sys);
|
|
|
|
|
|
AcDbObjectId id = GlobalFunc::AddToCurrentSpace(pValve, Adesk::kTrue);
|
|
|
|
|
|
return id;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId DrawSysPipeByLayer(XPoint ptStart, XPoint ptEnd, const TCHAR *szLayer, int iLevel = 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ptStart == ptEnd)
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
TPipeSys::SysType sys = GlobalFunc::GetPipeSysByLayer(szLayer);
|
|
|
|
|
|
CDbPipe *pPipe = new CDbPipe;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if (!g_Option::instance().g_bStandPipeArc)//传统扣弯
|
2026-09-28 15:28:50 +08:00
|
|
|
|
pPipe->SetRadiusIn(-2);
|
|
|
|
|
|
|
|
|
|
|
|
pPipe->SetHideLevel(iLevel);
|
|
|
|
|
|
pPipe->SetStartPoint(ptStart);
|
|
|
|
|
|
pPipe->SetEndPoint(ptEnd);
|
|
|
|
|
|
pPipe->setLayer(szLayer);
|
|
|
|
|
|
pPipe->setLinetype(GlobalFunc::GetPipeWireLayLineType(szLayer));
|
|
|
|
|
|
pPipe->SetDnDiameter(g_Option::instance().g_iDefaultPipeDn);
|
|
|
|
|
|
pPipe->SetMaterial(g_Option::instance().g_iPipeMaterial[GlobalFunc::GetPipeLayerIdxByName(szLayer)]);
|
|
|
|
|
|
pPipe->SetPipeWeight(g_Option::instance().g_nPipeWidth[GlobalFunc::GetPipeLayerIdxByName(szLayer)]);
|
|
|
|
|
|
pPipe->SetSysType(sys);
|
|
|
|
|
|
pPipe->SetRadius(g_Option::instance().g_nPipeRadius[GlobalFunc::GetPipeLayerIdxByName(szLayer)]);
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pPipe->setColor(AcCmColor()); //随层
|
2026-09-28 15:28:50 +08:00
|
|
|
|
pPipe->SetModelType(TPipeSys::kSystem);
|
|
|
|
|
|
AcDbObjectId id = GlobalFunc::AddToCurrentSpace(pPipe, Adesk::kTrue);
|
|
|
|
|
|
return id;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
2026-10-04 00:04:20 +08:00
|
|
|
|
// 住宅给水原理
|
2026-09-28 15:28:50 +08:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
void PrincipleFeed()
|
|
|
|
|
|
{
|
|
|
|
|
|
CTemporaryResourceOverride vTemp;
|
|
|
|
|
|
CPrincipleFeedDlg dlg;
|
|
|
|
|
|
if(dlg.DoModal() != IDOK)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
CString csLayer = LAY_PIPE_FEED;
|
|
|
|
|
|
GlobalFunc::InitPipeLayer(LAY_PIPE_FEED);
|
|
|
|
|
|
InitLayer(LAY_EQ_FEED);
|
|
|
|
|
|
|
|
|
|
|
|
XPoint ptIns, ptStart, ptEnd, ptFloor;
|
|
|
|
|
|
xg_getvar(_T("VIEWCTR"), ptIns);
|
|
|
|
|
|
ptIns = GlobalFunc::Ucs2Wcs(ptIns);
|
|
|
|
|
|
PickSet ss(SS_FREE);
|
|
|
|
|
|
ss.IncludeBegin();
|
|
|
|
|
|
double nAllHeight = dlg.m_nAllHeight;
|
|
|
|
|
|
double nBraLength = dlg.m_nFloorLen;
|
|
|
|
|
|
ptStart = ptIns;
|
|
|
|
|
|
ads_polar(ptStart, PI/2*3, dlg.m_nHeight*1000, ptStart);
|
|
|
|
|
|
ptFloor = ptIns;
|
|
|
|
|
|
CString csDwb = g_csDwbPath + _T("TwtSys");
|
|
|
|
|
|
XString xsTmp, xsTmp2, xsTmp4, xsTmp5, xsTmp7;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if(GlobalFunc::LoadDwbBlock(csDwb, _T("00000132"), xsTmp) != RTNORM) //断线
|
2026-09-28 15:28:50 +08:00
|
|
|
|
return;
|
|
|
|
|
|
if(dlg.m_iStyle == 1){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if(GlobalFunc::LoadDwbBlock(csDwb, _T("00000005"), xsTmp7) != RTNORM) //水龙头
|
2026-09-28 15:28:50 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
csDwb = g_csDwbPath + _T("valve");
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if(GlobalFunc::LoadDwbBlock(csDwb, _T("00000295"), xsTmp5) != RTNORM) //阀门
|
2026-09-28 15:28:50 +08:00
|
|
|
|
return;
|
|
|
|
|
|
ads_polar(ptStart, PI/2, dlg.m_nHeight*1000/2, ptEnd);
|
|
|
|
|
|
InsValveByName((const TCHAR*)xsTmp5, ptEnd, csLayer);
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_bValve){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if(GlobalFunc::LoadDwbBlock(csDwb, _T("00000497"), xsTmp2) != RTNORM) //截止阀
|
2026-09-28 15:28:50 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(dlg.m_bAmmeter){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if(GlobalFunc::LoadDwbBlock(csDwb, _T("00000752"), xsTmp4) != RTNORM) //水表
|
2026-09-28 15:28:50 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double nCountHeight = dlg.m_nMinEle;
|
|
|
|
|
|
Entity entLast;
|
|
|
|
|
|
GlobalFunc::InitTwtTextStyle(g_Option::instance().g_csTwtDimStyle);
|
|
|
|
|
|
for(int i=0;i<dlg.m_iNum+1;i++){
|
|
|
|
|
|
ptStart = ptFloor;
|
|
|
|
|
|
XPoint ptVerPipeS, ptVerPipeE;
|
|
|
|
|
|
ads_polar(ptStart, PI/2, dlg.m_nElevation*1000, ptVerPipeS);
|
|
|
|
|
|
if(i==0)
|
|
|
|
|
|
ads_polar(ptVerPipeS, PI/2*3, dlg.m_nHeight*1000, ptVerPipeE);
|
|
|
|
|
|
else
|
|
|
|
|
|
ads_polar(ptVerPipeS, PI/2*3, _tstof(dlg.m_lstHeight[i-1])*1000, ptVerPipeE);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//绘制每层立管
|
2026-09-28 15:28:50 +08:00
|
|
|
|
AcDbObjectId idPipe = DrawSysPipeByLayer(ptVerPipeE, ptVerPipeS, LAY_PIPE_FEED);
|
|
|
|
|
|
OPENOBJ_BEGIN(idPipe, AcDb::kForWrite, CDbPipe, pPipe);
|
|
|
|
|
|
if(pPipe){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pPipe->SetSysLabel(XString(_T("%d楼立管-1"), i+1));
|
|
|
|
|
|
// pPipe->SetSpareStr(_T("1#立管"));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_bFloor){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//楼板线和字
|
2026-09-28 15:28:50 +08:00
|
|
|
|
ads_polar(ptStart, PI, dlg.m_nHeight*1500, ptStart);
|
|
|
|
|
|
ads_polar(ptFloor, 0, dlg.m_nFloorLen, ptEnd);
|
|
|
|
|
|
CString csText;
|
|
|
|
|
|
if(i == dlg.m_iNum)
|
2026-10-04 00:04:20 +08:00
|
|
|
|
csText = _T("屋面");
|
2026-09-28 15:28:50 +08:00
|
|
|
|
else
|
|
|
|
|
|
csText = dlg.m_lstName[i];
|
|
|
|
|
|
double nLastHeight(0);
|
|
|
|
|
|
if(i > 0)
|
|
|
|
|
|
nLastHeight = _tstof(dlg.m_lstHeight[i-1]);
|
|
|
|
|
|
nCountHeight += nLastHeight;
|
|
|
|
|
|
DrawFloorLine(ptStart, ptEnd, csLayer, csText, nCountHeight,_T(""));
|
|
|
|
|
|
}
|
|
|
|
|
|
if(i == dlg.m_iNum)
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//干管
|
2026-09-28 15:28:50 +08:00
|
|
|
|
XPoint ptPipeS, ptPipeE, ptValve, ptAmmeter;
|
|
|
|
|
|
ads_polar(ptFloor, PI/2, dlg.m_nElevation*1000, ptPipeS);
|
|
|
|
|
|
|
|
|
|
|
|
BOOL bLeft = FALSE;
|
|
|
|
|
|
double nRotate(0);
|
|
|
|
|
|
if(dlg.m_iMode == 0)
|
|
|
|
|
|
nRotate = 0;
|
|
|
|
|
|
else if(dlg.m_iMode == 1){
|
|
|
|
|
|
nRotate = PI;
|
|
|
|
|
|
bLeft = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//仅绘制一边 公共建筑 或 2户以下的住宅
|
2026-09-28 15:28:50 +08:00
|
|
|
|
if(dlg.m_iDoorNum == 1){
|
|
|
|
|
|
ads_polar(ptPipeS, nRotate, dlg.m_nLen, ptPipeE);
|
|
|
|
|
|
ads_polar(ptPipeS, nRotate, dlg.m_nLen/4, ptValve);
|
|
|
|
|
|
ads_polar(ptPipeS, nRotate, dlg.m_nLen/5*3, ptAmmeter);
|
|
|
|
|
|
if(bLeft)
|
|
|
|
|
|
DrawSysPipeByLayer(ptPipeE, ptPipeS, csLayer);
|
|
|
|
|
|
else
|
|
|
|
|
|
DrawSysPipeByLayer(ptPipeS, ptPipeE, csLayer);
|
|
|
|
|
|
entLast.GetLast();
|
|
|
|
|
|
OPENOBJ_BEGIN(entLast, AcDb::kForWrite, CDbPipe, pPipe);
|
|
|
|
|
|
if(pPipe){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pPipe->SetSysLabel(XString(_T("%d楼-1"), i+1));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_iStyle == 0)
|
|
|
|
|
|
InsEquipmentByName(xsTmp, ptPipeE, nRotate, LAY_EQ_FEED, FALSE, FALSE);
|
|
|
|
|
|
else{
|
|
|
|
|
|
if(dlg.m_iMode == 0)
|
|
|
|
|
|
InsEquipmentByName(xsTmp7, ptPipeE, 0, LAY_EQ_FEED, FALSE, FALSE);
|
|
|
|
|
|
else if(dlg.m_iMode == 1)
|
|
|
|
|
|
InsEquipmentByName(xsTmp7, ptPipeE, 0, LAY_EQ_FEED, TRUE, FALSE);
|
|
|
|
|
|
}
|
2026-10-04 00:04:20 +08:00
|
|
|
|
entLast.GetLast();//输入住宅参数
|
2026-09-28 15:28:50 +08:00
|
|
|
|
OPENOBJ_BEGIN(entLast, AcDb::kForWrite, CDbEquipment, pEquipTmp);
|
|
|
|
|
|
if(pEquipTmp){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pEquipTmp->SetDang(dlg.m_nNg); //总当量
|
|
|
|
|
|
pEquipTmp->SetPipeLength(dlg.m_nNumPeople); //每户人数
|
|
|
|
|
|
pEquipTmp->SetNumber(XString(_T("%.2f"), dlg.m_nFactor)); //小时变化系数
|
|
|
|
|
|
pEquipTmp->SetSysBlock(XString(_T("%.d"), dlg.m_iRation));//用水定额
|
2026-09-28 15:28:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
CString csDim;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
csDim.Format(_T("%.1f人每户/q0=%d/Ng=%.1f每户/Kh=%.1f"), dlg.m_nNumPeople, dlg.m_iRation, dlg.m_nNg, dlg.m_nFactor);
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
XPoint ptText;
|
|
|
|
|
|
ads_polar(ptPipeE, 0, g_Option::instance().g_nTwtDimHeight * GlobalFunc::DocGetPScale(), ptText);
|
|
|
|
|
|
XText text(csDim, ptText, g_Option::instance().g_nTwtDimHeight * GlobalFunc::DocGetPScale(), g_Option::instance().g_nDimScale, g_Option::instance().g_csTwtDimStyle, LAY_CALC_TEXT);
|
|
|
|
|
|
if(bLeft)
|
|
|
|
|
|
text.Draw(AcDb::kTextBase, AcDb::kTextRight);
|
|
|
|
|
|
else
|
|
|
|
|
|
text.Draw();
|
|
|
|
|
|
entLast.GetLast();
|
|
|
|
|
|
GlobalFunc::WriteXdata(entLast, _T("TG-LAYER"), csLayer);
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_bValve)
|
|
|
|
|
|
InsValveByName((const TCHAR*)xsTmp2, ptValve, csLayer);
|
|
|
|
|
|
if(dlg.m_bAmmeter)
|
|
|
|
|
|
InsValveByName((const TCHAR*)xsTmp4, ptAmmeter, csLayer, ptPipeS, ptPipeE);
|
|
|
|
|
|
}
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//2户以上的住宅
|
2026-09-28 15:28:50 +08:00
|
|
|
|
else if(dlg.m_iDoorNum > 1){
|
|
|
|
|
|
if(dlg.m_iFloorDir == 0)
|
|
|
|
|
|
ads_polar(ptPipeS, nRotate, dlg.m_nLen, ptPipeE);
|
|
|
|
|
|
else
|
|
|
|
|
|
ads_polar(ptPipeS, nRotate, dlg.m_nLen*dlg.m_iDoorNum, ptPipeE);
|
|
|
|
|
|
|
|
|
|
|
|
if(bLeft)
|
|
|
|
|
|
DrawSysPipeByLayer(ptPipeE, ptPipeS, csLayer);
|
|
|
|
|
|
else
|
|
|
|
|
|
DrawSysPipeByLayer(ptPipeS, ptPipeE, csLayer);
|
|
|
|
|
|
entLast.GetLast();
|
|
|
|
|
|
|
|
|
|
|
|
OPENOBJ_BEGIN(entLast, AcDb::kForWrite, CDbPipe, pPipe);
|
|
|
|
|
|
if(pPipe){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pPipe->SetSysLabel(XString(_T("%d楼-1"), i+1));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_bValve)
|
|
|
|
|
|
{
|
|
|
|
|
|
XPoint ptMid;
|
|
|
|
|
|
ads_polar(ptPipeS, nRotate, dlg.m_nLen/2, ptMid);
|
|
|
|
|
|
InsValveByName((const TCHAR*)xsTmp2, ptMid, csLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
Entity entLast;
|
|
|
|
|
|
entLast.GetLast();
|
|
|
|
|
|
OPENOBJ_BEGIN(entLast, AcDb::kForWrite, CDbPipe, pPipe);
|
|
|
|
|
|
if(pPipe){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pPipe->SetSysLabel(XString(_T("%d楼-1"), i+1));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
if(dlg.m_iFloorDir == 0) //横向绘制
|
2026-09-28 15:28:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
double nDist = (dlg.m_iDoorNum-1) * 500;
|
|
|
|
|
|
XPoint ptBraS, ptBraE, ptBraTmp;
|
|
|
|
|
|
ads_polar(ptPipeE, PI/2, nDist/2, ptBraS);
|
|
|
|
|
|
ads_polar(ptPipeE, PI/2, -nDist/2, ptBraE);
|
|
|
|
|
|
DrawSysPipeByLayer(ptBraS, ptBraE, LAY_PIPE_FEED);
|
|
|
|
|
|
ptBraTmp = ptBraS;
|
|
|
|
|
|
|
|
|
|
|
|
for(int m=0;m<dlg.m_iDoorNum;m++){
|
|
|
|
|
|
ads_polar(ptBraTmp, -PI/2, 500*m, ptBraS);
|
|
|
|
|
|
ads_polar(ptBraS, nRotate, dlg.m_nLen/4, ptValve);
|
|
|
|
|
|
ads_polar(ptBraS, nRotate, dlg.m_nLen/5*3, ptAmmeter);
|
|
|
|
|
|
|
|
|
|
|
|
ads_polar(ptBraS, nRotate, dlg.m_nLen, ptBraE);
|
|
|
|
|
|
if(bLeft)
|
|
|
|
|
|
DrawSysPipeByLayer(ptBraE, ptBraS, csLayer);
|
|
|
|
|
|
else
|
|
|
|
|
|
DrawSysPipeByLayer(ptBraS, ptBraE, csLayer);
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_iStyle == 0)
|
|
|
|
|
|
InsEquipmentByName(xsTmp, ptBraE, nRotate, LAY_EQ_FEED, FALSE, FALSE);
|
|
|
|
|
|
else{
|
|
|
|
|
|
if(dlg.m_iMode == 0)
|
|
|
|
|
|
InsEquipmentByName(xsTmp7, ptBraE, 0, LAY_EQ_FEED, FALSE, FALSE);
|
|
|
|
|
|
else if(dlg.m_iMode == 1)
|
|
|
|
|
|
InsEquipmentByName(xsTmp7, ptBraE, 0, LAY_EQ_FEED, TRUE, FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
Entity entLast;
|
|
|
|
|
|
entLast.GetLast();
|
|
|
|
|
|
OPENOBJ_BEGIN(entLast, AcDb::kForWrite, CDbEquipment, pEquipTmp);
|
|
|
|
|
|
if(pEquipTmp){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pEquipTmp->SetDang(dlg.m_nNg); //总当量
|
|
|
|
|
|
pEquipTmp->SetPipeLength(dlg.m_nNumPeople); //每户人数
|
|
|
|
|
|
pEquipTmp->SetNumber(XString(_T("%.2f"), dlg.m_nFactor)); //小时变化系数
|
|
|
|
|
|
pEquipTmp->SetSysBlock(XString(_T("%.d"), dlg.m_iRation));//用水定额
|
2026-09-28 15:28:50 +08:00
|
|
|
|
// pEquipTmp->SetDang(-1);
|
|
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
CString csDim;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
csDim.Format(_T("%.1f人每户/q0=%d/Ng=%.1f每户/Kh=%.1f"), dlg.m_nNumPeople, dlg.m_iRation, dlg.m_nNg, dlg.m_nFactor);
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
XPoint ptText;
|
|
|
|
|
|
ads_polar(ptBraE, 0, g_Option::instance().g_nTwtDimHeight * GlobalFunc::DocGetPScale(), ptText);
|
|
|
|
|
|
XText text(csDim, ptText, g_Option::instance().g_nTwtDimHeight * GlobalFunc::DocGetPScale(), g_Option::instance().g_nDimScale, g_Option::instance().g_csTwtDimStyle, LAY_CALC_TEXT);
|
|
|
|
|
|
if(bLeft)
|
|
|
|
|
|
text.Draw(AcDb::kTextBase, AcDb::kTextRight);
|
|
|
|
|
|
else
|
|
|
|
|
|
text.Draw();
|
|
|
|
|
|
entLast.GetLast();
|
|
|
|
|
|
GlobalFunc::WriteXdata(entLast, _T("TG-LAYER"), csLayer);
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_bValve)
|
|
|
|
|
|
InsValveByName((const TCHAR*)xsTmp2, ptValve, csLayer);
|
|
|
|
|
|
if(dlg.m_bAmmeter)
|
|
|
|
|
|
InsValveByName((const TCHAR*)xsTmp4, ptAmmeter, csLayer, ptPipeS, ptPipeE);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-10-04 00:04:20 +08:00
|
|
|
|
else{ //竖向绘制
|
2026-09-28 15:28:50 +08:00
|
|
|
|
XPoint ptBraS, ptBraE, ptBraTmp;
|
|
|
|
|
|
|
|
|
|
|
|
for(int m=0;m<dlg.m_iDoorNum;m++){
|
|
|
|
|
|
ads_polar(ptPipeS, nRotate, dlg.m_nLen*(m+1), ptBraS);
|
|
|
|
|
|
ads_polar(ptBraS, PI/2, dlg.m_nLen, ptBraE);
|
|
|
|
|
|
|
|
|
|
|
|
ads_polar(ptBraS, PI/2, dlg.m_nLen/4, ptValve);
|
|
|
|
|
|
ads_polar(ptBraS, PI/2, dlg.m_nLen/5*3, ptAmmeter);
|
|
|
|
|
|
|
|
|
|
|
|
DrawSysPipeByLayer(ptBraS, ptBraE, csLayer);
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_iStyle == 0)
|
|
|
|
|
|
InsEquipmentByName(xsTmp, ptBraE, PI/2, LAY_EQ_FEED, FALSE, FALSE);
|
|
|
|
|
|
else{
|
|
|
|
|
|
if(dlg.m_iMode == 0)
|
|
|
|
|
|
InsEquipmentByName(xsTmp7, ptBraE, 0, LAY_EQ_FEED, FALSE, FALSE);
|
|
|
|
|
|
else if(dlg.m_iMode == 1)
|
|
|
|
|
|
InsEquipmentByName(xsTmp7, ptBraE, 0, LAY_EQ_FEED, TRUE, FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
Entity entLast;
|
|
|
|
|
|
entLast.GetLast();
|
|
|
|
|
|
OPENOBJ_BEGIN(entLast, AcDb::kForWrite, CDbEquipment, pEquipTmp);
|
|
|
|
|
|
if(pEquipTmp){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pEquipTmp->SetDang(dlg.m_nNg); //总当量
|
|
|
|
|
|
pEquipTmp->SetPipeLength(dlg.m_nNumPeople); //每户人数
|
|
|
|
|
|
pEquipTmp->SetNumber(XString(_T("%.2f"), dlg.m_nFactor)); //小时变化系数
|
|
|
|
|
|
pEquipTmp->SetSysBlock(XString(_T("%.d"), dlg.m_iRation));//用水定额
|
2026-09-28 15:28:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
if(dlg.m_bValve)
|
|
|
|
|
|
InsValveByName((const TCHAR*)xsTmp2, ptValve, csLayer);
|
|
|
|
|
|
if(dlg.m_bAmmeter)
|
|
|
|
|
|
InsValveByName((const TCHAR*)xsTmp4, ptAmmeter, csLayer, ptPipeS, ptPipeE);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ads_polar(ptFloor, PI/2, _tstof(dlg.m_lstHeight[i])*1000, ptFloor);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ss.IncludeEnd();
|
|
|
|
|
|
|
|
|
|
|
|
PickSet ssCopy(SS_FREE);
|
|
|
|
|
|
for(long m=0;m<ss.Length();m++){
|
|
|
|
|
|
Entity entTmp = ss[m];
|
|
|
|
|
|
if(!(entTmp.Is(_T("LINE")) || entTmp.Is(_T("ATS_ELEVATION")) || entTmp.Is(_T("ATS_TEXT"))))
|
|
|
|
|
|
ssCopy += entTmp;
|
|
|
|
|
|
OPENOBJ_BEGIN(entTmp, AcDb::kForWrite, CDbPipe, pPipe);
|
|
|
|
|
|
if(pPipe){
|
|
|
|
|
|
pPipe->SetMaterial(dlg.m_iMaterial);
|
|
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
}
|
|
|
|
|
|
int nOsMode=0;
|
|
|
|
|
|
xg_getvar(_T("OSMODE"), &nOsMode);
|
|
|
|
|
|
nOsMode &= ~0x4000;
|
|
|
|
|
|
nOsMode |= OS_INT|OS_END|OS_NEA|OS_MID;
|
|
|
|
|
|
XPushVar<int> vOsMode(_T("OSMODE"), nOsMode);
|
|
|
|
|
|
|
|
|
|
|
|
ptIns = GlobalFunc::Wcs2Ucs(ptIns);
|
|
|
|
|
|
|
|
|
|
|
|
ss.Redraw(2);
|
|
|
|
|
|
XPoint ptFinal;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
actrTransactionManager->flushGraphics(); //acad 刷新
|
|
|
|
|
|
int nRet = GlobalFunc::DragMovePickSet(ss, _T("\n请点取系统图位置<退出>: "), ptIns, ptFinal);
|
2026-09-28 15:28:50 +08:00
|
|
|
|
if(nRet != RTNORM){
|
|
|
|
|
|
ss.Erase();
|
|
|
|
|
|
//TPipePerDocData *pData = GetCurPipeDocData();
|
|
|
|
|
|
//pData->EnableWork(FALSE);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
ss.Redraw(1);
|
|
|
|
|
|
|
|
|
|
|
|
if(dlg.m_iVPipeNum > 1){
|
|
|
|
|
|
if(dlg.m_iFeedDir == 0)
|
|
|
|
|
|
ads_polar(ptFinal, PI/2*3, dlg.m_nHeight*1000-dlg.m_nElevation*1000, ptFinal);
|
|
|
|
|
|
else
|
|
|
|
|
|
ads_polar(ptFinal, PI/2, dlg.m_nHeight*1000*dlg.m_iNum+dlg.m_nElevation*1000, ptFinal);
|
|
|
|
|
|
XPoint ptMove = ptFinal;
|
|
|
|
|
|
|
|
|
|
|
|
XPushVar<int> vOsMode3(_T("OSMODE"), 0);
|
|
|
|
|
|
for(int m=0;m<dlg.m_iVPipeNum;m++){
|
|
|
|
|
|
PickSet ssNew2(SS_FREE);
|
|
|
|
|
|
XPoint ptTmp = ptMove;
|
|
|
|
|
|
ptMove.x += dlg.m_iVPipeDist;
|
|
|
|
|
|
|
|
|
|
|
|
AcDbObjectId idPipe = DrawSysPipeByLayer(ptTmp, ptMove, LAY_PIPE_FEED);
|
|
|
|
|
|
OPENOBJ_BEGIN(idPipe, AcDb::kForWrite, CDbPipe, pPipe);
|
|
|
|
|
|
if(pPipe){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
pPipe->SetSysLabel(XString(_T("干管-%d"),m+1));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
entLast.GetLast();
|
|
|
|
|
|
if(dlg.m_iFeedDir == 0)
|
2026-10-04 00:04:20 +08:00
|
|
|
|
GlobalFunc::WriteXdata(entLast, _T("TG-FEED-DIR"), _T("自下而上"));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
else
|
2026-10-04 00:04:20 +08:00
|
|
|
|
GlobalFunc::WriteXdata(entLast, _T("TG-FEED-DIR"), _T("自上而下"));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
if(m == dlg.m_iVPipeNum-1)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
ssNew2.IncludeBegin();
|
|
|
|
|
|
SHads_command(RTSTR, _T("COPY"), RTPICKS, (TLong_ptr *)ssCopy, RTSTR, _T(""),
|
|
|
|
|
|
RT3DPOINT, &ptFinal, RT3DPOINT, &ptMove, RTNONE);
|
|
|
|
|
|
ssNew2.IncludeEnd();
|
|
|
|
|
|
for(long n=0;n<ssNew2.Length();n++){
|
|
|
|
|
|
Entity entTmp = ssNew2[n];
|
|
|
|
|
|
OPENOBJ_BEGIN(entTmp, AcDb::kForWrite, CDbPipe, pPipe);
|
|
|
|
|
|
if(pPipe){
|
|
|
|
|
|
CString csFloor = pPipe->GetSysLabel();
|
|
|
|
|
|
int idx = csFloor.Find(_T("-"));
|
|
|
|
|
|
if(idx > -1){
|
|
|
|
|
|
CString csLeft = csFloor.Left(idx);
|
|
|
|
|
|
csLeft.Format(_T("%s-%d"), csLeft, m+2);
|
|
|
|
|
|
pPipe->SetSysLabel(csLeft);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
OPENOBJ_END();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
// CPrincipleFeedDlg dialog
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CPrincipleFeedDlg::m_bFloor = TRUE;
|
|
|
|
|
|
int CPrincipleFeedDlg::m_iNum = 6;
|
|
|
|
|
|
CString CPrincipleFeedDlg::m_csMaterial = "";
|
|
|
|
|
|
double CPrincipleFeedDlg::m_nNumPeople = 4;
|
|
|
|
|
|
double CPrincipleFeedDlg::m_nFactor = 2.8;
|
|
|
|
|
|
int CPrincipleFeedDlg::m_iRation = 250;
|
|
|
|
|
|
double CPrincipleFeedDlg::m_nNg = 4;
|
|
|
|
|
|
|
|
|
|
|
|
CPrincipleFeedDlg::CPrincipleFeedDlg(CWnd* pParent /*=NULL*/)
|
|
|
|
|
|
: CDialog(CPrincipleFeedDlg::IDD, pParent), m_spinFloor(1), m_spinLen(50), m_spinDoor(1)
|
|
|
|
|
|
{
|
|
|
|
|
|
//{{AFX_DATA_INIT(CPrincipleFeedDlg)
|
|
|
|
|
|
m_iMode = 0;
|
|
|
|
|
|
m_iStyle = 0;
|
|
|
|
|
|
m_bValve = TRUE;
|
|
|
|
|
|
m_bAmmeter = FALSE;
|
|
|
|
|
|
m_nFloorLen = 500;
|
|
|
|
|
|
m_nHeight = 3;
|
|
|
|
|
|
m_nElevation = 0.3;
|
|
|
|
|
|
m_nLen = 600;
|
|
|
|
|
|
m_iDoorNum = 1;
|
|
|
|
|
|
m_iMaterial = -1;
|
|
|
|
|
|
m_iVPipeDist = 10000;
|
|
|
|
|
|
m_iVPipeNum = 1;
|
|
|
|
|
|
m_iFeedDir = 0;
|
|
|
|
|
|
m_iFloorDir = 0;
|
|
|
|
|
|
//}}AFX_DATA_INIT
|
|
|
|
|
|
m_nAllHeight = 0;
|
|
|
|
|
|
m_nMinEle = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::DoDataExchange(CDataExchange* pDX)
|
|
|
|
|
|
{
|
|
|
|
|
|
CDialog::DoDataExchange(pDX);
|
|
|
|
|
|
//{{AFX_DATA_MAP(CPrincipleFeedDlg)
|
|
|
|
|
|
DDX_Control(pDX, IDC_COMBO_MATERIAL, m_comboMat);
|
|
|
|
|
|
DDX_Control(pDX, IDC_SPIN_DOORNUM, m_spinDoor);
|
|
|
|
|
|
DDX_Control(pDX, IDC_SPIN_LEN, m_spinLen);
|
|
|
|
|
|
DDX_Control(pDX, IDC_SPIN_FLOOR, m_spinFloor);
|
|
|
|
|
|
DDX_Radio(pDX, IDC_RADIO_TYPE1, m_iMode);
|
|
|
|
|
|
DDX_Radio(pDX, IDC_RADIO_STYLE1, m_iStyle);
|
|
|
|
|
|
DDX_Check(pDX, IDC_CHECK_VALVE, m_bValve);
|
|
|
|
|
|
DDX_Check(pDX, IDC_CHECK_AMMETER, m_bAmmeter);
|
|
|
|
|
|
DDX_Text(pDX, IDC_FLOOR_LEN2, m_nFloorLen);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_FOOR_HEIGHT, m_nHeight);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_ELEVATION, m_nElevation);
|
|
|
|
|
|
DDX_Text(pDX, IDC_FLOOR_LEN, m_nLen);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_DOORNUM, m_iDoorNum);
|
|
|
|
|
|
DDX_CBIndex(pDX, IDC_COMBO_MATERIAL, m_iMaterial);
|
|
|
|
|
|
DDX_Text(pDX, IDC_VPIPE_DIST, m_iVPipeDist);
|
|
|
|
|
|
DDX_Text(pDX, IDC_VPIPE_NUM, m_iVPipeNum);
|
|
|
|
|
|
DDX_Radio(pDX, IDC_RADIO_FEEDDIR, m_iFeedDir);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_RATION, m_iRation);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_HOUR_FACTOR, m_nFactor);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_PEOPLE_NUM, m_nNumPeople);
|
|
|
|
|
|
DDX_Text(pDX, IDC_FLOOR_NUM, m_iNum);
|
|
|
|
|
|
DDX_Check(pDX, IDC_CHECK_FLOOR, m_bFloor);
|
|
|
|
|
|
DDX_Text(pDX, IDC_EDIT_DOOR_DANG, m_nNg);
|
|
|
|
|
|
DDX_CBIndex(pDX, IDC_COMBO_FLOOR_DIR, m_iFloorDir);
|
|
|
|
|
|
//}}AFX_DATA_MAP
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CPrincipleFeedDlg, CDialog)
|
|
|
|
|
|
//{{AFX_MSG_MAP(CPrincipleFeedDlg)
|
|
|
|
|
|
ON_WM_PAINT()
|
|
|
|
|
|
ON_BN_CLICKED(IDC_RADIO_TYPE1, OnRadioType1)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_RADIO_TYPE2, OnRadioType2)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_BUTTON_HEIGHT, OnButtonHeight)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_BUTTON_RATION, OnButtonRation)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_BUTTON_FACTOR, OnButtonFactor)
|
|
|
|
|
|
//}}AFX_MSG_MAP
|
|
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
// CPrincipleFeedDlg message handlers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CPrincipleFeedDlg::OnInitDialog()
|
|
|
|
|
|
{
|
|
|
|
|
|
CDialog::OnInitDialog();
|
|
|
|
|
|
|
|
|
|
|
|
m_spinFloor.SetRange(1, 50);
|
|
|
|
|
|
m_spinLen.SetRange(50, 5000);
|
|
|
|
|
|
m_spinDoor.SetRange(1, 50);
|
|
|
|
|
|
XStringList lstMat;
|
|
|
|
|
|
GlobalFunc::GetPipeMaterialList(lstMat);
|
|
|
|
|
|
for(int i=0;i<lstMat.Length();i++){
|
|
|
|
|
|
m_comboMat.AddString(lstMat[i]);
|
|
|
|
|
|
CString csTmp = lstMat[i];
|
|
|
|
|
|
if(m_csMaterial == csTmp)
|
|
|
|
|
|
m_iMaterial = i;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_iMaterial < 0)
|
|
|
|
|
|
m_iMaterial = g_Option::instance().g_iPipeMaterial[0];
|
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
|
|
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::OnPaint()
|
|
|
|
|
|
{
|
|
|
|
|
|
CPaintDC dc(this); // device context for painting
|
|
|
|
|
|
OpenSlide();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::OpenSlide()
|
|
|
|
|
|
{
|
|
|
|
|
|
CWnd *pWnd = GetDlgItem(IDC_STATIC_PREVIEW);
|
|
|
|
|
|
CString csTmp;
|
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
csTmp.Format(_T("TWT(ZKT%d)"), m_iMode+1);
|
|
|
|
|
|
GlobalFunc::DrawSlide(csTmp, pWnd);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::OnRadioType1()
|
|
|
|
|
|
{
|
|
|
|
|
|
OpenSlide();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::OnRadioType2()
|
|
|
|
|
|
{
|
|
|
|
|
|
OpenSlide();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::OnButtonHeight()
|
|
|
|
|
|
{
|
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
CTemporaryResourceOverride vTemp;
|
|
|
|
|
|
CDistFloorDlg dlg;
|
|
|
|
|
|
for(int i=0;i<m_iNum;i++){
|
|
|
|
|
|
CString csText, csHeight;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
csText.Format(_T("%d楼"), i+1);
|
2026-09-28 15:28:50 +08:00
|
|
|
|
dlg.m_lstName.Append(tstrnew(csText));
|
|
|
|
|
|
csHeight.Format(_T("%.2f"), m_nHeight);
|
|
|
|
|
|
dlg.m_lstHeight.Append(tstrnew(csHeight));
|
|
|
|
|
|
}
|
|
|
|
|
|
if(dlg.DoModal() != IDOK)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_nMinEle = _tstof(dlg.m_sStartBaseEle);//zxl 2011.10.20 add
|
|
|
|
|
|
|
|
|
|
|
|
m_lstHeight.Reset();
|
|
|
|
|
|
m_iNum = dlg.m_lstHeight.Length();
|
|
|
|
|
|
|
|
|
|
|
|
for(i=0;i<m_iNum;i++){
|
|
|
|
|
|
CString csHeight = dlg.m_lstHeight[i];
|
|
|
|
|
|
m_lstHeight.Append(tstrnew(csHeight));
|
|
|
|
|
|
CString csText = dlg.m_lstName[i];
|
|
|
|
|
|
m_lstName.Append(tstrnew(csText));
|
|
|
|
|
|
}
|
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::OnOK()
|
|
|
|
|
|
{
|
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
m_comboMat.GetLBText(m_iMaterial, m_csMaterial);
|
|
|
|
|
|
CString csHeight, csText;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//把楼层高列表补齐
|
2026-09-28 15:28:50 +08:00
|
|
|
|
if(m_lstHeight.Length() < 1){
|
|
|
|
|
|
for(int i=0;i<m_iNum;i++){
|
2026-10-04 00:04:20 +08:00
|
|
|
|
csText.Format(_T("%d楼"), i+1);
|
2026-09-28 15:28:50 +08:00
|
|
|
|
m_lstName.Append(tstrnew(csText));
|
|
|
|
|
|
|
|
|
|
|
|
csHeight.Format(_T("%.2f"), m_nHeight);
|
|
|
|
|
|
m_lstHeight.Append(tstrnew(csHeight));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
int len = m_iNum - m_lstHeight.Length();
|
|
|
|
|
|
for(int j=0;j<len;j++){
|
|
|
|
|
|
csHeight.Format(_T("%.2f"), m_nHeight);
|
|
|
|
|
|
m_lstHeight.Append(tstrnew(csHeight));
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
csText.Format(_T("%d楼"), m_lstHeight.Length());
|
2026-09-28 15:28:50 +08:00
|
|
|
|
m_lstName.Append(tstrnew(csText));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//计算总高度
|
2026-09-28 15:28:50 +08:00
|
|
|
|
for(int i=0;i<m_iNum;i++){
|
|
|
|
|
|
csHeight = m_lstHeight[i];
|
|
|
|
|
|
m_nAllHeight += (_tstof(csHeight)*1000);
|
|
|
|
|
|
CString csText = m_lstName[i];
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//if(csText.Find(_T("地下")) > -1)
|
|
|
|
|
|
if(csText.Find(_T("地下")) > -1 || csText.Find(_T("-")) > -1)//添加-1F -2F表示楼层 zxl 2011.10.20 add
|
2026-09-28 15:28:50 +08:00
|
|
|
|
m_nMinEle -= _tstof(m_lstHeight[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
if(m_nLen < 1)
|
|
|
|
|
|
m_nLen = 10;
|
|
|
|
|
|
if(m_bAmmeter && m_bValve && m_nLen < 10)
|
|
|
|
|
|
m_nLen = 600;
|
|
|
|
|
|
|
|
|
|
|
|
CDialog::OnOK();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::OnButtonRation()
|
|
|
|
|
|
{
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//AfxMessageBox(_T("住宅最高日生活用水定额\n\n1.普通住宅Ⅰ (有大便器、洗涤盆) 85~150\n2.普通住宅Ⅱ(有大便器、洗脸盆、洗涤盆、洗衣机、 热水器和沐浴设备) 130~300\n3.普通住宅Ⅲ(有大便器、洗脸盆、洗涤盆、洗衣机、 集中热水供应和沐浴设备) 180~320\n4.别墅 (有大便器、洗脸盆、洗涤盆、洗衣机、洒水栓,家用热水机组和沐浴设备) 200~350\n\n"));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
RBList rbCmd=ads_buildlist(RTSTR, _T("IPrincipleFeed"), NULL);
|
|
|
|
|
|
resbuf *rbRes=NULL;
|
|
|
|
|
|
if(ads_invoke(rbCmd, &rbRes) == RTNORM && rbRes)
|
|
|
|
|
|
{
|
|
|
|
|
|
ads_relrb(rbRes);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CPrincipleFeedDlg::OnButtonFactor()
|
|
|
|
|
|
{
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//AfxMessageBox(_T("住宅最高日生活用水小时变化系数Kh\n\n1.普通住宅Ⅰ (有大便器、洗涤盆) 3.0~2.5\n2.普通住宅Ⅱ(有大便器、洗脸盆、洗涤盆、洗衣机、 热水器和沐浴设备) 2.8~2.3\n3.普通住宅Ⅲ(有大便器、洗脸盆、洗涤盆、洗衣机、 集中热水供应和沐浴设备) 2.5~2.0\n4.别墅 (有大便器、洗脸盆、洗涤盆、洗衣机、洒水栓,家用热水机组和沐浴设备) 2.3~1.8\n\n"));
|
2026-09-28 15:28:50 +08:00
|
|
|
|
RBList rbCmd=ads_buildlist(RTSTR, _T("IPrincipleFeed"), NULL);
|
|
|
|
|
|
resbuf *rbRes=NULL;
|
|
|
|
|
|
if(ads_invoke(rbCmd, &rbRes) == RTNORM && rbRes)
|
|
|
|
|
|
{
|
|
|
|
|
|
ads_relrb(rbRes);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|