namespace Yw.WinFrmUI
|
{
|
public partial class SetNozzleCalcuPrefixCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public SetNozzleCalcuPrefixCtrl()
|
{
|
InitializeComponent();
|
this.layoutControl1.SetupLayoutControl();
|
}
|
|
private Yw.Model.HydroNozzleInfo _nozzle = null;
|
|
/// <summary>
|
///
|
/// </summary>
|
public void SetBindingData(Yw.Model.HydroNozzleInfo nozzle)
|
{
|
this.layoutGroupCaption.Text = "喷嘴";
|
if (!string.IsNullOrEmpty(nozzle.Name))
|
{
|
this.layoutGroupCaption.Text = nozzle.Name;
|
}
|
this.txtElev.EditValue = nozzle.Elev;
|
this.txtDemand.EditValue = nozzle.Demand;
|
this.txtCoefficient.EditValue = nozzle.Coefficient;
|
this.txtMinorLoss.EditValue = nozzle.MinorLoss;
|
}
|
|
/// <summary>
|
/// 更新绑定数据
|
/// </summary>
|
public void UpdateBindingData()
|
{
|
if (_nozzle == null)
|
{
|
return;
|
}
|
_nozzle.Elev = double.Parse(this.txtElev.EditValue?.ToString());
|
_nozzle.Demand = this.txtDemand.EditValue == null ? null : double.Parse(this.txtDemand.EditValue.ToString());
|
_nozzle.Coefficient = double.Parse(this.txtCoefficient.EditValue?.ToString());
|
_nozzle.MinorLoss = this.txtMinorLoss.EditValue == null ? null : double.Parse(this.txtMinorLoss.EditValue.ToString());
|
}
|
|
|
}
|
}
|