| | |
| | | using Yw.WinFrmUI.Phart; |
| | | |
| | | namespace HStation.WinFrmUI.Xhs |
| | | namespace HStation.WinFrmUI.Xhs |
| | | { |
| | | public partial class SinglePumpAnalyInfoCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | { |
| | |
| | | |
| | | this.colName.OptionsColumn.AllowEdit = false; |
| | | this.colName.OptionsColumn.ReadOnly = true; |
| | | this.colName.Visible = false; |
| | | |
| | | |
| | | this.colColor.OptionsColumn.AllowEdit = false; |
| | | this.colColor.OptionsColumn.ReadOnly = true; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设置曲线 |
| | | /// </summary> |
| | | public event Action<string,double,double, Yw.Geometry.CubicSpline2d, Yw.Geometry.CubicSpline2d, Yw.Geometry.CubicSpline2d> SetEvent; |
| | | public event Action<string, double, double, Yw.Geometry.CubicSpline2d, Yw.Geometry.CubicSpline2d, Yw.Geometry.CubicSpline2d> SetEvent; |
| | | |
| | | /// <summary> |
| | | /// 设置曲线信息 |
| | | /// </summary> |
| | | public event Action<string,Color> SetInfoEvent; |
| | | public event Action<string, Color> SetInfoEvent; |
| | | |
| | | /// <summary> |
| | | /// 设置设计点 |
| | | /// </summary> |
| | | public event Action<double, double> SetDesignPointEvent; |
| | | |
| | | /// <summary> |
| | | /// 保存事件 |
| | | /// </summary> |
| | | public event Action<SinglePumpAnalyViewModel> SaveEvent; |
| | | |
| | | private List<SinglePumpAnalyViewModel> _all_binding_list = null; |
| | | |
| | | |
| | | public void SetBindingData(List<SinglePumpAnalyViewModel> vm_list) |
| | | { |
| | | _all_binding_list = new List<SinglePumpAnalyViewModel>(); |
| | |
| | | this.gridView2.BestFitColumns(); |
| | | this.gridView3.BestFitColumns(); |
| | | } |
| | | |
| | | |
| | | public void SetDesignPoint(double flow, double head) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //值变换 |
| | | private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) |
| | | { |
| | |
| | | vm.Calc(); |
| | | this.singlePumpAnalyViewModelBindingSource.ResetBindings(false); |
| | | this.SetEvent?.Invoke(vm.Id, vm.CurrentHz, vm.ExtendRatio, vm.QhCalc, vm.QeCalc, vm.QpCalc); |
| | | } |
| | | } |
| | | else if (e.Column == this.colExtendRatio) |
| | | { |
| | | var vm = this.gridView1.GetRow(e.RowHandle) as SinglePumpAnalyViewModel; |
| | |
| | | /// 设置设计点信息 |
| | | /// </summary> |
| | | public void SetSectPointList(List<Yw.WinFrmUI.Phart.PumpSectPointViewModel> vm_list) |
| | | { |
| | | { |
| | | if (_all_binding_list == null || !_all_binding_list.Any()) |
| | | return; |
| | | _all_binding_list.ForEach(vm => |
| | |
| | | |
| | | var pt = vm_list?.Find(x => x.Id == vm.Id); |
| | | if (pt != null) |
| | | { |
| | | { |
| | | vm.SectQ = pt.QueryQ; |
| | | vm.SectH = pt.QueryH; |
| | | vm.SectE = pt.QueryE; |
| | | vm.SectP = pt.QueryP; |
| | | vm.SectP = pt.QueryP; |
| | | }; |
| | | }); |
| | | this.singlePumpAnalyViewModelBindingSource.ResetBindings(false); |
| | |
| | | this.SetDesignPointEvent?.Invoke(design_q, design_h); |
| | | } |
| | | |
| | | |
| | | private void btnSave_Click(object sender, EventArgs e) |
| | | { |
| | | if (XtraMessageBox.Show("是否保存数据?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) |
| | | return; |
| | | var vm = _all_binding_list.Last(); |
| | | this.SaveEvent?.Invoke(vm); |
| | | } |
| | | } |
| | | } |