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
|
{
|
private void DrawPanelQE_QNpsh()
|
{
|
DrawGidLineInQE_NSPH_竖直();
|
DrawGidLineInQE_NSPH_水平();
|
DrawAxisEta();
|
DrawAxisNPSH();
|
}
|
private void DrawPanelQNpsh()
|
{
|
DrawGidLineInNSPH_竖直();
|
DrawGidLineInNSPH_水平();
|
|
DrawAxisNPSH();
|
}
|
private void DrawGidLineInQE_NSPH_竖直()
|
{
|
double spaceWidth = (_diagramRightBottomPt_QE.X - _diagramLeftBottomPt_QE.X) / (_coordinateParas.GridNumberX);//X轴上格子的宽度
|
|
var layer_grid_line = GetLayerByName("细实线");
|
|
double spaceInteriorWidth = spaceWidth / 3;
|
for (int i = 0; i < _coordinateParas.GridNumberX + 1; i++)
|
{
|
double space = i * spaceWidth;//竖直线之间的间距
|
Point2D startXgeziPt = new Point2D(_diagramLeftBottomPt_QE.X + space, _diagramLeftBottomPt_QE.Y);
|
Point2D endXgeziPt = new Point2D(_diagramLeftBottomPt_QE.X + space, _diagramLeftTopPt_QE.Y);
|
DxfLine dxfLine = new DxfLine(startXgeziPt, endXgeziPt);
|
dxfLine.Color = this._gridLineColor;
|
dxfLine.Layer = layer_grid_line;
|
|
_dxfFileModel.Entities.Add(dxfLine);
|
|
if (i != _coordinateParas.GridNumberX)
|
{
|
for (int j = 1; j < 3; j++)
|
{
|
Point2D startXgeziPt_subjoin = new Point2D(_diagramLeftBottomPt_QE.X + space + spaceInteriorWidth * j, _diagramLeftBottomPt_QE.Y);
|
Point2D endXgeziPt_subjoin = new Point2D(_diagramLeftBottomPt_QE.X + space + spaceInteriorWidth * j, _diagramLeftTopPt_QE.Y);
|
DxfLine dxfLine_subjoin = new DxfLine(startXgeziPt_subjoin, endXgeziPt_subjoin);
|
dxfLine_subjoin.Color = this._gridLineColor;
|
dxfLine_subjoin.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(dxfLine_subjoin);
|
}
|
}
|
}
|
}
|
|
private void DrawGidLineInQE_NSPH_水平()
|
{
|
var gridNumber = _coordinateParas.EndLineNoE - _coordinateParas.StartLineNoE;
|
double spaceHeight = (_diagramLeftTopPt_QE.Y - _diagramLeftBottomPt_QE.Y) / gridNumber;//Y轴上格子的宽度
|
double spaceInteriorHeight = spaceHeight / 5;
|
|
var layer_grid_line = GetLayerByName("细实线");
|
|
//bool isIntervalLabel = false;
|
//if (hGridNumber > 5)
|
//{
|
// isIntervalLabel = true;
|
//}
|
for (int i = 0; i < gridNumber; i++)
|
{
|
//if (isIntervalLabel && i % 2 == 0)
|
// continue;
|
|
double space = i * spaceHeight;//水平线
|
Point2D startXgeziPt = new Point2D(_diagramLeftBottomPt_QE.X, _diagramLeftBottomPt_QE.Y + space);
|
Point2D endXgeziPt = new Point2D(_diagramRightBottomPt_QE.X, _diagramLeftBottomPt_QE.Y + space);
|
DxfLine dxfLine = new DxfLine(startXgeziPt, endXgeziPt);
|
dxfLine.Color = this._gridLineColor;
|
dxfLine.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(dxfLine);
|
|
for (int j = 1; j < 5; j++)
|
{
|
Point2D startXgeziPt_subjoin = new Point2D(_diagramLeftBottomPt_QE.X, _diagramLeftBottomPt_QE.Y + space + spaceInteriorHeight * j);
|
Point2D endXgeziPt_subjoin = new Point2D(_diagramRightBottomPt_QE.X, _diagramLeftBottomPt_QE.Y + space + spaceInteriorHeight * j);
|
DxfLine dxfLine_subjoin = new DxfLine(startXgeziPt_subjoin, endXgeziPt_subjoin);
|
dxfLine_subjoin.Color = this._gridLineColor;
|
dxfLine_subjoin.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(dxfLine_subjoin);
|
}
|
}
|
|
DxfLine dxfTopLine = new DxfLine(new Point2D(_diagramLeftTopPt_QE.X, _diagramLeftTopPt_QE.Y), new Point2D(_diagramRightTopPt_QE.X, _diagramLeftTopPt_QE.Y));
|
dxfTopLine.Color = this._gridLineColor;
|
_dxfFileModel.Entities.Add(dxfTopLine);
|
|
}
|
|
|
private void DrawGidLineInNSPH_竖直()
|
{//只显示汽蚀, 不显示效率
|
double spaceWidth = (_diagramRightBottomPt_QNPSH.X - _diagramLeftBottomPt_QNPSH.X) / (_coordinateParas.GridNumberX);//X轴上格子的宽度
|
|
var layer_grid_line = GetLayerByName("细实线");
|
|
double spaceInteriorWidth = spaceWidth / 3;
|
for (int i = 0; i < _coordinateParas.GridNumberX + 1; i++)
|
{
|
double space = i * spaceWidth;//竖直线之间的间距
|
Point2D startXgeziPt = new Point2D(_diagramLeftBottomPt_QNPSH.X + space, _diagramLeftBottomPt_QNPSH.Y);
|
Point2D endXgeziPt = new Point2D(_diagramLeftBottomPt_QNPSH.X + space, _diagramLeftTopPt_QNPSH.Y);
|
DxfLine dxfLine = new DxfLine(startXgeziPt, endXgeziPt);
|
dxfLine.Color = this._gridLineColor;
|
dxfLine.Layer = layer_grid_line;
|
|
_dxfFileModel.Entities.Add(dxfLine);
|
|
if (i != _coordinateParas.GridNumberX)
|
{
|
for (int j = 1; j < 3; j++)
|
{
|
Point2D startXgeziPt_subjoin = new Point2D(_diagramLeftBottomPt_QNPSH.X + space + spaceInteriorWidth * j, _diagramLeftBottomPt_QNPSH.Y);
|
Point2D endXgeziPt_subjoin = new Point2D(_diagramLeftBottomPt_QNPSH.X + space + spaceInteriorWidth * j, _diagramLeftTopPt_QNPSH.Y);
|
DxfLine dxfLine_subjoin = new DxfLine(startXgeziPt_subjoin, endXgeziPt_subjoin);
|
dxfLine_subjoin.Color = this._gridLineColor;
|
dxfLine_subjoin.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(dxfLine_subjoin);
|
}
|
}
|
}
|
}
|
private void DrawGidLineInNSPH_水平()
|
{
|
var gridNumber = _coordinateParas.EndLineNoNPSH - _coordinateParas.StartLineNoNPSH;
|
double spaceHeight = (_diagramLeftTopPt_QNPSH.Y - _diagramLeftBottomPt_QNPSH.Y) / gridNumber;//Y轴上格子的宽度
|
double spaceInteriorHeight = spaceHeight / 5;
|
|
var layer_grid_line = GetLayerByName("细实线");
|
|
//bool isIntervalLabel = false;
|
//if (hGridNumber > 5)
|
//{
|
// isIntervalLabel = true;
|
//}
|
for (int i = 0; i < gridNumber; i++)
|
{
|
//if (isIntervalLabel && i % 2 == 0)
|
// continue;
|
|
double space = i * spaceHeight;//水平线
|
Point2D startXgeziPt = new Point2D(_diagramLeftBottomPt_QNPSH.X, _diagramLeftBottomPt_QNPSH.Y + space);
|
Point2D endXgeziPt = new Point2D(_diagramRightBottomPt_QNPSH.X, _diagramLeftBottomPt_QNPSH.Y + space);
|
DxfLine dxfLine = new DxfLine(startXgeziPt, endXgeziPt);
|
dxfLine.Color = this._gridLineColor;
|
dxfLine.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(dxfLine);
|
|
//if (gridNumber != i)
|
{
|
for (int j = 1; j < 5; j++)
|
{
|
Point2D startXgeziPt_subjoin = new Point2D(_diagramLeftBottomPt_QNPSH.X, _diagramLeftBottomPt_QNPSH.Y + space + spaceInteriorHeight * j);
|
Point2D endXgeziPt_subjoin = new Point2D(_diagramRightBottomPt_QNPSH.X, _diagramLeftBottomPt_QNPSH.Y + space + spaceInteriorHeight * j);
|
DxfLine dxfLine_subjoin = new DxfLine(startXgeziPt_subjoin, endXgeziPt_subjoin);
|
dxfLine_subjoin.Color = this._gridLineColor;
|
dxfLine_subjoin.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(dxfLine_subjoin);
|
}
|
}
|
|
}
|
|
DxfLine dxfTopLine = new DxfLine(new Point2D(_diagramLeftTopPt_QNPSH.X, _diagramLeftTopPt_QNPSH.Y), new Point2D(_diagramRightTopPt_QNPSH.X, _diagramLeftTopPt_QNPSH.Y));
|
dxfTopLine.Color = this._gridLineColor;
|
_dxfFileModel.Entities.Add(dxfTopLine);
|
|
}
|
|
|
private void DrawAxisEta()
|
{
|
double coorMin = _coordinateParas.DispMinE();
|
double coordSpace = _coordinateParas.CoordSpaceE;
|
double gridNumber = _coordinateParas.EndLineNoE - _coordinateParas.StartLineNoE;
|
double coorMax = gridNumber * coordSpace;//刻度显示最大值
|
|
var layer_grid_line = GetLayerByName("细实线");
|
|
//是否间隔的LABEL
|
//bool isIntervalLabel = false;
|
//if (_coordinateParas.GridNumberY > 20)
|
//{
|
// isIntervalLabel = true;
|
//}
|
|
for (int i = 0; i < gridNumber + 1; i++)
|
{
|
double space = i * this._diagram_Cell_Height_E;
|
double kedu_d = coorMin + i * coordSpace;
|
if (kedu_d < 0.001)
|
kedu_d = 0;
|
string kedu_str = kedu_d.ToString();
|
var labelPt = new Point3D(_diagramRightBottomPt_QE.X + 2.5, _diagramLeftBottomPt_QE.Y + space, 0d);
|
DxfMText axisLabel = new DxfMText(kedu_str, labelPt, _axisLabelSizeY);//\P表示回车
|
axisLabel.AttachmentPoint = AttachmentPoint.MiddleLeft;
|
if (_axisTextFont != null)
|
axisLabel.Style = this._axisTextFont;
|
axisLabel.Color = this._axisLabelColorP;
|
axisLabel.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(axisLabel);
|
|
|
|
Point2D startXgeziPt = new Point2D(_diagramRightBottomPt_QE.X + 1.2, _diagramRightBottomPt_QE.Y + space);
|
Point2D endXgeziPt = new Point2D(_diagramRightBottomPt_QE.X, _diagramRightBottomPt_QE.Y + space);
|
DxfLine dxfLine = new DxfLine(startXgeziPt, endXgeziPt);
|
dxfLine.Color = this._gridLineColor;
|
dxfLine.LineWeight = 40;
|
dxfLine.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(dxfLine);
|
|
|
////
|
//if (isIntervalLabel)
|
// i = i + 1;
|
}
|
|
string title = string.Format("Eta\r\n(%)");
|
|
Point3D pt = new Point3D();
|
pt.X = _diagramRightTopPt_QE.X + 8.5;
|
pt.Y = _diagramRightTopPt_QE.Y - 3;
|
pt.Z = 0;
|
DxfMText textTitle = new DxfMText(title, pt, _axisTitleSizeY);
|
textTitle.Color = this._axisTitleColorE;
|
if (_axisTextFont != null)
|
textTitle.Style = this._axisTextFont;
|
textTitle.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(textTitle);
|
}
|
|
private void DrawAxisNPSH()
|
{
|
double coorMin = _coordinateParas.DispMinNPSH();
|
double coordSpace = _coordinateParas.CoordSpaceNPSH;
|
double gridNumber = _coordinateParas.EndLineNoNPSH - _coordinateParas.StartLineNoNPSH;
|
double coorMax = gridNumber * coordSpace;//刻度显示最大值
|
|
var layer_grid_line = GetLayerByName("细实线");
|
|
//是否间隔的LABEL
|
//bool isIntervalLabel = false;
|
//if (_coordinateParas.GridNumberY > 20)
|
//{
|
// isIntervalLabel = true;
|
//}
|
|
|
for (int i = 0; i < gridNumber + 1; i++)
|
{
|
double space = i * _diagram_Cell_Height_NPSH;
|
double kedu_d = coorMin + i * coordSpace ;
|
if (kedu_d < 0.001)
|
kedu_d = 0;
|
string kedu_str = kedu_d.ToString();
|
var labelPt = new Point3D(_diagramLeftBottomPt_QNPSH.X - _axisLabelSpaceToDiagramY_left, _diagramLeftBottomPt_QNPSH.Y + space, 0d);
|
DxfMText axisLabel = new DxfMText(kedu_str, labelPt, _axisLabelSizeY);//\P表示回车
|
axisLabel.AttachmentPoint = AttachmentPoint.MiddleRight;
|
if (_axisTextFont != null)
|
axisLabel.Style = this._axisTextFont;
|
axisLabel.Color = this._axisLabelColorP;
|
axisLabel.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(axisLabel);
|
|
|
|
Point2D startXgeziPt = new Point2D(_diagramLeftBottomPt_QNPSH.X - 1.2, _diagramLeftBottomPt_QNPSH.Y + space);
|
Point2D endXgeziPt = new Point2D(_diagramLeftBottomPt_QNPSH.X, _diagramLeftBottomPt_QNPSH.Y + space);
|
DxfLine dxfLine = new DxfLine(startXgeziPt, endXgeziPt);
|
dxfLine.Color = this._gridLineColor;
|
dxfLine.LineWeight = 40;
|
dxfLine.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(dxfLine);
|
|
|
////
|
//if (isIntervalLabel)
|
// i = i + 1;
|
}
|
|
string title = string.Format("NPSH\r\n(m)");
|
|
Point3D pt = new Point3D();
|
pt.X = _diagramLeftTopPt_QNPSH.X - 9.5;
|
pt.Y = _diagramLeftTopPt_QNPSH.Y + 2;
|
pt.Z = 0;
|
DxfMText textTitle = new DxfMText(title, pt, _axisTitleSizeY);
|
textTitle.Color = this._axisTitleColorNPSH;
|
textTitle.AttachmentPoint = AttachmentPoint.MiddleRight;
|
if (_axisTextFont != null)
|
textTitle.Style = this._axisTextFont;
|
textTitle.Layer = layer_grid_line;
|
_dxfFileModel.Entities.Add(textTitle);
|
}
|
|
}
|
}
|