using DevExpress.XtraEditors;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class ExchangerPerform2dEditDlg : XtraForm
|
{
|
public ExchangerPerform2dEditDlg()
|
{
|
InitializeComponent();
|
}
|
|
/// <summary>
|
/// 回调事件
|
/// </summary>
|
public event Func<Yw.Geometry.CubicSpline2d, Task<bool>> ReloadDataEvent;
|
|
/// <summary>
|
/// 初始化数据
|
/// </summary>
|
public void SetBindingData(Yw.Geometry.CubicSpline2d ql)
|
{
|
if (ql == null)
|
{
|
return;
|
}
|
|
this.curveExpressEditCtrl1.SetBindingData(ql);
|
}
|
|
public void SetAxisTile(string x, string y)
|
{
|
this.curveExpressEditCtrl1.SetAxisTile(x, y);
|
}
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData(List<Yw.Geometry.Point2d> pt_ql_list,
|
List<Yw.Geometry.Point2d> def_pt_ql_list)
|
{
|
this.curveExpressEditCtrl1.SetBindingData(pt_ql_list, def_pt_ql_list);
|
}
|
|
//确定
|
private async void btnOk_Click(object sender, EventArgs e)
|
{
|
var bol = this.curveExpressEditCtrl1.GetPoints(
|
out List<Yw.Geometry.Point2d> pt_ql_list);
|
if (!bol)
|
{
|
return;
|
}
|
|
var cubic_spline_ql = new Yw.Geometry.CubicSpline2d(pt_ql_list);
|
var result = await this.ReloadDataEvent?.Invoke(cubic_spline_ql);
|
if (!result)
|
{
|
XtraMessageBox.Show("更新失败!");
|
return;
|
}
|
XtraMessageBox.Show("更新成功!");
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
}
|