using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using WW.Cad.IO;
|
using WW.Cad.Model.Entities;
|
using WW.Math;
|
|
namespace Eventech.PumpGraph.Dxf
|
{
|
//来源连成 (面板分开, 只要流量扬程, 流量功率,流量汽蚀 )
|
public partial class LxpFeatChart10 : LxpFeatChart_Split
|
{
|
public LxpFeatChart10()
|
{
|
_subGridLineNumber = 5;
|
}
|
|
#region 设置
|
|
public override bool SetFeatureCurveSimu(
|
Eventech.Model.LxpFeatChartCurveGroup maxCurveGroup,
|
Eventech.Model.LxpFeatChartCurveGroup workWaterCurveGroup,
|
Eventech.Model.LxpFeatChartCurveGroup workJieZhiCurveGroup,
|
Eventech.Model.LxpFeatChartCurveGroup minCurveGroup)
|
{
|
if (maxCurveGroup == null || maxCurveGroup.FeatCurveQH == null)
|
{
|
workWaterCurveGroup.FeatCurveQH.IsDispName = false;
|
return AddFeatureCurveSimu(workWaterCurveGroup, workJieZhiCurveGroup, true);
|
}
|
if (workWaterCurveGroup == null || workWaterCurveGroup.FeatCurveQH == null)
|
{
|
maxCurveGroup.FeatCurveQH.IsDispName = false;
|
return AddFeatureCurveSimu(maxCurveGroup, workJieZhiCurveGroup, true);
|
}
|
|
if (this._allCurveQH == null)
|
this._allCurveQH = new List<Model.CurveDispParasEx>();
|
if (this._allCurveQE == null)
|
this._allCurveQE = new List<Model.CurveDispParasEx>();
|
if (this._allCurveQP == null)
|
this._allCurveQP = new List<Model.CurveDispParasEx>();
|
if (this._allCurveNPSH == null)
|
this._allCurveNPSH = new List<Model.CurveDispParasEx>();
|
|
var defaultCurveColor = System.Drawing.Color.FromArgb(255, 255, 255);
|
|
bool isJieZhiCurveGrp = false;
|
if (workWaterCurveGroup != null && workJieZhiCurveGroup != null)
|
{
|
if (workWaterCurveGroup.FeatCurveQH != null && workJieZhiCurveGroup.FeatCurveQH != null)
|
{
|
if (!workWaterCurveGroup.FeatCurveQH.CurveExpress.IsEquals(workJieZhiCurveGroup.FeatCurveQH.CurveExpress))
|
isJieZhiCurveGrp = true;
|
}
|
}
|
|
if (!isJieZhiCurveGrp)
|
{//没有黏度曲线
|
#region 没有黏度曲线
|
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = maxCurveGroup.FeatCurveQH.CurveExpress,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurveName = maxCurveGroup.CurveName,
|
CurvePara = maxCurveGroup.CurvePara,
|
LabelPosiPara = maxCurveGroup.FeatCurveQH.LabelPosiPara
|
});
|
|
if (Math.Abs(maxCurveGroup.FeatCurveQH.CurveExpress.Index0 - workWaterCurveGroup.FeatCurveQH.CurveExpress.Index0) > 0.05)
|
{
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = workWaterCurveGroup.FeatCurveQH.CurveExpress,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = workWaterCurveGroup.CurvePara,
|
LabelPosiPara = workWaterCurveGroup.FeatCurveQH.LabelPosiPara
|
});
|
}
|
|
if (minCurveGroup != null)
|
{
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = minCurveGroup.FeatCurveQH.CurveExpress,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurveName = minCurveGroup.CurveName,
|
CurvePara = minCurveGroup.CurvePara,
|
LabelPosiPara = minCurveGroup.FeatCurveQH.LabelPosiPara
|
});
|
}
|
|
this._allCurveQE.Add(new Model.CurveDispParasEx() { CurveExpress = workWaterCurveGroup.FeatCurveQE.CurveExpress, CurveColor = defaultCurveColor });
|
this._allCurveQP.Add(new Model.CurveDispParasEx() { CurveExpress = workWaterCurveGroup.FeatCurveQP.CurveExpress, CurveColor = defaultCurveColor });
|
|
//不要工作汽蚀曲线,双达特殊要求
|
if (maxCurveGroup.FeatCurveNPSH != null && maxCurveGroup.FeatCurveNPSH.CurveExpress != null)
|
{
|
this._allCurveNPSH.Add(new Model.CurveDispParasEx() { CurveExpress = maxCurveGroup.FeatCurveNPSH.CurveExpress, CurveColor = defaultCurveColor });
|
}
|
if (minCurveGroup != null)
|
{
|
if (minCurveGroup.FeatCurveNPSH != null && minCurveGroup.FeatCurveNPSH.CurveExpress != null)
|
{
|
this._allCurveNPSH.Add(new Model.CurveDispParasEx() { CurveExpress = minCurveGroup.FeatCurveNPSH.CurveExpress, CurveColor = defaultCurveColor });
|
}
|
}
|
|
#endregion 没有黏度曲线
|
}
|
else
|
{
|
#region 有黏度曲线
|
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = maxCurveGroup.FeatCurveQH.CurveExpress,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurveName = maxCurveGroup.CurveName,
|
CurvePara = maxCurveGroup.CurvePara,
|
LabelPosiPara = maxCurveGroup.FeatCurveQH.LabelPosiPara
|
});
|
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = workJieZhiCurveGroup.FeatCurveQH.CurveExpress,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurveName = workJieZhiCurveGroup.CurveName,
|
CurvePara = workJieZhiCurveGroup.CurvePara,
|
LabelPosiPara = workJieZhiCurveGroup.FeatCurveQH.LabelPosiPara
|
});
|
|
if (Math.Abs(maxCurveGroup.FeatCurveQH.CurveExpress.Index0 - workWaterCurveGroup.FeatCurveQH.CurveExpress.Index0) > 0.05)
|
{
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = workWaterCurveGroup.FeatCurveQH.CurveExpress,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = workWaterCurveGroup.CurvePara,
|
LabelPosiPara = workWaterCurveGroup.FeatCurveQH.LabelPosiPara
|
});
|
}
|
|
if (minCurveGroup != null)
|
{
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = minCurveGroup.FeatCurveQH.CurveExpress,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurveName = minCurveGroup.CurveName,
|
CurvePara = minCurveGroup.CurvePara,
|
LabelPosiPara = minCurveGroup.FeatCurveQH.LabelPosiPara
|
});
|
}
|
|
this._allCurveQE.Add(new Model.CurveDispParasEx() { CurveExpress = workJieZhiCurveGroup.FeatCurveQE.CurveExpress, CurveColor = defaultCurveColor });
|
this._allCurveQP.Add(new Model.CurveDispParasEx() { CurveExpress = workJieZhiCurveGroup.FeatCurveQP.CurveExpress, CurveColor = defaultCurveColor });
|
|
//不要工作汽蚀曲线,双达特殊要求
|
if (maxCurveGroup.FeatCurveNPSH != null && maxCurveGroup.FeatCurveNPSH.CurveExpress != null)
|
{
|
this._allCurveNPSH.Add(new Model.CurveDispParasEx() { CurveExpress = maxCurveGroup.FeatCurveNPSH.CurveExpress, CurveColor = defaultCurveColor });
|
}
|
if (minCurveGroup != null)
|
{
|
if (minCurveGroup.FeatCurveNPSH != null && minCurveGroup.FeatCurveNPSH.CurveExpress != null)
|
{
|
this._allCurveNPSH.Add(new Model.CurveDispParasEx() { CurveExpress = minCurveGroup.FeatCurveNPSH.CurveExpress, CurveColor = defaultCurveColor });
|
}
|
}
|
|
#endregion 有黏度曲线
|
}
|
|
return true;
|
}
|
|
public override bool SetFeatureCurveSimu(
|
Eventech.Model.LxpCurveGroupExpress maxCurveGroup,
|
Eventech.Model.LxpCurveGroupExpress workWaterCurveGroup,
|
Eventech.Model.LxpCurveGroupExpress workJieZhiCurveGroup,
|
Eventech.Model.LxpCurveGroupExpress minCurveGroup)
|
{
|
if (maxCurveGroup == null || maxCurveGroup.CurveExpressQH == null)
|
{
|
return SetFeatureCurveBaoLuo(workWaterCurveGroup, workJieZhiCurveGroup, false);
|
}
|
if (workWaterCurveGroup == null || workWaterCurveGroup.CurveExpressQH == null)
|
{
|
return SetFeatureCurveBaoLuo(maxCurveGroup, workJieZhiCurveGroup, false);
|
}
|
|
if (this._allCurveQH == null)
|
this._allCurveQH = new List<Model.CurveDispParasEx>();
|
if (this._allCurveQE == null)
|
this._allCurveQE = new List<Model.CurveDispParasEx>();
|
if (this._allCurveQP == null)
|
this._allCurveQP = new List<Model.CurveDispParasEx>();
|
if (this._allCurveNPSH == null)
|
this._allCurveNPSH = new List<Model.CurveDispParasEx>();
|
|
var defaultCurveColor = System.Drawing.Color.FromArgb(255, 255, 255);
|
|
int jieCurveStatus = 0;
|
if (workWaterCurveGroup != null && workJieZhiCurveGroup != null)
|
{
|
if (!workWaterCurveGroup.CurveExpressQH.IsEquals(workJieZhiCurveGroup.CurveExpressQH))
|
jieCurveStatus = 2;//粘度曲线
|
else if (!workWaterCurveGroup.CurveExpressQP.IsEquals(workJieZhiCurveGroup.CurveExpressQP))
|
jieCurveStatus = 1;//比重曲线
|
}
|
string max_d2 = string.Format("%%c{0}", this.OriginD2);
|
string min_d2 = string.Format("%%c{0}", this._minD2);
|
string wrk_d2 = string.Format("%%c{0:0.0}", this._workD2);
|
if (jieCurveStatus == 0)
|
{//没有黏度曲线
|
#region 没有黏度曲线
|
|
Eventech.Model.FeatPoint posi = maxCurveGroup.CurveExpressQH.GetLastPoint();
|
|
this._allCurveQH.Add(
|
new Model.CurveDispParasEx()
|
{
|
CurveExpress = maxCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = max_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
|
if (Math.Abs(workWaterCurveGroup.CurveExpressQH.Index0 - maxCurveGroup.CurveExpressQH.Index0) > 0.05)
|
{
|
posi = workWaterCurveGroup.CurveExpressQH.GetLastPoint();
|
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = workWaterCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = wrk_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
}
|
|
if (minCurveGroup != null)
|
{
|
posi = minCurveGroup.CurveExpressQH.GetLastPoint();
|
|
this._allCurveQH.Add(
|
new Model.CurveDispParasEx()
|
{
|
CurveExpress = minCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = min_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
}
|
|
this._allCurveQE.Add(new Model.CurveDispParasEx() { CurveExpress = workWaterCurveGroup.CurveExpressQE, CurveColor = defaultCurveColor });
|
this._allCurveQP.Add(new Model.CurveDispParasEx() { CurveExpress = workWaterCurveGroup.CurveExpressQP, CurveColor = defaultCurveColor });
|
|
#endregion 没有黏度曲线
|
}
|
else if (jieCurveStatus == 1)
|
{//比重曲线
|
Eventech.Model.FeatPoint posi = maxCurveGroup.CurveExpressQH.GetLastPoint();
|
|
this._allCurveQH.Add(
|
new Model.CurveDispParasEx()
|
{
|
CurveExpress = maxCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = max_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
|
if (Math.Abs(workWaterCurveGroup.CurveExpressQH.Index0 - maxCurveGroup.CurveExpressQH.Index0) > 0.05)
|
{
|
posi = workWaterCurveGroup.CurveExpressQH.GetLastPoint();
|
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = workWaterCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = wrk_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
}
|
|
if (minCurveGroup != null)
|
{
|
posi = minCurveGroup.CurveExpressQH.GetLastPoint();
|
|
this._allCurveQH.Add(
|
new Model.CurveDispParasEx()
|
{
|
CurveExpress = minCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = min_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
}
|
|
this._allCurveQE.Add(new Model.CurveDispParasEx() { CurveExpress = workJieZhiCurveGroup.CurveExpressQE, CurveColor = defaultCurveColor });
|
this._allCurveQP.Add(new Model.CurveDispParasEx() { CurveExpress = workJieZhiCurveGroup.CurveExpressQP, CurveColor = defaultCurveColor });
|
}
|
else
|
{
|
Eventech.Model.FeatPoint posi = maxCurveGroup.CurveExpressQH.GetLastPoint();
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = maxCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = max_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
|
if (Math.Abs(workWaterCurveGroup.CurveExpressQH.Index0 - maxCurveGroup.CurveExpressQH.Index0) > 0.05)
|
{
|
posi = workWaterCurveGroup.CurveExpressQH.GetLastPoint();
|
|
this._allCurveQH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = workWaterCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = wrk_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
}
|
|
if (minCurveGroup != null)
|
{
|
posi = minCurveGroup.CurveExpressQH.GetLastPoint();
|
|
this._allCurveQH.Add(
|
new Model.CurveDispParasEx()
|
{
|
CurveExpress = minCurveGroup.CurveExpressQH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = min_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Left
|
});
|
}
|
|
this._allCurveQH.Add(new Model.CurveDispParasEx() { CurveExpress = workJieZhiCurveGroup.CurveExpressQH, CurveColor = defaultCurveColor });
|
this._allCurveQE.Add(new Model.CurveDispParasEx() { CurveExpress = workJieZhiCurveGroup.CurveExpressQE, CurveColor = defaultCurveColor });
|
this._allCurveQP.Add(new Model.CurveDispParasEx() { CurveExpress = workJieZhiCurveGroup.CurveExpressQP, CurveColor = defaultCurveColor });
|
}
|
|
//不要工作汽蚀曲线,双达特殊要求
|
if (maxCurveGroup.CurveExpressNPSH != null)
|
{
|
Eventech.Model.FeatPoint posi = maxCurveGroup.CurveExpressNPSH.GetLastPoint();
|
|
this._allCurveNPSH.Add(
|
new Model.CurveDispParasEx()
|
{
|
CurveExpress = maxCurveGroup.CurveExpressNPSH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = max_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Top
|
});
|
|
if (minCurveGroup.CurveExpressNPSH != null)
|
{
|
posi = minCurveGroup.CurveExpressNPSH.GetLastPoint();
|
//if (_isCutOutRangeCurveNPSH && this.RegionPreferMax != null)
|
//{
|
// double max_q = Math.Min(this.RegionPreferMax.Q, minCurveGroup.CurveExpressNPSH.RangeMax);
|
// posi.X = max_q;
|
// posi.Y = Eventech.Common.FitCurveHelper.GetFitPointY(minCurveGroup.CurveExpressNPSH, max_q);
|
//}
|
|
this._allCurveNPSH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = minCurveGroup.CurveExpressNPSH,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = min_d2,
|
LabelPosiPara = posi,
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Top
|
});
|
}
|
else if (maxCurveGroup.CurveExpressNPSHmin != null)
|
{
|
posi = maxCurveGroup.CurveExpressNPSH.GetLastPoint();
|
|
this._allCurveNPSH.Add(new Model.CurveDispParasEx()
|
{
|
CurveExpress = maxCurveGroup.CurveExpressNPSHmin,
|
CurveColor = defaultCurveColor,
|
IsDispPara = true,
|
CurvePara = min_d2,
|
LabelPosiPara = maxCurveGroup.CurveExpressNPSHmin.GetLastPoint(),
|
LabelPosiParaAligment = Eventech.Model.eTextAligment.Top
|
});
|
}
|
}
|
|
//if (minCurveGroup != null && minCurveGroup.CurveExpressQH != null && minCurveGroup.CurveExpressQH != null)
|
//{
|
// this._allCurveQH.Add(new Model.CurveDispParasEx() { CurveExpress = minCurveGroup.CurveExpressQH, CurveColor = System.Drawing.Color.FromArgb(0, 100, 0) });
|
//}
|
|
return true;
|
}
|
|
#endregion 设置
|
|
public override bool CreateDxf(string strFilePath)
|
{
|
try
|
{
|
if (string.IsNullOrEmpty(_strTemplateFile) || !System.IO.File.Exists(_strTemplateFile))
|
{
|
return false;
|
}
|
|
_dxfFileModel = DwgReader.Read(_strTemplateFile);
|
|
//颜色
|
InitialChartColorAndFont();
|
|
_isNPSHCurve = false;
|
if (_allCurveNPSH != null && _allCurveNPSH.Count() > 0)
|
_isNPSHCurve = true; ;
|
|
|
|
|
//检查坐标
|
CheckNpshCoord();
|
CheckPressCoord();
|
CheckPowerCoord();
|
|
//初始化整个面板尺寸信息
|
InitialDiagramSize(620, 830);
|
|
//绘制图框
|
DrawDiagramPanelQH_QE();
|
|
DrawDiagramPanelQP();
|
|
DrawDiagramPanelQNPSH();
|
|
|
|
|
DrawQHCurve();
|
DrawQPCurve();
|
DrawQNPSHCurve();
|
|
if (this._isDispCurveQE)
|
{
|
DrawQECurve();
|
}
|
|
//工作点
|
DrawWorkPoint();
|
|
//额定点 和 额定参数文字
|
//DrawRatedParas();
|
|
//区域参数 和 区域参数文字
|
DrawRegion();
|
|
//标题栏
|
DrawFrameTtileText_Relplace();
|
|
#region 等效线
|
|
if (_equalParaCurveE != null && IsDispEqualParaCurveE)
|
{
|
DrawEqualParaCurveE(_equalParaCurveE);
|
}
|
|
if (IsDispEqualParaTextE && _equalParaCurveE != null)
|
{
|
DrawEqualParaCurvePara(_equalParaCurveE);
|
}
|
|
#endregion 等效线
|
|
if (_equipmentCurveParas != null)
|
{
|
WW.Cad.Model.Entities.EntityColor colorDxf = Eventech.PumpGraph.Dxf.AutoCadHelper.GetColor(System.Drawing.Color.Beige);
|
|
DrawSingleCurveQH(colorDxf, _equipmentCurveParas.CurveInfo);
|
}
|
|
////绘制型谱
|
//DrawSpetrumShape();
|
|
//绘制介质粘度信息
|
DrawViscoInfo();
|
|
|
DrawFrameTtileText_Draw();
|
|
//保存文件
|
this._printKindSize = System.Drawing.Printing.PaperKind.A4;
|
SaveFile(strFilePath);
|
}
|
catch // (Exception ex)
|
{
|
return false;
|
}
|
|
return true;
|
}
|
|
protected override void InitialChartColorAndFont()
|
{
|
base.InitialChartColorAndFont();
|
|
_axisTitleSpaceToDiagramY_left = 65;
|
_axisTitleSpaceToDiagramY_right = 35;
|
_axisTitleSpaceToLabel_Vertial_Y = 10;
|
_axisLabelSpaceToDiagramY_left = 11;
|
_axisLabelSpaceToDiagramY_right = 15;
|
_axisLabelSpaceToDiagramQ = 13;
|
_axisTitleSpaceToDiagramQ_Y = 50;
|
_axisTitleSpaceToDiagramQ_X = 15;
|
_isDispGridSubLineX = true;
|
_isDispGridSubLineY = true;
|
|
_axisTitleDockV_Left = AttachmentPoint.MiddleCenter;
|
|
var dxf_gren_color = Eventech.PumpGraph.Dxf.AutoCadHelper.GetColor(100);
|
_gridLineColor = dxf_gren_color;
|
_axisTitleColorH = dxf_gren_color;
|
_axisTitleColorQ = dxf_gren_color;
|
_axisTitleColorE = dxf_gren_color;
|
_axisTitleColorP = dxf_gren_color;
|
_axisTitleColorNPSH = dxf_gren_color;
|
_axisLabelColorQ = dxf_gren_color;
|
_axisLabelColorP = dxf_gren_color;
|
_axisLabelColorH = dxf_gren_color;
|
_axisLabelColorE = dxf_gren_color;
|
_axisLabelColorNPSH = dxf_gren_color;
|
|
_gridSubLineColor = Eventech.PumpGraph.Dxf.AutoCadHelper.GetColor(130);
|
_equalParaCurveColor = Eventech.PumpGraph.Dxf.AutoCadHelper.GetColor(7);
|
_equalParaCurveColor = Eventech.PumpGraph.Dxf.AutoCadHelper.GetColor(7);
|
_curveParasLabelSpaceX = 3;
|
|
this._equalParaCurveWidth = 30;
|
this._gridLineWidth = 30;
|
this._defaultFeatCurveWidth = 40;
|
this._axisLabelSizeX = 12;
|
this._axisLabelSizeY = 12;
|
this._axisTitleSizeX = 14;
|
this._axisTitleSizeY = 14;
|
this._equalCurveParaLabelHeight = 12;
|
this._defatulCurveLabelHeight = 12;
|
|
_curveTextFont = _dxfFileModel.GetTextStyleWithName("HZTXT");//文件自带字体
|
_axisTextFont = _dxfFileModel.GetTextStyleWithName("HZTXT");//文件自带字体
|
_frameTextFont = _dxfFileModel.GetTextStyleWithName("Standard");//文件自带字体
|
}
|
|
private void InsertBlock测试用()
|
{
|
var fileName = @"C:\Users\TangXu\Desktop\LXP_Style2_CN.dwg";
|
|
var dxfModel = DwgReader.Read(fileName);
|
var block = dxfModel.Blocks.Where(x => x.Name == "性能曲线_BMS_工况点_V0").FirstOrDefault();
|
if (block != null)
|
{
|
var insert = new DxfInsert(block);
|
insert.ScaleFactor = new Vector3D(3, 3, 3);
|
insert.InsertionPoint = new WW.Math.Point3D(0, 0, 0);
|
//insert.Rotation
|
dxfModel.Entities.Add(insert);
|
}
|
}
|
|
protected override void InitialDiagramSize(double diagramTotalLength, double diagramTotalHeight)
|
{
|
base.InitialDiagramSize(diagramTotalLength, diagramTotalHeight);
|
|
_diagramLeftBottomPt = new Point2D(0, 0);
|
|
_diagramRightBottomPt.X = _diagramLeftBottomPt.X + diagramTotalLength;
|
_diagramRightBottomPt.Y = _diagramLeftBottomPt.Y;
|
|
_diagramLeftTopPt.X = _diagramLeftBottomPt.X;
|
_diagramLeftTopPt.Y = _diagramLeftBottomPt.Y + diagramTotalHeight;
|
|
_diagramRightTopPt.X = _diagramRightBottomPt.X;
|
_diagramRightTopPt.Y = _diagramLeftTopPt.Y;
|
|
int totalGridNumber_h = _coordinateParas.EndLineNoH - _coordinateParas.StartLineNoH;
|
int totalGridNumber_p = _coordinateParas.EndLineNoP - _coordinateParas.StartLineNoP;
|
int totalGridNumber_npsh = _coordinateParas.EndLineNoNPSH - _coordinateParas.StartLineNoNPSH;
|
|
int totalGridNumber_e = _coordinateParas.EndLineNoE - _coordinateParas.StartLineNoE;
|
|
|
|
int grid_number_qh_qe = 0;
|
if (this._isDispCurveQE)
|
{
|
grid_number_qh_qe = Math.Max(totalGridNumber_h, totalGridNumber_e + 2);
|
}
|
else
|
{
|
grid_number_qh_qe = totalGridNumber_h;
|
}
|
|
_diagram_Cell_Width = diagramTotalLength / _coordinateParas.GridNumberX;
|
|
if (_isNPSHCurve)
|
{
|
_diagram_Cell_Height_H = (diagramTotalHeight - 2 * _diagram_Space) / (totalGridNumber_p + totalGridNumber_npsh + grid_number_qh_qe);
|
_diagram_Cell_Height_E = _diagram_Cell_Height_H;
|
|
|
//最下面是功率
|
_diagramLeftBottomPt_QP = new Point2D(0, 0);
|
|
_diagramRightBottomPt_QP.X = _diagramLeftBottomPt_QP.X + diagramTotalLength;
|
_diagramRightBottomPt_QP.Y = _diagramLeftBottomPt_QP.Y;
|
|
_diagramLeftTopPt_QP.X = _diagramLeftBottomPt_QP.X;
|
_diagramLeftTopPt_QP.Y = _diagramLeftBottomPt_QP.Y + totalGridNumber_p * _diagram_Cell_Height_H;
|
|
_diagramRightTopPt_QP.X = _diagramRightBottomPt_QP.X + diagramTotalLength;
|
_diagramRightTopPt_QP.Y = _diagramRightBottomPt_QP.Y;
|
|
//汽蚀 , 在中间
|
_diagramLeftBottomPt_QNPSH.X = _diagramLeftTopPt_QP.X;
|
_diagramLeftBottomPt_QNPSH.Y = _diagramLeftTopPt_QP.Y + _diagram_Space;
|
|
_diagramRightBottomPt_QNPSH.X = _diagramLeftBottomPt_QNPSH.X + diagramTotalLength;
|
_diagramRightBottomPt_QNPSH.Y = _diagramLeftBottomPt_QNPSH.Y;
|
|
_diagramLeftTopPt_QNPSH.X = _diagramLeftBottomPt_QNPSH.X;
|
_diagramLeftTopPt_QNPSH.Y = _diagramLeftBottomPt_QNPSH.Y + totalGridNumber_npsh * _diagram_Cell_Height_H;
|
|
_diagramRightTopPt_QNPSH.X = _diagramRightBottomPt_QNPSH.X;
|
_diagramRightTopPt_QNPSH.Y = _diagramLeftTopPt_QNPSH.Y;
|
}
|
else
|
{
|
_diagram_Cell_Height_H = (diagramTotalHeight - 1 * _diagram_Space) / (totalGridNumber_p + grid_number_qh_qe);
|
_diagram_Cell_Height_E = _diagram_Cell_Height_H;
|
|
|
//最下面是功率
|
_diagramLeftBottomPt_QP = new Point2D(0, 0);
|
|
_diagramRightBottomPt_QP.X = _diagramLeftBottomPt_QP.X + diagramTotalLength;
|
_diagramRightBottomPt_QP.Y = _diagramLeftBottomPt_QP.Y;
|
|
_diagramLeftTopPt_QP.X = _diagramLeftBottomPt_QP.X;
|
_diagramLeftTopPt_QP.Y = _diagramLeftBottomPt_QP.Y + totalGridNumber_p * _diagram_Cell_Height_H;
|
|
_diagramRightTopPt_QP.X = _diagramRightBottomPt_QP.X + diagramTotalLength;
|
_diagramRightTopPt_QP.Y = _diagramRightBottomPt_QP.Y;
|
|
|
//没有汽蚀 就把功率 赋值 汽蚀
|
_diagramLeftBottomPt_QNPSH = _diagramLeftBottomPt_QP;
|
_diagramRightBottomPt_QNPSH = _diagramRightBottomPt_QP ;
|
_diagramLeftTopPt_QNPSH = _diagramLeftTopPt_QP;
|
_diagramRightTopPt_QNPSH = _diagramRightTopPt_QP;
|
}
|
|
if (this._isDispCurveQE)
|
{
|
_diagramLeftTopPt_QH.X = _diagramLeftTopPt_QNPSH.X;
|
_diagramLeftTopPt_QH.Y = _diagramLeftTopPt_QNPSH.Y + _diagram_Space + _diagram_Cell_Height_H * grid_number_qh_qe;
|
|
_diagramRightTopPt_QH.X = _diagramLeftTopPt_QH.X + diagramTotalLength;
|
_diagramRightTopPt_QH.Y = _diagramLeftTopPt_QH.Y;
|
|
_diagramLeftBottomPt_QH.X = _diagramLeftTopPt_QH.X;
|
_diagramLeftBottomPt_QH.Y = _diagramLeftTopPt_QH.Y - _diagram_Cell_Height_H * totalGridNumber_h;
|
|
_diagramRightBottomPt_QH.X = _diagramLeftBottomPt_QH.X + diagramTotalLength;
|
_diagramRightBottomPt_QH.Y = _diagramLeftBottomPt_QH.Y;
|
|
|
_diagramLeftBottomPt_QE.X = _diagramLeftTopPt_QNPSH.X;
|
_diagramLeftBottomPt_QE.Y = _diagramLeftTopPt_QNPSH.Y + _diagram_Space;
|
|
_diagramRightBottomPt_QE.X = _diagramLeftBottomPt_QE.X + diagramTotalLength;
|
_diagramRightBottomPt_QE.Y = _diagramLeftBottomPt_QE.Y;
|
|
|
_diagramLeftTopPt_QE.X = _diagramLeftBottomPt_QE.X;
|
_diagramLeftTopPt_QE.Y = _diagramLeftBottomPt_QE.Y + _diagram_Cell_Height_H * totalGridNumber_e;
|
|
|
_diagramRightTopPt_QE.X = _diagramLeftTopPt_QE.X + diagramTotalLength;
|
_diagramRightTopPt_QE.Y = _diagramLeftTopPt_QE.Y;
|
|
}
|
else
|
{
|
_diagramLeftTopPt_QH.X = _diagramLeftTopPt_QNPSH.X;
|
_diagramLeftTopPt_QH.Y = _diagramLeftTopPt_QNPSH.Y + _diagram_Space + _diagram_Cell_Height_H * totalGridNumber_h;
|
|
_diagramRightTopPt_QH.X = _diagramLeftTopPt_QH.X + diagramTotalLength;
|
_diagramRightTopPt_QH.Y = _diagramLeftTopPt_QH.Y;
|
|
_diagramLeftBottomPt_QH.X = _diagramLeftTopPt_QH.X;
|
_diagramLeftBottomPt_QH.Y = _diagramLeftTopPt_QH.Y - _diagram_Cell_Height_H * totalGridNumber_h;
|
|
_diagramRightBottomPt_QH.X = _diagramLeftBottomPt_QH.X + diagramTotalLength;
|
_diagramRightBottomPt_QH.Y = _diagramLeftBottomPt_QH.Y;
|
|
|
_diagramLeftBottomPt_QE = _diagramLeftBottomPt_QH;
|
_diagramLeftTopPt_QE = _diagramLeftTopPt_QH;
|
_diagramRightBottomPt_QE = _diagramRightBottomPt_QH;
|
_diagramRightTopPt_QE = _diagramRightTopPt_QH;
|
}
|
}
|
|
/// <summary>
|
/// 绘制面板(QH , QE)
|
/// </summary>
|
protected void DrawDiagramPanelQH_QE()
|
{
|
#region 流量 刻度线
|
|
for (int i = 0; i <= _coordinateParas.GridNumberX; i++)
|
{
|
//流量 刻度线
|
var vertiBottomH = new Point2D(_diagramLeftBottomPt_QH.X + i * _diagram_Cell_Width, _diagramLeftBottomPt_QH.Y);
|
var vertiTopH = new Point2D(vertiBottomH.X, _diagramLeftTopPt_QH.Y);
|
var vertiLine = new DxfLine(vertiBottomH, vertiTopH);
|
vertiLine.LineWeight = _gridLineWidth;
|
vertiLine.Color = _gridLineColor;
|
_dxfFileModel.Entities.Add(vertiLine);
|
|
//流量 子刻度线
|
if (_isDispGridSubLineX && _coordinateParas.GridNumberX != i)
|
{
|
if (_gridSubLineColor == null)
|
{
|
_gridSubLineColor = Eventech.PumpGraph.Dxf.AutoCadHelper.GetColor(System.Drawing.Color.White);
|
}
|
for (int m = 1; m < _subGridLineNumber; m++)
|
{
|
var space = m * _diagram_Cell_Width / _subGridLineNumber;
|
var horizLeftH_sub = new Point2D(vertiTopH.X + space, vertiBottomH.Y);
|
var horizRightH_sub = new Point2D(vertiTopH.X + space, vertiTopH.Y);
|
var horizLine_sub = new DxfLine(horizLeftH_sub, horizRightH_sub);
|
horizLine_sub.LineWeight = 1;
|
horizLine_sub.Color = _gridSubLineColor;
|
_dxfFileModel.Entities.Add(horizLine_sub);
|
}
|
}
|
}
|
|
#endregion 流量 刻度线
|
|
#region 扬程刻度
|
|
var gridNumberH = _coordinateParas.EndLineNoH - _coordinateParas.StartLineNoH;
|
for (int i = 0; i <= gridNumberH; i++)
|
{
|
//网格线
|
var horizLeftH = new Point2D(_diagramLeftBottomPt_QH.X, _diagramLeftBottomPt_QH.Y + i * _diagram_Cell_Height_H);
|
var horizRightH = new Point2D(_diagramRightBottomPt_QH.X, horizLeftH.Y);
|
var horizLine = new DxfLine(horizLeftH, horizRightH);
|
horizLine.LineWeight = _gridLineWidth;
|
horizLine.Color = _gridLineColor;
|
_dxfFileModel.Entities.Add(horizLine);
|
|
#region 子刻度线
|
|
if (this._isDispGridSubLineY && gridNumberH != i)
|
{
|
if (_gridSubLineColor == null)
|
{
|
_gridSubLineColor = Eventech.PumpGraph.Dxf.AutoCadHelper.GetColor(255, 20, 147);
|
}
|
for (int m = 1; m < _subGridLineNumber; m++)
|
{
|
var space = m * _diagram_Cell_Height_H / _subGridLineNumber;
|
var horizLeftH_sub = new Point2D(_diagramLeftBottomPt_QH.X, horizLeftH.Y + space);
|
var horizRightH_sub = new Point2D(_diagramRightBottomPt_QH.X, horizLeftH.Y + space);
|
var horizLine_sub = new DxfLine(horizLeftH_sub, horizRightH_sub);
|
horizLine_sub.LineWeight = 1;
|
horizLine_sub.Color = _gridSubLineColor;
|
_dxfFileModel.Entities.Add(horizLine_sub);
|
}
|
}
|
|
#endregion 子刻度线
|
|
//刻度线
|
if (this._isDrawMajorTickY)
|
{
|
var axis_label_text = new Point2D(horizLeftH.X - (i % 2 == 0 ? _axisMajorTickLength : _axisMinorTickLength), horizLeftH.Y);
|
var keDuLine = new DxfLine(axis_label_text, horizLeftH);
|
keDuLine.LineWeight = _gridLineWidth;
|
keDuLine.Color = _gridLineColor;
|
_dxfFileModel.Entities.Add(keDuLine);
|
}
|
|
//刻度
|
double keduValue = _coordinateParas.CoordMinH + (i + _coordinateParas.StartLineNoH) * _coordinateParas.CoordSpaceH;
|
if (keduValue < 0)
|
continue;
|
string kedu_str_left = "";
|
if (_unitH == Model.UnitH.M)
|
{
|
kedu_str_left = keduValue.ToString();
|
}
|
else if (_unitH == Model.UnitH.MPa)
|
{
|
kedu_str_left = (keduValue / 100).ToString();
|
}
|
else
|
{
|
kedu_str_left = Eventech.Common.UnitHHelper.fromM2(_unitH, keduValue).ToString("N2");
|
}
|
|
var label_posi_left = new Point3D(horizLeftH.X - _axisLabelSpaceToDiagramY_left, horizLeftH.Y, 0d);
|
DxfMText axisLabel_h_left = new DxfMText(kedu_str_left, label_posi_left, _axisLabelSizeY);//\P表示回车
|
axisLabel_h_left.AttachmentPoint = AttachmentPoint.MiddleRight;
|
if (_axisTextFont != null)
|
axisLabel_h_left.Style = this._axisTextFont;
|
axisLabel_h_left.Color = this._axisLabelColorH;
|
_dxfFileModel.Entities.Add(axisLabel_h_left);
|
}
|
|
//Title
|
Point3D pt_title_main_h = new Point3D();
|
pt_title_main_h.X = _diagramLeftTopPt_QH.X - _axisTitleSpaceToDiagramY_left;
|
pt_title_main_h.Y = _diagramLeftTopPt_QH.Y - _axisTitleSizeY - _axisTitleSpaceToLabel_Vertial_Y;
|
pt_title_main_h.Z = 0d;
|
DxfMText text_axis_title_h = new DxfMText(string.Format(@"{0}\P({1})", _axisTtileContentH, Eventech.Common.UnitHHelper.GetEnUnitName(_unitH)), pt_title_main_h, _axisTitleSizeY);//\P表示回车
|
if (this._axisTextFont != null)
|
text_axis_title_h.Style = this._axisTextFont;
|
text_axis_title_h.AttachmentPoint = _axisTitleDockV_Left;
|
text_axis_title_h.Color = this._axisTitleColorH;
|
_dxfFileModel.Entities.Add(text_axis_title_h);
|
|
#endregion 扬程刻度
|
|
#region 流量第二刻度
|
|
if (this.SecondAxisH != null)
|
{//产生第二刻度坐标:沃图要求
|
var unit_second_h = (Eventech.Model.UnitH)this.SecondAxisH.Unit;
|
for (var i = 0; i < this.SecondAxisH.Labels.Count; i++)
|
{
|
var val_h = this.SecondAxisH.Labels[i];
|
|
var vall_m3h = Eventech.Common.UnitHHelper.toM(unit_second_h, val_h);
|
if (vall_m3h < _coordinateParas.DispMinH() || vall_m3h > _coordinateParas.DispMaxH())
|
continue;
|
|
var vall_map = this.MapRealToPictH(vall_m3h);
|
|
var keDuLeftH1 = new Point2D(_diagramRightBottomPt_QH.X, vall_map);
|
var keDuLeftH2 = new Point2D(_diagramRightBottomPt_QH.X + _axisMajorTickLength, vall_map);
|
var keDuLine = new DxfLine(keDuLeftH1, keDuLeftH2);
|
keDuLine.LineWeight = _gridLineWidth;
|
keDuLine.Color = _gridLineColor;
|
_dxfFileModel.Entities.Add(keDuLine);
|
|
string kedu_str_right = val_h.ToString();
|
var label_posi_right = new Point3D(_diagramRightBottomPt_QH.X + _axisLabelSpaceToDiagramY_right, vall_map, 0d);
|
DxfMText axisLabel_h_right = new DxfMText(kedu_str_right, label_posi_right, _axisLabelSizeY);//\P表示回车
|
axisLabel_h_right.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
if (_axisTextFont != null)
|
axisLabel_h_right.Style = this._axisTextFont;
|
axisLabel_h_right.Color = this._axisLabelColorH;
|
_dxfFileModel.Entities.Add(axisLabel_h_right);
|
}
|
|
Point3D pt_title_inch = new Point3D();
|
pt_title_inch.X = _diagramRightBottomPt_QH.X + _axisLabelSpaceToDiagramY_right;
|
pt_title_inch.Y = _diagramRightTopPt_QH.Y + _axisLabelSizeY * 2.0;
|
pt_title_inch.Z = 0d;
|
DxfMText text_axisTitle_inch = new DxfMText(Eventech.Common.UnitHHelper.GetEnUnitName((Model.UnitH)this.SecondAxisH.Unit),
|
pt_title_inch, _axisTitleSizeY);
|
if (this._axisTextFont != null)
|
text_axisTitle_inch.Style = this._axisTextFont;
|
text_axisTitle_inch.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
text_axisTitle_inch.Color = this._axisTitleColorH;
|
_dxfFileModel.Entities.Add(text_axisTitle_inch);
|
}
|
|
if (this.SecondAxisQ != null)
|
{
|
Model.UnitQ second_flow_unit = (Model.UnitQ)this.SecondAxisQ.Unit;
|
var num = this.SecondAxisQ.Labels.Count;
|
// 流量刻度
|
for (int i = 0; i < num; i++)
|
{
|
//
|
var keduValue = this.SecondAxisQ.Labels[i];
|
var keduValue_posi = this.MapRealToPictQ(Eventech.Common.UnitQHelper.toM3H(second_flow_unit, keduValue));
|
string kedu_str = keduValue.ToString();
|
if (i == num - 1)
|
{
|
kedu_str = string.Format("{0} ({1})", kedu_str, Eventech.Common.UnitQHelper.GetEnUnitName(second_flow_unit));
|
}
|
|
var axisMajorLinePt1 = new Point2D(_diagramLeftTopPt_QH.X + keduValue_posi, _diagramLeftTopPt_QH.Y);
|
var axisMajorLinePt2 = new Point2D(_diagramLeftTopPt_QH.X + keduValue_posi, _diagramLeftTopPt_QH.Y + this._axisMajorTickLength);
|
var axisMajorLine = new DxfLine(axisMajorLinePt1, axisMajorLinePt2);
|
axisMajorLine.LineWeight = _gridLineWidth;
|
axisMajorLine.Color = _gridLineColor;
|
_dxfFileModel.Entities.Add(axisMajorLine);
|
|
var labelPtQ = new Point3D(
|
_diagramLeftTopPt_QH.X + keduValue_posi,
|
_diagramLeftTopPt_QH.Y + _axisLabelSpaceToDiagramQ, 0d);
|
DxfMText axisLabel_q = new DxfMText(kedu_str, labelPtQ, _axisLabelSizeX);//\P表示回车
|
axisLabel_q.AttachmentPoint = AttachmentPoint.BottomCenter;
|
//axisLabel_q.ReferenceRectangleHeight = _axisLabelSizeX;
|
if (_axisTextFont != null)
|
axisLabel_q.Style = this._axisTextFont;
|
//axisLabel_q.Height = _axisLabelSizeX;
|
axisLabel_q.Color = this._axisLabelColorQ;
|
_dxfFileModel.Entities.Add(axisLabel_q);
|
}
|
|
//string title_Q = string.Format("Q({0})", Eventech.Common.UnitQHelper.GetEnUnitName(_unitQ));
|
//Point3D pt_Q = new Point3D();
|
//pt_Q.X = _diagramRightBottomPt.X - _axisTitleSizeX / 2 - _axisTitleSpaceToDiagramQ_X;
|
//pt_Q.Y = _diagramRightBottomPt.Y - _axisTitleSpaceToDiagramQ_Y;
|
//pt_Q.Z = 0;
|
//DxfText textTitle_Q = new DxfText(title_Q, pt_Q, _axisTitleSizeX);
|
//textTitle_Q.Thickness = 0.5d;
|
//textTitle_Q.Color = _axisTitleColorQ;
|
//if (_axisTextFont != null)
|
// textTitle_Q.Style = _axisTextFont;
|
//_dxfFileModel.Entities.Add(textTitle_Q);
|
}
|
|
#endregion 流量第二刻度
|
|
if (this._isDispCurveQE)
|
{
|
DrawAxisEta();
|
}
|
}
|
|
protected void DrawAxisEta()
|
{
|
//扬程刻度
|
double max_grid_y = 0;
|
var gridNumberE = _coordinateParas.EndLineNoE - _coordinateParas.StartLineNoE;
|
for (int i = 0; i <= gridNumberE; i++)
|
{
|
//网格线
|
var grid_line_y = _diagramLeftBottomPt_QE.Y + i * _diagram_Cell_Height_H;
|
max_grid_y = grid_line_y;
|
double keduValue = _coordinateParas.CoordMinE + (i + _coordinateParas.StartLineNoE) * _coordinateParas.CoordSpaceE;
|
if (keduValue < 0)
|
continue;
|
if (keduValue > 100)
|
break;
|
|
#region 子刻度线
|
|
//if (_isDispGridSubLineY && gridNumberE != i)
|
//{
|
// if (_gridSubLineColor == null)
|
// {
|
// WW.Cad.Model.Color sub_grid_color = WW.Cad.Model.Color.CreateFromRgb(255, 20, 147);
|
// _gridSubLineColor = Eventech.PumpGraph.Dxf.AutoCadHelper.GetColor(sub_grid_color);
|
// }
|
// for (int m = 1; m < 5; m++)
|
// {
|
// var space = m * _diagram_Cell_Height_Up / 5;
|
// var horizLeftH_sub = new Point2D(_diagramLeftBottomPt_QH.X, horizLeftE.Y + space);
|
// var horizRightH_sub = new Point2D(_diagramRightBottomPt_QH.X, horizLeftE.Y + space);
|
// var horizLine_sub = new DxfLine(horizLeftH_sub, horizRightH_sub);
|
// horizLine_sub.LineWeight = 1;
|
// horizLine_sub.Color = _gridSubLineColor;
|
// _dxfFileModel.Entities.Add(horizLine_sub);
|
// }
|
//}
|
|
#endregion 子刻度线
|
|
//刻度线
|
var axis_label_text = new Point2D(_diagramRightBottomPt_QE.X + (i % 2 == 0 ? _axisMajorTickLength : _axisMinorTickLength), grid_line_y);
|
var keDuLine = new DxfLine(axis_label_text, new Point2D(_diagramRightBottomPt_QE.X, grid_line_y));
|
keDuLine.LineWeight = _gridLineWidth;
|
keDuLine.Color = _gridLineColor;
|
_dxfFileModel.Entities.Add(keDuLine);
|
|
//刻度
|
string kedu_str_left = string.Format("{0}%", keduValue);
|
var label_posi_left = new Point3D(_diagramRightBottomPt_QE.X + _axisLabelSpaceToDiagramY_right, grid_line_y, 0d);
|
DxfMText axisLabel_h_left = new DxfMText(kedu_str_left, label_posi_left, _axisLabelSizeY);//\P表示回车
|
axisLabel_h_left.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
if (_axisTextFont != null)
|
axisLabel_h_left.Style = this._axisTextFont;
|
axisLabel_h_left.Color = this._axisLabelColorH;
|
_dxfFileModel.Entities.Add(axisLabel_h_left);
|
}
|
|
//Title
|
Point3D pt_title_main = new Point3D();
|
pt_title_main.X = _diagramRightTopPt_QH.X + _axisTitleSpaceToDiagramY_right;
|
pt_title_main.Y = max_grid_y + _axisTitleSpaceToLabel_Vertial_Y + 35;// _diagramRightTopPt_QH.Y + _axisTitleSizeY + _axisTitleSpaceToLabel_Vertial_Y +10;
|
pt_title_main.Z = 0d;
|
DxfMText text_axisTitle = new DxfMText(@"效率\P(%)", pt_title_main, _axisTitleSizeY);//\P表示回车
|
if (this._axisTextFont != null)
|
text_axisTitle.Style = this._axisTextFont;
|
text_axisTitle.AttachmentPoint = _axisTitleDockV_Left;
|
text_axisTitle.Color = this._axisTitleColorH;
|
_dxfFileModel.Entities.Add(text_axisTitle);
|
}
|
|
public override bool InitialTemplate(string CorpDataFolder, Eventech.Model.eLocalizationType location, string attachInfo)
|
{
|
_currentLangugage = location;
|
var file = GetTemplateFilePath(CorpDataFolder, location);
|
if (string.IsNullOrEmpty(file))
|
return false;
|
this._strTemplateFile = file;
|
return true;
|
}
|
|
public static string GetTemplateFilePath(string CorpDataFolder, Eventech.Model.eLocalizationType location)
|
{
|
string strTemplateFolder = null;
|
if (location != Model.eLocalizationType.zhCN)
|
{
|
strTemplateFolder = System.IO.Path.Combine(CorpDataFolder, "template", "LXP_Style10_EN.dwg");
|
if (System.IO.File.Exists(strTemplateFolder))
|
{
|
return strTemplateFolder;
|
}
|
strTemplateFolder = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "template", "LXP_Style10_EN.dwg");
|
if (System.IO.File.Exists(strTemplateFolder))
|
{
|
return strTemplateFolder;
|
}
|
}
|
|
strTemplateFolder = System.IO.Path.Combine(CorpDataFolder, "template", "LXP_Style10_CN.dwg");
|
if (System.IO.File.Exists(strTemplateFolder))
|
{
|
return strTemplateFolder;
|
}
|
strTemplateFolder = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "template", "LXP_Style10_CN.dwg");
|
if (System.IO.File.Exists(strTemplateFolder))
|
{
|
return strTemplateFolder;
|
}
|
|
return strTemplateFolder;
|
}
|
}
|
}
|