From 513c72dd3c97787b0845bcc8526e004da9e50e64 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期二, 10 十二月 2024 12:02:47 +0800 Subject: [PATCH] 能耗分析整改 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.cs | 5 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.resx | 123 +++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs | 2 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.Designer.cs | 136 +++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs | 165 ------ WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user | 3 WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.resx | 120 +++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs | 3 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.Designer.cs | 49 + WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/10-analy/SimulationSingleWorkingAnalyCtrl.cs | 2 WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj | 3 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.Designer.cs | 292 +---------- WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.Designer.cs | 187 ++++++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.cs | 118 +++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyDlg.cs | 8 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.cs | 140 ++++++ 16 files changed, 931 insertions(+), 425 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs index 56ad3e6..3daca48 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs @@ -2402,11 +2402,12 @@ return; } var dlg = new SimulationSingleWorkingEnergyDlg(); - dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult); + dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult); dlg.ShowDialog(); } else { + var dlg = new SimulationMultiWorkingEnergyDlg(); dlg.SetBindingData(_hydroInfo, allCheckedWorkingList); dlg.ShowDialog(); diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs index c20af2b..13239e2 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs @@ -1630,7 +1630,7 @@ return; } var dlg = new SimulationSingleWorkingEnergyDlg(); - dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult); + dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult); dlg.ShowDialog(); } diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.Designer.cs index 1e3748f..60bad23 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.Designer.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.Designer.cs @@ -38,6 +38,7 @@ splitter = new DevExpress.XtraLayout.SplitterItem(); itemForWorkingList = new DevExpress.XtraLayout.LayoutControlItem(); itemForEnergy = new DevExpress.XtraLayout.LayoutControlItem(); + groupForWorkingList = new DevExpress.XtraLayout.LayoutControlGroup(); ((ISupportInitialize)ribbon).BeginInit(); ((ISupportInitialize)layoutControl1).BeginInit(); layoutControl1.SuspendLayout(); @@ -45,6 +46,7 @@ ((ISupportInitialize)splitter).BeginInit(); ((ISupportInitialize)itemForWorkingList).BeginInit(); ((ISupportInitialize)itemForEnergy).BeginInit(); + ((ISupportInitialize)groupForWorkingList).BeginInit(); SuspendLayout(); // // ribbon @@ -57,7 +59,7 @@ ribbon.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { ribbonPage1 }); ribbon.RibbonCaptionAlignment = DevExpress.XtraBars.Ribbon.RibbonCaptionAlignment.Left; ribbon.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False; - ribbon.Size = new Size(1179, 32); + ribbon.Size = new Size(990, 32); // // ribbonPage1 // @@ -79,67 +81,80 @@ layoutControl1.Name = "layoutControl1"; layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(719, 346, 650, 400); layoutControl1.Root = Root; - layoutControl1.Size = new Size(1179, 573); + layoutControl1.Size = new Size(990, 582); layoutControl1.TabIndex = 1; layoutControl1.Text = "layoutControl1"; // // simulationSingleWorkingEnergyCtrl1 // - simulationSingleWorkingEnergyCtrl1.Location = new Point(188, 17); + simulationSingleWorkingEnergyCtrl1.Location = new Point(159, 0); simulationSingleWorkingEnergyCtrl1.Name = "simulationSingleWorkingEnergyCtrl1"; - simulationSingleWorkingEnergyCtrl1.Size = new Size(991, 556); + simulationSingleWorkingEnergyCtrl1.Size = new Size(831, 582); simulationSingleWorkingEnergyCtrl1.TabIndex = 2; // // hydroWorkingListViewCtrl1 // - hydroWorkingListViewCtrl1.Location = new Point(2, 19); + hydroWorkingListViewCtrl1.BorderVisible = false; + hydroWorkingListViewCtrl1.Location = new Point(3, 24); hydroWorkingListViewCtrl1.Name = "hydroWorkingListViewCtrl1"; - hydroWorkingListViewCtrl1.Size = new Size(174, 552); + hydroWorkingListViewCtrl1.Size = new Size(143, 555); hydroWorkingListViewCtrl1.TabIndex = 0; // // Root // Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; Root.GroupBordersVisible = false; - Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { splitter, itemForWorkingList, itemForEnergy }); + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { splitter, itemForEnergy, groupForWorkingList }); Root.Name = "Root"; Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); - Root.Size = new Size(1179, 573); + Root.Size = new Size(990, 582); Root.TextVisible = false; // // splitter // splitter.AllowHotTrack = true; - splitter.Location = new Point(178, 0); + splitter.Location = new Point(149, 0); splitter.Name = "splitter"; - splitter.Size = new Size(10, 573); + splitter.Size = new Size(10, 582); // // itemForWorkingList // itemForWorkingList.Control = hydroWorkingListViewCtrl1; itemForWorkingList.Location = new Point(0, 0); itemForWorkingList.Name = "itemForWorkingList"; - itemForWorkingList.Size = new Size(178, 573); + itemForWorkingList.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + itemForWorkingList.Size = new Size(143, 555); itemForWorkingList.Text = "宸ュ喌鍒楄〃"; itemForWorkingList.TextLocation = DevExpress.Utils.Locations.Top; - itemForWorkingList.TextSize = new Size(48, 14); + itemForWorkingList.TextSize = new Size(0, 0); + itemForWorkingList.TextVisible = false; // // itemForEnergy // itemForEnergy.Control = simulationSingleWorkingEnergyCtrl1; - itemForEnergy.Location = new Point(188, 0); + itemForEnergy.Location = new Point(159, 0); itemForEnergy.Name = "itemForEnergy"; itemForEnergy.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); - itemForEnergy.Size = new Size(991, 573); + itemForEnergy.Size = new Size(831, 582); itemForEnergy.Text = "鑳借�楀垎鏋�"; itemForEnergy.TextLocation = DevExpress.Utils.Locations.Top; - itemForEnergy.TextSize = new Size(48, 14); + itemForEnergy.TextSize = new Size(0, 0); + itemForEnergy.TextVisible = false; + // + // groupForWorkingList + // + groupForWorkingList.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { itemForWorkingList }); + groupForWorkingList.Location = new Point(0, 0); + groupForWorkingList.Name = "groupForWorkingList"; + groupForWorkingList.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + groupForWorkingList.Size = new Size(149, 582); + groupForWorkingList.Text = "宸ュ喌鍒楄〃"; // // SimulationMultiWorkingEnergyDlg // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1179, 605); + ClientSize = new Size(990, 614); Controls.Add(layoutControl1); Controls.Add(ribbon); FormBorderStyle = FormBorderStyle.SizableToolWindow; @@ -155,6 +170,7 @@ ((ISupportInitialize)splitter).EndInit(); ((ISupportInitialize)itemForWorkingList).EndInit(); ((ISupportInitialize)itemForEnergy).EndInit(); + ((ISupportInitialize)groupForWorkingList).EndInit(); ResumeLayout(false); PerformLayout(); } @@ -173,5 +189,6 @@ private HStation.WinFrmUI.SimulationSingleWorkingEnergyCtrl simulationSingleWorkingEnergyCtrl1; private DevExpress.XtraLayout.LayoutControlItem itemForWorkingList; private DevExpress.XtraLayout.LayoutControlItem itemForEnergy; + private DevExpress.XtraLayout.LayoutControlGroup groupForWorkingList; } } \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.cs index bcf5fa4..49bcf03 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationMultiWorkingEnergyDlg.cs @@ -39,9 +39,8 @@ { var working = allWorkingList[0]; this.Text = $"鑳借�楀垎鏋�({working.Name})"; - this.itemForWorkingList.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; + this.groupForWorkingList.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; this.splitter.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; - this.itemForEnergy.TextVisible = false; LoadWorkingEnergy(working); } } @@ -67,7 +66,7 @@ var hydroInfo = _hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); hydroInfo.UpdateWorkingInfo(working.WorkingInfo); var calcuResult = hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss); - this.simulationSingleWorkingEnergyCtrl1.SetBindingData(hydroInfo, calcuResult); + this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, calcuResult); } diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.Designer.cs index e23b288..3f96ad6 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.Designer.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.Designer.cs @@ -30,58 +30,26 @@ { layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); panelControl1 = new PanelControl(); - txtE = new TextEdit(); - txtP = new TextEdit(); - txtH = new TextEdit(); - txtQ = new TextEdit(); - hydroPumpListStateViewCtrl1 = new HydroPumpListStateViewCtrl(); - hydroEnergyTotalViewCtrl1 = new HydroEnergyTotalViewCtrl(); Root = new DevExpress.XtraLayout.LayoutControlGroup(); - splitterItem1 = new DevExpress.XtraLayout.SplitterItem(); - layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup(); - layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); groupForSinglePumpInfo = new DevExpress.XtraLayout.LayoutControlGroup(); - layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); - layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); - layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem(); - layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem(); - emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); - layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); - layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); - pumpRunViewChart1 = new Yw.WinFrmUI.Phart.PumpRunViewChart(); + hydroEnergyTotalHorizViewCtrl1 = new HydroEnergyTotalHorizViewCtrl(); + layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem(); + simulationSingleWorkingPumpCtrl1 = new SimulationSingleWorkingPumpCtrl(); ((ISupportInitialize)layoutControl1).BeginInit(); layoutControl1.SuspendLayout(); ((ISupportInitialize)panelControl1).BeginInit(); panelControl1.SuspendLayout(); - ((ISupportInitialize)txtE.Properties).BeginInit(); - ((ISupportInitialize)txtP.Properties).BeginInit(); - ((ISupportInitialize)txtH.Properties).BeginInit(); - ((ISupportInitialize)txtQ.Properties).BeginInit(); ((ISupportInitialize)Root).BeginInit(); - ((ISupportInitialize)splitterItem1).BeginInit(); - ((ISupportInitialize)layoutControlGroup2).BeginInit(); - ((ISupportInitialize)layoutControlItem2).BeginInit(); ((ISupportInitialize)groupForSinglePumpInfo).BeginInit(); - ((ISupportInitialize)layoutControlItem4).BeginInit(); - ((ISupportInitialize)layoutControlItem5).BeginInit(); - ((ISupportInitialize)layoutControlItem6).BeginInit(); - ((ISupportInitialize)layoutControlItem7).BeginInit(); - ((ISupportInitialize)emptySpaceItem1).BeginInit(); - ((ISupportInitialize)layoutControlGroup1).BeginInit(); - ((ISupportInitialize)layoutControlItem1).BeginInit(); ((ISupportInitialize)layoutControlItem3).BeginInit(); + ((ISupportInitialize)layoutControlItem8).BeginInit(); SuspendLayout(); // // layoutControl1 // + layoutControl1.Controls.Add(hydroEnergyTotalHorizViewCtrl1); layoutControl1.Controls.Add(panelControl1); - layoutControl1.Controls.Add(txtE); - layoutControl1.Controls.Add(txtP); - layoutControl1.Controls.Add(txtH); - layoutControl1.Controls.Add(txtQ); - layoutControl1.Controls.Add(hydroPumpListStateViewCtrl1); - layoutControl1.Controls.Add(hydroEnergyTotalViewCtrl1); layoutControl1.Dock = DockStyle.Fill; layoutControl1.Location = new Point(0, 0); layoutControl1.Name = "layoutControl1"; @@ -94,210 +62,66 @@ // panelControl1 // panelControl1.BorderStyle = BorderStyles.Simple; - panelControl1.Controls.Add(pumpRunViewChart1); - panelControl1.Location = new Point(232, 71); + panelControl1.Controls.Add(simulationSingleWorkingPumpCtrl1); + panelControl1.Location = new Point(2, 75); panelControl1.Name = "panelControl1"; panelControl1.Padding = new Padding(1); - panelControl1.Size = new Size(778, 530); + panelControl1.Size = new Size(1008, 526); panelControl1.TabIndex = 11; - // - // txtE - // - txtE.Location = new Point(734, 35); - txtE.Name = "txtE"; - txtE.Properties.ReadOnly = true; - txtE.Properties.UseReadOnlyAppearance = false; - txtE.Size = new Size(106, 20); - txtE.StyleController = layoutControl1; - txtE.TabIndex = 5; - // - // txtP - // - txtP.Location = new Point(584, 35); - txtP.Name = "txtP"; - txtP.Properties.ReadOnly = true; - txtP.Properties.UseReadOnlyAppearance = false; - txtP.Size = new Size(106, 20); - txtP.StyleController = layoutControl1; - txtP.TabIndex = 4; - // - // txtH - // - txtH.Location = new Point(434, 35); - txtH.Name = "txtH"; - txtH.Properties.ReadOnly = true; - txtH.Properties.UseReadOnlyAppearance = false; - txtH.Size = new Size(106, 20); - txtH.StyleController = layoutControl1; - txtH.TabIndex = 3; - // - // txtQ - // - txtQ.Location = new Point(284, 35); - txtQ.Name = "txtQ"; - txtQ.Properties.ReadOnly = true; - txtQ.Properties.UseReadOnlyAppearance = false; - txtQ.Size = new Size(106, 20); - txtQ.StyleController = layoutControl1; - txtQ.TabIndex = 2; - // - // hydroPumpListStateViewCtrl1 - // - hydroPumpListStateViewCtrl1.Location = new Point(5, 148); - hydroPumpListStateViewCtrl1.Name = "hydroPumpListStateViewCtrl1"; - hydroPumpListStateViewCtrl1.Size = new Size(210, 450); - hydroPumpListStateViewCtrl1.TabIndex = 6; - // - // hydroEnergyTotalViewCtrl1 - // - hydroEnergyTotalViewCtrl1.Location = new Point(14, 35); - hydroEnergyTotalViewCtrl1.Name = "hydroEnergyTotalViewCtrl1"; - hydroEnergyTotalViewCtrl1.Size = new Size(192, 73); - hydroEnergyTotalViewCtrl1.TabIndex = 0; // // Root // Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; Root.GroupBordersVisible = false; - Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { splitterItem1, layoutControlGroup2, groupForSinglePumpInfo, layoutControlGroup1, layoutControlItem3 }); + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { groupForSinglePumpInfo, layoutControlItem3 }); Root.Name = "Root"; Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); Root.Size = new Size(1012, 603); Root.TextVisible = false; // - // splitterItem1 - // - splitterItem1.AllowHotTrack = true; - splitterItem1.Location = new Point(220, 0); - splitterItem1.Name = "splitterItem1"; - splitterItem1.Size = new Size(10, 603); - // - // layoutControlGroup2 - // - layoutControlGroup2.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); - layoutControlGroup2.AppearanceGroup.Options.UseBorderColor = true; - layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem2 }); - layoutControlGroup2.Location = new Point(0, 122); - layoutControlGroup2.Name = "layoutControlGroup2"; - layoutControlGroup2.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); - layoutControlGroup2.Size = new Size(220, 481); - layoutControlGroup2.Text = "姘存车鍒楄〃"; - // - // layoutControlItem2 - // - layoutControlItem2.Control = hydroPumpListStateViewCtrl1; - layoutControlItem2.Location = new Point(0, 0); - layoutControlItem2.Name = "layoutControlItem2"; - layoutControlItem2.Size = new Size(214, 454); - layoutControlItem2.TextSize = new Size(0, 0); - layoutControlItem2.TextVisible = false; - // // groupForSinglePumpInfo // - groupForSinglePumpInfo.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); - groupForSinglePumpInfo.AppearanceGroup.Options.UseBorderColor = true; - groupForSinglePumpInfo.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem4, layoutControlItem5, layoutControlItem6, layoutControlItem7, emptySpaceItem1 }); - groupForSinglePumpInfo.Location = new Point(230, 0); + groupForSinglePumpInfo.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem8 }); + groupForSinglePumpInfo.Location = new Point(0, 0); groupForSinglePumpInfo.Name = "groupForSinglePumpInfo"; - groupForSinglePumpInfo.Size = new Size(782, 69); - groupForSinglePumpInfo.Text = "姘存车"; - // - // layoutControlItem4 - // - layoutControlItem4.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; - layoutControlItem4.Control = txtQ; - layoutControlItem4.Location = new Point(0, 0); - layoutControlItem4.MaxSize = new Size(150, 24); - layoutControlItem4.MinSize = new Size(150, 24); - layoutControlItem4.Name = "layoutControlItem4"; - layoutControlItem4.Size = new Size(150, 24); - layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; - layoutControlItem4.Text = "娴侀噺:"; - layoutControlItem4.TextSize = new Size(28, 14); - // - // layoutControlItem5 - // - layoutControlItem5.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; - layoutControlItem5.Control = txtH; - layoutControlItem5.Location = new Point(150, 0); - layoutControlItem5.MaxSize = new Size(150, 24); - layoutControlItem5.MinSize = new Size(150, 24); - layoutControlItem5.Name = "layoutControlItem5"; - layoutControlItem5.Size = new Size(150, 24); - layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; - layoutControlItem5.Text = "鎵▼:"; - layoutControlItem5.TextSize = new Size(28, 14); - // - // layoutControlItem6 - // - layoutControlItem6.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; - layoutControlItem6.Control = txtP; - layoutControlItem6.Location = new Point(300, 0); - layoutControlItem6.MaxSize = new Size(150, 24); - layoutControlItem6.MinSize = new Size(150, 24); - layoutControlItem6.Name = "layoutControlItem6"; - layoutControlItem6.Size = new Size(150, 24); - layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; - layoutControlItem6.Text = "鍔熺巼:"; - layoutControlItem6.TextSize = new Size(28, 14); - // - // layoutControlItem7 - // - layoutControlItem7.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; - layoutControlItem7.Control = txtE; - layoutControlItem7.Location = new Point(450, 0); - layoutControlItem7.MaxSize = new Size(150, 24); - layoutControlItem7.MinSize = new Size(150, 24); - layoutControlItem7.Name = "layoutControlItem7"; - layoutControlItem7.Size = new Size(150, 24); - layoutControlItem7.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; - layoutControlItem7.Text = "鏁堢巼:"; - layoutControlItem7.TextSize = new Size(28, 14); - // - // emptySpaceItem1 - // - emptySpaceItem1.AllowHotTrack = false; - emptySpaceItem1.Location = new Point(600, 0); - emptySpaceItem1.Name = "emptySpaceItem1"; - emptySpaceItem1.Size = new Size(158, 24); - emptySpaceItem1.TextSize = new Size(0, 0); - // - // layoutControlGroup1 - // - layoutControlGroup1.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); - layoutControlGroup1.AppearanceGroup.Options.UseBorderColor = true; - layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1 }); - layoutControlGroup1.Location = new Point(0, 0); - layoutControlGroup1.Name = "layoutControlGroup1"; - layoutControlGroup1.Size = new Size(220, 122); - layoutControlGroup1.Text = "鎬昏兘鑰�"; - // - // layoutControlItem1 - // - layoutControlItem1.Control = hydroEnergyTotalViewCtrl1; - layoutControlItem1.Location = new Point(0, 0); - layoutControlItem1.Name = "layoutControlItem1"; - layoutControlItem1.Size = new Size(196, 77); - layoutControlItem1.TextSize = new Size(0, 0); - layoutControlItem1.TextVisible = false; + groupForSinglePumpInfo.Size = new Size(1012, 73); + groupForSinglePumpInfo.Text = "鎬昏兘鑰�"; // // layoutControlItem3 // layoutControlItem3.Control = panelControl1; - layoutControlItem3.Location = new Point(230, 69); + layoutControlItem3.Location = new Point(0, 73); layoutControlItem3.Name = "layoutControlItem3"; - layoutControlItem3.Size = new Size(782, 534); + layoutControlItem3.Size = new Size(1012, 530); layoutControlItem3.TextSize = new Size(0, 0); layoutControlItem3.TextVisible = false; // - // pumpRunViewChart1 + // hydroEnergyTotalHorizViewCtrl1 // - pumpRunViewChart1.Dock = DockStyle.Fill; - pumpRunViewChart1.Location = new Point(3, 3); - pumpRunViewChart1.Margin = new Padding(2, 2, 2, 2); - pumpRunViewChart1.Name = "pumpRunViewChart1"; - pumpRunViewChart1.Size = new Size(772, 524); - pumpRunViewChart1.TabIndex = 0; + hydroEnergyTotalHorizViewCtrl1.Location = new Point(14, 35); + hydroEnergyTotalHorizViewCtrl1.Name = "hydroEnergyTotalHorizViewCtrl1"; + hydroEnergyTotalHorizViewCtrl1.Size = new Size(984, 24); + hydroEnergyTotalHorizViewCtrl1.TabIndex = 12; + // + // layoutControlItem8 + // + layoutControlItem8.Control = hydroEnergyTotalHorizViewCtrl1; + layoutControlItem8.Location = new Point(0, 0); + layoutControlItem8.MaxSize = new Size(0, 28); + layoutControlItem8.MinSize = new Size(545, 28); + layoutControlItem8.Name = "layoutControlItem8"; + layoutControlItem8.Size = new Size(988, 28); + layoutControlItem8.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; + layoutControlItem8.TextSize = new Size(0, 0); + layoutControlItem8.TextVisible = false; + // + // simulationSingleWorkingPumpCtrl1 + // + simulationSingleWorkingPumpCtrl1.Dock = DockStyle.Fill; + simulationSingleWorkingPumpCtrl1.Location = new Point(3, 3); + simulationSingleWorkingPumpCtrl1.Name = "simulationSingleWorkingPumpCtrl1"; + simulationSingleWorkingPumpCtrl1.Size = new Size(1002, 520); + simulationSingleWorkingPumpCtrl1.TabIndex = 0; // // SimulationSingleWorkingEnergyCtrl // @@ -310,23 +134,10 @@ layoutControl1.ResumeLayout(false); ((ISupportInitialize)panelControl1).EndInit(); panelControl1.ResumeLayout(false); - ((ISupportInitialize)txtE.Properties).EndInit(); - ((ISupportInitialize)txtP.Properties).EndInit(); - ((ISupportInitialize)txtH.Properties).EndInit(); - ((ISupportInitialize)txtQ.Properties).EndInit(); ((ISupportInitialize)Root).EndInit(); - ((ISupportInitialize)splitterItem1).EndInit(); - ((ISupportInitialize)layoutControlGroup2).EndInit(); - ((ISupportInitialize)layoutControlItem2).EndInit(); ((ISupportInitialize)groupForSinglePumpInfo).EndInit(); - ((ISupportInitialize)layoutControlItem4).EndInit(); - ((ISupportInitialize)layoutControlItem5).EndInit(); - ((ISupportInitialize)layoutControlItem6).EndInit(); - ((ISupportInitialize)layoutControlItem7).EndInit(); - ((ISupportInitialize)emptySpaceItem1).EndInit(); - ((ISupportInitialize)layoutControlGroup1).EndInit(); - ((ISupportInitialize)layoutControlItem1).EndInit(); ((ISupportInitialize)layoutControlItem3).EndInit(); + ((ISupportInitialize)layoutControlItem8).EndInit(); ResumeLayout(false); } @@ -334,26 +145,11 @@ private DevExpress.XtraLayout.LayoutControl layoutControl1; private DevExpress.XtraLayout.LayoutControlGroup Root; - private TextEdit txtE; - private TextEdit txtP; - private TextEdit txtH; - private TextEdit txtQ; - private HydroPumpListStateViewCtrl hydroPumpListStateViewCtrl1; - private HydroEnergyTotalViewCtrl hydroEnergyTotalViewCtrl1; - private DevExpress.XtraLayout.SplitterItem splitterItem1; - private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup2; - private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; private DevExpress.XtraLayout.LayoutControlGroup groupForSinglePumpInfo; - private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4; - private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5; - private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6; - private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7; - private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1; private PanelControl panelControl1; - - private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1; - private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; - private Yw.WinFrmUI.Phart.PumpRunViewChart pumpRunViewChart1; + private HydroEnergyTotalHorizViewCtrl hydroEnergyTotalHorizViewCtrl1; + private SimulationSingleWorkingPumpCtrl simulationSingleWorkingPumpCtrl1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8; } } diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs index cc049b8..33a18b8 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyCtrl.cs @@ -12,6 +12,7 @@ using Yw.EPAnet; using Yw.Geometry; using Yw.Pump; +using Yw.Vmo; using Yw.WinFrmUI.Phart; namespace HStation.WinFrmUI @@ -22,38 +23,30 @@ { InitializeComponent(); this.layoutControl1.SetupLayoutControl(); - this.hydroPumpListStateViewCtrl1.SelectedChangedEvent += HydroPumpRunStatusListCtrl1_SelectedChangedEvent; } + private HydroWorkingVmo _working = null;//宸ュ喌 private Yw.Model.HydroModelInfo _hydroInfo = null;//姘村姏淇℃伅 private Dictionary<string, HydroCalcuVisualResult> _allCalcuResultVisualDict = null;//鎵�鏈夎绠楃粨鏋滃彲瑙佸瓧鍏� /// <summary> /// 缁戝畾鏁版嵁 /// </summary> - public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) + public void SetBindingData(HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) { - if (hydroInfo == null) - { - return; - } - if (calcuResult == null) - { - return; - } - if (!calcuResult.Succeed) - { - return; - } - var allCalcuResultVisualDict = calcuResult.GetVisualDict(); - SetBindingData(hydroInfo, allCalcuResultVisualDict); + var allCalcuResultVisualDict = calcuResult?.GetVisualDict(); + SetBindingData(working, hydroInfo, allCalcuResultVisualDict); } /// <summary> /// 缁戝畾鏁版嵁 /// </summary> - public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict) + public void SetBindingData(HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict) { + if (working == null) + { + return; + } if (hydroInfo == null) { return; @@ -62,148 +55,16 @@ { return; } + _working = working; _hydroInfo = hydroInfo; _allCalcuResultVisualDict = allCalcuResultVisualDict; - this.hydroEnergyTotalViewCtrl1.SetBindingData(hydroInfo, allCalcuResultVisualDict); - this.hydroPumpListStateViewCtrl1.SetBindingData(hydroInfo); + this.hydroEnergyTotalHorizViewCtrl1.SetBindingData(_hydroInfo, _allCalcuResultVisualDict); + this.simulationSingleWorkingPumpCtrl1.SetBindingData(_working, _hydroInfo, _allCalcuResultVisualDict); } - //娉甸�夋嫨鏀瑰彉 - private void HydroPumpRunStatusListCtrl1_SelectedChangedEvent(Yw.Model.HydroPumpInfo pump) - { - if (_hydroInfo == null) - { - return; - } - if (_allCalcuResultVisualDict == null || _allCalcuResultVisualDict.Count < 1) - { - return; - } - if (pump == null) - { - return; - } - this.groupForSinglePumpInfo.Text = pump.Name; - this.txtQ.EditValue = null; - this.txtH.EditValue = null; - this.txtP.EditValue = null; - this.txtE.EditValue = null; - if (_allCalcuResultVisualDict.ContainsKey(pump.Code)) - { - var calcuResult = _allCalcuResultVisualDict[pump.Code] as HydroCalcuPumpResult; - if (calcuResult != null) - { - if (pump.LinkStatus == Yw.Hydro.PumpStatus.Open) - { - this.txtQ.EditValue = calcuResult.CalcuQ.HasValue ? $"{Math.Round(calcuResult.CalcuQ.Value, 1)}m鲁/h" : null; - this.txtH.EditValue = calcuResult.CalcuH.HasValue ? $"{Math.Round(calcuResult.CalcuH.Value, 2)}m" : null; - this.txtP.EditValue = calcuResult.CalcuP.HasValue ? $"{Math.Round(calcuResult.CalcuP.Value, 1)}kW" : null; - this.txtE.EditValue = calcuResult.CalcuE.HasValue ? $"{Math.Round(calcuResult.CalcuE.Value, 1)}%" : null; - } - var vm = CreateViewModel(pump); - this.pumpRunViewChart1.SetBindingData(vm); - } - } - } - //鍒涘缓 - private PumpRunViewViewModel CreateViewModel(Yw.Model.HydroPumpInfo pump) - { - if (_hydroInfo == null) - { - return default; - } - var vm = new PumpRunViewViewModel(); - vm.Id = pump.Code; - vm.Name = pump.Name; - vm.CurveName = $"棰濆畾鏇茬嚎({pump.RatedHz}hz)"; - vm.RatedQ = pump.RatedQ.HasValue ? pump.RatedQ.Value : 0; - vm.RatedH = pump.RatedH.HasValue ? pump.RatedH.Value : 0; - vm.RatedP = pump.RatedP; - vm.RatedN = pump.RatedN.HasValue ? pump.RatedN.Value : 0; - vm.RatedHz = pump.RatedHz; - vm.Color = Color.LightGray; - - var curveqh = _hydroInfo.Curves?.Find(x => x.Code == pump.CurveQH); - if (curveqh != null) - { - var qh_pts = curveqh.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); - if (qh_pts != null && qh_pts.Count > 3) - { - vm.CurveQH = new CubicSpline2d(qh_pts); - } - } - - var curveqp = _hydroInfo.Curves?.Find(x => x.Code == pump.CurveQP); - if (curveqp != null) - { - var qp_pts = curveqp.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); - if (qp_pts != null && qp_pts.Count > 3) - { - vm.CurveQP = new CubicSpline2d(qp_pts); - } - } - - var curveqe = _hydroInfo.Curves?.Find(x => x.Code == pump.CurveQE); - if (curveqe != null) - { - var qepts = curveqe.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); - if (qepts != null && qepts.Count > 3) - { - vm.CurveQE = new CubicSpline2d(qepts); - } - } - - if (pump.LinkStatus == Yw.Hydro.PumpStatus.Open) - { - vm.Items = new List<PumpRunViewItemViewModel>(); - var vmItem = new PumpRunViewItemViewModel(); - vm.Items.Add(vmItem); - vmItem.Id = string.Empty; - vmItem.Name = "杩愯"; - vmItem.Hz = Math.Round(pump.RatedHz * pump.SpeedRatio, 1); - vmItem.Color = Color.Green; - if (pump.RatedN.HasValue) - { - vmItem.N = Math.Round(pump.RatedN.Value * pump.SpeedRatio, 1); - } - var calcuResult = _allCalcuResultVisualDict?.GetValue(pump.Code) as HydroCalcuPumpResult; - if (calcuResult != null) - { - vmItem.Q = calcuResult.CalcuQ ?? 0; - vmItem.H = calcuResult.CalcuH ?? 0; - vmItem.P = calcuResult.CalcuP; - vmItem.E = calcuResult.CalcuE; - } - vmItem.CurveName = $"杩愯鏇茬嚎({vmItem.Hz}hz)"; - - if (vm.CurveQH != null) - { - var qh_pts = vm.CurveQH.GetPointList(20); - var qh_run_pts = qh_pts.GetQHPointListByN(vm.RatedHz, vmItem.Hz); - vmItem.CurveQH = new CubicSpline2d(qh_run_pts); - } - - if (vm.CurveQP != null) - { - var qp_pts = vm.CurveQP.GetPointList(20); - var qp_run_pts = qp_pts.GetQPPointListByN(vm.RatedHz, vmItem.Hz); - vmItem.CurveQP = new CubicSpline2d(qp_run_pts); - } - - if (vm.CurveQE != null) - { - var qe_pts = vm.CurveQE.GetPointList(20); - var qe_run_pts = qe_pts.GetQEPointListByN(vm.RatedHz, vmItem.Hz); - vmItem.CurveQE = new CubicSpline2d(qe_run_pts); - } - - } - - return vm; - } } } diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyDlg.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyDlg.cs index 7ea1ccf..fae3d25 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyDlg.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/09-energy/SimulationSingleWorkingEnergyDlg.cs @@ -1,4 +1,6 @@ -锘縩amespace HStation.WinFrmUI +锘縰sing Yw.Vmo; + +namespace HStation.WinFrmUI { public partial class SimulationSingleWorkingEnergyDlg : DevExpress.XtraBars.Ribbon.RibbonForm { @@ -11,9 +13,9 @@ /// <summary> /// 缁戝畾鏁版嵁 /// </summary> - public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) + public void SetBindingData(HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) { - this.simulationSingleWorkingEnergyCtrl1.SetBindingData(hydroInfo, calcuResult); + this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, calcuResult); } diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/10-analy/SimulationSingleWorkingAnalyCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/10-analy/SimulationSingleWorkingAnalyCtrl.cs index 60b225d..a88a142 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/10-analy/SimulationSingleWorkingAnalyCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/10-analy/SimulationSingleWorkingAnalyCtrl.cs @@ -32,7 +32,7 @@ ) { this.hydroSingleWorkingEvaluationCtrl1.SetBindingData(hydroInfo, allMonitorList, working, calcuResult); - this.simulationSingleWorkingEnergyCtrl1.SetBindingData(hydroInfo, calcuResult); + this.simulationSingleWorkingEnergyCtrl1.SetBindingData(working, hydroInfo, calcuResult); this.hydroSingleWorkingLossCurveCtrl1.SetBindingData(hydroInfo, calcuResult, visual); this.hydroSingleWorkingLossStatisticsCtrl1.SetBindingData(hydroInfo, calcuResult); } diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.Designer.cs new file mode 100644 index 0000000..9b72010 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.Designer.cs @@ -0,0 +1,136 @@ +锘縩amespace HStation.WinFrmUI +{ + partial class SimulationSingleWorkingPumpCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + barManager1 = new DevExpress.XtraBars.BarManager(components); + bar2 = new DevExpress.XtraBars.Bar(); + barDockControlTop = new DevExpress.XtraBars.BarDockControl(); + barDockControlBottom = new DevExpress.XtraBars.BarDockControl(); + barDockControlLeft = new DevExpress.XtraBars.BarDockControl(); + barDockControlRight = new DevExpress.XtraBars.BarDockControl(); + pumpWorkingViewChart1 = new Yw.WinFrmUI.Phart.PumpWorkingViewChart(); + ((ISupportInitialize)barManager1).BeginInit(); + SuspendLayout(); + // + // barManager1 + // + barManager1.Bars.AddRange(new DevExpress.XtraBars.Bar[] { bar2 }); + barManager1.DockControls.Add(barDockControlTop); + barManager1.DockControls.Add(barDockControlBottom); + barManager1.DockControls.Add(barDockControlLeft); + barManager1.DockControls.Add(barDockControlRight); + barManager1.Form = this; + barManager1.MainMenu = bar2; + // + // bar2 + // + bar2.BarName = "Main menu"; + bar2.DockCol = 0; + bar2.DockRow = 0; + bar2.DockStyle = DevExpress.XtraBars.BarDockStyle.Top; + bar2.OptionsBar.AllowQuickCustomization = false; + bar2.OptionsBar.DrawBorder = false; + bar2.OptionsBar.DrawDragBorder = false; + bar2.OptionsBar.MultiLine = true; + bar2.OptionsBar.UseWholeRow = true; + bar2.Text = "Main menu"; + // + // barDockControlTop + // + barDockControlTop.CausesValidation = false; + barDockControlTop.Dock = DockStyle.Top; + barDockControlTop.Location = new Point(0, 0); + barDockControlTop.Manager = barManager1; + barDockControlTop.Size = new Size(854, 20); + // + // barDockControlBottom + // + barDockControlBottom.CausesValidation = false; + barDockControlBottom.Dock = DockStyle.Bottom; + barDockControlBottom.Location = new Point(0, 436); + barDockControlBottom.Manager = barManager1; + barDockControlBottom.Size = new Size(854, 0); + // + // barDockControlLeft + // + barDockControlLeft.CausesValidation = false; + barDockControlLeft.Dock = DockStyle.Left; + barDockControlLeft.Location = new Point(0, 20); + barDockControlLeft.Manager = barManager1; + barDockControlLeft.Size = new Size(0, 416); + // + // barDockControlRight + // + barDockControlRight.CausesValidation = false; + barDockControlRight.Dock = DockStyle.Right; + barDockControlRight.Location = new Point(854, 20); + barDockControlRight.Manager = barManager1; + barDockControlRight.Size = new Size(0, 416); + // + // pumpWorkingViewChart1 + // + pumpWorkingViewChart1.Dock = DockStyle.Fill; + pumpWorkingViewChart1.EquipVisible = true; + pumpWorkingViewChart1.Location = new Point(0, 20); + pumpWorkingViewChart1.Margin = new Padding(2, 2, 2, 2); + pumpWorkingViewChart1.Name = "pumpWorkingViewChart1"; + pumpWorkingViewChart1.QEVisible = true; + pumpWorkingViewChart1.QPVisble = true; + pumpWorkingViewChart1.RunPointVisible = true; + pumpWorkingViewChart1.Size = new Size(854, 416); + pumpWorkingViewChart1.TabIndex = 4; + // + // SimulationSingleWorkingPumpCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(pumpWorkingViewChart1); + Controls.Add(barDockControlLeft); + Controls.Add(barDockControlRight); + Controls.Add(barDockControlBottom); + Controls.Add(barDockControlTop); + Name = "SimulationSingleWorkingPumpCtrl"; + Size = new Size(854, 436); + ((ISupportInitialize)barManager1).EndInit(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private DevExpress.XtraBars.BarManager barManager1; + private DevExpress.XtraBars.Bar bar2; + private DevExpress.XtraBars.BarDockControl barDockControlTop; + private DevExpress.XtraBars.BarDockControl barDockControlBottom; + private DevExpress.XtraBars.BarDockControl barDockControlLeft; + private DevExpress.XtraBars.BarDockControl barDockControlRight; + private Yw.WinFrmUI.Phart.PumpWorkingViewChart pumpWorkingViewChart1; + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.cs new file mode 100644 index 0000000..f6189bc --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.cs @@ -0,0 +1,140 @@ +锘縰sing DevExpress.XtraEditors; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Yw.Geometry; +using Yw.Pump; +using Yw.Vmo; +using Yw.WinFrmUI.Phart; + +namespace HStation.WinFrmUI +{ + public partial class SimulationSingleWorkingPumpCtrl : DevExpress.XtraEditors.XtraUserControl + { + public SimulationSingleWorkingPumpCtrl() + { + InitializeComponent(); + } + + private HydroWorkingVmo _working = null; + private Yw.Model.HydroModelInfo _hydroInfo = null; + private Dictionary<string, HydroCalcuVisualResult> _allCalcuResultVisualDict = null; + + public void SetBindingData + (HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) + { + var allCalcuResultVisualDict = calcuResult.GetVisualDict(); + SetBindingData(working, hydroInfo, allCalcuResultVisualDict); + } + + public void SetBindingData + (HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict) + { + _working = working; + _hydroInfo = hydroInfo; + _allCalcuResultVisualDict = allCalcuResultVisualDict; + var vm = CreateViewModel(); + this.pumpWorkingViewChart1.SetBindingData(vm); + } + + //鍒涘缓 + private PumpWorkingViewViewModel CreateViewModel() + { + if (_working == null) + { + return default; + } + if (_hydroInfo == null) + { + return default; + } + if (_allCalcuResultVisualDict == null || _allCalcuResultVisualDict.Count < 1) + { + return default; + } + var vm = new PumpWorkingViewViewModel(); + vm.Id = _working.ID.ToString(); + vm.Name = _working.Name; + vm.CurveName = $"瑁呯疆绾�"; + vm.Color = Color.Black; + + vm.StartH = 2; + + if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0) + { + var pumps = _hydroInfo.Pumps.Where(x => x.LinkStatus == Yw.Hydro.PumpStatus.Open).ToList(); + if (pumps.Count > 0) + { + vm.Items = new List<PumpWorkingViewItemViewModel>(); + foreach (var pump in pumps) + { + var vmItem = new PumpWorkingViewItemViewModel(); + vm.Items.Add(vmItem); + vmItem.Id = pump.Code; + vmItem.Name = pump.Name; + vmItem.CurveName = pump.Name; + vmItem.Color = HydroPumpCurveColorHelper.GetRandomColor(pumps.IndexOf(pump)); + var calcuResult = _allCalcuResultVisualDict?.GetValue(pump.Code) as HydroCalcuPumpResult; + if (calcuResult != null) + { + vmItem.Q = calcuResult.CalcuQ ?? 0; + vmItem.H = calcuResult.CalcuH ?? 0; + vmItem.P = calcuResult.CalcuP; + vmItem.E = calcuResult.CalcuE; + } + vmItem.Hz = Math.Round(pump.SpeedRatio * pump.RatedHz, 1); + vmItem.N = pump.RatedN.HasValue ? Math.Round(pump.SpeedRatio * pump.RatedN.Value, 1) : 0; + + + var curveqh = _hydroInfo.Curves?.Find(x => x.Code == pump.CurveQH); + if (curveqh != null) + { + var qh_pts = curveqh.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); + if (qh_pts != null && qh_pts.Count > 3) + { + var qh_run_pts = qh_pts.GetQHPointListByN(pump.RatedHz, vmItem.Hz); + vmItem.CurveQH = new CubicSpline2d(qh_run_pts); + } + } + + var curveqp = _hydroInfo.Curves?.Find(x => x.Code == pump.CurveQP); + if (curveqp != null) + { + var qp_pts = curveqp.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); + if (qp_pts != null && qp_pts.Count > 3) + { + var qp_run_pts = qp_pts.GetQPPointListByN(pump.RatedHz, vmItem.Hz); + vmItem.CurveQP = new CubicSpline2d(qp_run_pts); + } + } + + var curveqe = _hydroInfo.Curves?.Find(x => x.Code == pump.CurveQE); + if (curveqe != null) + { + var qe_pts = curveqe.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); + if (qe_pts != null && qe_pts.Count > 3) + { + var qe_run_pts = qe_pts.GetQEPointListByN(pump.RatedHz, vmItem.Hz); + vmItem.CurveQE = new CubicSpline2d(qe_run_pts); + } + } + + } + + vm.PipeQ = vm.Items.Sum(t => t.Q); + vm.PipeH = vm.Items.Max(t => t.H); + } + } + + return vm; + } + + + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.resx b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.resx new file mode 100644 index 0000000..ada806c --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationSingleWorkingPumpCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="barManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user index 20e9def..ca42f0b 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user @@ -277,6 +277,9 @@ <Compile Update="03-simulation\11-pump\03-analy\SimulationSingleWorkingPumpAnalyDlg.cs"> <SubType>Form</SubType> </Compile> + <Compile Update="03-simulation\11-pump\04-working\SimulationSingleWorkingPumpCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> <Compile Update="03-simulation\12-report\test.cs"> <SubType>UserControl</SubType> </Compile> diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.Designer.cs new file mode 100644 index 0000000..76f36f7 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.Designer.cs @@ -0,0 +1,187 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroEnergyTotalHorizViewCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); + txtE = new DevExpress.XtraEditors.TextEdit(); + txtP = new DevExpress.XtraEditors.TextEdit(); + txtQ = new DevExpress.XtraEditors.TextEdit(); + Root = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); + emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); + ((ISupportInitialize)layoutControl1).BeginInit(); + layoutControl1.SuspendLayout(); + ((ISupportInitialize)txtE.Properties).BeginInit(); + ((ISupportInitialize)txtP.Properties).BeginInit(); + ((ISupportInitialize)txtQ.Properties).BeginInit(); + ((ISupportInitialize)Root).BeginInit(); + ((ISupportInitialize)layoutControlItem1).BeginInit(); + ((ISupportInitialize)layoutControlItem2).BeginInit(); + ((ISupportInitialize)layoutControlItem3).BeginInit(); + ((ISupportInitialize)emptySpaceItem1).BeginInit(); + SuspendLayout(); + // + // layoutControl1 + // + layoutControl1.Controls.Add(txtE); + layoutControl1.Controls.Add(txtP); + layoutControl1.Controls.Add(txtQ); + layoutControl1.Dock = DockStyle.Fill; + layoutControl1.Location = new Point(0, 0); + layoutControl1.Name = "layoutControl1"; + layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(1177, 0, 650, 400); + layoutControl1.Root = Root; + layoutControl1.Size = new Size(805, 33); + layoutControl1.TabIndex = 0; + layoutControl1.Text = "layoutControl1"; + // + // txtE + // + txtE.Location = new Point(414, 6); + txtE.Name = "txtE"; + txtE.Properties.ReadOnly = true; + txtE.Properties.UseReadOnlyAppearance = false; + txtE.Size = new Size(124, 20); + txtE.StyleController = layoutControl1; + txtE.TabIndex = 6; + // + // txtP + // + txtP.Location = new Point(234, 6); + txtP.Name = "txtP"; + txtP.Properties.ReadOnly = true; + txtP.Properties.UseReadOnlyAppearance = false; + txtP.Size = new Size(124, 20); + txtP.StyleController = layoutControl1; + txtP.TabIndex = 5; + // + // txtQ + // + txtQ.Location = new Point(54, 6); + txtQ.Name = "txtQ"; + txtQ.Properties.ReadOnly = true; + txtQ.Properties.UseReadOnlyAppearance = false; + txtQ.Size = new Size(124, 20); + txtQ.StyleController = layoutControl1; + txtQ.TabIndex = 4; + // + // Root + // + Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; + Root.GroupBordersVisible = false; + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1, layoutControlItem2, layoutControlItem3, emptySpaceItem1 }); + Root.Name = "Root"; + Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + Root.Size = new Size(805, 33); + Root.TextVisible = false; + // + // layoutControlItem1 + // + layoutControlItem1.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; + layoutControlItem1.Control = txtQ; + layoutControlItem1.Location = new Point(0, 0); + layoutControlItem1.MaxSize = new Size(180, 24); + layoutControlItem1.MinSize = new Size(180, 24); + layoutControlItem1.Name = "layoutControlItem1"; + layoutControlItem1.Size = new Size(180, 33); + layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; + layoutControlItem1.Text = "鎬绘祦閲�:"; + layoutControlItem1.TextSize = new Size(40, 14); + // + // layoutControlItem2 + // + layoutControlItem2.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; + layoutControlItem2.Control = txtP; + layoutControlItem2.Location = new Point(180, 0); + layoutControlItem2.MaxSize = new Size(180, 24); + layoutControlItem2.MinSize = new Size(180, 24); + layoutControlItem2.Name = "layoutControlItem2"; + layoutControlItem2.Size = new Size(180, 33); + layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; + layoutControlItem2.Text = "鎬诲姛鐜�:"; + layoutControlItem2.TextSize = new Size(40, 14); + // + // layoutControlItem3 + // + layoutControlItem3.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; + layoutControlItem3.Control = txtE; + layoutControlItem3.Location = new Point(360, 0); + layoutControlItem3.MaxSize = new Size(180, 24); + layoutControlItem3.MinSize = new Size(180, 24); + layoutControlItem3.Name = "layoutControlItem3"; + layoutControlItem3.Size = new Size(180, 33); + layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; + layoutControlItem3.Text = "鎬绘晥鐜�:"; + layoutControlItem3.TextSize = new Size(40, 14); + // + // emptySpaceItem1 + // + emptySpaceItem1.AllowHotTrack = false; + emptySpaceItem1.Location = new Point(540, 0); + emptySpaceItem1.MinSize = new Size(1, 1); + emptySpaceItem1.Name = "emptySpaceItem1"; + emptySpaceItem1.Size = new Size(265, 33); + emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; + emptySpaceItem1.TextSize = new Size(0, 0); + // + // HydroEnergyTotalHorizViewCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(layoutControl1); + Name = "HydroEnergyTotalHorizViewCtrl"; + Size = new Size(805, 33); + ((ISupportInitialize)layoutControl1).EndInit(); + layoutControl1.ResumeLayout(false); + ((ISupportInitialize)txtE.Properties).EndInit(); + ((ISupportInitialize)txtP.Properties).EndInit(); + ((ISupportInitialize)txtQ.Properties).EndInit(); + ((ISupportInitialize)Root).EndInit(); + ((ISupportInitialize)layoutControlItem1).EndInit(); + ((ISupportInitialize)layoutControlItem2).EndInit(); + ((ISupportInitialize)layoutControlItem3).EndInit(); + ((ISupportInitialize)emptySpaceItem1).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraLayout.LayoutControl layoutControl1; + private DevExpress.XtraEditors.TextEdit txtP; + private DevExpress.XtraEditors.TextEdit txtQ; + private DevExpress.XtraLayout.LayoutControlGroup Root; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; + private DevExpress.XtraEditors.TextEdit txtE; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; + private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.cs new file mode 100644 index 0000000..9efb2f7 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.cs @@ -0,0 +1,118 @@ +锘縰sing DevExpress.Office.Utils; +using DevExpress.Xpo.Helpers; +using DevExpress.XtraEditors; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Yw.EPAnet; +using Yw.WinFrmUI.Q3d; + +namespace Yw.WinFrmUI +{ + public partial class HydroEnergyTotalHorizViewCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroEnergyTotalHorizViewCtrl() + { + InitializeComponent(); + this.layoutControl1.SetupLayoutControl(); + } + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) + { + if (hydroInfo == null) + { + return; + } + if (calcuResult == null) + { + return; + } + if (!calcuResult.Succeed) + { + return; + } + + var allCalcuResultVisualDict = calcuResult.GetVisualDict(); + SetBindingData(hydroInfo, allCalcuResultVisualDict); + } + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict) + { + if (hydroInfo == null) + { + return; + } + if (allCalcuResultVisualDict == null || allCalcuResultVisualDict.Count < 1) + { + return; + } + + double? totalQ = null; + double? totalP = null; + var allEfficiList = new List<double>(); + if (hydroInfo.Pumps != null && hydroInfo.Pumps.Count > 0) + { + foreach (var pump in hydroInfo.Pumps) + { + if (!allCalcuResultVisualDict.ContainsKey(pump.Code)) + { + continue; + } + var calcuResult = allCalcuResultVisualDict[pump.Code] as HydroCalcuPumpResult; + if (calcuResult == null) + { + continue; + } + if (pump.LinkStatus == Yw.Hydro.PumpStatus.Open) + { + if (calcuResult.CalcuQ.HasValue) + { + if (!totalQ.HasValue) + { + totalQ = 0; + } + totalQ += calcuResult.CalcuQ.Value; + } + if (calcuResult.CalcuP.HasValue) + { + if (!totalP.HasValue) + { + totalP = 0; + } + totalP += calcuResult.CalcuP.Value; + } + if (calcuResult.CalcuE.HasValue) + { + allEfficiList.Add(calcuResult.CalcuE.Value); + } + } + } + } + if (totalQ.HasValue) + { + this.txtQ.EditValue = $"{Math.Round(totalQ.Value, 1)}m鲁/h"; + } + if (totalP.HasValue) + { + this.txtP.EditValue = $"{Math.Round(totalP.Value, 1)}kW"; + } + if (allEfficiList.Count > 0) + { + this.txtE.EditValue = $"{Math.Round(allEfficiList.Average(), 1)}%"; + } + } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalHorizViewCtrl.resx @@ -0,0 +1,120 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj index 16f1b9a..3306590 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj @@ -221,6 +221,9 @@ <Compile Update="19-pump\04-design\HydroPumpDesignPointListGridCtrl.cs"> <SubType>UserControl</SubType> </Compile> + <Compile Update="20-energy\02-total\HydroEnergyTotalHorizViewCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> <Compile Update="99-view\02-l2d\HydroL2dViewPage.cs"> <SubType>UserControl</SubType> </Compile> -- Gitblit v1.9.3