using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
|
using WW.Cad.Base;
|
using WW.Cad.Drawing;
|
using WW.Cad.Drawing.GDI;
|
using WW.Cad.IO;
|
using WW.Cad.Model;
|
using WW.Math;
|
using WW.Cad.Model.Entities;
|
using WW.Actions;
|
using WW.Cad.Model.Tables;
|
using WW.Cad.Model.Objects;
|
|
namespace TProduct.PumpGraph.Dxf
|
{
|
public partial class LxpFeatChart7
|
{
|
|
protected override void DrawQHCurve()
|
{
|
if (_allCurveQH == null || _allCurveQH.Count() == 0)
|
return;
|
var layer_curve = GetLayerByName("粗实线");
|
|
double borderOffsetFactor = 1.1;//调整背景遮罩的比例 1是文字的背景,越大背景遮罩效果越大
|
|
#region 把预设的最小切割线,找出标为显示
|
//string min_curve_id = null;
|
//if (!_isHaveSetMinCurve)
|
//{
|
|
// double min_d2_insimu = double.MaxValue;
|
// foreach (var curve in _allCurveQH)
|
// {
|
// if (curve.CurveTag != null)
|
// {
|
// var tag = curve.CurveTag.ToString();
|
// if (tag == "SimuWaterCurve")
|
// {
|
// if (curve.GetCurveDoublePara() > 0)
|
// {
|
// min_d2_insimu = Math.Min(min_d2_insimu, curve.GetCurveDoublePara());
|
// min_curve_id = curve.CurveID.ToString();
|
// }
|
// }
|
// }
|
// }
|
//}
|
#endregion
|
|
_defatulCurveLabelHeight = 2;
|
foreach (var curve in _allCurveQH)
|
{
|
if (!curve.IsDispCurve)
|
continue;
|
if (curve.CurveExpress == null)
|
continue;
|
//if (curve.CurveTag != null)
|
//{
|
// var tag = curve.CurveTag.ToString();
|
// if (tag == "SimuWaterCurve")
|
// {
|
// if (curve.GetCurveDoublePara() != this._minD2)
|
// continue;
|
// //if (curve.CurveID.ToString() != min_curve_id)
|
// // continue;
|
// }
|
|
//}
|
|
|
var points = Eventech.Common.CurveExpressConver.ToPoints(curve.CurveExpress, 15);
|
//绘制曲线
|
var dxfSpline = DrawSingleCurveQH(_colorCurve, points, 30, layer_curve);
|
if (dxfSpline == null)
|
return;
|
//绘制曲线名称
|
bool isDrawCurveName = false;
|
if (curve.IsDispName && !string.IsNullOrEmpty(curve.CurveName) && !curve.CurveName.StartsWith("SIMUINDEX"))
|
{
|
isDrawCurveName = true;
|
var pt_posi = new Point3D(dxfSpline.FitPoints[0].X + _defatulCurveLabelHeight, dxfSpline.FitPoints[1].Y + _defatulCurveLabelHeight - 2, 0d);
|
if (curve.LabelPosiName != null && !curve.LabelPosiName.IsZeroPt())
|
{
|
pt_posi.X = MapRealToPictQ(curve.LabelPosiName.X);
|
pt_posi.Y = MapRealToPictH(curve.LabelPosiName.Y);
|
}
|
|
pt_posi.X += _curveParasLabelSpaceX;
|
pt_posi.Y += _curveParasLabelSpaceY;
|
pt_posi.Y += 1;//大部分定位的是曲线上的位置,所以加上一个字高度
|
|
DxfMText textLabel = new DxfMText("%%c"+curve.CurveName, pt_posi, _defatulCurveLabelHeight);
|
textLabel.Color = _colorCurveText;
|
if (_curveTextFont != null)
|
textLabel.Style = _curveTextFont;
|
|
if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Right)
|
textLabel.AttachmentPoint = AttachmentPoint.MiddleRight;
|
else if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Left)
|
textLabel.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
else if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Top)
|
textLabel.AttachmentPoint = AttachmentPoint.BottomCenter;
|
|
textLabel.BackgroundFillFlags = BackgroundFillFlags.UseBackgroundFillColor | BackgroundFillFlags.UseDrawingWindowColor;
|
textLabel.BackgroundFillInfo = new BackgroundFillInfo();
|
textLabel.BackgroundFillInfo.BorderOffsetFactor = borderOffsetFactor;//调整背景遮罩的比例 1是文字的背景,越大背景遮罩效果越大
|
|
if (_curveTextFont != null)
|
textLabel.Style = this._curveTextFont;
|
_dxfFileModel.Entities.Add(textLabel);
|
}
|
|
if (curve.IsDispPara && !string.IsNullOrEmpty(curve.CurvePara) && !isDrawCurveName)
|
{
|
var pt_posi = new Point3D(dxfSpline.FitPoints[0].X + _defatulCurveLabelHeight, dxfSpline.FitPoints[1].Y + _defatulCurveLabelHeight - 2, 0d);
|
if (curve.LabelPosiPara != null && curve.LabelPosiPara.IsZeroPt())
|
{
|
pt_posi.X = MapRealToPictQ(curve.LabelPosiPara.X);
|
pt_posi.Y = MapRealToPictH(curve.LabelPosiPara.Y);
|
}
|
|
pt_posi.X += _curveParasLabelSpaceX;
|
pt_posi.Y += _curveParasLabelSpaceY;
|
pt_posi.Y += 2;//大部分定位的是曲线上的位置,所以加上一个字高度
|
|
DxfMText textLabel = new DxfMText(curve.CurvePara, pt_posi, _defatulCurveLabelHeight);
|
textLabel.Color = _colorCurveText;
|
if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Right)
|
textLabel.AttachmentPoint = AttachmentPoint.MiddleRight;
|
else if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Left)
|
textLabel.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
else if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Top)
|
textLabel.AttachmentPoint = AttachmentPoint.BottomCenter;
|
|
|
textLabel.BackgroundFillFlags = BackgroundFillFlags.UseBackgroundFillColor | BackgroundFillFlags.UseDrawingWindowColor;
|
textLabel.BackgroundFillInfo = new BackgroundFillInfo();
|
textLabel.BackgroundFillInfo.BorderOffsetFactor = borderOffsetFactor;//调整背景遮罩的比例 1是文字的背景,越大背景遮罩效果越大
|
|
if (_curveTextFont != null)
|
textLabel.Style = this._curveTextFont;
|
_dxfFileModel.Entities.Add(textLabel);
|
}
|
}
|
}
|
|
|
//绘制汽蚀曲线
|
protected override void DrawQNPSHCurve()
|
{
|
if (_allCurveNPSH == null || _allCurveNPSH.Count() == 0)
|
return;
|
|
foreach (var curve in _allCurveNPSH)
|
{
|
if (!curve.IsDispCurve)
|
continue;
|
if (curve.CurveExpress == null)
|
continue;
|
double work_qh_max_flow = -1;
|
if (_isTrimCurveNpshOverQH)
|
{
|
var wrk_qh_curve = (from x in _allCurveQH where x.CurveTag != null && x.CurveTag.ToString() == "WorkWaterCurve" select x.CurveExpress).FirstOrDefault();
|
if (wrk_qh_curve != null)
|
work_qh_max_flow = wrk_qh_curve.RangeMax;
|
}
|
|
|
Eventech.Model.FeatPointList points = null;
|
if (this._regionPointParas != null)
|
{
|
if (IsCurveNpshStartWithRegionAllow)
|
{//剪切且延长
|
if (this._regionPointParas.AllowRegionMin.Q > curve.CurveExpress.RangeMin)
|
{
|
double max_q = curve.CurveExpress.RangeMax;
|
points = Eventech.Common.FitCurveHelper.GetFitPointsByRange(curve.CurveExpress, this._regionPointParas.AllowRegionMin.Q, max_q, 7);
|
}
|
else
|
{
|
points = Eventech.Common.FitCurveHelper.GetFitPoints(curve.CurveExpress, 7);
|
points.Insert(0, new Eventech.Model.FeatPoint(this._regionPointParas.AllowRegionMin.Q, points.First().Y));
|
}
|
|
}
|
|
else
|
{
|
//if (_isTrimCurveNpshOverQH)
|
//{
|
//
|
//}
|
|
if (_isTrimCurveNpshOverQH && work_qh_max_flow > 1)
|
points = Eventech.Common.FitCurveHelper.GetFitPointsByRange(curve.CurveExpress, curve.CurveExpress.RangeMin, work_qh_max_flow, 7);
|
else
|
points = Eventech.Common.FitCurveHelper.GetFitPoints(curve.CurveExpress, 7);
|
}
|
}
|
else
|
{
|
if (_isTrimCurveNpshOverQH && work_qh_max_flow > 1)
|
points = Eventech.Common.FitCurveHelper.GetFitPointsByRange(curve.CurveExpress, curve.CurveExpress.RangeMin, work_qh_max_flow, 7);
|
else
|
points = Eventech.Common.FitCurveHelper.GetFitPoints(curve.CurveExpress, 7);
|
}
|
|
var dxfSpline = DrawSingleCurveQNPSH(_colorCurve, points);
|
if (dxfSpline == null)
|
return;
|
if (curve.IsDispPara && !string.IsNullOrEmpty(curve.CurvePara))
|
{
|
var pt_posi = new Point3D(dxfSpline.FitPoints[0].X + _defatulCurveLabelHeight * 1.5, dxfSpline.FitPoints[0].Y + _defatulCurveLabelHeight, 0d);
|
if (curve.LabelPosiPara != null)
|
{
|
pt_posi = new Point3D(curve.LabelPosiPara.X, curve.LabelPosiPara.Y, 0d);
|
}
|
|
if (curve.LabelPosiPara != null)
|
{
|
pt_posi.X = MapRealToPictQ(curve.LabelPosiPara.X);
|
pt_posi.Y = MapRealToPictNPSH(curve.LabelPosiPara.Y);
|
}
|
|
pt_posi.X += _curveParasLabelSpaceX;
|
pt_posi.Y += _curveParasLabelSpaceY;
|
|
DxfMText textLabel = new DxfMText(curve.CurvePara, pt_posi, _defatulCurveLabelHeight);
|
if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Right)
|
textLabel.AttachmentPoint = AttachmentPoint.MiddleRight;
|
else if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Left)
|
textLabel.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
else if (curve.LabelPosiParaAligment == Eventech.Model.eTextAligment.Top)
|
textLabel.AttachmentPoint = AttachmentPoint.BottomCenter;
|
|
textLabel.Color = _colorCurve;
|
|
textLabel.BackgroundFillFlags = BackgroundFillFlags.UseBackgroundFillColor | BackgroundFillFlags.UseDrawingWindowColor;
|
textLabel.BackgroundFillInfo = new BackgroundFillInfo();
|
textLabel.BackgroundFillInfo.BorderOffsetFactor = 1.2;//调整背景遮罩的比例 1是文字的背景,越大背景遮罩效果越大
|
|
if (_curveTextFont != null)
|
textLabel.Style = this._curveTextFont;
|
_dxfFileModel.Entities.Add(textLabel);
|
}
|
}
|
}
|
|
//绘制效率曲线
|
protected override void DrawQECurve()
|
{
|
if (_allCurveQE == null || _allCurveQE.Count() == 0)
|
return;
|
if (!this.IsDispCurveQE)
|
return;
|
|
var layer_curve = GetLayerByName("粗实线");
|
foreach (var curve in _allCurveQE)
|
{
|
if (!curve.IsDispCurve)
|
continue;
|
if (curve.CurveExpress == null)
|
continue;
|
var points = Eventech.Common.CurveExpressConver.ToPoints(curve.CurveExpress, 15);
|
|
|
var dxfSpline = DrawSingleCurveQE(_colorCurve, points, 30, layer_curve);
|
if (dxfSpline == null)
|
return;
|
if (curve.IsDispPara && !string.IsNullOrEmpty(curve.CurvePara))
|
{
|
var pt_posi = new Point3D(dxfSpline.FitPoints[0].X + _defatulCurveLabelHeight, dxfSpline.FitPoints[1].Y + _defatulCurveLabelHeight - 2, 0d);
|
if (curve.LabelPosiPara != null)
|
{
|
pt_posi.X = MapRealToPictQ(curve.LabelPosiPara.X);
|
pt_posi.Y = MapRealToPictE(curve.LabelPosiPara.Y);
|
}
|
|
DxfMText textLabel = new DxfMText(curve.CurvePara, pt_posi, _defatulCurveLabelHeight);
|
textLabel.Color = _colorCurve;
|
if (_curveTextFont != null)
|
textLabel.Style = this._curveTextFont;
|
_dxfFileModel.Entities.Add(textLabel);
|
}
|
|
}
|
}
|
|
|
//绘制功率曲线
|
protected override void DrawQPCurve()
|
{
|
if (_allCurveQP == null || _allCurveQP.Count() == 0)
|
return;
|
var layer_curve = GetLayerByName("粗实线");
|
foreach (var curve in _allCurveQP)
|
{
|
if (!curve.IsDispCurve)
|
continue;
|
if (curve.CurveExpress == null)
|
continue;
|
var points = Eventech.Common.CurveExpressConver.ToPoints(curve.CurveExpress, 15);
|
|
var dxfSpline = DrawSingleCurveQP(_colorCurve, points, 30, layer_curve);
|
if (dxfSpline == null)
|
return;
|
if (curve.IsDispPara && !string.IsNullOrEmpty(curve.CurvePara))
|
{
|
var pt_posi = new Point3D(dxfSpline.FitPoints[0].X + _defatulCurveLabelHeight, dxfSpline.FitPoints[1].Y + _defatulCurveLabelHeight - 2, 0d);
|
if (curve.LabelPosiPara != null)
|
{
|
pt_posi.X = MapRealToPictQ(curve.LabelPosiPara.X);
|
pt_posi.Y = MapRealToPictP(curve.LabelPosiPara.Y);
|
}
|
|
DxfMText textLabel = new DxfMText(curve.CurvePara, pt_posi, _defatulCurveLabelHeight);
|
textLabel.Color = _colorCurve;
|
if (_curveTextFont != null)
|
textLabel.Style = this._curveTextFont;
|
_dxfFileModel.Entities.Add(textLabel);
|
}
|
}
|
}
|
|
|
//绘制区域
|
public void DrawRegion()
|
{
|
var layer_grid_line = GetLayerByName("细实线");
|
|
#region 最优区域(标注)
|
DxfDimensionStyle alternativedimenstionStyle = null;
|
if (this._isDispRegionPrefer && this._regionPointParas != null)
|
{
|
if (alternativedimenstionStyle == null)
|
{
|
WW.Cad.Model.Color deminColor = WW.Cad.Model.Color.CreateFromColorIndex(100); //CreateFromRgb(0, 255, 0);
|
//var frameTextFont = _dxfFileModel.GetTextStyleWithName("PC_TEXTSTYLE");//文件自带字体
|
|
alternativedimenstionStyle = new DxfDimensionStyle(_dxfFileModel);
|
alternativedimenstionStyle.Name = "Architectural";//GB_LINEAR 文字在线上面 "Architectural" 文字在中间
|
//alternativedimenstionStyle.LinearUnitFormat = LinearUnitFormat.Engineering;
|
alternativedimenstionStyle.ArrowSize = 1.5d;
|
alternativedimenstionStyle.TextHeight = 2.5;
|
//alternativedimenstionStyle.FixedExtensionLineLength = 5;
|
alternativedimenstionStyle.ExtensionLineColor = deminColor;
|
alternativedimenstionStyle.ExtensionLineExtension = 2;
|
alternativedimenstionStyle.DimensionLineColor = deminColor;
|
alternativedimenstionStyle.TextColor = deminColor;
|
|
alternativedimenstionStyle.TextBackgroundFillMode = DimensionTextBackgroundFillMode.DrawingBackgroundColor;
|
// alternativedimenstionStyle.TextBackgroundColor = WW.Cad.Model.Color.CreateFromColorIndex(18); //CreateFromRgb(0, 255, 0);
|
//if (frameTextFont != null)
|
// alternativedimenstionStyle.TextStyle = frameTextFont;
|
//alternativedimenstionStyle.TickSize = 10;
|
_dxfFileModel.DimensionStyles.Add(alternativedimenstionStyle);
|
|
}
|
|
DxfDimension.Linear dimension = new DxfDimension.Linear(alternativedimenstionStyle);
|
// dimension.HasTextRotation = false;
|
// dimension.TextRotation = 0;
|
// Touches bottom side of the circle.
|
dimension.ExtensionLine1StartPoint = new Point3D(MapRealToPictQ(this._regionPointParas.PerferRegionMin.Q), _diagramLeftTopPt_QH.Y, 0);
|
// Touches top side of the circle.
|
dimension.ExtensionLine2StartPoint = new Point3D(MapRealToPictQ(this._regionPointParas.PerferRegionMax.Q), _diagramLeftTopPt_QH.Y, 0);
|
//dimension.Color = GetEntityColor(System.Drawing.Color.Beige);
|
//dimension.DxfColor = GetEntityColor(System.Drawing.Color.Beige);
|
dimension.DimensionLineLocation = new Point3D((dimension.ExtensionLine1StartPoint.X + dimension.ExtensionLine2StartPoint.X) * 0.5, _diagramLeftTopPt_QH.Y + 3.2, 0);
|
// dimension.UseTextMiddlePoint = true;
|
//dimension.HorizontalDirection = 0;
|
if (this._currentLangugage == Eventech.Model.eLocalizationType.zhCN)
|
dimension.Text = " 优先工作区 ";//
|
else
|
dimension.Text = " Priority workspace ";//
|
|
_dxfFileModel.Entities.Add(dimension);
|
|
//DxfVPort activeViewport = DxfVPort.CreateActiveVPort();
|
//activeViewport.Center = new Point2D(3, 2);
|
//activeViewport.Height = 15;
|
//_dxfFileModel.VPorts.Add(activeViewport);
|
|
var dxfLineDash = _dxfFileModel.LineTypes.Where(x => x.Name == "DASHED2").FirstOrDefault();//虚线
|
|
Point2D pt_min1 = new Point2D(MapRealToPictQ(this._regionPointParas.PerferRegionMin.Q), _diagramLeftTopPt_QH.Y);
|
Point2D pt_min2 = new Point2D(MapRealToPictQ(this._regionPointParas.PerferRegionMin.Q), _diagramLeftBottomPt_QP.Y);
|
DxfLine dxfLine_min = new DxfLine(pt_min1, pt_min2);
|
dxfLine_min.Color = AutoCadHelper.GetColor(System.Drawing.Color.Red);
|
dxfLine_min.Layer = layer_grid_line;
|
if (dxfLineDash != null)
|
dxfLine_min.LineType = dxfLineDash;
|
_dxfFileModel.Entities.Add(dxfLine_min);
|
|
|
|
Point2D pt_max1 = new Point2D(MapRealToPictQ(this._regionPointParas.PerferRegionMax.Q), _diagramLeftTopPt_QH.Y);
|
Point2D pt_max2 = new Point2D(MapRealToPictQ(this._regionPointParas.PerferRegionMax.Q), _diagramLeftBottomPt_QP.Y);
|
DxfLine dxfLine_max = new DxfLine(pt_max1, pt_max2);
|
dxfLine_max.Color = AutoCadHelper.GetColor(System.Drawing.Color.Red);
|
dxfLine_max.Layer = layer_grid_line;
|
if (dxfLineDash != null)
|
dxfLine_max.LineType = dxfLineDash;
|
_dxfFileModel.Entities.Add(dxfLine_max);
|
}
|
#endregion
|
|
#region 运行区域(标注)
|
if (_isDispRegionAllow && this._regionPointParas != null)
|
{
|
if (alternativedimenstionStyle == null)
|
{
|
WW.Cad.Model.Color deminColor = WW.Cad.Model.Color.CreateFromColorIndex(100); //CreateFromRgb(0, 255, 0);
|
//var deminColor = WW.Cad.Model.Color.CreateFromRgb(0, 0, 255);
|
//if (this._isMonoColor)
|
// deminColor = WW.Cad.Model.Color.CreateFromRgb(250, 250, 250);
|
|
alternativedimenstionStyle = new DxfDimensionStyle(_dxfFileModel);
|
alternativedimenstionStyle.Name = "Architectural";
|
//alternativedimenstionStyle.LinearUnitFormat = LinearUnitFormat.Engineering;
|
alternativedimenstionStyle.ArrowSize = 1.5d;
|
alternativedimenstionStyle.TextHeight = 2;
|
//alternativedimenstionStyle.FixedExtensionLineLength = 5;
|
alternativedimenstionStyle.ExtensionLineColor = deminColor;
|
alternativedimenstionStyle.ExtensionLineExtension = 2.5;
|
alternativedimenstionStyle.DimensionLineColor = deminColor;
|
alternativedimenstionStyle.TextColor = deminColor;
|
//alternativedimenstionStyle.TickSize = 10;
|
alternativedimenstionStyle.TextBackgroundFillMode = DimensionTextBackgroundFillMode.DrawingBackgroundColor;
|
//alternativedimenstionStyle.TextBackgroundColor = WW.Cad.Model.Color.CreateFromColorIndex(18); //CreateFromRgb(0, 255, 0);
|
_dxfFileModel.DimensionStyles.Add(alternativedimenstionStyle);
|
|
}
|
|
|
DxfDimension.Linear dimension = new DxfDimension.Linear(alternativedimenstionStyle);
|
// dimension.HasTextRotation = false;
|
// dimension.TextRotation = 0;
|
// Touches bottom side of the circle.
|
dimension.ExtensionLine1StartPoint = new Point3D(MapRealToPictQ(this._regionPointParas.AllowRegionMin.Q), _diagramLeftBottomPt_QH.Y, 0);
|
// Touches top side of the circle.
|
dimension.ExtensionLine2StartPoint = new Point3D(MapRealToPictQ(this._regionPointParas.AllowRegionMax.Q), _diagramLeftBottomPt_QH.Y, 0);
|
//dimension.Color = GetEntityColor(System.Drawing.Color.Beige);
|
//dimension.DxfColor = GetEntityColor(System.Drawing.Color.Beige);
|
dimension.DimensionLineLocation = new Point3D((dimension.ExtensionLine1StartPoint.X + dimension.ExtensionLine2StartPoint.X) * 0.5, _diagramLeftBottomPt_QH.Y - 4.25, 0);
|
// dimension.UseTextMiddlePoint = true;
|
//dimension.HorizontalDirection = 0;
|
if (this._currentLangugage == Eventech.Model.eLocalizationType.zhCN)
|
dimension.Text = " 允许工作区 ";//
|
else
|
dimension.Text = " Allow workspace ";//
|
|
_dxfFileModel.Entities.Add(dimension);
|
|
//DxfVPort activeViewport = DxfVPort.CreateActiveVPort();
|
//activeViewport.Center = new Point2D(3, 2);
|
//activeViewport.Height = 15;
|
//_dxfFileModel.VPorts.Add(activeViewport);
|
|
var dxfLineDash = _dxfFileModel.LineTypes.Where(x => x.Name == "LEI").FirstOrDefault();//虚线
|
|
Point2D pt_min1 = new Point2D(MapRealToPictQ(this._regionPointParas.AllowRegionMin.Q), _diagramLeftTopPt_QH.Y);
|
Point2D pt_min2 = new Point2D(MapRealToPictQ(this._regionPointParas.AllowRegionMin.Q), _diagramLeftBottomPt_QP.Y);
|
DxfLine dxfLine_min = new DxfLine(pt_min1, pt_min2);
|
dxfLine_min.Color = AutoCadHelper.GetColor(System.Drawing.Color.Red);
|
dxfLine_min.Layer = layer_grid_line;
|
if (dxfLineDash != null)
|
dxfLine_min.LineType = dxfLineDash;
|
_dxfFileModel.Entities.Add(dxfLine_min);
|
|
|
|
Point2D pt_max1 = new Point2D(MapRealToPictQ(this._regionPointParas.AllowRegionMax.Q), _diagramLeftTopPt_QH.Y);
|
Point2D pt_max2 = new Point2D(MapRealToPictQ(this._regionPointParas.AllowRegionMax.Q), _diagramLeftBottomPt_QP.Y);
|
DxfLine dxfLine_max = new DxfLine(pt_max1, pt_max2);
|
dxfLine_max.Color = AutoCadHelper.GetColor(System.Drawing.Color.Red);
|
dxfLine_max.Layer = layer_grid_line;
|
if (dxfLineDash != null)
|
dxfLine_max.LineType = dxfLineDash;
|
_dxfFileModel.Entities.Add(dxfLine_max);
|
}
|
#endregion
|
|
#region 最小流量线
|
//if (_isDispRegionAllow && this._regionPointParas != null)
|
//{
|
// var regionAllowQ_pict = MapRealToPictQ(this._regionPointParas.AllowRegionMin.Q);
|
|
// var curveColor = TProduct.PumpGraph.Dxf.AutoCadHelper.GetColor(110);
|
// //
|
// var dxfLineDash = _dxfFileModel.LineTypes.Where(x => x.Name == "DASHED2").FirstOrDefault();//虚线
|
// //延长线
|
// DxfLine lineQ = new DxfLine(new Point2D(regionAllowQ_pict, this._diagramLeftTopPt_QH.Y), new Point2D(regionAllowQ_pict, -8));
|
// lineQ.LineWeight = 40;
|
// lineQ.Color = curveColor;
|
// if (dxfLineDash != null)
|
// lineQ.LineType = dxfLineDash;
|
// _dxfFileModel.Entities.Add(lineQ);
|
|
// //文字
|
// var textFont = _dxfFileModel.GetTextStyleWithName("PC_TEXTSTYLE4");//文件自带字体
|
// if (textFont == null)
|
// textFont = _dxfFileModel.GetTextStyleWithName("Standard");//文件自带字体
|
|
// Point3D pt_q_min = new Point3D();
|
// pt_q_min.X = regionAllowQ_pict;
|
// pt_q_min.Y = -30;
|
// pt_q_min.Z = 0d;
|
// DxfMText text_q_min = new DxfMText("Qmin", pt_q_min, 11);//\P表示回车
|
// text_q_min.AttachmentPoint = AttachmentPoint.TopCenter;
|
// text_q_min.Color = curveColor;
|
// text_q_min.Style = textFont;
|
// _dxfFileModel.Entities.Add(text_q_min);
|
//}
|
#endregion
|
|
}
|
|
|
#region 工作点
|
private void DrawWorkPoint()
|
{
|
if (!_isDrawDesignPoint)
|
return;
|
var layer_curve = GetLayerByName("粗实线");
|
|
var textColor = TProduct.PumpGraph.Dxf.AutoCadHelper.GetColor(TProduct.PumpGraph.Dxf.AutoCadHelper.RedColorIndex);
|
if (this._isMonoColor)
|
{
|
textColor = TProduct.PumpGraph.Dxf.AutoCadHelper.GetColor(TProduct.PumpGraph.Dxf.AutoCadHelper.WhiteColorIndex);
|
}
|
if (this._designPointStdUnit != null)
|
{
|
Point2D centerPt = new Point2D();
|
centerPt.X = MapRealToPictQ(this._designPointStdUnit.X);
|
centerPt.Y = MapRealToPictH(this._designPointStdUnit.Y);
|
|
|
|
//
|
DxfLine lineQ = new DxfLine(new Point2D(centerPt.X, this._diagramLeftTopPt_QH.Y), new Point2D(centerPt.X, this._diagramLeftBottomPt.Y));
|
lineQ.LineWeight = 30;
|
lineQ.Color = textColor;
|
lineQ.Layer = layer_curve;
|
_dxfFileModel.Entities.Add(lineQ);
|
|
|
|
DxfLine lineH = new DxfLine(new Point2D(this._diagramLeftTopPt_QH.X, centerPt.Y), new Point2D(this._diagramRightTopPt_QH.X, centerPt.Y));
|
lineH.LineWeight = 30;
|
lineH.Layer = layer_curve;
|
lineH.Color = textColor;
|
_dxfFileModel.Entities.Add(lineH);
|
|
|
|
DxfCircle circleQP = new DxfCircle(centerPt, 1.5);
|
circleQP.LineWeight = 200;
|
circleQP.Color = textColor;
|
circleQP.Layer = layer_curve;
|
_dxfFileModel.Entities.Add(circleQP);
|
}
|
|
|
|
|
|
|
|
}
|
#endregion
|
|
|
}
|
}
|