2861 lines
84 KiB
C++
2861 lines
84 KiB
C++
#include "stdafx.h"
|
||
#include "TArchSettingEditTools.h"
|
||
#include "symdef.h"
|
||
#include "OptionSheet.h"
|
||
#include "fontpropertypage.h"
|
||
#include "afxtempl.h"
|
||
#include "TgAs.h"
|
||
|
||
|
||
extern TARCH_IMPEXP BOOL g_bDwgTabBar,g_bZoomKey,g_nRBtnMenuTime,g_nSpeedMenu;
|
||
extern TARCH_IMPEXP BOOL g_bLimitHeight;//外部限高
|
||
extern TARCH_IMPEXP BOOL g_bDefaultOpenFirst;//默认打开新一个
|
||
extern TARCH_IMPEXP BOOL g_bScrollBar;//是否需要右滚动条
|
||
extern int TARCH_IMPEXP g_nRunMode;
|
||
extern int TARCH_IMPEXP g_iMenuType;
|
||
extern TARCH_IMPEXP BOOL g_bEnableShortCut;
|
||
extern TARCH_IMPEXP BOOL g_bEnableSelectPreview;//是否选择预览
|
||
extern TARCH_IMPEXP BOOL g_bAutoFocus;//自动十字光标
|
||
extern TARCH_IMPEXP int g_nProductId;
|
||
extern TARCH_IMPEXP double g_nVersion;
|
||
extern TARCH_IMPEXP BOOL g_bAutoOpenRecent;
|
||
extern TARCH_IMPEXP double g_nWalkDistStep;
|
||
extern TARCH_IMPEXP double g_nWalkAngleStep;
|
||
//add by fxj 080925
|
||
//extern BOOL IsScreenMenuVisible();
|
||
// 2010-3-15 16:36 wubo
|
||
// 移植Geo
|
||
// extern TARCH_IMPEXP void DocStatus();
|
||
//extern int ShowScreenMenu(BOOL bTrue);
|
||
|
||
extern BOOL g_bScreenMenu;
|
||
extern TARCH_IMPEXP BOOL g_bBlaconyHalf;
|
||
|
||
CTArchSettingEditTools::CTArchSettingEditTools(void)
|
||
{
|
||
CodeBase db;
|
||
XString xsDbfFile;
|
||
if (!FindFile(_T("tchdata.dbf"), xsDbfFile)) {
|
||
// MessageBox(_T("对不起,没有发现tchdata.dbf文件!"));
|
||
return;
|
||
}
|
||
CString csCmd, csName, csDescribe, csIcon, csType;
|
||
int iHit;
|
||
XDbfTable *pTable = db.Open(xsDbfFile);
|
||
if (pTable)
|
||
{
|
||
pTable->MoveFirst();
|
||
while(!pTable->IsEOF())
|
||
{
|
||
GET_FIELD(pTable, _T("chacmd"), csName);
|
||
GET_FIELD(pTable, _T("engcmd"), csCmd);
|
||
GET_FIELD(pTable, _T("explain"), csDescribe);
|
||
GET_FIELD(pTable, _T("icon"), csIcon);
|
||
GET_FIELD(pTable, _T("flag"), iHit);
|
||
GET_FIELD(pTable, _T("type"), csType);
|
||
m_lstToolbarData.Append(new CToolbarData(csType, csCmd, csName, csDescribe, csIcon, iHit));
|
||
pTable->MoveNext();
|
||
}
|
||
}
|
||
else
|
||
{
|
||
return;
|
||
}
|
||
}
|
||
|
||
CTArchSettingEditTools::~CTArchSettingEditTools(void)
|
||
{
|
||
}
|
||
|
||
int CTArchSettingEditTools::GetIndex(const CXMLNodeInfoEx &data,const CString &strAttriName)
|
||
{
|
||
int nIndex = -1;
|
||
NodeAttriButeAry aryNodeAttribute = data.m_aryNodeAttribute;
|
||
NodeAttriBute attriBute;
|
||
int nLen = aryNodeAttribute.GetLength();
|
||
int i=0;
|
||
BOOL bFind = FALSE;
|
||
for (;i<nLen;i++)
|
||
{
|
||
CString strName = aryNodeAttribute.GetAt(i).first;
|
||
if (strName == strAttriName)
|
||
{
|
||
attriBute = aryNodeAttribute.GetAt(i);
|
||
bFind = TRUE;
|
||
break;
|
||
}
|
||
}
|
||
if (bFind)
|
||
{
|
||
nIndex = GetSubStrNumInStr(attriBute.second,data.m_strNodeValue);
|
||
}
|
||
return nIndex;
|
||
}
|
||
|
||
void CTArchSettingEditTools::GetListCtrlIndex(const CXMLNodeInfoEx &data,CStringArray &arystr)
|
||
{
|
||
CString strPath = data.m_strNodeXPath;
|
||
CString strTem;
|
||
int nPos = strPath.Find(_T("/"),1);
|
||
int nStart = 1;
|
||
while (nPos!=-1)
|
||
{
|
||
int nNum = nPos-nStart;
|
||
strTem = strPath.Mid(nStart,nNum);
|
||
arystr.Add(strTem);
|
||
nStart = nPos+1;
|
||
nPos = strPath.Find(_T("/"),nPos+1);
|
||
}
|
||
int nSize = strPath.GetLength();
|
||
if (nStart-1<nSize-1)
|
||
{
|
||
strTem = strPath.Mid(nStart,nSize-nStart);
|
||
arystr.Add(strTem);
|
||
}
|
||
}
|
||
|
||
BOOL CTArchSettingEditTools::ExportTArchSettingData(CString strPath)
|
||
{
|
||
int nLen = strPath.GetLength();
|
||
TCHAR *szPath = new TCHAR[nLen+1];
|
||
assert( NULL!= szPath );
|
||
if ( NULL == szPath )
|
||
{
|
||
return FALSE;
|
||
}
|
||
_tcscpy( szPath,strPath.GetBuffer(nLen));
|
||
BOOL bResult = FALSE;
|
||
strPath.ReleaseBuffer();
|
||
NodeAttriBute nodeInfo;
|
||
NodeAttriButeAry nodeInfoAry;
|
||
nodeInfo.first = _T("name");
|
||
nodeInfo.second = _T("上华软件设置");
|
||
nodeInfoAry.AddTail(nodeInfo);
|
||
nodeInfo.first =_T("comment");
|
||
nodeInfo.second = _T("上华软件设置选项");
|
||
nodeInfoAry.AddTail(nodeInfo);
|
||
if (m_pXMLDoc->CreateNewXMLDoc(szPath,_T("version='1.0' encoding='utf-8'"),_T("目录"),nodeInfoAry))
|
||
{
|
||
CXMLDOMNodePtr pRoot = m_pXMLDoc->GetRoot();
|
||
pRoot->SetNodeTabValue(_T("\t"));
|
||
CXMLDOMNodePtr pDWGSetNode = pRoot->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("图形设置"));
|
||
pDWGSetNode->SetAttributeValue(_T("comment"),_T("保存于图形内的设置参数、系统变量"));
|
||
//pDWGSetNode->SetNodeTabValue(_T("\n\t\t"));
|
||
CXMLDOMNodePtr pSheet1Node = pDWGSetNode->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("基本设定"));
|
||
pSheet1Node->SetAttributeValue(_T("comment"),_T("图形基本参数设定"));
|
||
//pSheet1Node->SetNodeTabValue(_T("\n\t\t\t"));
|
||
ExportDwgSet(pSheet1Node);
|
||
//pDWGSetNode->SetNodeTabValue(_T("\n\t\t"));
|
||
CXMLDOMNodePtr pSheet2Node = pDWGSetNode->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("墙柱加粗填充"));
|
||
pSheet2Node->SetAttributeValue(_T("comment"),_T("墙、柱对象加粗填充设置"));
|
||
//pSheet2Node->SetNodeTabValue(_T("\n\t\t\t"));
|
||
ExportWallPillarSet(pSheet2Node);
|
||
CXMLDOMNodePtr pAdvancedSet = pRoot->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("高级选项"));
|
||
pAdvancedSet->SetAttributeValue(_T("comment"),_T("全局参数设置"));
|
||
ExortAdvancedSet(pAdvancedSet);
|
||
CXMLDOMNodePtr pSelfSetNode = pRoot->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("自定义"));
|
||
pSelfSetNode->SetAttributeValue(_T("comment"),_T("软件界面等用户使用接口设置"));
|
||
CXMLDOMNodePtr pScreenMenuNode = pSelfSetNode->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("屏幕菜单"));
|
||
ExportScreenMenu(pScreenMenuNode);
|
||
CXMLDOMNodePtr pUserKeyNode = pSelfSetNode->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("操作配置"));
|
||
ExportUserOpreatorSetting(pUserKeyNode);
|
||
CXMLDOMNodePtr pOtherSetNode = pSelfSetNode->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("基本界面"));
|
||
ExportOtherSetting(pOtherSetNode);
|
||
ExportToolBar(pSelfSetNode);
|
||
CXMLDOMNodePtr pHotKeyNode = pSelfSetNode->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("快捷键"));
|
||
ExportHotKey(pHotKeyNode);
|
||
m_pXMLDoc->Save();
|
||
return TRUE;
|
||
}
|
||
else
|
||
{
|
||
return FALSE;
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::ExportDwgSet(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//门窗设置
|
||
CXMLDOMNodePtr pWindowsNode = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("门窗"));
|
||
pWindowsNode->SetAttributeValue(_T("comment"),_T("门窗相关设置"));
|
||
//pWindowsNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
CXMLDOMNodePtr pWindowsNumNode = pWindowsNode->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("编号"));
|
||
pWindowsNumNode->SetAttributeValue(_T("comment"),_T("门窗编号是否大写"));
|
||
pWindowsNumNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
|
||
//pWindowsNumNode->SetNodeTabValue(_T("\n"));
|
||
BOOL bCapLabel= FALSE;
|
||
int nStairSect = 0;
|
||
int nSpaceAreaPrecision = 0;
|
||
TDbConfig *pConfig=GetDwgGlobal(AcDb::kForRead);
|
||
if (pConfig) {
|
||
if (pConfig->IsSingleSect())
|
||
nStairSect=1;
|
||
bCapLabel=pConfig->IsCapLabel();
|
||
nSpaceAreaPrecision = pConfig->GetSpaceAreaPrecision();
|
||
pConfig->close();
|
||
}
|
||
|
||
if (bCapLabel)
|
||
{
|
||
pWindowsNumNode->SetNodeValue(_T("是"));
|
||
}
|
||
else
|
||
{
|
||
pWindowsNumNode->SetNodeValue(_T("否"));
|
||
}
|
||
//楼梯设置
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
|
||
CXMLDOMNodePtr pStatirNode = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("楼梯"));
|
||
pStatirNode->SetAttributeValue(_T("comment"),_T("楼梯设置"));
|
||
//pStatirNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
CXMLDOMNodePtr pStatirStyleNode = pStatirNode->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("剖断样式"));
|
||
pStatirStyleNode->SetAttributeValue(_T("options"),_T("双剖断 单剖断"));
|
||
if (nStairSect==0)
|
||
{
|
||
pStatirStyleNode->SetNodeValue(_T("双剖断"));
|
||
}
|
||
else
|
||
{
|
||
pStatirStyleNode->SetNodeValue(_T("单剖断"));
|
||
}
|
||
|
||
//pStatirStyleNode->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
//尺寸标注设置
|
||
//直线
|
||
/*CXMLDOMNodePtr pDimArrowNode = pXMLDOMNodePtr->AppendNode(_T("目录"),_T(""),_T("name"),_T("尺寸标注"));
|
||
pDimArrowNode->SetAttributeValue(_T("comment"),_T("尺寸标注设置"));
|
||
CXMLDOMNodePtr pLDimArrowNode = pDimArrowNode->AppendNode(_T("选项"),_T(""),_T("name"),_T("直线标注样式"));
|
||
pLDimArrowNode->SetAttributeValue(_T("options"),_T("粗线 细线 圆点"));
|
||
int nLDimArrow = g_nLineDimArrow;
|
||
if (nLDimArrow==0)
|
||
{
|
||
pLDimArrowNode->SetNodeValue(_T("粗线"));
|
||
}
|
||
else if (nLDimArrow==1)
|
||
{
|
||
pLDimArrowNode->SetNodeValue(_T("细线"));
|
||
}
|
||
else
|
||
{
|
||
pLDimArrowNode->SetNodeValue(_T("圆点"));
|
||
}*/
|
||
//角度
|
||
//CXMLDOMNodePtr pADimArrowNode = pDimArrowNode->AppendNode(_T("选项"),_T(""),_T("name"),_T("角度标注样式"));
|
||
//pADimArrowNode->SetAttributeValue(_T("options"),_T("标准箭头 圆点"));
|
||
//int nADimArrow = g_nAngleDimArrow;//角度标注
|
||
//if (nADimArrow==0)
|
||
//{
|
||
// pADimArrowNode->SetNodeValue(_T("标准箭头"));
|
||
//}
|
||
//else
|
||
//{
|
||
// pADimArrowNode->SetNodeValue(_T("圆点"));
|
||
//}
|
||
|
||
//当前比例
|
||
CString strScale = (const TCHAR *)Dist2Str(DocGetPScale());//当前比例;
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pScaleNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strScale,_T("name"),_T("当前比例"));
|
||
//pScaleNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
//当前层高
|
||
CString strLHeight = (const TCHAR *)Dist2Str(DocGetLHeight());
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pLHeightNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strLHeight,_T("name"),_T("当前层高"));
|
||
//pLHeightNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
//房间面积标注小数位数设置
|
||
CString strSpaceAreaPrecision;
|
||
strSpaceAreaPrecision.Format(_T("%d"),nSpaceAreaPrecision);
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pSpaceAreaPrecisionNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strSpaceAreaPrecision,_T("name"),_T("房间面积标注小数位数设置"));
|
||
//pSpaceAreaPrecisionNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
//文字距离基线系数
|
||
CString strText2BaseRatio;
|
||
double dText2BaseRatio = DocGetText2BaseRatio();
|
||
strText2BaseRatio.Format(_T("%.lg"),dText2BaseRatio);
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pText2BaseRatioNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strText2BaseRatio,_T("name"),_T("文字距离基线系数"));
|
||
//pText2BaseRatioNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
//显示模式
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pDrawModeNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strLHeight,_T("name"),_T("显示模式"));
|
||
pDrawModeNode->SetAttributeValue(_T("comment"),_T("图形当前显示模式"));
|
||
pDrawModeNode->SetAttributeValue(_T("options"),_T("2D 3D AUTO"));
|
||
int nDrawMode = DocGetDrawMode()-1;
|
||
if (nDrawMode == 0)
|
||
{
|
||
pDrawModeNode->SetNodeValue(_T("2D"));
|
||
}
|
||
else if (nDrawMode == 1)
|
||
{
|
||
pDrawModeNode->SetNodeValue(_T("3D"));
|
||
}
|
||
else
|
||
{
|
||
pDrawModeNode->SetNodeValue(_T("AUTO"));
|
||
}
|
||
//pDrawModeNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
//单位设置
|
||
int nUnitType = -1;
|
||
if (!DocGetMeterUnitDraw())//单位换算
|
||
{
|
||
if (DocGetMeterUnitDim())
|
||
nUnitType=1;
|
||
else
|
||
nUnitType=0;
|
||
}
|
||
else
|
||
nUnitType=2;
|
||
CString strDrawUnit,strDimUnit;
|
||
switch (nUnitType)
|
||
{
|
||
case 0:
|
||
{
|
||
strDrawUnit = _T("mm");
|
||
strDimUnit = _T("mm");
|
||
}
|
||
break;
|
||
case 1:
|
||
{
|
||
strDrawUnit = _T("mm");
|
||
strDimUnit = _T("M");
|
||
}
|
||
break;
|
||
case 2:
|
||
{
|
||
strDrawUnit = _T("M");
|
||
strDimUnit = _T("M");
|
||
}
|
||
break;
|
||
default:
|
||
{
|
||
strDrawUnit = _T("mm");
|
||
strDimUnit = _T("mm");
|
||
}
|
||
break;
|
||
}
|
||
|
||
//绘图单位
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pDrawUnitNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strDrawUnit,_T("name"),_T("绘图单位"));
|
||
pDrawUnitNode->SetAttributeValue(_T("options"),_T("mm M"));
|
||
//pDrawUnitNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
//标注单位
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pDimUnitNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strDimUnit,_T("name"),_T("标注单位"));
|
||
pDimUnitNode->SetAttributeValue(_T("comment"),_T("只对尺寸、坐标标注有效"));
|
||
pDimUnitNode->SetAttributeValue(_T("options"),_T("mm M"));
|
||
//pDimUnitNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
//索引图名中文字大小的控制比例
|
||
double dDrawingIndexTextRatio = DocGetDITextRatio();
|
||
CString strValue;
|
||
strValue.Format(_T("%lg"),dDrawingIndexTextRatio);
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pDrawingIndexTextRatio = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("索引图名中文字大小的控制比例"));
|
||
//pDrawingIndexTextRatio->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
// sg modify 110210,暂时注释掉导出部分,换成新接口导出
|
||
/*
|
||
// BOOL bGetOldDrawingIndex = DocGetOldDrawingIndex();
|
||
int nGetOldDrawingIndex = DocGetDrawingIndexStyle();
|
||
if (nGetOldDrawingIndex == 1)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pOldDrawingIndex = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("是否保留老版本绘制样式"));
|
||
pOldDrawingIndex->SetAttributeValue(_T("options"),_T("是 否"));
|
||
*/
|
||
|
||
// sg add 110210,圆圈文字显示样式
|
||
CXMLDOMNodePtr pDITextStyleNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strLHeight,_T("name"),_T("圆圈文字显示样式"));
|
||
pDITextStyleNode->SetAttributeValue(_T("comment"), _T("圆圈文字显示样式"));
|
||
pDITextStyleNode->SetAttributeValue(_T("options"), _T("不出圈文字 旧圆圈文字 可出圈文字"));
|
||
int nDITextStyle = DocGetDrawingIndexStyle();
|
||
if (nDITextStyle == 0)
|
||
{
|
||
pDITextStyleNode->SetNodeValue(_T("不出圈文字"));
|
||
}
|
||
else if (nDITextStyle == 1)
|
||
{
|
||
pDITextStyleNode->SetNodeValue(_T("旧圆圈文字"));
|
||
}
|
||
else
|
||
{
|
||
pDITextStyleNode->SetNodeValue(_T("可出圈文字"));
|
||
}
|
||
|
||
|
||
//add by xlc on 090805
|
||
BOOL bBlaconyHalf = g_bBlaconyHalf;
|
||
if (bBlaconyHalf)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pBlaconyHalf = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("阳台按一半面积计算"));
|
||
pBlaconyHalf->SetAttributeValue(_T("options"),_T("是 否"));
|
||
|
||
strValue.Format(_T("%.2lg"),DocGetEleTriangleSize());
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pEleTriangleSize = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("三角形标高符号高度"));
|
||
//pEleTriangleSize->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
strValue.Format(_T("%.2lg"),DocGetEleDoteSize()*2);
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pEleDoteSize = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("圆点标高符号直径"));
|
||
//pEleDoteSize->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
strValue.Format(_T("%.2lg"),DocGetMultiLeaderDistRatio());
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pLeaderDist = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("引出文字距基线末端距离"));
|
||
//pLeaderDist->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
|
||
// sg add 110210,增加“凸窗挡板和门窗套是否有保温”设置
|
||
if (DocGetProWinSlabInsu())
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pProWinSlabInsu = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("凸窗挡板和门窗套是否有保温"));
|
||
pProWinSlabInsu->SetAttributeValue(_T("options"), _T("是 否"));
|
||
|
||
// sg add 120626,9.0增加弧长样式
|
||
if (DocGetArcLenDimType() == 0) // 新样式
|
||
strValue = _T("新标准");
|
||
else
|
||
strValue = _T("旧标准");
|
||
CXMLDOMNodePtr pArcLenDimType = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("弧长标注"));
|
||
pArcLenDimType->SetAttributeValue(_T("options"), _T("旧标准 新标准"));
|
||
}
|
||
|
||
void CTArchSettingEditTools::ExportWallPillarSet(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//加粗
|
||
CXMLDOMNodePtr pBoldModeNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("加粗"));
|
||
pBoldModeNode->SetAttributeValue(_T("comment"),_T("是否启动加粗"));
|
||
pBoldModeNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
BOOL bBoldMode = DocGetIsLineWeight();
|
||
if (bBoldMode)
|
||
{
|
||
pBoldModeNode->SetNodeValue(_T("是"));
|
||
}
|
||
else
|
||
{
|
||
pBoldModeNode->SetNodeValue(_T("否"));
|
||
}
|
||
//pBoldModeNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
//填充
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pFillModeNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("填充"));
|
||
pFillModeNode->SetAttributeValue(_T("comment"),_T("是否启动填充"));
|
||
pFillModeNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
//pFillModeNode->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
BOOL bFillMode = DocGetIsSolidFill();
|
||
if (bFillMode)
|
||
{
|
||
pFillModeNode->SetNodeValue(_T("是"));
|
||
}
|
||
else
|
||
{
|
||
pFillModeNode->SetNodeValue(_T("否"));
|
||
}
|
||
// 详图比例
|
||
CString strDetailScale =(const TCHAR *)Dist2Str(g_nDetailScale);
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pDetailScale = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strDetailScale,_T("name"),_T("详图比例"));
|
||
pDetailScale->SetAttributeValue(_T("comment"),_T("当比例小于此比例时启用详图模式"));
|
||
//pDetailScale->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t"));
|
||
CXMLDOMNodePtr pMaterialPattern = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("墙柱材料"));
|
||
pMaterialPattern->SetAttributeValue(_T("comment"),_T("根据墙、柱材料设置加粗填充"));
|
||
//pMaterialPattern->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
ExortMaterialPattern(pMaterialPattern);
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
TDbConfig temp;
|
||
TDbConfig *p = GetDwgGlobal(AcDb::kForRead);
|
||
XDbObject vTemp(p);
|
||
if (!p) p=&temp;
|
||
ExortMaterialPattern1(p, pXMLDOMNodePtr);
|
||
ExortMaterialPattern2(p, pXMLDOMNodePtr);
|
||
ExortMaterialPattern3(p, pXMLDOMNodePtr);
|
||
ExortMaterialPattern4(p, pXMLDOMNodePtr);
|
||
ExortMaterialPattern5(p, pXMLDOMNodePtr);
|
||
ExortMaterialPattern6(p, pXMLDOMNodePtr);
|
||
ExortMaterialPattern7(p, pXMLDOMNodePtr);
|
||
ExortMaterialPattern8(p, pXMLDOMNodePtr);
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern1(TDbConfig *pConfig,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("轻质隔墙"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetHatch1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准填充样式"));
|
||
pSetHatch1->SetNodeValue(pConfig->GetHatchDivider(FALSE));
|
||
//pSetHatch1->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetbLineHatch = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充方式"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
pSetbLineHatch->SetAttributeValue(_T("options"),_T("普通填充 线图案填充"));
|
||
//pSetbLineHatch->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
if (pConfig->IsDividerLineHatch())
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("线图案填充"));
|
||
}
|
||
else
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("普通填充"));
|
||
}
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetHatch2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充样式"));
|
||
pSetHatch2->SetNodeValue(pConfig->GetHatchDivider(TRUE));
|
||
//pSetHatch2->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetColor = pChild->AppendNode(_T("选项"),_T(""),_T("name"),_T("填充颜色"));
|
||
CString strColor;
|
||
strColor.Format(_T("%d"),pConfig->GetDividerColor());
|
||
pSetColor->SetNodeValue(strColor);
|
||
//pSetColor->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CString strBold1;
|
||
strBold1.Format(_T("%.2lf"),pConfig->GetBoldDivider(FALSE));
|
||
pSetBold1->SetNodeValue(strBold1);
|
||
//pSetBold1->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetBold2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图线宽"));
|
||
CString strBold2;
|
||
strBold2.Format(_T("%.2lf"),pConfig->GetBoldDivider(TRUE));
|
||
pSetBold2->SetNodeValue(strBold2);
|
||
//pSetBold2->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern2(TDbConfig *pConfig,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),WALLMATE_Fill);
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetHatch1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准填充样式"));
|
||
pSetHatch1->SetNodeValue(pConfig->GetHatchFill(FALSE));
|
||
//pSetHatch1->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetbLineHatch = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充方式"));
|
||
pSetbLineHatch->SetAttributeValue(_T("options"),_T("普通填充 线图案填充"));
|
||
//pSetbLineHatch->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
if (pConfig->IsFillLineHatch())
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("线图案填充"));
|
||
}
|
||
else
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("普通填充"));
|
||
}
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetHatch2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充样式"));
|
||
pSetHatch2->SetNodeValue(pConfig->GetHatchFill(TRUE));
|
||
//pSetHatch2->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetColor = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("填充颜色"));
|
||
CString strColor;
|
||
strColor.Format(_T("%d"),pConfig->GetFillColor());
|
||
pSetColor->SetNodeValue(strColor);
|
||
//pSetColor->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CString strBold1;
|
||
strBold1.Format(_T("%.2lf"),pConfig->GetBoldFill(FALSE));
|
||
pSetBold1->SetNodeValue(strBold1);
|
||
//pSetBold1->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetBold2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图线宽"));
|
||
CString strBold2;
|
||
strBold2.Format(_T("%.2lf"),pConfig->GetBoldFill(TRUE));
|
||
pSetBold2->SetNodeValue(strBold2);
|
||
//pSetBold2->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern3(TDbConfig *pConfig,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),WALLMATE_Fill1);
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetHatch1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准填充样式"));
|
||
pSetHatch1->SetNodeValue(pConfig->GetHatchFill1(FALSE));
|
||
//pSetHatch1->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetbLineHatch = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充方式"));
|
||
pSetbLineHatch->SetAttributeValue(_T("options"),_T("普通填充 线图案填充"));
|
||
//pSetbLineHatch->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
if (pConfig->IsFill1LineHatch())
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("线图案填充"));
|
||
}
|
||
else
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("普通填充"));
|
||
}
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetHatch2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充样式"));
|
||
pSetHatch2->SetNodeValue(pConfig->GetHatchFill1(TRUE));
|
||
//pSetHatch2->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetColor = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("填充颜色"));
|
||
CString strColor;
|
||
strColor.Format(_T("%d"),pConfig->GetFill1Color());
|
||
pSetColor->SetNodeValue(strColor);
|
||
//pSetColor->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CString strBold1;
|
||
strBold1.Format(_T("%.2lf"),pConfig->GetBoldFill1(FALSE));
|
||
pSetBold1->SetNodeValue(strBold1);
|
||
//pSetBold1->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetBold2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图线宽"));
|
||
CString strBold2;
|
||
strBold2.Format(_T("%.2lf"),pConfig->GetBoldFill1(TRUE));
|
||
pSetBold2->SetNodeValue(strBold2);
|
||
//pSetBold2->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern4(TDbConfig *pConfig,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//pXMLDOMNodePtr->SetNodeTabValue(_T("\n\t\t\t\t"));
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),WALLMATE_Fill2);
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetHatch1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准填充样式"));
|
||
pSetHatch1->SetNodeValue(pConfig->GetHatchFill2(FALSE));
|
||
//pSetHatch1->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetbLineHatch = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充方式"));
|
||
pSetbLineHatch->SetAttributeValue(_T("options"),_T("普通填充 线图案填充"));
|
||
//pSetbLineHatch->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
if (pConfig->IsFill2LineHatch())
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("线图案填充"));
|
||
}
|
||
else
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("普通填充"));
|
||
}
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetHatch2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充样式"));
|
||
pSetHatch2->SetNodeValue(pConfig->GetHatchFill2(TRUE));
|
||
//pSetHatch2->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetColor = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("填充颜色"));
|
||
CString strColor;
|
||
strColor.Format(_T("%d"),pConfig->GetFill2Color());
|
||
pSetColor->SetNodeValue(strColor);
|
||
//pSetColor->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CString strBold1;
|
||
strBold1.Format(_T("%.2lf"),pConfig->GetBoldFill2(FALSE));
|
||
pSetBold1->SetNodeValue(strBold1);
|
||
//pSetBold1->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
//pChild->SetNodeTabValue(_T("\n\t\t\t\t\t"));
|
||
CXMLDOMNodePtr pSetBold2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图线宽"));
|
||
CString strBold2;
|
||
strBold2.Format(_T("%.2lf"),pConfig->GetBoldFill2(TRUE));
|
||
pSetBold2->SetNodeValue(strBold2);
|
||
//pSetBold2->SetNodeTabValue(_T("\n\t\t\t\t\t\t"));
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern5(TDbConfig *pConfig,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("砖墙柱"));
|
||
CXMLDOMNodePtr pSetHatch1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准填充样式"));
|
||
pSetHatch1->SetNodeValue(pConfig->GetHatchBrick(FALSE));
|
||
CXMLDOMNodePtr pSetbLineHatch = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充方式"));
|
||
pSetbLineHatch->SetAttributeValue(_T("options"),_T("普通填充 线图案填充"));
|
||
if (pConfig->IsBrickLineHatch())
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("线图案填充"));
|
||
}
|
||
else
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("普通填充"));
|
||
}
|
||
CXMLDOMNodePtr pSetHatch2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充样式"));
|
||
pSetHatch2->SetNodeValue(pConfig->GetHatchBrick(TRUE));
|
||
CXMLDOMNodePtr pSetColor = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("填充颜色"));
|
||
CString strColor;
|
||
strColor.Format(_T("%d"),pConfig->GetBrickColor());
|
||
pSetColor->SetNodeValue(strColor);
|
||
CXMLDOMNodePtr pSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CString strBold1;
|
||
strBold1.Format(_T("%.2lf"),pConfig->GetBoldBrick(FALSE));
|
||
pSetBold1->SetNodeValue(strBold1);
|
||
CXMLDOMNodePtr pSetBold2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图线宽"));
|
||
CString strBold2;
|
||
strBold2.Format(_T("%.2lf"),pConfig->GetBoldBrick(TRUE));
|
||
pSetBold2->SetNodeValue(strBold2);
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern6(TDbConfig *pConfig,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("石墙柱"));
|
||
CXMLDOMNodePtr pSetHatch1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准填充样式"));
|
||
pSetHatch1->SetNodeValue(pConfig->GetHatchRocket(FALSE));
|
||
CXMLDOMNodePtr pSetbLineHatch = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充方式"));
|
||
pSetbLineHatch->SetAttributeValue(_T("options"),_T("普通填充 线图案填充"));
|
||
if (pConfig->IsRocketLineHatch())
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("线图案填充"));
|
||
}
|
||
else
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("普通填充"));
|
||
}
|
||
CXMLDOMNodePtr pSetHatch2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充样式"));
|
||
pSetHatch2->SetNodeValue(pConfig->GetHatchRocket(TRUE));
|
||
CXMLDOMNodePtr pSetColor = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("填充颜色"));
|
||
CString strColor;
|
||
strColor.Format(_T("%d"),pConfig->GetRocketColor());
|
||
pSetColor->SetNodeValue(strColor);
|
||
CXMLDOMNodePtr pSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CString strBold1;
|
||
strBold1.Format(_T("%.2lf"),pConfig->GetBoldRocket(FALSE));
|
||
pSetBold1->SetNodeValue(strBold1);
|
||
CXMLDOMNodePtr pSetBold2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图线宽"));
|
||
CString strBold2;
|
||
strBold2.Format(_T("%.2lf"),pConfig->GetBoldRocket(TRUE));
|
||
pSetBold2->SetNodeValue(strBold2);
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern7(TDbConfig *pConfig,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("钢筋混凝土"));
|
||
CXMLDOMNodePtr pSetHatch1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准填充样式"));
|
||
pSetHatch1->SetNodeValue(pConfig->GetHatchConcrete(FALSE));
|
||
CXMLDOMNodePtr pSetbLineHatch = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充方式"));
|
||
pSetbLineHatch->SetAttributeValue(_T("options"),_T("普通填充 线图案填充"));
|
||
if (pConfig->IsConcreteLineHatch())
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("线图案填充"));
|
||
}
|
||
else
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("普通填充"));
|
||
}
|
||
CXMLDOMNodePtr pSetHatch2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充样式"));
|
||
pSetHatch2->SetNodeValue(pConfig->GetHatchConcrete(TRUE));
|
||
CXMLDOMNodePtr pSetColor = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("填充颜色"));
|
||
CString strColor;
|
||
strColor.Format(_T("%d"),pConfig->GetConcreteColor());
|
||
pSetColor->SetNodeValue(strColor);
|
||
//CXMLDOMNodePtr pSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CXMLDOMNodePtr ppSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CString strBold1;
|
||
strBold1.Format(_T("%.2lf"),pConfig->GetBoldConcrete(FALSE));
|
||
ppSetBold1->SetNodeValue(strBold1);
|
||
CXMLDOMNodePtr pSetBold2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图线宽"));
|
||
CString strBold2;
|
||
strBold2.Format(_T("%.2lf"),pConfig->GetBoldConcrete(TRUE));
|
||
pSetBold2->SetNodeValue(strBold2);
|
||
}
|
||
void CTArchSettingEditTools::ExortMaterialPattern8(TDbConfig *pConfig,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("钢柱"));
|
||
CXMLDOMNodePtr pSetHatch1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准填充样式"));
|
||
pSetHatch1->SetNodeValue(pConfig->GetHatchSteel(FALSE));
|
||
CXMLDOMNodePtr pSetbLineHatch = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充方式"));
|
||
pSetbLineHatch->SetAttributeValue(_T("options"),_T("普通填充 线图案填充"));
|
||
if (pConfig->IsSteelLineHatch())
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("线图案填充"));
|
||
}
|
||
else
|
||
{
|
||
pSetbLineHatch->SetNodeValue(_T("普通填充"));
|
||
}
|
||
CXMLDOMNodePtr pSetHatch2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图填充样式"));
|
||
pSetHatch2->SetNodeValue(pConfig->GetHatchSteel(TRUE));
|
||
CXMLDOMNodePtr pSetColor = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("填充颜色"));
|
||
CString strColor;
|
||
strColor.Format(_T("%d"),pConfig->GetSteelColor());
|
||
pSetColor->SetNodeValue(strColor);
|
||
CXMLDOMNodePtr pSetBold1 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("标准线宽"));
|
||
CString strBold1;
|
||
strBold1.Format(_T("%.2lf"),pConfig->GetBoldSteel(FALSE));
|
||
pSetBold1->SetNodeValue(strBold1);
|
||
CXMLDOMNodePtr pSetBold2 = pChild->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("详图线宽"));
|
||
CString strBold2;
|
||
strBold2.Format(_T("%.2lf"),pConfig->GetBoldSteel(TRUE));
|
||
pSetBold2->SetNodeValue(strBold2);
|
||
}
|
||
|
||
void CTArchSettingEditTools::ExortAdvancedSet(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
XString sFullFileDef;
|
||
if (!FindFile(_T("config.def"), sFullFileDef))
|
||
{
|
||
AfxMessageBox(_T("\n找不到'config.def'文件!"));
|
||
return;
|
||
}
|
||
|
||
XString sFullFile;
|
||
if (!FindFile(_T("config.ini"), sFullFile))
|
||
{
|
||
AfxMessageBox(_T("\n找不到'config.ini'文件!"));
|
||
return;
|
||
}
|
||
WDict dictCur;
|
||
WDict dictCfg;
|
||
dictCfg.ReadFile(sFullFileDef);//读入标配
|
||
dictCur.ReadFile(sFullFile);//读入当前配置
|
||
if (dictCur.m_sDesc!=dictCfg.m_sDesc)//配置版本不同
|
||
dictCfg.CopyData(dictCur);//将当前配置尽量复制过来
|
||
else
|
||
{
|
||
dictCfg.Clear();
|
||
dictCfg.Conbine(dictCur);//直接使用当前配置
|
||
}
|
||
DictToXml(&dictCfg,pXMLDOMNodePtr);
|
||
}
|
||
|
||
void CTArchSettingEditTools::ExportScreenMenu(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
CString strValue;
|
||
//BOOL bScreenMenu = IsScreenMenuVisible();
|
||
BOOL bScreenMenu(FALSE);
|
||
if (bScreenMenu)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pShowMenuNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("显示上华屏幕菜单"));
|
||
pShowMenuNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
//菜单风格
|
||
CXMLDOMNodePtr pMenuStyleNode = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("菜单风格"));
|
||
BOOL bLimitHeight=g_bLimitHeight;
|
||
if (bLimitHeight)
|
||
{
|
||
strValue = _T("推拉风格");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("折叠风格");
|
||
}
|
||
CXMLDOMNodePtr pSetMenuStyleNode = pMenuStyleNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("设置菜单风格"));
|
||
pSetMenuStyleNode->SetAttributeValue(_T("options"),_T("折叠风格 推拉风格"));
|
||
BOOL bScrollBar=g_bScrollBar;
|
||
if (bScrollBar)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pScreenHeightNode = pMenuStyleNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("屏幕高度设置"));
|
||
pScreenHeightNode->SetAttributeValue(_T("comment"),_T("屏幕高度不足时使用滚动条(或使用鼠标中健滚轮)"));
|
||
pScreenHeightNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
BOOL bAutoOpenFirst=g_bDefaultOpenFirst;
|
||
if (bAutoOpenFirst)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pAutoExpandNode = pMenuStyleNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("自动展开第一个子菜单目录"));
|
||
pAutoExpandNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
//背景颜色
|
||
CXMLDOMNodePtr pBKColorNode = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("背景颜色"));
|
||
strValue.Format(_T("%d"),g_menuColors[0]);
|
||
CXMLDOMNodePtr pFirstLayerNode = pBKColorNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("第一层"));
|
||
strValue.Format(_T("%d"),g_menuColors[1]);
|
||
CXMLDOMNodePtr pSecondLayerNode = pBKColorNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("第二层"));
|
||
strValue.Format(_T("%d"),g_menuColors[2]);
|
||
CXMLDOMNodePtr pThirdLayerNode = pBKColorNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("第三层"));
|
||
strValue.Format(_T("%d"),g_menuColors[3]);
|
||
CXMLDOMNodePtr pFourLayerNode = pBKColorNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("第四层"));
|
||
}
|
||
|
||
void CTArchSettingEditTools::ExportToolBar(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
CXMLDOMNodePtr pToobarNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("工具条"));
|
||
XString strXsDbfFile;
|
||
if (!FindFile(_T("tchdata.dbf"), strXsDbfFile)) {
|
||
return;
|
||
}
|
||
CString csCmd, csName, csDescribe, csIcon, csType;
|
||
CString strValue;
|
||
int iHit;
|
||
CodeBase db;
|
||
XDbfTable *pTable = db.Open(strXsDbfFile);
|
||
if (pTable) {
|
||
pTable->MoveFirst();
|
||
|
||
//modify by xlc on 090722 工具条按顺序导出
|
||
DList<CToolbarData> lstToolbarData;
|
||
lstToolbarData.Reset();
|
||
|
||
while(!pTable->IsEOF()) {
|
||
GET_FIELD(pTable, _T("chacmd"), csName);
|
||
GET_FIELD(pTable, _T("engcmd"), csCmd);
|
||
GET_FIELD(pTable, _T("explain"), csDescribe);
|
||
GET_FIELD(pTable, _T("icon"), csIcon);
|
||
GET_FIELD(pTable, _T("flag"), iHit);
|
||
GET_FIELD(pTable, _T("type"), csType);
|
||
if (iHit>0)
|
||
{
|
||
//strValue += (csName+_T(" "));
|
||
lstToolbarData.Append(new CToolbarData(csType, csCmd, csName, csDescribe, csIcon, iHit));
|
||
}
|
||
pTable->MoveNext();
|
||
}
|
||
|
||
lstToolbarData.QuickSort(CToolbarData::SortByItem);
|
||
for (int i=0;i<lstToolbarData.Length();i++)
|
||
{
|
||
strValue += (lstToolbarData[i]->m_csName+_T(" "));
|
||
}
|
||
|
||
int nLen = strValue.GetLength();
|
||
if (nLen>0)
|
||
{
|
||
strValue.Delete(nLen-1);
|
||
}
|
||
pToobarNode->SetNodeValue(strValue);
|
||
pTable->Close();
|
||
}
|
||
else{
|
||
return;
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::ExportHotKey(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//输出tree
|
||
ExportPgp(pXMLDOMNodePtr);
|
||
ExportOneHotKey(pXMLDOMNodePtr);
|
||
}
|
||
|
||
extern HINSTANCE _hdllInstance;
|
||
void CTArchSettingEditTools::ExportPgp(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
Array<CString> aryStrKeyTitle;
|
||
std::map<CString,TarchHotKeyInfo> mapKeyInfo;
|
||
XString strAcadPgp,strPath;
|
||
|
||
//modify by xlc on 090731 R17有专用的pgp
|
||
GetModuleFileName(_hdllInstance,strPath,1024);
|
||
BOOL bFind=FALSE;
|
||
if (strPath.Length()>0)
|
||
{
|
||
CString str=strPath;
|
||
str.Replace(_T("tch_kerncmd.arx"),_T("acad.pgp"));
|
||
if (FindFile(str,strAcadPgp))
|
||
{
|
||
bFind = TRUE;
|
||
}
|
||
}
|
||
if (!bFind)
|
||
{
|
||
if (!FindFile(_T("acad.pgp"), strAcadPgp))
|
||
{
|
||
return;
|
||
}
|
||
}
|
||
CStdioFile file;
|
||
if (!file.Open(strAcadPgp, CFile::modeRead))
|
||
{
|
||
AfxMessageBox(CString(_T("打开文件 \"")) + strAcadPgp + _T("\" 失败"));
|
||
return ;
|
||
}
|
||
CString sString;
|
||
BOOL bFirst = TRUE;
|
||
while(file.ReadString(sString))
|
||
{
|
||
TCHAR sKey[256] = _T("");
|
||
TCHAR sName[256] = _T("");
|
||
|
||
if (sString[0])
|
||
{
|
||
if (sString[0] == _T(';') && sString[1] == _T(';'))
|
||
{
|
||
aryStrKeyTitle.AddTail(sString.Right(sString.GetLength()-2));
|
||
std::map<CString,TarchHotKeyInfo>::iterator iter = mapKeyInfo.find(sString.Right(sString.GetLength()-2));
|
||
if (iter == mapKeyInfo.end())
|
||
{
|
||
TarchHotKeyInfo hotKeyInfo;
|
||
mapKeyInfo.insert(std::map<CString,TarchHotKeyInfo>::value_type(sString.Right(sString.GetLength()-2),hotKeyInfo));
|
||
}
|
||
bFirst = FALSE;
|
||
}
|
||
else if (sString[0] != _T(';'))
|
||
{
|
||
if (sString.Find(_T("*")) == -1 ||sString.Find(_T(":")) != -1)
|
||
{
|
||
continue;
|
||
}
|
||
if (bFirst)
|
||
{
|
||
aryStrKeyTitle.AddTail(_T("ACAD"));
|
||
std::map<CString,TarchHotKeyInfo>::iterator iter = mapKeyInfo.find(_T("ACAD"));
|
||
if (iter == mapKeyInfo.end())
|
||
{
|
||
TarchHotKeyInfo hotKeyInfo;
|
||
mapKeyInfo.insert(std::map<CString,TarchHotKeyInfo>::value_type(_T("ACAD"),hotKeyInfo));
|
||
}
|
||
bFirst = FALSE;
|
||
}
|
||
CString str = sString,strType,strCmd,strNote;
|
||
strType = sString.Left(sString.Find(_T(",")));
|
||
|
||
//add by xlc on 090921 解决pgp文件中有中文逗号的问题
|
||
if (strType.IsEmpty())
|
||
{
|
||
strType = sString.Left(sString.Find(_T(",")));
|
||
}
|
||
|
||
strCmd = str.Right(str.GetLength()-str.Find(_T("*"))-1);
|
||
strNote = FindComment(strCmd);
|
||
int nLen = aryStrKeyTitle.GetLength();
|
||
if (nLen>0)
|
||
{
|
||
CString strTitle = aryStrKeyTitle.GetAt(nLen-1);
|
||
std::map<CString,TarchHotKeyInfo>::iterator iter = mapKeyInfo.find(strTitle);
|
||
if (iter != mapKeyInfo.end())
|
||
{
|
||
iter->second.m_strKeyName += (strType+_T(" "));
|
||
iter->second.m_strCmdName += (strCmd+_T(" "));
|
||
iter->second.m_strCmment += (strNote+_T(" "));
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
|
||
}
|
||
}
|
||
}
|
||
std::map<CString,TarchHotKeyInfo>::iterator iter = mapKeyInfo.begin();
|
||
CXMLDOMNodePtr pPopularHotKeyNode = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("普通快捷键"));
|
||
for (iter;iter!=mapKeyInfo.end();iter++)
|
||
{
|
||
CXMLDOMNodePtr pChild = pPopularHotKeyNode->AppendNodeEx(_T("选项"),_T(""),_T("name"),iter->first);
|
||
CString strHotKeyValue,strHotKeyCmd,strHotKeyComment;
|
||
strHotKeyValue = iter->second.m_strKeyName;
|
||
strHotKeyCmd = iter->second.m_strCmdName;
|
||
strHotKeyComment = iter->second.m_strCmment;
|
||
int nLen = strHotKeyValue.GetLength();
|
||
strHotKeyValue.Delete(nLen-1);
|
||
nLen = strHotKeyCmd.GetLength();
|
||
strHotKeyCmd.Delete(nLen-1);
|
||
nLen = strHotKeyComment.GetLength();
|
||
strHotKeyComment.Delete(nLen-1);
|
||
pChild->SetAttributeValue(_T("cmdname"),strHotKeyCmd);
|
||
pChild->SetAttributeValue(_T("comment"),strHotKeyComment);
|
||
pChild->SetNodeValue(strHotKeyValue);
|
||
}
|
||
file.Close();
|
||
}
|
||
|
||
CString CTArchSettingEditTools::FindComment(const CString &strCmd)
|
||
{
|
||
CString strCmment = _T("无");
|
||
for(int i = 0; i < m_lstToolbarData.Length(); i++)
|
||
{
|
||
if (strCmd == m_lstToolbarData[i]->m_csCmd)
|
||
{
|
||
strCmment = m_lstToolbarData[i]->m_csName;
|
||
break;
|
||
}
|
||
}
|
||
return strCmment;
|
||
}
|
||
|
||
// 把字符中间的空格处理成替换字符
|
||
CString ReplaceBlank(CString strItem)
|
||
{
|
||
strItem.TrimLeft();
|
||
strItem.TrimRight();
|
||
if (strItem.IsEmpty())
|
||
return _T("&");
|
||
|
||
strItem.Replace(_T(' '), _T('&'));
|
||
|
||
return strItem;
|
||
}
|
||
|
||
// 把字符中间的替换字符处理成空格
|
||
CString ReplaceBlankBack(CString strItem)
|
||
{
|
||
strItem.TrimLeft();
|
||
strItem.TrimRight();
|
||
|
||
if (strItem.IsEmpty())
|
||
return _T(" ");
|
||
|
||
strItem.Replace(_T('&'), _T(' '));
|
||
|
||
return strItem;
|
||
}
|
||
|
||
extern TKeyMapTable g_KeyMapTable;
|
||
void CTArchSettingEditTools::ExportOneHotKey(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//输出grid
|
||
CXMLDOMNodePtr pOneKeyHotKeyNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("一键快捷"));
|
||
CString strHotKeyValue,strHotKeyCmd,strHotKeyComment;
|
||
long i = 0;
|
||
for(g_KeyMapTable.MoveToFirst(); !g_KeyMapTable.IsOut(); g_KeyMapTable.MoveToNext())
|
||
{
|
||
TKeyMap *pMap = &g_KeyMapTable.GetCurData();
|
||
CString strKey = pMap->sKey;
|
||
CString strCmd= pMap->sCommand;
|
||
// if (strCmd==_T(""))
|
||
// {
|
||
// strCmd = _T("无");
|
||
// }
|
||
CString strComment = pMap->sNote;
|
||
// if (strComment==_T(""))
|
||
// {
|
||
// strComment = _T("无");
|
||
// }
|
||
// lgh modify,替换其中的空字符,字符串中间不能有空格
|
||
strHotKeyValue +=(ReplaceBlank(strKey)+_T(" "));
|
||
strHotKeyCmd +=(ReplaceBlank(strCmd)+_T(" "));
|
||
strHotKeyComment +=(ReplaceBlank(strComment)+_T(" "));
|
||
}
|
||
int nLen = strHotKeyValue.GetLength();
|
||
strHotKeyValue.Delete(nLen-1);
|
||
nLen = strHotKeyCmd.GetLength();
|
||
strHotKeyCmd.Delete(nLen-1);
|
||
nLen = strHotKeyComment.GetLength();
|
||
strHotKeyComment.Delete(nLen-1);
|
||
pOneKeyHotKeyNode->SetAttributeValue(_T("cmdname"),strHotKeyCmd);
|
||
pOneKeyHotKeyNode->SetAttributeValue(_T("comment"),strHotKeyComment);
|
||
pOneKeyHotKeyNode->SetNodeValue(strHotKeyValue);
|
||
//是否启用快捷键
|
||
CXMLDOMNodePtr pBeginHotKeyNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),_T(""),_T("name"),_T("启用快捷键"));
|
||
pBeginHotKeyNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
CString strValue;
|
||
BOOL bEnable = g_bEnableShortCut;
|
||
if (bEnable)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
pBeginHotKeyNode->SetNodeValue(strValue);
|
||
}
|
||
|
||
void CTArchSettingEditTools::ExportOtherSetting(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//界面设置
|
||
CXMLDOMNodePtr pWindowSet = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("界面设置"));
|
||
CString strValue;
|
||
/*BOOL bShortcutMenu = (g_nSpeedMenu!=0);
|
||
if (bShortcutMenu)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pStartRbtnNode = pWindowSet->AppendNode(_T("选项"),strValue,_T("name"),_T("启用上华右键快捷菜单"));
|
||
pStartRbtnNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
CString strRadio1,strRadio2,strRadio3;
|
||
strRadio1= _T("右键");
|
||
strRadio2=_T("ctrl+右键");
|
||
strRadio3= _T("慢击右键");
|
||
CString strTem;
|
||
int nMenuTime=g_nRBtnMenuTime;
|
||
strTem.Format(_T("%d"),nMenuTime);
|
||
strRadio3+=strTem;
|
||
int nRClick = g_nSpeedMenu-1;
|
||
if (nRClick==0)
|
||
{
|
||
strValue = strRadio1;
|
||
}
|
||
else if (nRClick==1)
|
||
{
|
||
strValue = strRadio2;
|
||
}
|
||
else
|
||
{
|
||
strValue = strRadio3;
|
||
}
|
||
CXMLDOMNodePtr pFreeRbtnNode = pWindowSet->AppendNode(_T("选项"),strValue,_T("name"),_T("空选时右键状态"));
|
||
pFreeRbtnNode->SetAttributeValue(_T("options"),strRadio1+_T(" ")+strRadio2+_T(" ")+strRadio3);
|
||
BOOL bZoomKey =g_bZoomKey;
|
||
if (bZoomKey)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pZoomNode = pWindowSet->AppendNode(_T("选项"),strValue,_T("name"),_T("启用放大缩小热键"));
|
||
pZoomNode->SetAttributeValue(_T("options"),_T("是 否"));*/
|
||
BOOL bDwgTabBar =g_bDwgTabBar;
|
||
if (bDwgTabBar)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pTagNode = pWindowSet->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("启用文档标签"));
|
||
pTagNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
//在位编辑
|
||
CXMLDOMNodePtr pEditNode = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),_T("在位编辑"));
|
||
strValue.Format(_T("%d"),g_colorInPlaceText);
|
||
CXMLDOMNodePtr pFontColorNode = pEditNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("字体颜色"));
|
||
strValue.Format(_T("%d"),g_colorInPlaceGround);
|
||
CXMLDOMNodePtr pBkColorNode = pEditNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("背景颜色"));
|
||
strValue.Format(_T("%d"),g_iInPlaceFontHeight);
|
||
CXMLDOMNodePtr pFontHeightNode = pEditNode->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("字体高度"));
|
||
}
|
||
|
||
//导出用户操作界面
|
||
void CTArchSettingEditTools::ExportUserOpreatorSetting(const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
//界面设置
|
||
// CXMLDOMNodePtr pWindowSet = pXMLDOMNodePtr->AppendNode(_T("目录"),_T(""),_T("name"),_T("用户操作"));
|
||
CString strValue;
|
||
BOOL bShortcutMenu = (g_nSpeedMenu!=0);
|
||
if (bShortcutMenu)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pStartRbtnNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("启用上华右键快捷菜单"));
|
||
pStartRbtnNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
CString strRadio1,strRadio2,strRadio3;
|
||
strRadio1= _T("右键");
|
||
strRadio2=_T("ctrl+右键");
|
||
strRadio3= _T("慢击右键");
|
||
CString strTem;
|
||
int nMenuTime=g_nRBtnMenuTime;
|
||
strTem.Format(_T("%d"),nMenuTime);
|
||
strRadio3+=strTem;
|
||
int nRClick = g_nSpeedMenu-1;
|
||
if (nRClick==0)
|
||
{
|
||
strValue = strRadio1;
|
||
}
|
||
else if (nRClick==1)
|
||
{
|
||
strValue = strRadio2;
|
||
}
|
||
else
|
||
{
|
||
strValue = strRadio3;
|
||
}
|
||
CXMLDOMNodePtr pFreeRbtnNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("空选时右键状态"));
|
||
pFreeRbtnNode->SetAttributeValue(_T("options"),strRadio1+_T(" ")+strRadio2+_T(" ")+strRadio3);
|
||
BOOL bZoomKey =g_bZoomKey;
|
||
if (bZoomKey)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pZoomNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("启用放大缩小热键"));
|
||
pZoomNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
BOOL bPreViewKey =g_bEnableSelectPreview;
|
||
if (bPreViewKey)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pPreViewNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("启用选择预览"));
|
||
pPreViewNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
BOOL bAutoFocusKey =g_bAutoFocus;
|
||
if (bAutoFocusKey)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pAutoFocusNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("自动恢复十字光标"));
|
||
pAutoFocusNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
BOOL bAutoRecent =g_bAutoOpenRecent;
|
||
if (bAutoRecent)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pAutoRecentNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("启动时自动加载最近使用的工程环境"));
|
||
pAutoRecentNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
BOOL bModelNumber =g_bModelNumber;
|
||
if (bModelNumber)
|
||
{
|
||
strValue = _T("是");
|
||
}
|
||
else
|
||
{
|
||
strValue = _T("否");
|
||
}
|
||
CXMLDOMNodePtr pModelNumberNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("动态拖动绘制时使用模数"));
|
||
pModelNumberNode->SetAttributeValue(_T("options"),_T("是 否"));
|
||
strValue.Format(_T("%.lg"),g_nWallStep);
|
||
CXMLDOMNodePtr pWallNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("墙体"));
|
||
strValue.Format(_T("%.lg"),g_nWinStep);
|
||
CXMLDOMNodePtr pWindowNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("门窗"));
|
||
strValue.Format(_T("%.lg"),g_nWalkDistStep);
|
||
CXMLDOMNodePtr pWalkDistNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("虚拟漫游距离步长"));
|
||
strValue.Format(_T("%.2f"), g_nWalkAngleStep*180/PI);
|
||
CXMLDOMNodePtr pWalkAngleNode = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),strValue,_T("name"),_T("角度步长"));
|
||
}
|
||
|
||
void CTArchSettingEditTools::DevideStr(const CString &str,CStringArray &aryStr)
|
||
{
|
||
CString strTem;
|
||
int nPos = str.Find(_T(" "),0);
|
||
int nStart = 0;
|
||
while (nPos!=-1)
|
||
{
|
||
int nNum = nPos-nStart;
|
||
strTem = str.Mid(nStart,nNum);
|
||
aryStr.Add(strTem);
|
||
nStart = nPos+1;
|
||
nPos = str.Find(_T(" "),nPos+1);
|
||
}
|
||
int nSize = str.GetLength();
|
||
if (nStart-1<nSize-1)
|
||
{
|
||
strTem = str.Mid(nStart,nSize-nStart);
|
||
aryStr.Add(strTem);
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::DictToXml(WDict *pDict,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
if (pDict == NULL)
|
||
return;
|
||
|
||
for(pDict->MoveToFirst(); !pDict->IsOut(); pDict->MoveToNext())
|
||
{
|
||
WDict *pCurDict = (WDict*)pDict->GetCurData();
|
||
if (pCurDict == NULL)
|
||
continue;
|
||
if (pCurDict->GetType() == TYPE_WDict)
|
||
{
|
||
DictToXmlParentNode(pCurDict,pXMLDOMNodePtr);
|
||
}
|
||
else
|
||
DictToXmlLeafNode(pCurDict,pXMLDOMNodePtr);
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::DictToXmlParentNode(WDict *pDict,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
if (pDict == NULL)
|
||
return;
|
||
|
||
CString szName = pDict->m_sName;
|
||
CString szDesc = pDict->m_sDesc;
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("目录"),_T(""),_T("name"),szName);
|
||
pChild->SetAttributeValue(_T("comment"),szDesc);
|
||
if (pDict->GetDataNum() == 0)// 空集合
|
||
{
|
||
return;
|
||
}
|
||
for(pDict->MoveToFirst(); !pDict->IsOut(); pDict->MoveToNext())
|
||
{
|
||
WDict *pCurDict = (WDict*)pDict->GetCurData();
|
||
if (pCurDict == NULL)
|
||
continue;
|
||
if (pCurDict->GetType() == TYPE_WDict)
|
||
DictToXmlParentNode(pCurDict,pChild);
|
||
else
|
||
DictToXmlLeafNode(pCurDict,pChild);
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::DictToXmlLeafNode(WDict *pDict,const CXMLDOMNodePtr& pXMLDOMNodePtr)
|
||
{
|
||
if (pDict == NULL)
|
||
return;
|
||
CString szName = pDict->m_sName;
|
||
int nType = pDict->GetType();
|
||
CString szValue, szType;
|
||
CString szDesc = pDict->m_sDesc;
|
||
CString strOptions;
|
||
if (nType == TYPE_WBoolItem)
|
||
{
|
||
WBoolItem *pItem = (WBoolItem*)pDict;
|
||
szValue = (pItem->m_data) ? _T("是") : _T("否");
|
||
szType = _T("布尔型");
|
||
// sg add 090724,高级选项中的BOOL型变量,写XML文件错误
|
||
strOptions = _T(" 是 否");
|
||
}
|
||
else if (nType == TYPE_WCharItem)
|
||
{
|
||
WCharItem *pItem = (WCharItem*)pDict;
|
||
szValue.Format(_T("%c"), pItem->m_data);
|
||
szType = _T("字符型");
|
||
}
|
||
else if (nType == TYPE_WLongItem)
|
||
{
|
||
WLongItem *pItem = (WLongItem*)pDict;
|
||
szValue.Format(_T("%d"), pItem->m_data);
|
||
szType = _T("整型");
|
||
}
|
||
else if (nType == TYPE_WDoubleItem)
|
||
{
|
||
WDoubleItem *pItem = (WDoubleItem*)pDict;
|
||
szValue.Format(_T("%lg"), pItem->m_data);
|
||
szType = _T("浮点型");
|
||
}
|
||
else if (nType == TYPE_WCStringItem)
|
||
{
|
||
WCStringItem *pItem = (WCStringItem*)pDict;
|
||
szValue = pItem->m_data;
|
||
szType = _T("字符串型");
|
||
}
|
||
else if (nType == TYPE_WSelectItem)
|
||
{
|
||
WSelectItem *pItem = (WSelectItem*)pDict;
|
||
szValue = pItem->GetSelString();
|
||
szType = _T("选择型");
|
||
for(pItem->MoveToFirst(); !pItem->IsOut(); pItem->MoveToNext())
|
||
{
|
||
strOptions += _T(" ")+pItem->GetCurData();
|
||
}
|
||
}
|
||
CXMLDOMNodePtr pChild = pXMLDOMNodePtr->AppendNodeEx(_T("选项"),szValue,_T("name"),szName);
|
||
pChild->SetAttributeValue(_T("comment"),szDesc);
|
||
if (nType == TYPE_WSelectItem)
|
||
{
|
||
//规范化字符串 形成a b形式
|
||
int n = strOptions.Find(_T(" "),0);
|
||
if (n>=0)
|
||
{
|
||
strOptions.Delete(n);
|
||
}
|
||
pChild->SetAttributeValue(_T("options"),strOptions);
|
||
}
|
||
else if (nType == TYPE_WBoolItem) // sg add 090724,高级选项中的BOOL型变量,写XML文件错误
|
||
{
|
||
//规范化字符串 形成a b形式
|
||
int n = strOptions.Find(_T(" "),0);
|
||
if (n>=0)
|
||
{
|
||
strOptions.Delete(n);
|
||
}
|
||
pChild->SetAttributeValue(_T("options"),strOptions);
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::ImportAllTArchSettingData(std::map<CString,NodeInfoAry> &importMapData)
|
||
{
|
||
std::map<CString,NodeInfoAry>::iterator iter;
|
||
iter = importMapData.find(_T("基本设定"));//界面1
|
||
if (iter!=importMapData.end())
|
||
{
|
||
ImportBaseSet(iter->second);
|
||
}
|
||
iter = importMapData.find(_T("墙柱加粗填充"));//界面2
|
||
if (iter!=importMapData.end())
|
||
{
|
||
ImportWallPillarSet(iter->second);
|
||
}
|
||
iter = importMapData.find(_T("高级选项"));//界面3
|
||
if (iter!=importMapData.end())
|
||
{
|
||
ImportAdvancedSet(iter->second);
|
||
}
|
||
|
||
iter = importMapData.find(_T("屏幕菜单"));//界面1
|
||
if (iter!=importMapData.end())
|
||
{
|
||
ImportScreenMenu(iter->second);
|
||
}
|
||
iter = importMapData.find(_T("基本界面"));//界面2
|
||
if (iter!=importMapData.end())
|
||
{
|
||
ImportOtherSet(iter->second);
|
||
}
|
||
iter = importMapData.find(_T("工具条"));//界面3
|
||
if (iter!=importMapData.end())
|
||
{
|
||
ImportToolBar(iter->second);
|
||
}
|
||
iter = importMapData.find(_T("快捷键"));//界面4
|
||
if (iter!=importMapData.end())
|
||
{
|
||
ImportHotKeySet(iter->second);
|
||
}
|
||
iter = importMapData.find(_T("操作配置"));
|
||
if (iter!=importMapData.end())
|
||
{
|
||
ImportUserOpreatorSet(iter->second);
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::ImportBaseSet(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
int nLen = aryData.GetLength();
|
||
int i=0;
|
||
for (;i<nLen;i++)
|
||
{
|
||
CXMLNodeInfoEx data = aryData.GetAt(i);
|
||
SetOneBasePara(data);
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::SetOneBasePara(const CXMLNodeInfoEx& data)
|
||
{
|
||
CString strName = data.m_aryNodeAttribute.GetAt(0).second;
|
||
CString strAttriName = _T("options");
|
||
if (strName == _T("编号"))
|
||
{
|
||
BOOL bCapLabel;
|
||
int nIndex = GetIndex(data,strAttriName);
|
||
if (nIndex==0)
|
||
{
|
||
bCapLabel = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bCapLabel = FALSE;
|
||
}
|
||
TDbConfig *pConfig=GetDwgGlobal(AcDb::kForWrite);
|
||
if (pConfig)
|
||
{
|
||
pConfig->SetCapLabel(bCapLabel);
|
||
pConfig->close();
|
||
}
|
||
}
|
||
else if (strName == _T("剖断样式"))
|
||
{
|
||
int nIndex =GetIndex(data,strAttriName);
|
||
if (nIndex!=-1)
|
||
{
|
||
TDbConfig *pConfig=GetDwgGlobal(AcDb::kForWrite);
|
||
if (pConfig) {
|
||
pConfig->SetSingleSect(nIndex==1);
|
||
pConfig->close();
|
||
}
|
||
}
|
||
}
|
||
else if (strName == _T("当前比例"))
|
||
{
|
||
if (_tstof(data.m_strNodeValue)>0.1) {
|
||
DocSetPScale(_tstof(data.m_strNodeValue));
|
||
DocStatus();
|
||
}
|
||
}
|
||
else if (strName == _T("当前层高"))
|
||
{
|
||
if (_tstof(data.m_strNodeValue)>_DIST_SNAP)
|
||
DocSetLHeight(_tstof(data.m_strNodeValue));
|
||
}
|
||
else if (strName == _T("显示模式"))
|
||
{
|
||
int nIndex = GetIndex(data,strAttriName);
|
||
if (nIndex!=-1)
|
||
{
|
||
DocSetDrawMode(nIndex+1);
|
||
}
|
||
}
|
||
else if (strName == _T("房间面积标注小数位数设置"))
|
||
{
|
||
int nSpaceAreaPrecision =0;
|
||
#ifdef UNICODE
|
||
nSpaceAreaPrecision = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nSpaceAreaPrecision = atoi(data.m_strNodeValue);
|
||
#endif
|
||
TDbConfig *pConfig=GetDwgGlobal(AcDb::kForWrite);
|
||
if (pConfig) {
|
||
pConfig->SetSpaceAreaPrecision(nSpaceAreaPrecision);
|
||
pConfig->close();
|
||
}
|
||
}
|
||
else if (strName == _T("文字距离基线系数"))
|
||
{
|
||
DocSetText2BaseRatio(_tstof(data.m_strNodeValue));
|
||
}
|
||
else if (strName == _T("绘图单位"))
|
||
{
|
||
int nIndex = GetIndex(data,strAttriName);
|
||
BOOL bDim = DocGetMeterUnitDim();
|
||
if (!bDim)
|
||
{
|
||
DocSetMeterUnitDraw(FALSE);
|
||
}
|
||
else
|
||
{
|
||
DocSetMeterUnitDraw(nIndex!=0);
|
||
}
|
||
}
|
||
else if (strName == _T("标注单位"))
|
||
{
|
||
BOOL bDraw = DocGetMeterUnitDraw();
|
||
int nIndex = GetIndex(data,strAttriName);
|
||
if (bDraw)
|
||
{
|
||
DocSetMeterUnitDim(TRUE);
|
||
}
|
||
else
|
||
{
|
||
DocSetMeterUnitDim(nIndex!=0);
|
||
}
|
||
}
|
||
else if (strName == _T("索引图名中文字大小的控制比例"))
|
||
{
|
||
// lgh modify 110222. 圆圈文字字高系数,根据相关意见:在8.5版本中,只写入,不读取
|
||
// double dValue = _tstof(data.m_strNodeValue);
|
||
// DocSetDITextRatio(dValue);
|
||
}
|
||
else if (strName == _T("是否保留老版本绘制样式"))
|
||
{
|
||
// sg modify 110210,8.5改变设置内容,需要将旧的配置文件转换为新的设置
|
||
int nIndex = GetIndex(data, strAttriName);
|
||
if (nIndex == 0)
|
||
{
|
||
// DocSetOldDrawingIndex(TRUE);
|
||
DocSetDrawingIndexStyle(1);
|
||
}
|
||
else
|
||
{
|
||
// DocSetOldDrawingIndex(FALSE);
|
||
DocSetDrawingIndexStyle(0);
|
||
}
|
||
}
|
||
// sg add 110210,8.5增加“圆圈文字”样式
|
||
else if (strName == _T("圆圈文字显示样式"))
|
||
{
|
||
int nIndex = GetIndex(data, strAttriName);
|
||
if (nIndex != -1)
|
||
{
|
||
if (nIndex == 2)
|
||
nIndex += 1;
|
||
|
||
DocSetDrawingIndexStyle(nIndex);
|
||
}
|
||
}
|
||
// sg add 110210,8.5增加“凸窗挡板和门窗套保温”设置
|
||
else if (strName == _T("凸窗挡板和门窗套是否有保温"))
|
||
{
|
||
int nIndex = GetIndex(data,strAttriName);
|
||
DocSetProWinSlabInsu(nIndex == 0);
|
||
}
|
||
else if (strName == _T("三角形标高符号高度"))
|
||
{
|
||
double dValue = _tstof(data.m_strNodeValue);
|
||
DocSetEleTriangleSize(dValue);
|
||
}
|
||
else if (strName == _T("圆点标高符号直径"))
|
||
{
|
||
double dValue = _tstof(data.m_strNodeValue)/2;
|
||
DocSetEleDoteSize(dValue);
|
||
}
|
||
else if (strName == _T("十字标高符号线长"))
|
||
{
|
||
double dValue = _tstof(data.m_strNodeValue);
|
||
DocSetEleCrossSize(dValue);
|
||
}
|
||
else if (strName == _T("引出文字距基线末端距离"))
|
||
{
|
||
double dValue = _tstof(data.m_strNodeValue);
|
||
DocSetMultiLeaderDistRatio(dValue);
|
||
}
|
||
// sg add 120626,9.0增加弧长样式
|
||
else if (strName == _T("弧长标注"))
|
||
{
|
||
int nIndex = GetIndex(data, strAttriName);
|
||
if (nIndex != -1)
|
||
DocSetArcLenDimType(1-nIndex);
|
||
}
|
||
else if (strName == _T("阳台按一半面积计算"))
|
||
{
|
||
// 阳台一半面积不读取。
|
||
// removed by lgh 20101104
|
||
// int nIndex = GetIndex(data,strAttriName);
|
||
// if (nIndex == 0)
|
||
// {
|
||
// g_bBlaconyHalf=TRUE;
|
||
// }
|
||
// else
|
||
// {
|
||
// g_bBlaconyHalf=FALSE;
|
||
// }
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::ImportWallPillarSet(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
TDbConfig *p = GetDwgGlobal(AcDb::kForWrite);
|
||
XDbObject vTemp(p);
|
||
if (p)
|
||
{
|
||
int nLen = aryData.GetLength();
|
||
int i=0;
|
||
for (;i<nLen;i++)
|
||
{
|
||
CXMLNodeInfoEx data = aryData.GetAt(i);
|
||
SetWallPillarPara(data,p);
|
||
}
|
||
}
|
||
vTemp.Close();
|
||
}
|
||
|
||
void CTArchSettingEditTools::SetWallPillarPara(const CXMLNodeInfoEx& data,TDbConfig *p)
|
||
{
|
||
CString strName = data.m_aryNodeAttribute.GetAt(0).second;
|
||
CString strAttriName = _T("options");
|
||
if (strName == _T("加粗"))
|
||
{
|
||
BOOL bBoldMode;
|
||
int nIndex = GetIndex(data,strAttriName);
|
||
if (nIndex == 0)
|
||
{
|
||
bBoldMode = TRUE;
|
||
}
|
||
else
|
||
{
|
||
bBoldMode = FALSE;
|
||
}
|
||
p->SetLineWeight(bBoldMode);
|
||
}
|
||
else if (strName == _T("填充"))
|
||
{
|
||
int nIndex = GetIndex(data,strAttriName);
|
||
BOOL bFillMod;
|
||
if (nIndex == 0)
|
||
{
|
||
bFillMod = TRUE;
|
||
}
|
||
else
|
||
{
|
||
bFillMod = FALSE;
|
||
}
|
||
p->SetSolidFill(bFillMod);
|
||
}
|
||
else if (strName == _T("详图比例"))
|
||
{
|
||
double nScale=_tstof(data.m_strNodeValue);
|
||
if (nScale>1.0)
|
||
p->SetDetailScale(nScale);
|
||
}
|
||
else
|
||
{
|
||
CStringArray arystr;
|
||
GetListCtrlIndex(data,arystr);
|
||
if (arystr.GetSize()>2)
|
||
{
|
||
// Zyu modify on 100722,支持64位
|
||
//int nLen = arystr.GetSize();
|
||
INT_PTR nLen = arystr.GetSize();
|
||
CString strTemFather = arystr.GetAt(nLen-2);
|
||
CString strTemChild = arystr.GetAt(nLen-1);
|
||
if (strTemFather == WALLMATE_Divider)
|
||
{
|
||
ImportMaterialPattern1(data,p,strTemChild);
|
||
}
|
||
else if (strTemFather == WALLMATE_Fill)
|
||
{
|
||
ImportMaterialPattern2(data,p,strTemChild);
|
||
}
|
||
else if (strTemFather == WALLMATE_Fill1)
|
||
{
|
||
ImportMaterialPattern3(data,p,strTemChild);
|
||
}
|
||
else if (strTemFather == WALLMATE_Fill1)
|
||
{
|
||
ImportMaterialPattern4(data,p,strTemChild);
|
||
}
|
||
else if (strTemFather == _T("砖墙柱"))
|
||
{
|
||
ImportMaterialPattern5(data,p,strTemChild);
|
||
}
|
||
else if (strTemFather == _T("石墙柱"))
|
||
{
|
||
ImportMaterialPattern6(data,p,strTemChild);
|
||
}
|
||
|
||
else if (strTemFather == _T("钢筋混凝土")) // 保留上面的空行,否则在VC8下编译不通过
|
||
{
|
||
ImportMaterialPattern7(data,p,strTemChild);
|
||
}
|
||
else if (strTemFather == _T("钢柱"))
|
||
{
|
||
ImportMaterialPattern8(data,p,strTemChild);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//轻质隔墙材料
|
||
void CTArchSettingEditTools::ImportMaterialPattern1(const CXMLNodeInfoEx& data,TDbConfig *pConfig,const CString &strName)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (strName == _T("标准填充样式"))
|
||
{
|
||
pConfig->SetHatchDivider(data.m_strNodeValue, FALSE);
|
||
}
|
||
else if (strName == _T("详图填充方式"))
|
||
{
|
||
int n = GetIndex(data,strAttri);
|
||
if (n==1)
|
||
{
|
||
pConfig->SetDividerLineHatch(TRUE);
|
||
}
|
||
else
|
||
{
|
||
pConfig->SetDividerLineHatch(FALSE);
|
||
}
|
||
}
|
||
else if (strName == _T("详图填充样式"))
|
||
{
|
||
pConfig->SetHatchDivider(data.m_strNodeValue, TRUE);
|
||
}
|
||
else if (strName == _T("填充颜色"))
|
||
{
|
||
int nColor;
|
||
#ifdef UNICODE
|
||
nColor = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nColor = atoi(data.m_strNodeValue);
|
||
#endif
|
||
pConfig->SetDividerColor(nColor);
|
||
}
|
||
else if (strName == _T("标准线宽"))
|
||
{
|
||
pConfig->SetBoldDivider(_tstof(data.m_strNodeValue), FALSE);
|
||
}
|
||
else if (strName == _T("详图线宽"))
|
||
{
|
||
pConfig->SetBoldDivider(_tstof(data.m_strNodeValue), TRUE);
|
||
}
|
||
}
|
||
//填充墙材料
|
||
void CTArchSettingEditTools::ImportMaterialPattern2(const CXMLNodeInfoEx& data,TDbConfig *pConfig,const CString &strName)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (strName == _T("标准填充样式"))
|
||
{
|
||
pConfig->SetHatchFill(data.m_strNodeValue, FALSE);
|
||
}
|
||
else if (strName == _T("详图填充方式"))
|
||
{
|
||
int n = GetIndex(data,strAttri);
|
||
if (n==1)
|
||
{
|
||
pConfig->SetFillLineHatch(TRUE);
|
||
}
|
||
else
|
||
{
|
||
pConfig->SetFillLineHatch(FALSE);
|
||
}
|
||
}
|
||
else if (strName == _T("详图填充样式"))
|
||
{
|
||
pConfig->SetHatchFill(data.m_strNodeValue, TRUE);
|
||
}
|
||
else if (strName == _T("填充颜色"))
|
||
{
|
||
int nColor;
|
||
#ifdef UNICODE
|
||
nColor = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nColor = atoi(data.m_strNodeValue);
|
||
#endif
|
||
pConfig->SetFillColor(nColor);
|
||
}
|
||
else if (strName == _T("标准线宽"))
|
||
{
|
||
pConfig->SetBoldFill(_tstof(data.m_strNodeValue), FALSE);
|
||
}
|
||
else if (strName == _T("详图线宽"))
|
||
{
|
||
pConfig->SetBoldFill(_tstof(data.m_strNodeValue), TRUE);
|
||
}
|
||
}
|
||
//填充墙1材料
|
||
void CTArchSettingEditTools::ImportMaterialPattern3(const CXMLNodeInfoEx& data,TDbConfig *pConfig,const CString &strName)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (strName == _T("标准填充样式"))
|
||
{
|
||
pConfig->SetHatchFill1(data.m_strNodeValue, FALSE);
|
||
}
|
||
else if (strName == _T("详图填充方式"))
|
||
{
|
||
int n = GetIndex(data,strAttri);
|
||
if (n==1)
|
||
{
|
||
pConfig->SetFill1LineHatch(TRUE);
|
||
}
|
||
else
|
||
{
|
||
pConfig->SetFill1LineHatch(FALSE);
|
||
}
|
||
}
|
||
else if (strName == _T("详图填充样式"))
|
||
{
|
||
pConfig->SetHatchFill1(data.m_strNodeValue, TRUE);
|
||
}
|
||
else if (strName == _T("填充颜色"))
|
||
{
|
||
int nColor;
|
||
#ifdef UNICODE
|
||
nColor = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nColor = atoi(data.m_strNodeValue);
|
||
#endif
|
||
pConfig->SetFill1Color(nColor);
|
||
}
|
||
else if (strName == _T("标准线宽"))
|
||
{
|
||
pConfig->SetBoldFill1(_tstof(data.m_strNodeValue), FALSE);
|
||
}
|
||
else if (strName == _T("详图线宽"))
|
||
{
|
||
pConfig->SetBoldFill1(_tstof(data.m_strNodeValue), TRUE);
|
||
}
|
||
}
|
||
//填充墙2材料
|
||
void CTArchSettingEditTools::ImportMaterialPattern4(const CXMLNodeInfoEx& data,TDbConfig *pConfig,const CString &strName)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (strName == _T("标准填充样式"))
|
||
{
|
||
pConfig->SetHatchFill2(data.m_strNodeValue, FALSE);
|
||
}
|
||
else if (strName == _T("详图填充方式"))
|
||
{
|
||
int n = GetIndex(data,strAttri);
|
||
if (n==1)
|
||
{
|
||
pConfig->SetFill2LineHatch(TRUE);
|
||
}
|
||
else
|
||
{
|
||
pConfig->SetFill2LineHatch(FALSE);
|
||
}
|
||
}
|
||
else if (strName == _T("详图填充样式"))
|
||
{
|
||
pConfig->SetHatchFill2(data.m_strNodeValue, TRUE);
|
||
}
|
||
else if (strName == _T("填充颜色"))
|
||
{
|
||
int nColor;
|
||
#ifdef UNICODE
|
||
nColor = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nColor = atoi(data.m_strNodeValue);
|
||
#endif
|
||
pConfig->SetFill2Color(nColor);
|
||
}
|
||
else if (strName == _T("标准线宽"))
|
||
{
|
||
pConfig->SetBoldFill2(_tstof(data.m_strNodeValue), FALSE);
|
||
}
|
||
else if (strName == _T("详图线宽"))
|
||
{
|
||
pConfig->SetBoldFill2(_tstof(data.m_strNodeValue), TRUE);
|
||
}
|
||
}
|
||
//砖墙柱材料
|
||
void CTArchSettingEditTools::ImportMaterialPattern5(const CXMLNodeInfoEx& data,TDbConfig *pConfig,const CString &strName)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (strName == _T("标准填充样式"))
|
||
{
|
||
pConfig->SetHatchBrick(data.m_strNodeValue, FALSE);
|
||
}
|
||
else if (strName == _T("详图填充方式"))
|
||
{
|
||
int n = GetIndex(data,strAttri);
|
||
if (n==1)
|
||
{
|
||
pConfig->SetBrickLineHatch(TRUE);
|
||
}
|
||
else
|
||
{
|
||
pConfig->SetBrickLineHatch(FALSE);
|
||
}
|
||
}
|
||
else if (strName == _T("详图填充样式"))
|
||
{
|
||
pConfig->SetHatchBrick(data.m_strNodeValue, TRUE);
|
||
}
|
||
else if (strName == _T("填充颜色"))
|
||
{
|
||
int nColor;
|
||
#ifdef UNICODE
|
||
nColor = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nColor = atoi(data.m_strNodeValue);
|
||
#endif
|
||
pConfig->SetBrickColor(nColor);
|
||
}
|
||
else if (strName == _T("标准线宽"))
|
||
{
|
||
pConfig->SetBoldBrick(_tstof(data.m_strNodeValue), FALSE);
|
||
}
|
||
else if (strName == _T("详图线宽"))
|
||
{
|
||
pConfig->SetBoldBrick(_tstof(data.m_strNodeValue), TRUE);
|
||
}
|
||
}
|
||
//石墙柱材料
|
||
void CTArchSettingEditTools::ImportMaterialPattern6(const CXMLNodeInfoEx& data,TDbConfig *pConfig,const CString &strName)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (strName == _T("标准填充样式"))
|
||
{
|
||
pConfig->SetHatchRocket(data.m_strNodeValue, FALSE);
|
||
}
|
||
else if (strName == _T("详图填充方式"))
|
||
{
|
||
int n = GetIndex(data,strAttri);
|
||
if (n==1)
|
||
{
|
||
pConfig->SetRocketLineHatch(TRUE);
|
||
}
|
||
else
|
||
{
|
||
pConfig->SetRocketLineHatch(FALSE);
|
||
}
|
||
}
|
||
else if (strName == _T("详图填充样式"))
|
||
{
|
||
pConfig->SetHatchRocket(data.m_strNodeValue, TRUE);
|
||
}
|
||
else if (strName == _T("填充颜色"))
|
||
{
|
||
int nColor;
|
||
#ifdef UNICODE
|
||
nColor = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nColor = atoi(data.m_strNodeValue);
|
||
#endif
|
||
pConfig->SetRocketColor(nColor);
|
||
}
|
||
else if (strName == _T("标准线宽"))
|
||
{
|
||
pConfig->SetBoldRocket(_tstof(data.m_strNodeValue), FALSE);
|
||
}
|
||
else if (strName == _T("详图线宽"))
|
||
{
|
||
pConfig->SetBoldRocket(_tstof(data.m_strNodeValue), TRUE);
|
||
}
|
||
}
|
||
//钢筋混凝土
|
||
void CTArchSettingEditTools::ImportMaterialPattern7(const CXMLNodeInfoEx& data,TDbConfig *pConfig,const CString &strName)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (strName == _T("标准填充样式"))
|
||
{
|
||
pConfig->SetHatchConcrete(data.m_strNodeValue, FALSE);
|
||
}
|
||
else if (strName == _T("详图填充方式"))
|
||
{
|
||
int n = GetIndex(data,strAttri);
|
||
if (n==1)
|
||
{
|
||
pConfig->SetConcreteLineHatch(TRUE);
|
||
}
|
||
else
|
||
{
|
||
pConfig->SetConcreteLineHatch(FALSE);
|
||
}
|
||
}
|
||
else if (strName == _T("详图填充样式"))
|
||
{
|
||
pConfig->SetHatchConcrete(data.m_strNodeValue, TRUE);
|
||
}
|
||
else if (strName == _T("填充颜色"))
|
||
{
|
||
int nColor;
|
||
#ifdef UNICODE
|
||
nColor = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nColor = atoi(data.m_strNodeValue);
|
||
#endif
|
||
pConfig->SetConcreteColor(nColor);
|
||
}
|
||
else if (strName == _T("标准线宽"))
|
||
{
|
||
pConfig->SetBoldConcrete(_tstof(data.m_strNodeValue), FALSE);
|
||
}
|
||
else if (strName == _T("详图线宽"))
|
||
{
|
||
pConfig->SetBoldConcrete(_tstof(data.m_strNodeValue), TRUE);
|
||
}
|
||
}
|
||
//刚柱
|
||
void CTArchSettingEditTools::ImportMaterialPattern8(const CXMLNodeInfoEx& data,TDbConfig *pConfig,const CString &strName)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (strName == _T("标准填充样式"))
|
||
{
|
||
pConfig->SetHatchSteel(data.m_strNodeValue, FALSE);
|
||
}
|
||
else if (strName == _T("详图填充方式"))
|
||
{
|
||
int n = GetIndex(data,strAttri);
|
||
if (n==1)
|
||
{
|
||
pConfig->SetSteelLineHatch(TRUE);
|
||
}
|
||
else
|
||
{
|
||
pConfig->SetSteelLineHatch(FALSE);
|
||
}
|
||
}
|
||
else if (strName == _T("详图填充样式"))
|
||
{
|
||
pConfig->SetHatchSteel(data.m_strNodeValue, TRUE);
|
||
}
|
||
else if (strName == _T("填充颜色"))
|
||
{
|
||
int nColor;
|
||
#ifdef UNICODE
|
||
nColor = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nColor = atoi(data.m_strNodeValue);
|
||
#endif
|
||
pConfig->SetSteelColor(nColor);
|
||
}
|
||
else if (strName == _T("标准线宽"))
|
||
{
|
||
pConfig->SetBoldSteel(_tstof(data.m_strNodeValue), FALSE);
|
||
}
|
||
else if (strName == _T("详图线宽"))
|
||
{
|
||
pConfig->SetBoldSteel(_tstof(data.m_strNodeValue), TRUE);
|
||
}
|
||
}
|
||
|
||
//导入高级选项内容
|
||
void CTArchSettingEditTools::ImportAdvancedSet(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
//XString sFullFile;
|
||
//if (!FindFile(_T("config.ini"), sFullFile))
|
||
//{
|
||
// //AfxMessageBox(_T("\n找不到'config.ini'文件!"));
|
||
// return;
|
||
//}
|
||
//WDict dictCur;
|
||
//dictCur.ReadFile(sFullFile);//读入当前配置
|
||
XString sFullFileDef;
|
||
if (!FindFile(_T("config.def"), sFullFileDef))
|
||
{
|
||
AfxMessageBox(_T("\n找不到'config.def'文件!"));
|
||
return;
|
||
}
|
||
|
||
XString sFullFile;
|
||
if (!FindFile(_T("config.ini"), sFullFile))
|
||
{
|
||
AfxMessageBox(_T("\n找不到'config.ini'文件!"));
|
||
return;
|
||
}
|
||
//m_sFilePath = sFullFile;
|
||
WDict dictCur;
|
||
WDict dictCfg;
|
||
dictCfg.ReadFile(sFullFileDef);//读入标配
|
||
dictCur.ReadFile(sFullFile);//读入当前配置
|
||
if (dictCur.m_sDesc!=dictCfg.m_sDesc)//配置版本不同
|
||
dictCfg.CopyData(dictCur);//将当前配置尽量复制过来
|
||
else
|
||
{
|
||
dictCfg.Clear();
|
||
dictCfg.Conbine(dictCur);//直接使用当前配置
|
||
}
|
||
int nLen = aryData.GetLength();
|
||
int i=0;
|
||
for (i=0;i<nLen;i++)
|
||
{
|
||
CXMLNodeInfoEx nodeInfo = aryData.GetAt(i);
|
||
CString strPath = nodeInfo.m_strNodeXPath;
|
||
int nPos = -1;
|
||
nPos = strPath.Find(_T("/"),0);
|
||
if (nPos!=-1)
|
||
{
|
||
int nNum = strPath.Find(_T("/"),nPos+1);
|
||
strPath.Delete(nPos,nNum-nPos);
|
||
nNum = strPath.Find(_T("/"),nPos+1);
|
||
strPath.Delete(nPos,nNum-nPos);
|
||
}
|
||
strPath.Delete(0);
|
||
/*while (nPos!=-1)
|
||
{
|
||
nPos = nPos+1;
|
||
nPos = strPath.Find(_T("/"),nPos);
|
||
if (nPos!=-1)
|
||
{
|
||
strPath.Delete(nPos);
|
||
strPath.Insert(nPos,_T("\\"));
|
||
}
|
||
}*/
|
||
WDictItem* pItem = NULL;
|
||
//WDictItem* pItem = NULL;
|
||
/*CString strPathA = _T("系统参数配置\\")+strPath;*/
|
||
//WDictPath path(strPath),path1(strPath);//模块更新后改为strpath查询
|
||
//path1.Clear();
|
||
//for(long i=0;i<path.GetLength();i++)
|
||
//{
|
||
// if (i<path.GetLastIndex())
|
||
// path1.AddTail(new WDict(path(i).m_sName));
|
||
// else
|
||
// path1.AddTail(new WDictItem(path(i).m_sName));
|
||
//}
|
||
strPath.Replace(_T("/"),_T("\\"));
|
||
pItem = dictCfg.FindItem(strPath);
|
||
// CString sPath=_T("轴线\\轴线出头");
|
||
// WDictItem *pIte1m=dictCfg.FindItem(sPath);
|
||
if (pItem)
|
||
{
|
||
int nType = pItem->GetType();
|
||
switch (pItem->GetType())
|
||
{
|
||
case TYPE_WBoolItem:
|
||
{
|
||
bool bData = false;
|
||
int nIndex = GetIndex(nodeInfo,_T("options"));
|
||
if (nIndex ==0)
|
||
{
|
||
bData = true;
|
||
}
|
||
dictCfg.SetValue(strPath,bData);
|
||
}
|
||
break;
|
||
case TYPE_WCharItem:
|
||
dictCfg.SetValue(strPath,nodeInfo.m_strNodeValue);
|
||
break;
|
||
case TYPE_WLongItem:
|
||
{
|
||
#ifdef UNICODE
|
||
dictCfg.SetValue(strPath,_wtoi(nodeInfo.m_strNodeValue));
|
||
#else
|
||
dictCfg.SetValue(strPath,atoi(nodeInfo.m_strNodeValue));
|
||
#endif
|
||
}
|
||
break;
|
||
case TYPE_WDoubleItem:
|
||
dictCfg.SetValue(strPath,_tstof(nodeInfo.m_strNodeValue));
|
||
break;
|
||
case TYPE_WCStringItem:
|
||
dictCfg.SetValue(strPath,nodeInfo.m_strNodeValue);
|
||
break;
|
||
case TYPE_WSelectItem:
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,_T("options"));
|
||
if (nIndex>=0)
|
||
{
|
||
unsigned int nSet = nIndex;
|
||
dictCfg.SetValue(strPath,nSet);
|
||
}
|
||
}
|
||
break;
|
||
default :
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
dictCfg.WriteFile(sFullFile);//写入ini
|
||
}
|
||
|
||
void CTArchSettingEditTools::ImportScreenMenu(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
int nLen = aryData.GetLength();
|
||
int i=0;
|
||
for (;i<nLen;i++)
|
||
{
|
||
CXMLNodeInfoEx data = aryData.GetAt(i);
|
||
SetScreenMenuData(data);
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::SetScreenMenuData(const CXMLNodeInfoEx &data)
|
||
{
|
||
CString strName = data.m_aryNodeAttribute.GetAt(0).second;
|
||
if (strName == _T("显示上华屏幕菜单"))
|
||
{
|
||
int nIndex = GetIndex(data,_T("options"));
|
||
BOOL bScreenMenu;
|
||
if (nIndex==0)
|
||
{
|
||
bScreenMenu = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bScreenMenu = FALSE;
|
||
}
|
||
//ShowScreenMenu(bScreenMenu);
|
||
g_bScreenMenu = bScreenMenu;
|
||
}
|
||
else if (strName == _T("设置菜单风格"))
|
||
{
|
||
int nIndex = GetIndex(data,_T("options"));
|
||
BOOL bLimitHeight;
|
||
if (nIndex==0)
|
||
{
|
||
bLimitHeight = FALSE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bLimitHeight = TRUE;
|
||
}
|
||
g_bLimitHeight = bLimitHeight;
|
||
}
|
||
else if (strName == _T("屏幕高度设置"))
|
||
{
|
||
int nIndex = GetIndex(data,_T("options"));
|
||
BOOL bScrollBar;
|
||
if (nIndex==0)
|
||
{
|
||
bScrollBar = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bScrollBar = FALSE;
|
||
}
|
||
g_bScrollBar = bScrollBar;
|
||
}
|
||
else if (strName == _T("自动展开第一个子菜单目录"))
|
||
{
|
||
int nIndex = GetIndex(data,_T("options"));
|
||
BOOL bAutoOpenFirst;
|
||
if (nIndex==0)
|
||
{
|
||
bAutoOpenFirst = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bAutoOpenFirst = FALSE;
|
||
}
|
||
g_bDefaultOpenFirst = bAutoOpenFirst;
|
||
}
|
||
else if (strName == _T("第一层"))
|
||
{
|
||
int nMenuBKColor1;
|
||
#ifdef UNICODE
|
||
nMenuBKColor1 = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nMenuBKColor1 = atoi(data.m_strNodeValue);
|
||
#endif
|
||
g_menuColors[0] = nMenuBKColor1;
|
||
}
|
||
else if (strName == _T("第二层"))
|
||
{
|
||
int nMenuBKColor2;
|
||
#ifdef UNICODE
|
||
nMenuBKColor2 = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nMenuBKColor2 = atoi(data.m_strNodeValue);
|
||
#endif
|
||
g_menuColors[1] = nMenuBKColor2;
|
||
}
|
||
else if (strName == _T("第三层"))
|
||
{
|
||
int nMenuBKColor3;
|
||
#ifdef UNICODE
|
||
nMenuBKColor3 = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nMenuBKColor3 = atoi(data.m_strNodeValue);
|
||
#endif
|
||
g_menuColors[2] = nMenuBKColor3;
|
||
}
|
||
else if (strName == _T("第四层"))
|
||
{
|
||
int nMenuBKColor4;
|
||
#ifdef UNICODE
|
||
nMenuBKColor4 = _wtoi(data.m_strNodeValue);
|
||
#else
|
||
nMenuBKColor4 = atoi(data.m_strNodeValue);
|
||
#endif
|
||
g_menuColors[4] = nMenuBKColor4;
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::ImportToolBar(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
CString strValue = aryData.GetAt(0).m_strNodeValue;
|
||
CStringArray aryStrValue;
|
||
DevideStr(strValue,aryStrValue);
|
||
CodeBase db;
|
||
XString xsDbfFile;
|
||
if (!FindFile(_T("tchdata.dbf"),xsDbfFile)) {
|
||
return;
|
||
}
|
||
CString csCmd, csName, csDescribe, csIcon, csType;
|
||
XDbfTable *pTable = db.Open(xsDbfFile);
|
||
if (pTable) {
|
||
pTable->MoveFirst();
|
||
while(!pTable->IsEOF()) {
|
||
GET_FIELD(pTable, _T("chacmd"), csName);
|
||
// Zyu modify on 100722,支持64位
|
||
//int len = aryStrValue.GetSize();
|
||
INT_PTR len = aryStrValue.GetSize();
|
||
int iHit(0);
|
||
for(int i=0;i<len;i++){
|
||
CString csSel = aryStrValue.GetAt(i);
|
||
if (csName == csSel){
|
||
iHit = i+2;
|
||
break;
|
||
}
|
||
}
|
||
SET_FIELD(pTable, _T("flag"), iHit);
|
||
pTable->MoveNext();
|
||
}
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::ImportHotKeySet(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
NodeInfoAry aryInfo = aryData;
|
||
NodeInfoAry aryPopularHotKey;
|
||
int nLen = aryInfo.GetLength();
|
||
int i=0;
|
||
for (i=0;i<nLen;i++)
|
||
{
|
||
CXMLNodeInfoEx nodeInfo = aryInfo.GetAt(i);
|
||
if (nodeInfo.m_aryNodeAttribute.GetLength()>0)
|
||
{
|
||
if (nodeInfo.m_aryNodeAttribute[0].second == _T("一键快捷"))//一键快捷表格
|
||
{
|
||
CStringArray aryStrCmd,aryStrComment,aryStrValue;
|
||
if (nodeInfo.m_aryNodeAttribute.GetLength()>=3)
|
||
{
|
||
DevideStr(nodeInfo.m_aryNodeAttribute.GetAt(1).second,aryStrCmd);
|
||
DevideStr(nodeInfo.m_aryNodeAttribute.GetAt(2).second,aryStrComment);
|
||
DevideStr(nodeInfo.m_strNodeValue,aryStrValue);
|
||
// Zyu modify on 100722,支持64位
|
||
//int nLen = aryStrCmd.GetSize();
|
||
int nLencmd = (int)aryStrCmd.GetSize();
|
||
int nLenComment = (int)aryStrComment.GetSize();
|
||
int nLenValue = (int)aryStrValue.GetSize();
|
||
int nMinLen = Minimum(3, nLencmd, nLenValue, nLenComment);
|
||
if (nLencmd != nMinLen || nLencmd != nMinLen || nLenValue != nMinLen)
|
||
{
|
||
AfxMessageBox(_T("XML文件数据错误,请仔细检查读取结果!"));
|
||
}
|
||
|
||
int j=0;
|
||
g_KeyMapTable.Clear();
|
||
for(j=0;j<nMinLen;j++)
|
||
{
|
||
TKeyMap *pMap = new TKeyMap;
|
||
// lgh modify。替换其中的特殊字符,还原为空字符。
|
||
pMap->sKey = ReplaceBlankBack(aryStrValue.GetAt(j));
|
||
pMap->sCommand = ReplaceBlankBack(aryStrCmd.GetAt(j));
|
||
pMap->sNote =ReplaceBlankBack(aryStrComment.GetAt(j));
|
||
g_KeyMapTable.AddTail(*pMap);
|
||
}
|
||
g_KeyMapTable.WriteShortCutKey();
|
||
}
|
||
}
|
||
else if (nodeInfo.m_aryNodeAttribute[0].second == _T("启用快捷键"))//
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,_T("options"));
|
||
if (nIndex ==0)
|
||
{
|
||
g_bEnableShortCut = TRUE;
|
||
}
|
||
else
|
||
{
|
||
g_bEnableShortCut = FALSE;
|
||
}
|
||
}
|
||
else//普通快捷键
|
||
{
|
||
aryPopularHotKey.AddTail(nodeInfo);
|
||
}
|
||
}
|
||
}
|
||
if (aryPopularHotKey.GetLength()>0)
|
||
{
|
||
//导入普通快捷键界面
|
||
WritePgp(aryPopularHotKey);
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::WritePgp(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
XString strAcadPgp;
|
||
if (!FindFile(_T("acad.pgp"), strAcadPgp))
|
||
{
|
||
return;
|
||
}
|
||
CStringArray strNoteArray;
|
||
CString sString;
|
||
CStdioFile file;
|
||
if (!file.Open(strAcadPgp, CFile::modeRead))
|
||
{
|
||
AfxMessageBox(CString(_T("打开文件 \"")) + strAcadPgp + _T("\" 失败"));
|
||
return ;
|
||
}
|
||
while(file.ReadString(sString))
|
||
{
|
||
if (sString[0])
|
||
{
|
||
if (sString[0] == _T(';') && sString[1] == _T(';'))
|
||
{
|
||
}
|
||
else if (sString[0] != _T(';'))
|
||
{
|
||
}
|
||
else
|
||
{
|
||
strNoteArray.Add(sString);
|
||
}
|
||
}
|
||
}
|
||
file.Close();
|
||
FILE *fp2 = _tfopen(strAcadPgp, _T("w"));
|
||
if (!fp2)
|
||
return;
|
||
//输出注释
|
||
for(int i = 0; i < strNoteArray.GetSize(); i++)
|
||
{
|
||
_fputts(_T("\n"), fp2);
|
||
_fputts(strNoteArray[i], fp2);
|
||
}
|
||
|
||
//输出类别和命令
|
||
int nLen = aryData.GetLength();
|
||
for (i=0;i<nLen;i++)
|
||
{
|
||
CXMLNodeInfoEx nodeInfo = aryData.GetAt(i);
|
||
if (nodeInfo.m_aryNodeAttribute.GetLength()>=3)
|
||
{
|
||
CString strRowName = nodeInfo.m_aryNodeAttribute.GetAt(0).second;
|
||
CString strTmp = _T("\n\n;;");
|
||
strTmp += strRowName;
|
||
_fputts(strTmp, fp2);
|
||
CStringArray aryStrCmd,aryStrComment,aryStrValue;
|
||
DevideStr(nodeInfo.m_aryNodeAttribute.GetAt(1).second,aryStrCmd);
|
||
DevideStr(nodeInfo.m_aryNodeAttribute.GetAt(2).second,aryStrComment);
|
||
DevideStr(nodeInfo.m_strNodeValue,aryStrValue);
|
||
// Zyu modify on 100722,支持64位
|
||
//int nNum = aryStrValue.GetSize();
|
||
INT_PTR nNum = aryStrValue.GetSize();
|
||
int j=0;
|
||
for (j=0;j<nNum;j++)
|
||
{
|
||
CString strKey = aryStrValue.GetAt(j);
|
||
CString strName= aryStrCmd.GetAt(j);
|
||
CString csTmp = _T("\n")+strKey+_T(", *")+strName;
|
||
|
||
if (!(strKey.IsEmpty() || strName.IsEmpty()))
|
||
_fputts(csTmp, fp2);
|
||
}
|
||
}
|
||
}
|
||
fclose(fp2);
|
||
AfxMessageBox(CString(_T("文件 \"")) + strAcadPgp + _T("\" 已修改,必须重新启动上华软件或\n重新初始化PGP改动才能生效!"));
|
||
}
|
||
|
||
void CTArchSettingEditTools::ImportOtherSet(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
int nLen = aryData.GetLength();
|
||
int i=0;
|
||
for (i=0;i<nLen;i++)
|
||
{
|
||
CXMLNodeInfoEx nodeInfo = aryData.GetAt(i);
|
||
SetFontProperty(nodeInfo);
|
||
}
|
||
}
|
||
|
||
//导入用户操作
|
||
void CTArchSettingEditTools::ImportUserOpreatorSet(const Array<CXMLNodeInfoEx> &aryData)
|
||
{
|
||
int nLen = aryData.GetLength();
|
||
int i=0;
|
||
for (i=0;i<nLen;i++)
|
||
{
|
||
CXMLNodeInfoEx nodeInfo = aryData.GetAt(i);
|
||
SetUserOpreator(nodeInfo);
|
||
}
|
||
}
|
||
void CTArchSettingEditTools::SetUserOpreator(const CXMLNodeInfoEx&nodeInfo)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (nodeInfo.m_aryNodeAttribute.GetLength()>0)
|
||
{
|
||
CString strName = nodeInfo.m_aryNodeAttribute.GetAt(0).second;
|
||
if (strName == _T("启用上华右键快捷菜单"))
|
||
{
|
||
BOOL bShortcutMenu;
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
if (nIndex==0)
|
||
{
|
||
bShortcutMenu = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bShortcutMenu = FALSE;
|
||
}
|
||
if (!bShortcutMenu) g_nSpeedMenu=0;
|
||
}
|
||
else if (strName == _T("空选时右键状态"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
g_nSpeedMenu = nIndex +1;
|
||
if (nIndex==2)
|
||
{
|
||
int nLen = strName.GetLength();
|
||
int nSubIndex = -1;
|
||
int i=0;
|
||
for (i=0;i<nLen;i++)
|
||
{
|
||
if (strName.GetAt(i)>=30&&strName.GetAt(i)<=39)
|
||
{
|
||
nSubIndex=i;
|
||
break;
|
||
}
|
||
}
|
||
if (nSubIndex!=-1)
|
||
{
|
||
CString strNum = strName.Mid(nSubIndex,nLen-nSubIndex);
|
||
#ifdef UNICODE
|
||
g_nRBtnMenuTime = _wtoi(strNum);
|
||
#else
|
||
g_nRBtnMenuTime = atoi(strNum);
|
||
#endif
|
||
}
|
||
}
|
||
}
|
||
else if (strName==_T("启用放大缩小热键"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
BOOL bZoomKey;
|
||
if (nIndex==0)
|
||
{
|
||
bZoomKey = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bZoomKey = FALSE;
|
||
}
|
||
g_bZoomKey = bZoomKey;
|
||
}
|
||
else if (strName==_T("启用选择预览"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
BOOL bZoomKey;
|
||
if (nIndex==0)
|
||
{
|
||
bZoomKey = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bZoomKey = FALSE;
|
||
}
|
||
g_bEnableSelectPreview = bZoomKey;
|
||
}
|
||
else if (strName==_T("自动恢复十字光标"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
BOOL bZoomKey;
|
||
if (nIndex==0)
|
||
{
|
||
bZoomKey = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bZoomKey = FALSE;
|
||
}
|
||
g_bAutoFocus = bZoomKey;
|
||
}
|
||
else if (strName==_T("启动时自动加载最近使用的工程环境"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
BOOL bZoomKey;
|
||
if (nIndex==0)
|
||
{
|
||
bZoomKey = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bZoomKey = FALSE;
|
||
}
|
||
g_bAutoOpenRecent = bZoomKey;
|
||
}
|
||
else if (strName==_T("动态拖动绘制时使用模数"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
BOOL bZoomKey;
|
||
if (nIndex==0)
|
||
{
|
||
bZoomKey = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bZoomKey = FALSE;
|
||
}
|
||
g_bModelNumber = bZoomKey;
|
||
}
|
||
else if (strName==_T("墙体"))
|
||
{
|
||
g_nWallStep = _tstof(nodeInfo.m_strNodeValue);
|
||
}
|
||
else if (strName==_T("门窗"))
|
||
{
|
||
g_nWinStep = _tstof(nodeInfo.m_strNodeValue);
|
||
}
|
||
else if (strName==_T("虚拟漫游距离步长"))
|
||
{
|
||
double nTempVal=_tstof(nodeInfo.m_strNodeValue);
|
||
if (nTempVal>_DIST_SNAP)
|
||
g_nWalkDistStep=nTempVal;
|
||
}
|
||
else if (strName==_T("角度步长"))
|
||
{
|
||
double nTempVal=_tstof(nodeInfo.m_strNodeValue);
|
||
nTempVal *= PI/180.0;
|
||
if (nTempVal>_angSnap)
|
||
g_nWalkAngleStep=nTempVal;
|
||
}
|
||
}
|
||
}
|
||
|
||
void CTArchSettingEditTools::SetFontProperty(const CXMLNodeInfoEx&nodeInfo)
|
||
{
|
||
CString strAttri = _T("options");
|
||
if (nodeInfo.m_aryNodeAttribute.GetLength()>0)
|
||
{
|
||
CString strName = nodeInfo.m_aryNodeAttribute.GetAt(0).second;
|
||
/*if (strName == _T("启用上华右键快捷菜单"))
|
||
{
|
||
BOOL bShortcutMenu;
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
if (nIndex==0)
|
||
{
|
||
bShortcutMenu = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bShortcutMenu = FALSE;
|
||
}
|
||
if (!bShortcutMenu) g_nSpeedMenu=0;
|
||
}
|
||
else if (strName == _T("空选时右键状态"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
g_nSpeedMenu = nIndex +1;
|
||
if (nIndex==2)
|
||
{
|
||
int nLen = strName.GetLength();
|
||
int nSubIndex = -1;
|
||
int i=0;
|
||
for (i=0;i<nLen;i++)
|
||
{
|
||
if (strName.GetAt(i)>=30&&strName.GetAt(i)<=39)
|
||
{
|
||
nSubIndex=i;
|
||
break;
|
||
}
|
||
}
|
||
if (nSubIndex!=-1)
|
||
{
|
||
CString strNum = strName.Mid(nSubIndex,nLen-nSubIndex);
|
||
#ifdef UNICODE
|
||
g_nRBtnMenuTime = _wtoi(strNum);
|
||
#else
|
||
g_nRBtnMenuTime = atoi(strNum);
|
||
#endif
|
||
}
|
||
}
|
||
}
|
||
else if (strName==_T("启用放大缩小热键"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
BOOL bZoomKey;
|
||
if (nIndex==0)
|
||
{
|
||
bZoomKey = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bZoomKey = FALSE;
|
||
}
|
||
g_bZoomKey = bZoomKey;
|
||
}else */
|
||
if (strName==_T("启用文档标签"))
|
||
{
|
||
int nIndex = GetIndex(nodeInfo,strAttri);
|
||
BOOL bDwgTabBar;
|
||
if (nIndex==0)
|
||
{
|
||
bDwgTabBar = TRUE;
|
||
}
|
||
else if (nIndex == 1)
|
||
{
|
||
bDwgTabBar = FALSE;
|
||
}
|
||
g_bDwgTabBar = bDwgTabBar;
|
||
}
|
||
else if (strName==_T("字体颜色"))
|
||
{
|
||
//g_colorInPlaceText =
|
||
//m_cFontCol.SetWindowText(nodeInfo.m_strNodeValue);
|
||
#ifdef UNICODE
|
||
g_colorInPlaceText = _wtoi(nodeInfo.m_strNodeValue);
|
||
#else
|
||
g_colorInPlaceText = atoi(nodeInfo.m_strNodeValue);
|
||
#endif
|
||
}
|
||
else if (strName==_T("背景颜色"))
|
||
{
|
||
#ifdef UNICODE
|
||
g_colorInPlaceGround = _wtoi(nodeInfo.m_strNodeValue);
|
||
#else
|
||
g_colorInPlaceGround = atoi(nodeInfo.m_strNodeValue);
|
||
#endif
|
||
}
|
||
else if (strName==_T("字体高度"))
|
||
{
|
||
#ifdef UNICODE
|
||
g_iInPlaceFontHeight = _wtoi(nodeInfo.m_strNodeValue);
|
||
#else
|
||
g_iInPlaceFontHeight = atoi(nodeInfo.m_strNodeValue);
|
||
#endif
|
||
}
|
||
}
|
||
} |