Shuxia Ning
2024-10-14 c7e02f7991407f48a377b47ad2599f52017e8d55
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -1,7 +1,6 @@
global using Yw.EPAnet;
using DevExpress.XtraMap.Drawing;
using NetTaste;
using Org.BouncyCastle.Crypto.Engines;
using Yw.WinFrmUI.Bimface;
using Yw.WinFrmUI.Hydro;
namespace HStation.WinFrmUI
{
@@ -12,8 +11,7 @@
            InitializeComponent();
            this.PageTitle.Caption = "水力模拟";
            this.PageTitle.HeaderSvgImage = this.svgImg32[0];
            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
        }
        private HStation.Vmo.XhsProjectVmo _project = null;//项目
@@ -499,11 +497,13 @@
            {
                return;
            }
            if (_parter == null)
            {
                this.xhsProjectSimulationPropertyCtrl1.SelectParter(null);
                return;
            }
            this.xhsProjectSimulationPropertyCtrl1.SelectParter(_parter.Code);
            if (_calcuResult != null)
            {
@@ -540,6 +540,7 @@
                    }
                }
            }
        }
        #endregion
@@ -599,7 +600,7 @@
                var qh_pt_list = qh.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList();
                var qe_pt_list = qe?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList();
                var qp_pt_list = qp?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList();
                var vm = new Yw.WinFrmUI.Phart.PumpSerialParallelViewModel();
                vm.Id = x.Code;
                vm.Name = x.Code;
@@ -780,5 +781,76 @@
        #region 标注
        private List<HydroMarkSetViewModel> _allMarkList = null;
        //标注
        private void barBtnMark_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (_hydroInfo == null)
            {
                return;
            }
            if (_allMarkList == null)
            {
                _allMarkList = new List<HydroMarkSetViewModel>();
                if (_hydroInfo.Waterboxs != null && _hydroInfo.Waterboxs.Count > 0)
                {
                    _allMarkList.Add(new HydroMarkSetViewModel()
                    {
                        Code = Yw.Hydro.ParterCatalog.Waterbox,
                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Waterbox),
                        MarkType = (int)eWaterboxMarkType.None
                    });
                }
                if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0)
                {
                    _allMarkList.Add(new HydroMarkSetViewModel()
                    {
                        Code = Yw.Hydro.ParterCatalog.Pump,
                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Pump),
                        MarkType = (int)eWaterboxMarkType.None
                    });
                }
                if (_hydroInfo.Valves != null && _hydroInfo.Valves.Count > 0)
                {
                    _allMarkList.Add(new HydroMarkSetViewModel()
                    {
                        Code = Yw.Hydro.ParterCatalog.Valve,
                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Valve),
                        MarkType = (int)eWaterboxMarkType.None
                    });
                }
                if (_hydroInfo.Pipes != null && _hydroInfo.Pipes.Count > 0)
                {
                    _allMarkList.Add(new HydroMarkSetViewModel()
                    {
                        Code = Yw.Hydro.ParterCatalog.Pipe,
                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Pipe),
                        MarkType = (int)eWaterboxMarkType.None
                    });
                }
                if (_hydroInfo.Nozzles != null && _hydroInfo.Nozzles.Count > 0)
                {
                    _allMarkList.Add(new HydroMarkSetViewModel()
                    {
                        Code = Yw.Hydro.ParterCatalog.Nozzle,
                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Nozzle),
                        MarkType = (int)eWaterboxMarkType.None
                    });
                }
            }
            var dlg = new SetHydroMarkDlg();
            dlg.SetBindingData(() => _hydroInfo, _allMarkList);
            dlg.ReloadDataEvent += async (obj) =>
            {
                var leadLabels = obj?.Select(x => new LeadLabel() { Id = x.Code, Text = x.Text }).ToList();
                await _bimfaceCtrl?.SetLeadLabels(leadLabels);
            };
            dlg.ShowDialog();
        }
        #endregion
    }
}