namespace HStation.WinFrmUI
|
{
|
public partial class SimulationPumpCurveEditDlg : DevExpress.XtraBars.Ribbon.RibbonForm
|
{
|
public SimulationPumpCurveEditDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
|
}
|
|
/// <summary>
|
/// 重载数据
|
/// 第一个QH
|
/// 第二个QP
|
/// 第三个QE
|
/// </summary>
|
public event Action<List<Yw.Geometry.Point2d>, List<Yw.Geometry.Point2d>, List<Yw.Geometry.Point2d>> ReloadDataEvent;
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData
|
(
|
List<Yw.Geometry.Point2d> curveqh,
|
List<Yw.Geometry.Point2d> curveqp,
|
List<Yw.Geometry.Point2d> curveqe
|
)
|
{
|
if (curveqh == null)
|
{
|
return;
|
}
|
if (curveqp == null)
|
{
|
return;
|
}
|
if (curveqe == null)
|
{
|
return;
|
}
|
var curveqh_rhs = curveqh.Select(x => new Yw.Geometry.Point2d(Math.Round(x.X, 1), Math.Round(x.Y, 2))).ToList();
|
var curveqp_rhs = curveqp.Select(x => new Yw.Geometry.Point2d(Math.Round(x.X, 1), Math.Round(x.Y, 1))).ToList();
|
var curveqe_rhs = curveqe.Select(x => new Yw.Geometry.Point2d(Math.Round(x.X, 1), Math.Round(x.Y, 1))).ToList();
|
this.pumpChartExcelEditCtrl1.SetBindingData(curveqh_rhs, curveqe_rhs, curveqp_rhs);
|
}
|
|
//确定
|
private void GeneralOkAndCancelCtrl1_OkEvent()
|
{
|
var bol = this.pumpChartExcelEditCtrl1.Get
|
(
|
out var curveqh,
|
out var curveqe,
|
out var curveqp,
|
out var featqh,
|
out var featqe,
|
out var featqp
|
);
|
if (!bol)
|
{
|
TipFormHelper.ShowError("更新失败!");
|
return;
|
}
|
this.ReloadDataEvent?.Invoke(curveqh, curveqp, curveqe);
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
|
|
}
|
}
|