namespace Yw.WinFrmUI
{
public partial class HydroCurveEditDlg : DevExpress.XtraBars.Ribbon.RibbonForm
{
public HydroCurveEditDlg()
{
InitializeComponent();
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
this.layoutControl1.SetupLayoutControl();
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
}
///
///
///
public event Action ReloadDataEvent;
private Yw.Model.HydroCurveInfo _curve = null;//曲线
///
/// 绑定数据
///
public void SetBindingData(Yw.Model.HydroCurveInfo curve)
{
if (curve == null)
{
return;
}
_curve = curve;
this.hydroCurveEditCtrl1.SetBindingData(curve);
switch (curve.CurveType)
{
case Yw.WinFrmUI.HydroCurveType.CurveQH:
{
this.Text = "流量扬程曲线";
}
break;
case HydroCurveType.CurveQP:
{
this.Text = "流量功率曲线";
}
break;
case HydroCurveType.CurveQE:
{
this.Text = "流量效率曲线";
}
break;
case HydroCurveType.CurveQL:
{
this.Text = "水头损失曲线";
}
break;
case HydroCurveType.CurveOL:
{
this.Text = "开度损失曲线";
}
break;
case HydroCurveType.CurveVol:
{
this.Text = "容积曲线";
}
break;
default: break;
}
}
//确定
private void GeneralOkAndCancelCtrl1_OkEvent()
{
var curve = this.hydroCurveEditCtrl1.GetCurveInfo();
if (curve == null)
{
TipFormHelper.ShowWarn("更新失败!");
return;
}
this.ReloadDataEvent?.Invoke(curve);
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}