From 8486fdaaf94faddbf7e475c660726f9a71b72a4b Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期一, 02 十二月 2024 21:14:07 +0800 Subject: [PATCH] 修复phart问题 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.cs | 65 +++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.resx | 123 +++++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.Designer.cs | 171 ++++++++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.Designer.cs | 177 +++++++++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user | 3 WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.cs | 90 +++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj | 3 WinFrmUI/Yw.WinFrmUI.Phart.Core/Yw.WinFrmUI.Phart.Core.csproj | 2 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.resx | 120 +++++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListItemStateViewModel.cs | 8 WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.resx | 30 + WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.Designer.cs | 18 WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.Designer.cs | 16 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.cs | 2 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.cs | 98 ++++++ 15 files changed, 909 insertions(+), 17 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.Designer.cs new file mode 100644 index 0000000..305281c --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.Designer.cs @@ -0,0 +1,171 @@ +锘縩amespace HStation.WinFrmUI +{ + partial class SimulationPumpFeatCtrl + { + /// <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(); + hydroPumpListStateEditCtrl1 = new HydroPumpListStateEditCtrl(); + Root = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); + splitterItem1 = new DevExpress.XtraLayout.SplitterItem(); + panelControl1 = new PanelControl(); + layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); + pumpOperationChart1 = new Yw.WinFrmUI.Phart.PumpOperationChart(); + ((ISupportInitialize)layoutControl1).BeginInit(); + layoutControl1.SuspendLayout(); + ((ISupportInitialize)Root).BeginInit(); + ((ISupportInitialize)layoutControlGroup1).BeginInit(); + ((ISupportInitialize)layoutControlItem1).BeginInit(); + ((ISupportInitialize)splitterItem1).BeginInit(); + ((ISupportInitialize)panelControl1).BeginInit(); + panelControl1.SuspendLayout(); + ((ISupportInitialize)layoutControlItem3).BeginInit(); + SuspendLayout(); + // + // layoutControl1 + // + layoutControl1.Controls.Add(panelControl1); + layoutControl1.Controls.Add(hydroPumpListStateEditCtrl1); + layoutControl1.Dock = DockStyle.Fill; + layoutControl1.Location = new Point(0, 0); + layoutControl1.Name = "layoutControl1"; + layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(1055, 304, 650, 400); + layoutControl1.Root = Root; + layoutControl1.Size = new Size(952, 597); + layoutControl1.TabIndex = 0; + layoutControl1.Text = "layoutControl1"; + // + // hydroPumpListStateEditCtrl1 + // + hydroPumpListStateEditCtrl1.Location = new Point(0, 22); + hydroPumpListStateEditCtrl1.Name = "hydroPumpListStateEditCtrl1"; + hydroPumpListStateEditCtrl1.Size = new Size(217, 575); + hydroPumpListStateEditCtrl1.TabIndex = 4; + // + // Root + // + Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; + Root.GroupBordersVisible = false; + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlGroup1, splitterItem1, layoutControlItem3 }); + Root.Name = "Root"; + Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + Root.Size = new Size(952, 597); + Root.TextVisible = false; + // + // layoutControlGroup1 + // + layoutControlGroup1.GroupStyle = DevExpress.Utils.GroupStyle.Title; + layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1 }); + layoutControlGroup1.Location = new Point(0, 0); + layoutControlGroup1.Name = "layoutControlGroup1"; + layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + layoutControlGroup1.Size = new Size(217, 597); + layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + layoutControlGroup1.Text = "姘存车鍒楄〃"; + // + // layoutControlItem1 + // + layoutControlItem1.Control = hydroPumpListStateEditCtrl1; + layoutControlItem1.Location = new Point(0, 0); + layoutControlItem1.Name = "layoutControlItem1"; + layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + layoutControlItem1.Size = new Size(217, 575); + layoutControlItem1.TextSize = new Size(0, 0); + layoutControlItem1.TextVisible = false; + // + // splitterItem1 + // + splitterItem1.AllowHotTrack = true; + splitterItem1.Location = new Point(217, 0); + splitterItem1.Name = "splitterItem1"; + splitterItem1.Size = new Size(10, 597); + // + // panelControl1 + // + panelControl1.BorderStyle = BorderStyles.Simple; + panelControl1.Controls.Add(pumpOperationChart1); + panelControl1.Location = new Point(227, 0); + panelControl1.Name = "panelControl1"; + panelControl1.Padding = new Padding(1); + panelControl1.Size = new Size(725, 597); + panelControl1.TabIndex = 7; + // + // layoutControlItem3 + // + layoutControlItem3.Control = panelControl1; + layoutControlItem3.Location = new Point(227, 0); + layoutControlItem3.Name = "layoutControlItem3"; + layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + layoutControlItem3.Size = new Size(725, 597); + layoutControlItem3.TextSize = new Size(0, 0); + layoutControlItem3.TextVisible = false; + // + // pumpOperationChart1 + // + pumpOperationChart1.Dock = DockStyle.Fill; + pumpOperationChart1.LineNameVisible = true; + pumpOperationChart1.LineVisible = false; + pumpOperationChart1.Location = new Point(3, 3); + pumpOperationChart1.Margin = new Padding(2, 2, 2, 2); + pumpOperationChart1.Name = "pumpOperationChart1"; + pumpOperationChart1.Size = new Size(719, 591); + pumpOperationChart1.TabIndex = 0; + // + // SimulationPumpFeatCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(layoutControl1); + Name = "SimulationPumpFeatCtrl"; + Size = new Size(952, 597); + ((ISupportInitialize)layoutControl1).EndInit(); + layoutControl1.ResumeLayout(false); + ((ISupportInitialize)Root).EndInit(); + ((ISupportInitialize)layoutControlGroup1).EndInit(); + ((ISupportInitialize)layoutControlItem1).EndInit(); + ((ISupportInitialize)splitterItem1).EndInit(); + ((ISupportInitialize)panelControl1).EndInit(); + panelControl1.ResumeLayout(false); + ((ISupportInitialize)layoutControlItem3).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraLayout.LayoutControl layoutControl1; + private HydroPumpListStateEditCtrl hydroPumpListStateEditCtrl1; + private DevExpress.XtraLayout.LayoutControlGroup Root; + private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; + private DevExpress.XtraLayout.SplitterItem splitterItem1; + private PanelControl panelControl1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; + private Yw.WinFrmUI.Phart.PumpOperationChart pumpOperationChart1; + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.cs new file mode 100644 index 0000000..072b59a --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.cs @@ -0,0 +1,98 @@ +锘縰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.WinFrmUI.Phart; + +namespace HStation.WinFrmUI +{ + public partial class SimulationPumpFeatCtrl : DevExpress.XtraEditors.XtraUserControl + { + public SimulationPumpFeatCtrl() + { + InitializeComponent(); + this.layoutControl1.SetupLayoutControl(); + this.hydroPumpListStateEditCtrl1.SelectedChangedEvent += HydroPumpListStateEditCtrl1_SelectedChangedEvent; + } + + /// <summary> + /// + /// </summary> + public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo) + { + this.hydroPumpListStateEditCtrl1.SetBindingData(hydroInfo); + } + + + private void HydroPumpListStateEditCtrl1_SelectedChangedEvent(HydroPumpListItemStateViewModel obj) + { + var vm = CreateViewModel(obj); + this.pumpOperationChart1.SetBindingData(vm); + } + + //鍒涘缓 + private PumpOperationViewModel CreateViewModel(HydroPumpListItemStateViewModel state) + { + var vm = new PumpOperationViewModel(); + vm.Id = state.Code; + vm.Name = state.Name; + vm.RatedQ = state.Vmo.RatedQ.HasValue ? state.Vmo.RatedQ.Value : 0; + vm.RatedH = state.Vmo.RatedH.HasValue ? state.Vmo.RatedH.Value : 0; + vm.RatedP = state.Vmo.RatedP; + vm.RatedN = state.Vmo.RatedN.HasValue ? state.Vmo.RatedN.Value : 0; + vm.RatedHz = state.Vmo.RatedHz; + vm.CurrentHz = state.CurrentHz; + vm.CurrentN = Math.Round(state.CurrentHz / state.Vmo.RatedHz * vm.RatedN, 1); + vm.CurrentStatus = state.RunStatus; + + var curveqh = state.HydroInfo.Curves?.Find(x => x.Code == state.Vmo.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 qh_current_pts = qh_pts.GetQHPointListByN(state.Vmo.RatedHz, state.CurrentHz); + vm.CurrentCurveQH = new CubicSpline2d(qh_current_pts); + } + } + + var curveqp = state.HydroInfo.Curves?.Find(x => x.Code == state.Vmo.CurveQP); + if (curveqp != null) + { + var qppts = curveqp.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); + if (qppts != null && qppts.Count > 3) + { + vm.CurveQP = new CubicSpline2d(qppts); + var sqppts = qppts.GetQHPointListByN(state.Vmo.RatedHz, state.CurrentHz); + vm.CurrentCurveQP = new CubicSpline2d(sqppts); + } + } + + var curveqe = state.HydroInfo.Curves?.Find(x => x.Code == state.Vmo.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); + var sqepts = qepts.GetQHPointListByN(state.Vmo.RatedHz, state.CurrentHz); + vm.CurrentCurveQE = new CubicSpline2d(sqepts); + } + } + + return vm; + } + + + + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.resx b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatCtrl.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/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.Designer.cs index 33be06f..846af0a 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.Designer.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.Designer.cs @@ -31,7 +31,7 @@ ribbon = new DevExpress.XtraBars.Ribbon.RibbonControl(); ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage(); ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup(); - hydroPumpListStateGridCtrl1 = new HydroPumpListStateEditCtrl(); + simulationPumpFeatCtrl1 = new SimulationPumpFeatCtrl(); ((ISupportInitialize)ribbon).BeginInit(); SuspendLayout(); // @@ -58,20 +58,20 @@ ribbonPageGroup1.Name = "ribbonPageGroup1"; ribbonPageGroup1.Text = "ribbonPageGroup1"; // - // hydroPumpListStateGridCtrl1 + // simulationPumpFeatCtrl1 // - hydroPumpListStateGridCtrl1.Dock = DockStyle.Left; - hydroPumpListStateGridCtrl1.Location = new Point(0, 32); - hydroPumpListStateGridCtrl1.Name = "hydroPumpListStateGridCtrl1"; - hydroPumpListStateGridCtrl1.Size = new Size(295, 601); - hydroPumpListStateGridCtrl1.TabIndex = 1; + simulationPumpFeatCtrl1.Dock = DockStyle.Fill; + simulationPumpFeatCtrl1.Location = new Point(0, 32); + simulationPumpFeatCtrl1.Name = "simulationPumpFeatCtrl1"; + simulationPumpFeatCtrl1.Size = new Size(996, 601); + simulationPumpFeatCtrl1.TabIndex = 3; // // SimulationPumpFeatDlg // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(996, 633); - Controls.Add(hydroPumpListStateGridCtrl1); + Controls.Add(simulationPumpFeatCtrl1); Controls.Add(ribbon); FormBorderStyle = FormBorderStyle.SizableToolWindow; Name = "SimulationPumpFeatDlg"; @@ -89,6 +89,6 @@ private DevExpress.XtraBars.Ribbon.RibbonControl ribbon; private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1; private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1; - private HydroPumpListStateEditCtrl hydroPumpListStateGridCtrl1; + private SimulationPumpFeatCtrl simulationPumpFeatCtrl1; } } \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.cs index 33342dc..5bc1816 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/02-feat/SimulationPumpFeatDlg.cs @@ -10,7 +10,7 @@ public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo) { - this.hydroPumpListStateGridCtrl1.SetBindingData(hydroInfo); + this.simulationPumpFeatCtrl1.SetBindingData(hydroInfo); } 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 99d90ec..3a8aa4a 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 @@ -199,6 +199,9 @@ <Compile Update="03-simulation\11-pump\01-parallel\SimulationPumpParallelCtrl.cs"> <SubType>UserControl</SubType> </Compile> + <Compile Update="03-simulation\11-pump\02-feat\SimulationPumpFeatCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> <Compile Update="03-simulation\XhsProjectSimulationMgrPage.cs"> <SubType>UserControl</SubType> </Compile> diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.Designer.cs new file mode 100644 index 0000000..52bc6be --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.Designer.cs @@ -0,0 +1,177 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class SetHydroPumpWorkingDlg + { + /// <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 Windows Form 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(); + layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); + generalOkAndCancelCtrl1 = new GeneralOkAndCancelCtrl(); + txtCurrentHz = new DevExpress.XtraEditors.TextEdit(); + imgCmbLinkStatus = new DevExpress.XtraEditors.ImageComboBoxEdit(); + Root = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); + dxErrorProvider1 = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(components); + ((ISupportInitialize)layoutControl1).BeginInit(); + layoutControl1.SuspendLayout(); + ((ISupportInitialize)txtCurrentHz.Properties).BeginInit(); + ((ISupportInitialize)imgCmbLinkStatus.Properties).BeginInit(); + ((ISupportInitialize)Root).BeginInit(); + ((ISupportInitialize)layoutControlItem10).BeginInit(); + ((ISupportInitialize)layoutControlItem2).BeginInit(); + ((ISupportInitialize)layoutControlItem1).BeginInit(); + ((ISupportInitialize)dxErrorProvider1).BeginInit(); + SuspendLayout(); + // + // layoutControl1 + // + layoutControl1.Controls.Add(generalOkAndCancelCtrl1); + layoutControl1.Controls.Add(txtCurrentHz); + layoutControl1.Controls.Add(imgCmbLinkStatus); + layoutControl1.Dock = DockStyle.Fill; + layoutControl1.Location = new Point(0, 0); + layoutControl1.Name = "layoutControl1"; + layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(670, 266, 650, 400); + layoutControl1.Root = Root; + layoutControl1.Size = new Size(385, 74); + layoutControl1.TabIndex = 1; + layoutControl1.Text = "layoutControl1"; + // + // generalOkAndCancelCtrl1 + // + generalOkAndCancelCtrl1.ButtonCancelMaxSize = new Size(100, 26); + generalOkAndCancelCtrl1.ButtonCancelMinSize = new Size(100, 26); + generalOkAndCancelCtrl1.ButtonOkMaxSize = new Size(100, 26); + generalOkAndCancelCtrl1.ButtonOkMinSize = new Size(100, 26); + generalOkAndCancelCtrl1.Location = new Point(12, 36); + generalOkAndCancelCtrl1.Name = "generalOkAndCancelCtrl1"; + generalOkAndCancelCtrl1.Size = new Size(361, 26); + generalOkAndCancelCtrl1.TabIndex = 3; + // + // txtCurrentHz + // + txtCurrentHz.Location = new Point(258, 12); + txtCurrentHz.Name = "txtCurrentHz"; + txtCurrentHz.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False; + txtCurrentHz.Properties.DisplayFormat.FormatString = "{0}hz"; + txtCurrentHz.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; + txtCurrentHz.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager)); + txtCurrentHz.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False"); + txtCurrentHz.Properties.NullValuePrompt = "hz"; + txtCurrentHz.Size = new Size(115, 20); + txtCurrentHz.StyleController = layoutControl1; + txtCurrentHz.TabIndex = 2; + // + // imgCmbLinkStatus + // + imgCmbLinkStatus.Location = new Point(76, 12); + imgCmbLinkStatus.Name = "imgCmbLinkStatus"; + imgCmbLinkStatus.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); + imgCmbLinkStatus.Size = new Size(114, 20); + imgCmbLinkStatus.StyleController = layoutControl1; + imgCmbLinkStatus.TabIndex = 0; + // + // Root + // + Root.AppearanceItemCaption.Options.UseTextOptions = true; + Root.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; + Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; + Root.GroupBordersVisible = false; + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem10, layoutControlItem2, layoutControlItem1 }); + Root.Name = "Root"; + Root.Size = new Size(385, 74); + Root.TextVisible = false; + // + // layoutControlItem10 + // + layoutControlItem10.Control = imgCmbLinkStatus; + layoutControlItem10.Location = new Point(0, 0); + layoutControlItem10.Name = "layoutControlItem10"; + layoutControlItem10.Size = new Size(182, 24); + layoutControlItem10.Text = "寮�鏈虹姸鎬�:"; + layoutControlItem10.TextSize = new Size(52, 14); + // + // layoutControlItem2 + // + layoutControlItem2.Control = generalOkAndCancelCtrl1; + layoutControlItem2.Location = new Point(0, 24); + layoutControlItem2.Name = "layoutControlItem2"; + layoutControlItem2.Size = new Size(365, 30); + layoutControlItem2.TextSize = new Size(0, 0); + layoutControlItem2.TextVisible = false; + // + // layoutControlItem1 + // + layoutControlItem1.Control = txtCurrentHz; + layoutControlItem1.Location = new Point(182, 0); + layoutControlItem1.Name = "layoutControlItem1"; + layoutControlItem1.Size = new Size(183, 24); + layoutControlItem1.Text = "璁惧畾棰戠巼:"; + layoutControlItem1.TextSize = new Size(52, 14); + // + // dxErrorProvider1 + // + dxErrorProvider1.ContainerControl = this; + // + // SetHydroPumpWorkingDlg + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(385, 74); + Controls.Add(layoutControl1); + MaximizeBox = false; + Name = "SetHydroPumpWorkingDlg"; + StartPosition = FormStartPosition.CenterParent; + Text = "璁剧疆"; + ((ISupportInitialize)layoutControl1).EndInit(); + layoutControl1.ResumeLayout(false); + ((ISupportInitialize)txtCurrentHz.Properties).EndInit(); + ((ISupportInitialize)imgCmbLinkStatus.Properties).EndInit(); + ((ISupportInitialize)Root).EndInit(); + ((ISupportInitialize)layoutControlItem10).EndInit(); + ((ISupportInitialize)layoutControlItem2).EndInit(); + ((ISupportInitialize)layoutControlItem1).EndInit(); + ((ISupportInitialize)dxErrorProvider1).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraLayout.LayoutControl layoutControl1; + private DevExpress.XtraLayout.LayoutControlGroup Root; + private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8; + private DevExpress.XtraEditors.ImageComboBoxEdit imgCmbLinkStatus; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10; + private DevExpress.XtraEditors.TextEdit txtCurrentHz; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; + private GeneralOkAndCancelCtrl generalOkAndCancelCtrl1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; + } +} \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.cs new file mode 100644 index 0000000..84be983 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.cs @@ -0,0 +1,90 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class SetHydroPumpWorkingDlg : DevExpress.XtraEditors.XtraForm + { + public SetHydroPumpWorkingDlg() + { + InitializeComponent(); + this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; + this.layoutControl1.SetupLayoutControl(); + this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; + InitialLinkStatus(); + } + + /// <summary> + /// 閲嶈浇鏁版嵁浜嬩欢 + /// </summary> + public event Action<HydroWorkingPumpViewModel> ReloadDataEvent; + + private HydroWorkingPumpViewModel _working = null;//宸ュ喌 + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + public void SetBindingData(Yw.Model.HydroPumpInfo visual) + { + if (visual == null) + { + return; + } + var working = new HydroWorkingPumpViewModel(visual); + SetBindingData(working); + } + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + public void SetBindingData(HydroWorkingPumpViewModel working) + { + _working = working; + this.imgCmbLinkStatus.EditValue = working.LinkStatus; + this.txtCurrentHz.EditValue = working.CurrentHz; + } + + //鍒濆鍖栫娈电姸鎬� + private void InitialLinkStatus() + { + this.imgCmbLinkStatus.Properties.BeginUpdate(); + this.imgCmbLinkStatus.Properties.Items.Clear(); + this.imgCmbLinkStatus.Properties.Items.Add(HydroLinkStatusHelper.GetStatusName(Yw.Hydro.LinkStatus.Open), Yw.Hydro.LinkStatus.Open, -1); + this.imgCmbLinkStatus.Properties.Items.Add(HydroLinkStatusHelper.GetStatusName(Yw.Hydro.LinkStatus.Closed), Yw.Hydro.LinkStatus.Closed, -1); + this.imgCmbLinkStatus.Properties.EndUpdate(); + } + + //楠岃瘉 + private bool Valid() + { + this.dxErrorProvider1.ClearErrors(); + if (this.imgCmbLinkStatus.EditValue == null) + { + this.dxErrorProvider1.SetError(this.imgCmbLinkStatus, "蹇呴�夐」"); + return false; + } + if (this.txtCurrentHz.EditValue == null) + { + this.dxErrorProvider1.SetError(this.txtCurrentHz, "蹇呭~椤�"); + return false; + } + return true; + } + + //纭畾 + private void GeneralOkAndCancelCtrl1_OkEvent() + { + if (_working == null) + { + return; + } + if (!Valid()) + { + return; + } + _working.LinkStatus = this.imgCmbLinkStatus.EditValue.ToString(); + _working.CurrentHz = double.Parse(this.txtCurrentHz.EditValue.ToString()); + this.ReloadDataEvent?.Invoke(_working); + this.DialogResult = DialogResult.OK; + this.Close(); + } + + } +} \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.resx new file mode 100644 index 0000000..d438392 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/10-working/02-visual/03-pump/SetHydroPumpWorkingDlg.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="dxErrorProvider1.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/05-state/HydroPumpListItemStateViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListItemStateViewModel.cs index c9b7edd..d0e8d52 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListItemStateViewModel.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListItemStateViewModel.cs @@ -20,7 +20,7 @@ /// <summary> /// /// </summary> - public HydroPumpListItemStateViewModel(Yw.Model.HydroPumpInfo rhs) + public HydroPumpListItemStateViewModel(Yw.Model.HydroPumpInfo rhs, Yw.Model.HydroModelInfo hydroInfo) { this.Code = rhs.Code; this.Name = rhs.Name; @@ -38,6 +38,7 @@ this.Description = rhs.Description; this.Vmo = rhs; + this.HydroInfo = hydroInfo; } /// <summary> @@ -80,5 +81,10 @@ /// vmo /// </summary> public Yw.Model.HydroPumpInfo Vmo { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroModelInfo HydroInfo { get; set; } } } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.Designer.cs index 3282b73..662153d 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.Designer.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.Designer.cs @@ -29,6 +29,8 @@ private void InitializeComponent() { components = new Container(); + DevExpress.Utils.SimpleContextButton simpleContextButton1 = new DevExpress.Utils.SimpleContextButton(); + ComponentResourceManager resources = new ComponentResourceManager(typeof(HydroPumpListStateEditCtrl)); 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(); @@ -49,6 +51,14 @@ // // imageListBoxControl1 // + simpleContextButton1.AlignmentOptions.Panel = DevExpress.Utils.ContextItemPanel.Center; + simpleContextButton1.AlignmentOptions.Position = DevExpress.Utils.ContextItemPosition.Far; + simpleContextButton1.Id = new Guid("ee22239a-6899-40f3-bbe4-7a30d39c9f1d"); + simpleContextButton1.ImageOptionsCollection.ItemNormal.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("resource.SvgImage"); + simpleContextButton1.ImageOptionsCollection.ItemNormal.SvgImageSize = new Size(24, 24); + simpleContextButton1.Name = "simpleContextButton1"; + simpleContextButton1.ToolTip = "璁剧疆"; + imageListBoxControl1.ContextButtons.Add(simpleContextButton1); imageListBoxControl1.DataSource = hydroPumpListItemStateViewModelBindingSource; imageListBoxControl1.Dock = DockStyle.Fill; imageListBoxControl1.ItemHeight = 34; @@ -60,7 +70,7 @@ tableColumnDefinition1.Length.Value = 40D; tableColumnDefinition2.Length.Value = 210D; tableColumnDefinition3.Length.Type = DevExpress.XtraEditors.TableLayout.TableDefinitionLengthType.Pixel; - tableColumnDefinition3.Length.Value = 66D; + tableColumnDefinition3.Length.Value = 80D; itemTemplateBase1.Columns.Add(tableColumnDefinition1); itemTemplateBase1.Columns.Add(tableColumnDefinition2); itemTemplateBase1.Columns.Add(tableColumnDefinition3); @@ -82,13 +92,15 @@ templatedItemElement3.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter; templatedItemElement3.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside; templatedItemElement3.Text = "CurrentHz"; - templatedItemElement3.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter; + templatedItemElement3.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleLeft; 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; + imageListBoxControl1.ContextButtonClick += imageListBoxControl1_ContextButtonClick; // // HydroPumpListStateEditCtrl // diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.cs index 94f8932..942eba7 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.cs @@ -19,6 +19,11 @@ InitializeComponent(); } + /// <summary> + /// 閫夋嫨鏀瑰彉浜嬩欢 + /// </summary> + public event Action<HydroPumpListItemStateViewModel> SelectedChangedEvent; + private BindingList<HydroPumpListItemStateViewModel> _allBindingList = null; /// <summary> @@ -26,15 +31,15 @@ /// </summary> public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo) { - SetBindingData(hydroInfo?.Pumps); + SetBindingData(hydroInfo?.Pumps, hydroInfo); } /// <summary> /// 缁戝畾鏁版嵁 /// </summary> - public void SetBindingData(List<Yw.Model.HydroPumpInfo> allPumpList) + public void SetBindingData(List<Yw.Model.HydroPumpInfo> allPumpList, Yw.Model.HydroModelInfo hydroInfo) { - var list = allPumpList?.Select(x => new HydroPumpListItemStateViewModel(x)).ToList(); + var list = allPumpList?.Select(x => new HydroPumpListItemStateViewModel(x, hydroInfo)).ToList(); SetBindingData(list); } @@ -49,6 +54,60 @@ this.hydroPumpListItemStateViewModelBindingSource.ResetBindings(false); } + /// <summary> + /// 鑾峰彇宸ュ喌鍒楄〃 + /// </summary> + public List<HydroWorkingPumpViewModel> GetWorkingList() + { + return _allBindingList?.Select(x => new HydroWorkingPumpViewModel() + { + Code = x.Code, + LinkStatus = x.RunStatus ? Yw.Hydro.PumpStatus.Open : Yw.Hydro.PumpStatus.Closed, + CurrentHz = x.CurrentHz + }).ToList(); + } + + // + private void imageListBoxControl1_ContextButtonClick(object sender, DevExpress.Utils.ContextItemClickEventArgs e) + { + var vm = e.DataItem as HydroPumpListItemStateViewModel; + if (vm == null) + { + return; + } + var working = new HydroWorkingPumpViewModel() + { + Code = vm.Code, + LinkStatus = vm.RunStatus ? Yw.Hydro.PumpStatus.Open : Yw.Hydro.PumpStatus.Closed, + CurrentHz = vm.CurrentHz + }; + var dlg = new SetHydroPumpWorkingDlg(); + dlg.ReloadDataEvent += (rhs) => + { + vm.RunStatus = rhs.LinkStatus == Yw.Hydro.PumpStatus.Open; + vm.CurrentHz = rhs.CurrentHz; + this.hydroPumpListItemStateViewModelBindingSource.ResetBindings(false); + }; + dlg.SetBindingData(working); + dlg.ShowDialog(); + } + + //閫夋嫨鏀瑰彉 + private void imageListBoxControl1_SelectedValueChanged(object sender, EventArgs e) + { + if (_allBindingList == null || _allBindingList.Count < 1) + { + return; + } + var item = this.imageListBoxControl1.SelectedItem; + var vm = item as HydroPumpListItemStateViewModel; + if (vm == null) + { + return; + } + this.SelectedChangedEvent?.Invoke(vm); + } + } } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.resx index 812d835..a6732fa 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.resx +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/19-pump/05-state/HydroPumpListStateEditCtrl.resx @@ -120,4 +120,34 @@ <metadata name="hydroPumpListItemStateViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> + <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> + <data name="resource.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi40 + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAABwFAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg + MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlllbGxvd3tmaWxsOiNGRkIxMTU7fQoJ + LlJlZHtmaWxsOiNEMTFDMUM7fQoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9CgkuQmx1ZXtmaWxsOiMxMTc3 + RDc7fQoJLldoaXRle2ZpbGw6I0ZGRkZGRjt9CgkuR3JlZW57ZmlsbDojMDM5QzIzO30KCS5zdDB7b3Bh + Y2l0eTowLjc1O30KCS5zdDF7b3BhY2l0eTowLjU7fQoJLnN0MntvcGFjaXR5OjAuMjU7fQoJLnN0M3tm + aWxsOiNGRkIxMTU7fQo8L3N0eWxlPg0KICA8ZyAvPg0KICA8ZyBpZD0iUmVuYW1lXzFfIj4NCiAgICA8 + cGF0aCBkPSJNMi4xLDE2aDIuMmwwLjYtMi4zaDMuMkw4LjgsMTZIMTFMNy44LDZINS40TDIuMSwxNnog + TTYuNCw4LjdjMC4xLTAuMywwLjEtMC42LDAuMS0wLjloMC4xICAgYzAsMC4zLDAuMSwwLjYsMC4xLDAu + OWwxLDMuM0g1LjRMNi40LDguN3ogTTE3LjUsMTAuNmMwLjYtMC4yLDEuMS0wLjUsMS41LTAuOWMwLjQt + MC40LDAuNi0wLjksMC42LTEuNGMwLTAuNy0wLjMtMS4zLTAuOS0xLjcgICBDMTguMSw2LjIsMTcuMSw2 + LDE1LjksNkgxMnY5LjlWMTZoNGMxLjIsMCwyLjItMC4yLDIuOS0wLjhDMTkuNywxNC42LDIwLDE0LDIw + LDEzYzAtMC42LTAuMi0xLjItMC43LTEuNiAgIEMxOC45LDExLDE4LjMsMTAuNywxNy41LDEwLjZ6IE0x + NC40LDcuN2gwLjljMS4xLDAsMS43LDAuNCwxLjcsMS4xYzAsMC40LTAuMSwwLjctMC40LDAuOUMxNi40 + LDkuOSwxNiwxMCwxNS41LDEwaC0xLjFWNy43eiAgICBNMTcsMTMuOGMtMC4zLDAuMi0wLjgsMC40LTEu + MywwLjRoLTEuM3YtMi42aDEuM2MwLjUsMCwwLjksMC4xLDEuMywwLjNjMC4zLDAuMiwwLjUsMC42LDAu + NSwwLjlDMTcuNSwxMy4zLDE3LjQsMTMuNiwxNywxMy44eiIgY2xhc3M9IkJsYWNrIiAvPg0KICAgIDxw + YXRoIGQ9Ik0yNywxOWwtOCw4bC00LTRsOC04TDI3LDE5eiBNMjgsMThsMS43LTEuN2MwLjQtMC40LDAu + NC0xLDAtMS4zTDI3LDEyLjNjLTAuNC0wLjQtMS0wLjQtMS4zLDBMMjQsMTRMMjgsMTh6ICAgIE0xNCwy + NHY0aDRMMTQsMjR6IiBjbGFzcz0iQmx1ZSIgLz4NCiAgPC9nPg0KPC9zdmc+Cw== +</value> + </data> </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 2187414..df8e7bb 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj @@ -146,6 +146,9 @@ <Compile Update="06-visual\19-compressor\SetHydroCompressorListDlg.cs"> <SubType>Form</SubType> </Compile> + <Compile Update="10-working\02-visual\03-pump\SetHydroPumpWorkingDlg.cs"> + <SubType>Form</SubType> + </Compile> <Compile Update="10-working\02-visual\05-resistanse\SetHydroWorkingResistanceCtrl.cs"> <SubType>UserControl</SubType> </Compile> diff --git a/WinFrmUI/Yw.WinFrmUI.Phart.Core/Yw.WinFrmUI.Phart.Core.csproj b/WinFrmUI/Yw.WinFrmUI.Phart.Core/Yw.WinFrmUI.Phart.Core.csproj index 9d5a0b6..5e8f44b 100644 --- a/WinFrmUI/Yw.WinFrmUI.Phart.Core/Yw.WinFrmUI.Phart.Core.csproj +++ b/WinFrmUI/Yw.WinFrmUI.Phart.Core/Yw.WinFrmUI.Phart.Core.csproj @@ -51,7 +51,7 @@ <ItemGroup> <PackageReference Include="DevExpress.Win.Design" Version="23.2.4" /> <PackageReference Include="NPOI" Version="2.7.1" /> - <PackageReference Include="Yw.Pump.Core" Version="3.1.2" /> + <PackageReference Include="Yw.Pump.Core" Version="3.1.5" /> </ItemGroup> <ItemGroup> -- Gitblit v1.9.3