namespace HStation.WinFrmUI.PhartRelation
{
public partial class XtrPerform2dMultiViewDlg : XtraForm
{
public XtrPerform2dMultiViewDlg()
{
InitializeComponent();
}
///
///
///
/// id,名称,转速比,颜色,...
///
///
public void SetBindingData(List> list,bool only_line, bool is_parallel = true)
{
if (list == null || !list.Any())
{
return;
}
var helper = new Yw.WinFrmUI.Phart.ParallelConnectionHelper();
foreach (var item in list)
{
var id = item.Item1;
var name = item.Item2;
var hz = item.Item3 * 50;
var color = item.Item4;
var qh = item.Item5;
var qe = item.Item6;
var qp = item.Item7;
Yw.Geometry.CubicSpline2d cubic_spline_qh = null, cubic_spline_qe = null, cubic_spline_qp = null;
cubic_spline_qh = new Yw.Geometry.CubicSpline2d(qh.FeatCurve.GetPointList());
if (qe != null)
cubic_spline_qe = new Yw.Geometry.CubicSpline2d(qe.FeatCurve.GetPointList());
if (qp != null)
cubic_spline_qp = new Yw.Geometry.CubicSpline2d(qp.FeatCurve.GetPointList());
cubic_spline_qh = Yw.WinFrmUI.Phart.Perform2dCalcHelper.CalculateSimilarQH(cubic_spline_qh, 50, hz);
cubic_spline_qe = Yw.WinFrmUI.Phart.Perform2dCalcHelper.CalculateSimilarQE(cubic_spline_qe, 50, hz);
cubic_spline_qp = Yw.WinFrmUI.Phart.Perform2dCalcHelper.CalculateSimilarQP(cubic_spline_qp, 50, hz);
if (!only_line)
{
this.xtrPerform2dMultiChart1.Add(id, name, color, cubic_spline_qh, cubic_spline_qe, cubic_spline_qp);
}
helper.Add(cubic_spline_qh, cubic_spline_qp);
}
var calc_bol = false;
var line_name = "";
List pt_qh_list;
List pt_qe_list;
List pt_qp_list;
if (is_parallel)
{
line_name = "并联曲线";
calc_bol = helper.CalculateParallel(out pt_qh_list, out pt_qe_list, out pt_qp_list);
}
else
{
line_name = "串联曲线";
calc_bol = helper.CalculateSeries(out pt_qh_list, out pt_qe_list, out pt_qp_list);
}
if (!calc_bol)
return;
this.xtrPerform2dMultiChart1.Add(-1, line_name, System.Drawing.Color.Black, pt_qh_list, pt_qe_list, pt_qp_list);
}
}
}