using System;
|
using System.Collections.Generic;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
|
namespace TProduct.PumpGraph.Picture
|
{
|
public abstract class ZlpFeatChart : FeatChart
|
{
|
|
|
protected Eventech.Model.QhCoordinateParas _coordinateParas = null;
|
|
public void SetCoordinate(Eventech.Model.QhCoordinateParas coordinateParas)
|
{
|
this._coordinateParas = coordinateParas;
|
}
|
|
|
|
|
|
|
protected float _diagram_Cell_Height = 10;//图表中每个格子的高度(图片上的高度)
|
|
|
|
//X轴实际尺寸换算为像素尺寸
|
protected float MapRealToPictQ(double Q)
|
{
|
return (float)((_coordinateParas.AxisCalcQ.Calc(Q) - _coordinateParas.AxisLabelQ.First() ) * _chartDiagram.Width / (_coordinateParas.AxisLabelQ.Last() - _coordinateParas.AxisLabelQ.First())) + _chartDiagram.Left;
|
//return (float)((_coordinateParas.AxisCalcQ.Calc(Q) - _coordinateParas.AxisLabelQ[0]) * (_diagramRightBottomPt.X - _diagramLeftBottomPt.X) / ((_coordinateParas.AxisLabelQ[_coordinateParas.AxisLabelQ.Count - 1] - _coordinateParas.AxisLabelQ[0]))) + _diagramLeftBottomPt.X;
|
}
|
|
//扬程曲线Y坐标实际尺寸换算为像素尺寸
|
protected float MapRealToPictH(double H)
|
{
|
return _chartDiagram.Bottom - (float)((H - _coordinateParas.AxisLabelH.First()) * _chartDiagram.Height / (_coordinateParas.AxisLabelH.Last() - _coordinateParas.AxisLabelH.First()));
|
//return _diagramLeftBottomPt.Y - (float)((H - _coordinateParas.AxisLabelH[0]) * (_diagramLeftBottomPt.Y - _diagramLeftTopPt.Y) / (_coordinateParas.AxisLabelH[_coordinateParas.AxisLabelH.Count - 1] - _coordinateParas.AxisLabelH[0]));
|
}
|
|
|
public void SetEqualParaCurve(Eventech.Model.CombineCurveList equalParaCurveE, Eventech.Model.AnnoAnchorPointList annoAnchorPointList)
|
{
|
AnnoAnchorPointList = annoAnchorPointList;
|
_equalParaCurveE = equalParaCurveE;
|
}
|
|
|
public void SetChartTextWith(float QtextWith, float HtextWith, float EtextWith, float PtextWith)
|
{
|
|
this._axisTitleTextSizeY = HtextWith;
|
|
this._axisTitleTextSizeQ = QtextWith;
|
}
|
|
|
|
/// <summary>
|
/// 绘制扬程特殊线
|
/// </summary>
|
protected void DrawSpecConstantLineH()
|
{
|
if (_maxHeadValue.HasValue && _maxHeadValue > 0)
|
{
|
//var color = TProduct.PumpGraph.Dxf.AutoCadHelper.BlueColor;
|
|
//var pic_h = MapRealToPictH(_maxHeadValue.Value);
|
//DxfLine lineRight = new DxfLine(new Point2D(_diagramLeftTopPt.X, pic_h), new Point2D(_diagramRightTopPt.X, pic_h));
|
//lineRight.LineWeight = 2;
|
//lineRight.Color = color;
|
//_dxfFileModel.Entities.Add(lineRight);
|
|
|
//var labelPtH = new Point3D(_diagramRightTopPt.X - 5, pic_h + 2, 0d);
|
//DxfMText axisLabel_h = new DxfMText("最高扬程", labelPtH, _axisLabelSizeY);//\P表示回车
|
//axisLabel_h.AttachmentPoint = AttachmentPoint.BottomRight;
|
//if (_axisTextFont != null)
|
// axisLabel_h.Style = this._axisTextFont;
|
//axisLabel_h.Color = color;
|
//_dxfFileModel.Entities.Add(axisLabel_h);
|
}
|
|
|
if (_averagHeadValue.HasValue && _averagHeadValue > 0)
|
{
|
//var color = TProduct.PumpGraph.Dxf.AutoCadHelper.BlueColor;
|
|
//var pic_h = MapRealToPictH(_averagHeadValue.Value);
|
//DxfLine lineRight = new DxfLine(new Point2D(_diagramLeftTopPt.X, pic_h), new Point2D(_diagramRightTopPt.X, pic_h));
|
//lineRight.LineWeight = 2;
|
//lineRight.Color = color;
|
//_dxfFileModel.Entities.Add(lineRight);
|
|
|
//var labelPtH = new Point3D(_diagramRightTopPt.X - 5, pic_h + 2, 0d);
|
//DxfMText axisLabel_h = new DxfMText("平均扬程", labelPtH, _axisLabelSizeY);//\P表示回车
|
//axisLabel_h.AttachmentPoint = AttachmentPoint.BottomRight;
|
//if (_axisTextFont != null)
|
// axisLabel_h.Style = this._axisTextFont;
|
//axisLabel_h.Color = color;
|
//_dxfFileModel.Entities.Add(axisLabel_h);
|
}
|
|
if (_minHeadValue.HasValue && _minHeadValue > 0)
|
{
|
//var color = TProduct.PumpGraph.Dxf.AutoCadHelper.BlueColor;
|
|
//var pic_h = MapRealToPictH(_minHeadValue.Value);
|
//DxfLine lineRight = new DxfLine(new Point2D(_diagramLeftTopPt.X, pic_h), new Point2D(_diagramRightTopPt.X, pic_h));
|
//lineRight.LineWeight = 2;
|
//lineRight.Color = color;
|
//_dxfFileModel.Entities.Add(lineRight);
|
|
|
//var labelPtH = new Point3D(_diagramRightTopPt.X - 5, pic_h + 2, 0d);
|
//DxfMText axisLabel_h = new DxfMText("最低扬程", labelPtH, _axisLabelSizeY);//\P表示回车
|
//axisLabel_h.AttachmentPoint = AttachmentPoint.BottomRight;
|
//if (_axisTextFont != null)
|
// axisLabel_h.Style = this._axisTextFont;
|
//axisLabel_h.Color = color;
|
//_dxfFileModel.Entities.Add(axisLabel_h);
|
}
|
}
|
protected double? _maxHeadValue = null;
|
protected double? _averagHeadValue = null;
|
protected double? _minHeadValue = null;
|
public void SetSpecConstantLineValue(double? min, double? avery, double? max)
|
{
|
this._maxHeadValue = max;
|
this._averagHeadValue = avery;
|
this._minHeadValue = min;
|
}
|
|
|
|
|
|
}
|
}
|