lixiaojun
2024-12-09 4607e20cecf567ee2e86f9a07158deaa1b74d622
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace HStation.WinFrmUI
{
    public partial class SimulationSinglePumpFeatDlg : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public SimulationSinglePumpFeatDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
            this.simulationSinglePumpFeatCtrl1.SaveEvent += SimulationSinglePumpFeatCtrl1_SaveEvent;
        }
 
        /// <summary>
        /// 保存事件
        /// </summary>
        public event Action<HydroWorkingPumpViewModel> SaveEvent;
 
        private void SimulationSinglePumpFeatCtrl1_SaveEvent(HydroWorkingPumpViewModel working)
        {
            this.SaveEvent?.Invoke(working);
        }
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(HydroPumpViewModel pumpViewModel)
        {
            if (pumpViewModel == null)
            {
                return;
            }
            SetBindingData(pumpViewModel.HydroInfo, pumpViewModel.Vmo);
        }
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPumpInfo pumpInfo)
        {
            this.simulationSinglePumpFeatCtrl1.SetBindingData(hydroInfo, pumpInfo);
        }
 
        private void SimulationPumpFeatDlg_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.simulationSinglePumpFeatCtrl1.Save();
        }
 
 
    }
}