duheng
2024-10-24 bb5865148234cad04ae31d4de9264f4209a3fa6d
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/02-analy/SinglePumpAnalyInfoCtrl.cs
@@ -1,6 +1,4 @@
using Yw.WinFrmUI.Phart;
namespace HStation.WinFrmUI.Xhs
namespace HStation.WinFrmUI.Xhs
{
    public partial class SinglePumpAnalyInfoCtrl : DevExpress.XtraEditors.XtraUserControl
    {
@@ -19,7 +17,7 @@
            this.colName.OptionsColumn.AllowEdit = false;
            this.colName.OptionsColumn.ReadOnly = true;
            this.colName.Visible = false;
            this.colColor.OptionsColumn.AllowEdit = false;
            this.colColor.OptionsColumn.ReadOnly = true;
@@ -29,8 +27,6 @@
            this.colCurrentSpeed.OptionsColumn.ReadOnly = true;
        }
@@ -49,6 +45,11 @@
        /// </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)
@@ -65,7 +66,6 @@
            this.gridView2.BestFitColumns();
            this.gridView3.BestFitColumns();
        }
        public void SetDesignPoint(double flow, double head)
        {
@@ -194,6 +194,12 @@
            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);
        }
    }
}