Shuxia Ning
2024-11-19 a01861a95ede48fa4979a47b24f21616e362e534
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/04-scheme/01-add/01-set/02-valve/SetSchemeValveListCtrl.cs
@@ -1,5 +1,4 @@
using HStation.WinFrmUI.Xhs;
using Yw.Model;
using Yw.Model;
namespace HStation.WinFrmUI
{
@@ -33,7 +32,12 @@
        /// <summary>
        /// 水力改变事件
        /// </summary>
        public event Action<List<HydroParterInfo>> HydroChangedEvent;
        public event Action<List<HydroParterInfo>> HydroChangedEvent;
        /// <summary>
        /// 水力记录改变事件
        /// </summary>
        public event Action<SetSchemeParterRecord> HydroRecordChangedEvent;
        /// <summary>
        /// 显示查询面板
@@ -67,7 +71,7 @@
        /// </summary>
        public void SetBindingData(HydroModelInfo hydroInfo)
        {
            _hydroInfo=hydroInfo;
            _hydroInfo = hydroInfo;
            _allList = new List<HydroValveViewModel>();
            if (hydroInfo != null && hydroInfo.Valves != null && hydroInfo.Valves.Count > 0)
            {
@@ -83,7 +87,7 @@
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, List<HydroCalcuResult> allCalcuResultList)
        public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, List<HydroCalcuVisualResult> allCalcuResultList)
        {
            _allList = new List<HydroValveViewModel>();
            if (hydroInfo != null && hydroInfo.Valves != null && hydroInfo.Valves.Count > 0)
@@ -164,7 +168,7 @@
        /// <summary>
        /// 更新计算属性
        /// </summary>
        public void UpdateCalcuProperty(List<HydroCalcuResult> allCalcuResultList)
        public void UpdateCalcuProperty(List<HydroCalcuVisualResult> allCalcuResultList)
        {
            if (allCalcuResultList != null && allCalcuResultList.Count > 0)
            {
@@ -221,7 +225,7 @@
        //设置
        private void SelectChange()
        {
        {
            if (_hydroInfo == null)
            {
                XtraMessageBox.Show("无水力信息");
@@ -248,7 +252,7 @@
            };
            dlg.ShowDialog();
        }
        //单元格点击
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
@@ -272,6 +276,21 @@
                        row.UpdateProperty();
                        this.gridView1.RefreshRow(e.RowHandle);
                        this.HydroChangedEvent?.Invoke(new List<Yw.Model.HydroParterInfo>() { row.Vmo });
                        var record = new SetSchemeParterRecord();
                        record.Name = row.Vmo.Name;
                        record.Code = row.Vmo.Code;
                        record.Catalog = Yw.Hydro.ParterCatalog.Valve;
                        record.MatchingModel = output;
                        record.Items = new List<SetSchemeParterRecordItem>() {
                        new() {Name="型号",BeforeValue=$"{output.ModelType}",AfterValue=$"{output.MatchingModelType}"},
                        new() {Name="材料",BeforeValue=$"{output.Material}",AfterValue=$"{output.MatchingMaterial}"},
                        new() {Name="直径(mm)",BeforeValue=$"{output.Diameter}",AfterValue=$"{output.MatchingDiameter}"},
                        new() {Name="局阻系数",BeforeValue=$"{output.MinorLoss}",AfterValue=$"{output.MatchingMinorLoss}"},
                        new() {Name="阀门类型",BeforeValue=$"{output.ValveType}",AfterValue=$"{output.MatchingValveType}"},
                        };
                        this.HydroRecordChangedEvent?.Invoke(record);
                    }
                };
                dlg.ShowDialog();
@@ -281,6 +300,6 @@
                this.HydroClickEvent?.Invoke(row.Vmo);
            }
        }
    }
}