WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/00-core/HydroParterListCtrl.Designer.cs
@@ -60,11 +60,11 @@ tabPageTranslations = new DevExpress.XtraBars.Navigation.TabNavigationPage(); hydroTranslationListCtrl1 = new HydroTranslationListCtrl(); tabPageExchangers = new DevExpress.XtraBars.Navigation.TabNavigationPage(); tabPagePump = new DevExpress.XtraBars.Navigation.TabNavigationPage(); hydroExchangerListCtrl1 = new HydroExchangerListCtrl(); tabPagePumps = new DevExpress.XtraBars.Navigation.TabNavigationPage(); hydroPumpListCtrl1 = new HydroPumpListCtrl(); tabPageValves = new DevExpress.XtraBars.Navigation.TabNavigationPage(); hydroValveListCtrl1 = new HydroValveListCtrl(); hydroExchangerListCtrl1 = new HydroExchangerListCtrl(); ((ISupportInitialize)tabPane1).BeginInit(); tabPane1.SuspendLayout(); tabPageJunctions.SuspendLayout(); @@ -83,7 +83,7 @@ tabPagePipes.SuspendLayout(); tabPageTranslations.SuspendLayout(); tabPageExchangers.SuspendLayout(); tabPagePump.SuspendLayout(); tabPagePumps.SuspendLayout(); tabPageValves.SuspendLayout(); SuspendLayout(); // @@ -105,12 +105,12 @@ tabPane1.Controls.Add(tabPagePipes); tabPane1.Controls.Add(tabPageTranslations); tabPane1.Controls.Add(tabPageExchangers); tabPane1.Controls.Add(tabPagePump); tabPane1.Controls.Add(tabPagePumps); tabPane1.Controls.Add(tabPageValves); tabPane1.Dock = DockStyle.Fill; tabPane1.Location = new Point(0, 0); tabPane1.Name = "tabPane1"; tabPane1.Pages.AddRange(new DevExpress.XtraBars.Navigation.NavigationPageBase[] { tabPageJunctions, tabPageElbows, tabPageThreelinks, tabPageFourlinks, tabPageMeters, tabPageFlowmeters, tabPagePressmeters, tabPageNozzles, tabPageHydrants, tabPageBlunthead, tabPageReservoirs, tabPageTanks, tabPageWaterboxs, tabPagePipes, tabPageTranslations, tabPageExchangers, tabPagePump, tabPageValves }); tabPane1.Pages.AddRange(new DevExpress.XtraBars.Navigation.NavigationPageBase[] { tabPageJunctions, tabPageElbows, tabPageThreelinks, tabPageFourlinks, tabPageMeters, tabPageFlowmeters, tabPagePressmeters, tabPageNozzles, tabPageHydrants, tabPageBlunthead, tabPageReservoirs, tabPageTanks, tabPageWaterboxs, tabPagePipes, tabPageTranslations, tabPageExchangers, tabPagePumps, tabPageValves }); tabPane1.RegularSize = new Size(1028, 629); tabPane1.SelectedPage = tabPageJunctions; tabPane1.Size = new Size(1028, 629); @@ -349,12 +349,20 @@ tabPageExchangers.Name = "tabPageExchangers"; tabPageExchangers.Size = new Size(1028, 596); // // tabPagePump // hydroExchangerListCtrl1 // tabPagePump.Caption = "水泵"; tabPagePump.Controls.Add(hydroPumpListCtrl1); tabPagePump.Name = "tabPagePump"; tabPagePump.Size = new Size(1028, 596); hydroExchangerListCtrl1.Dock = DockStyle.Fill; hydroExchangerListCtrl1.Location = new Point(0, 0); hydroExchangerListCtrl1.Name = "hydroExchangerListCtrl1"; hydroExchangerListCtrl1.Size = new Size(1028, 596); hydroExchangerListCtrl1.TabIndex = 0; // // tabPagePumps // tabPagePumps.Caption = "水泵"; tabPagePumps.Controls.Add(hydroPumpListCtrl1); tabPagePumps.Name = "tabPagePumps"; tabPagePumps.Size = new Size(1028, 596); // // hydroPumpListCtrl1 // @@ -378,14 +386,6 @@ hydroValveListCtrl1.Name = "hydroValveListCtrl1"; hydroValveListCtrl1.Size = new Size(1028, 596); hydroValveListCtrl1.TabIndex = 0; // // hydroExchangerListCtrl1 // hydroExchangerListCtrl1.Dock = DockStyle.Fill; hydroExchangerListCtrl1.Location = new Point(0, 0); hydroExchangerListCtrl1.Name = "hydroExchangerListCtrl1"; hydroExchangerListCtrl1.Size = new Size(1028, 596); hydroExchangerListCtrl1.TabIndex = 0; // // HydroParterListCtrl // @@ -412,7 +412,7 @@ tabPagePipes.ResumeLayout(false); tabPageTranslations.ResumeLayout(false); tabPageExchangers.ResumeLayout(false); tabPagePump.ResumeLayout(false); tabPagePumps.ResumeLayout(false); tabPageValves.ResumeLayout(false); ResumeLayout(false); } @@ -436,7 +436,7 @@ private DevExpress.XtraBars.Navigation.TabNavigationPage tabPagePipes; private DevExpress.XtraBars.Navigation.TabNavigationPage tabPageTranslations; private DevExpress.XtraBars.Navigation.TabNavigationPage tabPageExchangers; private DevExpress.XtraBars.Navigation.TabNavigationPage tabPagePump; private DevExpress.XtraBars.Navigation.TabNavigationPage tabPagePumps; private DevExpress.XtraBars.Navigation.TabNavigationPage tabPageValves; private HydroJunctionListCtrl hydroJunctionListCtrl1; private HydroElbowListCtrl hydroElbowListCtrl1; WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/00-core/HydroParterListCtrl.cs
@@ -5,7 +5,121 @@ public HydroParterListCtrl() { InitializeComponent(); this.hydroJunctionListCtrl1.HydroClickEvent += HydroJunctionListCtrl1_HydroClickEvent; this.hydroNozzleListCtrl1.HydroClickEvent += HydroNozzleListCtrl1_HydroClickEvent; this.hydroHydrantListCtrl1.HydroClickEvent += HydroHydrantListCtrl1_HydroClickEvent; this.hydroElbowListCtrl1.HydroClickEvent += HydroElbowListCtrl1_HydroClickEvent; this.hydroThreelinkListCtrl1.HydroClickEvent += HydroThreelinkListCtrl1_HydroClickEvent; this.hydroFourlinkListCtrl1.HydroClickEvent += HydroFourlinkListCtrl1_HydroClickEvent; this.hydroMeterListCtrl1.HydroClickEvent += HydroMeterListCtrl1_HydroClickEvent; this.hydroFlowmeterListCtrl1.HydroClickEvent += HydroFlowmeterListCtrl1_HydroClickEvent; this.hydroPressmeterListCtrl1.HydroClickEvent += HydroPressmeterListCtrl1_HydroClickEvent; this.hydroBluntheadListCtrl1.HydroClickEvent += HydroBluntheadListCtrl1_HydroClickEvent; this.hydroPipeListCtrl1.HydroClickEvent += HydroPipeListCtrl1_HydroClickEvent; this.hydroTranslationListCtrl1.HydroClickEvent += HydroTranslationListCtrl1_HydroClickEvent; this.hydroExchangerListCtrl1.HydroClickEvent += HydroExchangerListCtrl1_HydroClickEvent; this.hydroPumpListCtrl1.HydroClickEvent += HydroPumpListCtrl1_HydroClickEvent; this.hydroValveListCtrl1.HydroClickEvent += HydroValveListCtrl1_HydroClickEvent; } #region 事件触发 //连接节点 private void HydroJunctionListCtrl1_HydroClickEvent(Model.HydroJunctionInfo obj) { this.HydroClickEvent?.Invoke(obj); } //喷嘴 private void HydroNozzleListCtrl1_HydroClickEvent(Model.HydroNozzleInfo obj) { this.HydroClickEvent?.Invoke(obj); } //消火栓 private void HydroHydrantListCtrl1_HydroClickEvent(Model.HydroHydrantInfo obj) { this.HydroClickEvent?.Invoke(obj); } //弯头 private void HydroElbowListCtrl1_HydroClickEvent(Model.HydroElbowInfo obj) { this.HydroClickEvent?.Invoke(obj); } //三通 private void HydroThreelinkListCtrl1_HydroClickEvent(Model.HydroThreelinkInfo obj) { this.HydroClickEvent?.Invoke(obj); } //四通 private void HydroFourlinkListCtrl1_HydroClickEvent(Model.HydroFourlinkInfo obj) { this.HydroClickEvent?.Invoke(obj); } //水表 private void HydroMeterListCtrl1_HydroClickEvent(Model.HydroMeterInfo obj) { this.HydroClickEvent?.Invoke(obj); } //流量计 private void HydroFlowmeterListCtrl1_HydroClickEvent(Model.HydroFlowmeterInfo obj) { this.HydroClickEvent?.Invoke(obj); } //压力表 private void HydroPressmeterListCtrl1_HydroClickEvent(Model.HydroPressmeterInfo obj) { this.HydroClickEvent?.Invoke(obj); } //闷头 private void HydroBluntheadListCtrl1_HydroClickEvent(Model.HydroBluntheadInfo obj) { this.HydroClickEvent?.Invoke(obj); } //管道 private void HydroPipeListCtrl1_HydroClickEvent(Model.HydroPipeInfo obj) { this.HydroClickEvent?.Invoke(obj); } //阀门 private void HydroValveListCtrl1_HydroClickEvent(Model.HydroValveInfo obj) { this.HydroClickEvent?.Invoke(obj); } //水泵 private void HydroPumpListCtrl1_HydroClickEvent(Model.HydroPumpInfo obj) { this.HydroClickEvent?.Invoke(obj); } //换热器 private void HydroExchangerListCtrl1_HydroClickEvent(Model.HydroExchangerInfo obj) { this.HydroClickEvent?.Invoke(obj); } //过渡件 private void HydroTranslationListCtrl1_HydroClickEvent(Model.HydroTranslationInfo obj) { this.HydroClickEvent?.Invoke(obj); } #endregion /// <summary> /// 水力点击事件 /// </summary> public event Action<Yw.Model.HydroParterInfo> HydroClickEvent; /// <summary> /// 列表为空时隐藏Page @@ -23,8 +137,178 @@ /// <summary> /// 绑定数据 /// </summary> public void SetBindingData() public void SetBindingData(Yw.Model.HydroModelInfo rhs) { this.hydroJunctionListCtrl1.SetBindingData(rhs.Junctions); this.hydroNozzleListCtrl1.SetBindingData(rhs.Nozzles); this.hydroHydrantListCtrl1.SetBindingData(rhs.Hydrants); this.hydroElbowListCtrl1.SetBindingData(rhs.Elbows); this.hydroThreelinkListCtrl1.SetBindingData(rhs.Threelinks); this.hydroFourlinkListCtrl1.SetBindingData(rhs.Fourlinks); this.hydroMeterListCtrl1.SetBindingData(rhs.Meters); this.hydroFlowmeterListCtrl1.SetBindingData(rhs.Flowmeters); this.hydroPressmeterListCtrl1.SetBindingData(rhs.Pressmeters); this.hydroBluntheadListCtrl1.SetBindingData(rhs.Bluntheads); this.hydroReservoirListCtrl1.SetBindingData(rhs.Reservoirs); this.hydroTankListCtrl1.SetBindingData(rhs.Tanks); this.hydroWaterboxListCtrl1.SetBindingData(rhs.Waterboxs); this.hydroPipeListCtrl1.SetBindingData(rhs.Pipes); this.hydroExchangerListCtrl1.SetBindingData(rhs.Exchangers); this.hydroTranslationListCtrl1.SetBindingData(rhs.Translations); this.hydroPumpListCtrl1.SetBindingData(rhs.Pumps); this.hydroValveListCtrl1.SetBindingData(rhs.Valves); if (this.HidePageWhenListIsNull) { if (rhs.Junctions == null || rhs.Junctions.Count < 1) { this.tabPageJunctions.PageVisible = false; } else { this.tabPageJunctions.PageVisible = true; } if (rhs.Nozzles == null || rhs.Nozzles.Count < 1) { this.tabPageNozzles.PageVisible = false; } else { this.tabPageNozzles.PageVisible = true; } if (rhs.Hydrants == null || rhs.Hydrants.Count < 1) { this.tabPageHydrants.PageVisible = false; } else { this.tabPageHydrants.PageVisible = true; } if (rhs.Elbows == null || rhs.Elbows.Count < 1) { this.tabPageElbows.PageVisible = false; } else { this.tabPageElbows.PageVisible = true; } if (rhs.Threelinks == null || rhs.Threelinks.Count < 1) { this.tabPageThreelinks.PageVisible = false; } else { this.tabPageThreelinks.PageVisible = true; } if (rhs.Fourlinks == null || rhs.Fourlinks.Count < 1) { this.tabPageFourlinks.PageVisible = false; } else { this.tabPageFourlinks.PageVisible = true; } if (rhs.Meters == null || rhs.Meters.Count < 1) { this.tabPageMeters.PageVisible = false; } else { this.tabPageMeters.PageVisible = true; } if (rhs.Flowmeters == null || rhs.Flowmeters.Count < 1) { this.tabPageFlowmeters.PageVisible = false; } else { this.tabPageFlowmeters.PageVisible = true; } if (rhs.Pressmeters == null || rhs.Pressmeters.Count < 1) { this.tabPagePressmeters.PageVisible = false; } else { this.tabPagePressmeters.PageVisible = true; } if (rhs.Bluntheads == null || rhs.Bluntheads.Count < 1) { this.tabPageBlunthead.PageVisible = false; } else { this.tabPageBlunthead.PageVisible = true; } if (rhs.Reservoirs == null || rhs.Reservoirs.Count < 1) { this.tabPageReservoirs.PageVisible = false; } else { this.tabPageReservoirs.PageVisible = true; } if (rhs.Tanks == null || rhs.Tanks.Count < 1) { this.tabPageTanks.PageVisible = false; } else { this.tabPageTanks.PageVisible = true; } if (rhs.Waterboxs == null || rhs.Waterboxs.Count < 1) { this.tabPageWaterboxs.PageVisible = false; } else { this.tabPageWaterboxs.PageVisible = true; } if (rhs.Pipes == null || rhs.Pipes.Count < 1) { this.tabPagePipes.PageVisible = false; } else { this.tabPagePipes.PageVisible = true; } if (rhs.Translations == null || rhs.Translations.Count < 1) { this.tabPageTranslations.PageVisible = false; } else { this.tabPageTranslations.PageVisible = true; } if (rhs.Exchangers == null || rhs.Exchangers.Count < 1) { this.tabPageExchangers.PageVisible = false; } else { this.tabPageExchangers.PageVisible = true; } if (rhs.Pumps == null || rhs.Pumps.Count < 1) { this.tabPagePumps.PageVisible = false; } else { this.tabPagePumps.PageVisible = true; } if (rhs.Valves == null || rhs.Valves.Count < 1) { this.tabPageValves.PageVisible = false; } else { this.tabPageValves.PageVisible = true; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/14-exchanger/HydroExchangerListCtrl.cs
@@ -11,28 +11,28 @@ /// <summary> /// 水力点击事件 /// </summary> // public event Action<Yw.Model.HydroExchangerInfo> HydroClickEvent; public event Action<Yw.Model.HydroExchangerInfo> HydroClickEvent; private List<HydroExchangerViewModel> _allBindingList = null;//所有绑定列表 ///// <summary> ///// 绑定数据 ///// </summary> ///// <param name="allExchangerList"></param> //public void SetBindingData(List<Yw.Model.HydroExchangerInfo> allExchangerList) //{ // _allBindingList = new List<HydroExchangerViewModel>(); // if (allExchangerList != null && allExchangerList.Count > 0) // { // foreach (var nozzle in allExchangerList) // { // var vm = new HydroExchangerViewModel(nozzle); // _allBindingList.Add(vm); // } // } // // this.hydroExchangerViewModelBindingSource.DataSource = _allBindingList; // // this.hydroExchangerViewModelBindingSource.ResetBindings(false); //} /// <summary> /// 绑定数据 /// </summary> /// <param name="allExchangerList"></param> public void SetBindingData(List<Yw.Model.HydroExchangerInfo> allExchangerList) { _allBindingList = new List<HydroExchangerViewModel>(); if (allExchangerList != null && allExchangerList.Count > 0) { foreach (var nozzle in allExchangerList) { var vm = new HydroExchangerViewModel(nozzle); _allBindingList.Add(vm); } } this.hydroExchangerViewModelBindingSource.DataSource = _allBindingList; this.hydroExchangerViewModelBindingSource.ResetBindings(false); } //行点击事件 private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/14-exchanger/HydroExchangerViewModel.cs
@@ -10,27 +10,27 @@ /// </summary> public HydroExchangerViewModel() { } ///// <summary> ///// ///// </summary> //public HydroExchangerViewModel(Yw.Model.HydroExchangerInfo rhs) //{ // this.ID = rhs.ID; // this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); // this.Code = rhs.Code; // this.Name = rhs.Name; // this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); // this.Description = rhs.Description; // this.StartCode = rhs.StartCode; // this.EndCode = rhs.EndCode; // this.LinkStatus = rhs.LinkStatus; // this.Diameter = rhs.Diameter; // this.Length = rhs.Length; // this.MinorLoss = rhs.MinorLoss; // this.Roughness = rhs.Roughness; /// <summary> /// /// </summary> public HydroExchangerViewModel(Yw.Model.HydroExchangerInfo rhs) { this.ID = rhs.ID; this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); this.Code = rhs.Code; this.Name = rhs.Name; this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); this.Description = rhs.Description; this.StartCode = rhs.StartCode; this.EndCode = rhs.EndCode; this.LinkStatus = rhs.LinkStatus; this.Diameter = rhs.Diameter; this.Length = rhs.Length; this.MinorLoss = rhs.MinorLoss; this.Roughness = rhs.Roughness; // this.Vmo = rhs; //} this.Vmo = rhs; } /// <summary> /// id @@ -126,7 +126,7 @@ /// <summary> /// /// </summary> // public Yw.Model.HydroExchangerInfo Vmo { get; set; } public Yw.Model.HydroExchangerInfo Vmo { get; set; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj
@@ -9,7 +9,7 @@ <ItemGroup> <PackageReference Include="DevExpress.Win.Design" Version="23.2.4" /> <PackageReference Include="Yw.BLL.Hydro.Core" Version="3.1.1" /> <PackageReference Include="Yw.BLL.Hydro.Core" Version="3.1.2" /> </ItemGroup> <ItemGroup>