From a8cb18d49c3014e2929b93628748b5c8aee6e5e9 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期三, 11 十二月 2024 18:35:07 +0800 Subject: [PATCH] 多工况下水泵列表修复 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/HydroPumpListCtrl.cs | 14 WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.Designer.cs | 113 ++++++++++++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/01-statistics/HydroEnergyStatisticsHelper.cs | 3 WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/01-list/HydroPumpListViewItemViewModel.cs | 2 WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroPumpListViewItemInWorkingsViewModel.datasource | 10 + WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.cs | 2 WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.resx | 123 +++++++++++++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewItemInWorkingsViewModel.cs | 84 ++++++++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj | 3 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.Designer.cs | 4 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs | 16 +- WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.cs | 70 ++++++++ 12 files changed, 425 insertions(+), 19 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs index 5c7a820..a443927 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.Designer.cs @@ -134,7 +134,7 @@ ribbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages; ribbonControl1.ShowQatLocationSelector = false; ribbonControl1.ShowToolbarCustomizeItem = false; - ribbonControl1.Size = new Size(1464, 101); + ribbonControl1.Size = new Size(1464, 128); ribbonControl1.Toolbar.ShowCustomizeItem = false; ribbonControl1.ToolbarLocation = DevExpress.XtraBars.Ribbon.RibbonQuickAccessToolbarLocation.Hidden; // @@ -660,12 +660,12 @@ tabPane1.Controls.Add(tabPageBimface); tabPane1.Controls.Add(tabPageQ3d); tabPane1.Dock = DockStyle.Fill; - tabPane1.Location = new Point(0, 101); + tabPane1.Location = new Point(0, 128); tabPane1.Name = "tabPane1"; tabPane1.Pages.AddRange(new DevExpress.XtraBars.Navigation.NavigationPageBase[] { tabPageBimface, tabPageQ3d }); - tabPane1.RegularSize = new Size(1189, 434); + tabPane1.RegularSize = new Size(1189, 407); tabPane1.SelectedPage = tabPageBimface; - tabPane1.Size = new Size(1189, 434); + tabPane1.Size = new Size(1189, 407); tabPane1.TabIndex = 1; tabPane1.Text = "tabPane1"; // @@ -673,7 +673,7 @@ // tabPageBimface.Caption = "涓夌淮妯″瀷"; tabPageBimface.Name = "tabPageBimface"; - tabPageBimface.Size = new Size(1189, 374); + tabPageBimface.Size = new Size(1189, 401); // // tabPageQ3d // @@ -693,19 +693,19 @@ docPnlRight.Dock = DevExpress.XtraBars.Docking.DockingStyle.Right; docPnlRight.FloatVertical = true; docPnlRight.ID = new Guid("cffe2560-3445-4488-83cf-b9e4b936ff18"); - docPnlRight.Location = new Point(1189, 101); + docPnlRight.Location = new Point(1189, 128); docPnlRight.Name = "docPnlRight"; docPnlRight.OriginalSize = new Size(275, 200); docPnlRight.SavedDock = DevExpress.XtraBars.Docking.DockingStyle.Right; docPnlRight.SavedIndex = 0; - docPnlRight.Size = new Size(275, 599); + docPnlRight.Size = new Size(275, 572); docPnlRight.Text = "灞炴��"; // // controlContainerRight // controlContainerRight.Location = new Point(4, 26); controlContainerRight.Name = "controlContainerRight"; - controlContainerRight.Size = new Size(268, 570); + controlContainerRight.Size = new Size(268, 543); controlContainerRight.TabIndex = 0; // // docPnlBottom diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.Designer.cs index 90648ec..90bea66 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.Designer.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.Designer.cs @@ -30,7 +30,7 @@ { layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); hydroWorkingCheckedListHorizCtrl1 = new HydroWorkingCheckedListHorizCtrl(); - hydroPumpListViewCtrl1 = new HydroPumpListViewCtrl(); + hydroPumpListViewCtrl1 = new HydroPumpListViewInWorkingsCtrl(); panelControl1 = new PanelControl(); simulationPumpAnalyChartCtrl1 = new SimulationPumpAnalyChartCtrl(); Root = new DevExpress.XtraLayout.LayoutControlGroup(); @@ -196,7 +196,7 @@ private DevExpress.XtraLayout.LayoutControl layoutControl1; private HydroWorkingCheckedListHorizCtrl hydroWorkingCheckedListHorizCtrl1; - private HydroPumpListViewCtrl hydroPumpListViewCtrl1; + private HydroPumpListViewInWorkingsCtrl hydroPumpListViewCtrl1; private PanelControl panelControl1; private DevExpress.XtraLayout.LayoutControlGroup Root; private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1; diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.cs index 6809d19..ef8668b 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/03-analy/SimulationMultiWorkingPumpAnalyCtrl.cs @@ -45,7 +45,7 @@ _hydroInfo = hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); _allWorkingList = allWorkingList; this.hydroWorkingCheckedListHorizCtrl1.SetBindingData(allWorkingList); - this.hydroPumpListViewCtrl1.SetBindingData(_hydroInfo); + this.hydroPumpListViewCtrl1.SetBindingData(_hydroInfo, allWorkingList); } //姘存车閫夋嫨鏀瑰彉 diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/HydroPumpListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/HydroPumpListCtrl.cs index d0cbaef..edc07b2 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/HydroPumpListCtrl.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/HydroPumpListCtrl.cs @@ -362,13 +362,13 @@ this.colRatedN.Visible = true; this.colRatedHz.Visible = true; this.colCurve.Visible = true; - this.colCalcuQ.Visible = true; - this.colCalcuH.Visible = true; - this.colCalcuP.Visible = true; - this.colCalcuE.Visible = true; this.colHasDb.Visible = true; this.colFlags.Visible = true; this.colDescription.Visible = true; + this.colCalcuE.Visible = true; + this.colCalcuP.Visible = true; + this.colCalcuH.Visible = true; + this.colCalcuQ.Visible = true; this.colSet.Visible = true; } @@ -421,10 +421,10 @@ this.colHasDb.Visible = true; this.colFlags.Visible = true; this.colDescription.Visible = true; - this.colCalcuQ.Visible = true; - this.colCalcuH.Visible = true; - this.colCalcuP.Visible = true; this.colCalcuE.Visible = true; + this.colCalcuP.Visible = true; + this.colCalcuH.Visible = true; + this.colCalcuQ.Visible = true; this.colSet.Visible = false; } } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/01-list/HydroPumpListViewItemViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/01-list/HydroPumpListViewItemViewModel.cs index 8b04f3e..b2966f5 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/01-list/HydroPumpListViewItemViewModel.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/01-list/HydroPumpListViewItemViewModel.cs @@ -30,6 +30,8 @@ this.HydroInfo = hydroInfo; } + + /// <summary> /// 缂栫爜 /// </summary> diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.Designer.cs new file mode 100644 index 0000000..f6d0246 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.Designer.cs @@ -0,0 +1,113 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroPumpListViewInWorkingsCtrl + { + /// <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(); + DevExpress.XtraEditors.TableLayout.ItemTemplateBase itemTemplateBase1 = new DevExpress.XtraEditors.TableLayout.ItemTemplateBase(); + DevExpress.XtraEditors.TableLayout.TableColumnDefinition tableColumnDefinition1 = new DevExpress.XtraEditors.TableLayout.TableColumnDefinition(); + DevExpress.XtraEditors.TableLayout.TableColumnDefinition tableColumnDefinition2 = new DevExpress.XtraEditors.TableLayout.TableColumnDefinition(); + DevExpress.XtraEditors.TableLayout.TableColumnDefinition tableColumnDefinition3 = new DevExpress.XtraEditors.TableLayout.TableColumnDefinition(); + DevExpress.XtraEditors.TableLayout.TemplatedItemElement templatedItemElement1 = new DevExpress.XtraEditors.TableLayout.TemplatedItemElement(); + DevExpress.XtraEditors.TableLayout.TemplatedItemElement templatedItemElement2 = new DevExpress.XtraEditors.TableLayout.TemplatedItemElement(); + DevExpress.XtraEditors.TableLayout.TemplatedItemElement templatedItemElement3 = new DevExpress.XtraEditors.TableLayout.TemplatedItemElement(); + DevExpress.XtraEditors.TableLayout.TableRowDefinition tableRowDefinition1 = new DevExpress.XtraEditors.TableLayout.TableRowDefinition(); + imageListBoxControl1 = new DevExpress.XtraEditors.ImageListBoxControl(); + hydroPumpListViewItemInWorkingsViewModelBindingSource = new BindingSource(components); + ((ISupportInitialize)imageListBoxControl1).BeginInit(); + ((ISupportInitialize)hydroPumpListViewItemInWorkingsViewModelBindingSource).BeginInit(); + SuspendLayout(); + // + // imageListBoxControl1 + // + imageListBoxControl1.DataSource = hydroPumpListViewItemInWorkingsViewModelBindingSource; + imageListBoxControl1.Dock = DockStyle.Fill; + imageListBoxControl1.ItemHeight = 34; + imageListBoxControl1.Location = new Point(0, 0); + imageListBoxControl1.Name = "imageListBoxControl1"; + imageListBoxControl1.Size = new Size(262, 541); + imageListBoxControl1.TabIndex = 0; + tableColumnDefinition1.Length.Type = DevExpress.XtraEditors.TableLayout.TableDefinitionLengthType.Pixel; + tableColumnDefinition1.Length.Value = 32D; + tableColumnDefinition2.Length.Type = DevExpress.XtraEditors.TableLayout.TableDefinitionLengthType.Pixel; + tableColumnDefinition2.Length.Value = 153D; + tableColumnDefinition3.Length.Type = DevExpress.XtraEditors.TableLayout.TableDefinitionLengthType.Pixel; + tableColumnDefinition3.Length.Value = 70D; + itemTemplateBase1.Columns.Add(tableColumnDefinition1); + itemTemplateBase1.Columns.Add(tableColumnDefinition2); + itemTemplateBase1.Columns.Add(tableColumnDefinition3); + templatedItemElement1.ColumnIndex = 1; + templatedItemElement1.FieldName = "Name"; + templatedItemElement1.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter; + templatedItemElement1.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside; + templatedItemElement1.Text = "Name"; + templatedItemElement1.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleLeft; + templatedItemElement1.TextLocation = new Point(10, 0); + templatedItemElement2.Appearance.Normal.ForeColor = Color.Silver; + templatedItemElement2.Appearance.Normal.Options.UseForeColor = true; + templatedItemElement2.ColumnIndex = 2; + templatedItemElement2.FieldName = "RatedHz"; + templatedItemElement2.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter; + templatedItemElement2.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside; + templatedItemElement2.Text = "RatedHz"; + templatedItemElement2.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter; + templatedItemElement3.FieldName = "Image"; + templatedItemElement3.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter; + templatedItemElement3.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside; + templatedItemElement3.Text = "Image"; + templatedItemElement3.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter; + itemTemplateBase1.Elements.Add(templatedItemElement1); + itemTemplateBase1.Elements.Add(templatedItemElement2); + itemTemplateBase1.Elements.Add(templatedItemElement3); + itemTemplateBase1.Name = "template1"; + itemTemplateBase1.Rows.Add(tableRowDefinition1); + imageListBoxControl1.Templates.Add(itemTemplateBase1); + imageListBoxControl1.SelectedValueChanged += imageListBoxControl1_SelectedValueChanged; + // + // hydroPumpListViewItemInWorkingsViewModelBindingSource + // + hydroPumpListViewItemInWorkingsViewModelBindingSource.DataSource = typeof(HydroPumpListViewItemInWorkingsViewModel); + // + // HydroPumpListViewInWorkingsCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(imageListBoxControl1); + Name = "HydroPumpListViewInWorkingsCtrl"; + Size = new Size(262, 541); + ((ISupportInitialize)imageListBoxControl1).EndInit(); + ((ISupportInitialize)hydroPumpListViewItemInWorkingsViewModelBindingSource).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraEditors.ImageListBoxControl imageListBoxControl1; + private BindingSource hydroPumpListViewItemInWorkingsViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.cs new file mode 100644 index 0000000..aed8194 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.cs @@ -0,0 +1,70 @@ +锘縰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; + +namespace Yw.WinFrmUI +{ + public partial class HydroPumpListViewInWorkingsCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroPumpListViewInWorkingsCtrl() + { + InitializeComponent(); + } + + /// <summary> + /// 閫夋嫨鏀瑰彉浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroPumpInfo> SelectedChangedEvent; + + private List<HydroPumpListViewItemInWorkingsViewModel> _allBindingList = null;//缁戝畾鍒楄〃 + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, List<HydroWorkingVmo> allWorkingList) + { + if (hydroInfo == null) + { + return; + } + SetBindingData(hydroInfo.Pumps, allWorkingList); + } + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + public void SetBindingData(List<Yw.Model.HydroPumpInfo> pumps, List<HydroWorkingVmo> allWorkingList) + { + var allWorkingInfoList = allWorkingList?.Select(x => JsonHelper.Json2Object<HydroWorkingInfoViewModel>(x.WorkingInfo)).ToList(); + _allBindingList = new List<HydroPumpListViewItemInWorkingsViewModel>(); + pumps?.ForEach(x => _allBindingList.Add(new HydroPumpListViewItemInWorkingsViewModel(x, allWorkingInfoList))); + this.hydroPumpListViewItemInWorkingsViewModelBindingSource.DataSource = _allBindingList; + this.hydroPumpListViewItemInWorkingsViewModelBindingSource.ResetBindings(false); + } + + //閫夋嫨鏀瑰彉 + private void imageListBoxControl1_SelectedValueChanged(object sender, EventArgs e) + { + if (_allBindingList == null || _allBindingList.Count < 1) + { + return; + } + var item = this.imageListBoxControl1.SelectedItem; + var pump = item as HydroPumpListViewItemInWorkingsViewModel; + if (pump == null) + { + return; + } + this.SelectedChangedEvent?.Invoke(pump.Vmo); + } + + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.resx new file mode 100644 index 0000000..74dc86a --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewInWorkingsCtrl.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="hydroPumpListViewItemInWorkingsViewModelBindingSource.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/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewItemInWorkingsViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewItemInWorkingsViewModel.cs new file mode 100644 index 0000000..0fb43fb --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/06-working/HydroPumpListViewItemInWorkingsViewModel.cs @@ -0,0 +1,84 @@ +锘縰sing DevExpress.Xpo.Helpers; + +namespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroPumpListViewItemInWorkingsViewModel + { + /// <summary> + /// + /// </summary> + public HydroPumpListViewItemInWorkingsViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroPumpListViewItemInWorkingsViewModel(Yw.Model.HydroPumpInfo rhs, List<HydroWorkingInfoViewModel> allWorkingInfoList) + { + this.Code = rhs.Code; + this.Name = rhs.Name; + this.RatedHz = $"{rhs.RatedHz}hz"; + this.LinkStatus = Yw.Hydro.PumpStatus.Closed; + if (allWorkingInfoList != null && allWorkingInfoList.Count > 0) + { + if (allWorkingInfoList.Exists(x => x.Pumps != null && x.Pumps.Exists(t => t.Code == this.Code && t.LinkStatus == Yw.Hydro.PumpStatus.Open))) + { + this.LinkStatus = Yw.Hydro.PumpStatus.Open; + } + } + this.Description = rhs.Description; + + this.Vmo = rhs; + } + + /// <summary> + /// 缂栫爜 + /// </summary> + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + public string Name { get; set; } + + /// <summary> + /// 棰濆畾棰戠巼 + /// </summary> + public string RatedHz { get; set; } + + /// <summary> + /// 杩愯鐘舵�� + /// </summary> + public string LinkStatus { get; set; } + + /// <summary> + /// 鍥剧墖 + /// </summary> + public Image Image + { + get + { + if (this.LinkStatus == Yw.Hydro.PumpStatus.Open) + { + return Yw.WinFrmUI.Hydro.Core.Properties.Resources.pump_run_32; + } + return Yw.WinFrmUI.Hydro.Core.Properties.Resources.pump_shut_32; + } + } + + /// <summary> + /// 璇存槑 + /// </summary> + public string Description { get; set; } + + /// <summary> + /// vmo + /// </summary> + public Yw.Model.HydroPumpInfo Vmo { get; set; } + + + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/01-statistics/HydroEnergyStatisticsHelper.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/01-statistics/HydroEnergyStatisticsHelper.cs index c799a25..647dccd 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/01-statistics/HydroEnergyStatisticsHelper.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/01-statistics/HydroEnergyStatisticsHelper.cs @@ -57,6 +57,7 @@ minorLossEnergy.EnergyValue += pumpLoss; } + allStatisticsList.ForEach(x => x.EnergyValue = Math.Round(x.EnergyValue, 2)); return allStatisticsList; } @@ -107,7 +108,7 @@ break; default: break; } - item.EnergyValue = Math.Round(energyGroup.Sum(x => x.EnergyPower), 1); + item.EnergyValue = Math.Round(energyGroup.Sum(x => x.EnergyPower), 2); allStatisticsList.Add(item); } } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroPumpListViewItemInWorkingsViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroPumpListViewItemInWorkingsViewModel.datasource new file mode 100644 index 0000000..dfcc3ed --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroPumpListViewItemInWorkingsViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroPumpListViewItemInWorkingsViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroPumpListViewItemInWorkingsViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ 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 01a966d..55e0097 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="19-pump\06-working\HydroPumpListViewInWorkingsCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> <Compile Update="20-energy\02-total\HydroEnergyTotalHorizViewCtrl.cs"> <SubType>UserControl</SubType> </Compile> -- Gitblit v1.9.3