WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/PumpParallelChartDlg.cs
@@ -7,14 +7,14 @@ public PumpParallelChartDlg() { InitializeComponent(); this.Text = "å¹¶èåæ"; this.Text = "å¹¶èåæ"; this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; this.pumpSerialParallelChart.LineVisible = true; this.pumpParallelInfoCtrl1.SetEvent += (id, qh, qe, qp) => { var list = this.pumpParallelInfoCtrl1.GetRunList(); SetParallel(list); }; }; this.pumpParallelInfoCtrl1.SetInfoEvent += (id, name, color) => { this.pumpSerialParallelChart.SetInfo(id, name, color); @@ -40,6 +40,11 @@ this.pumpSerialParallelChart.OnCalcQueryPoint += (id, pt) => { this.pumpParallelInfoCtrl1.SetQueryInfo(id, pt); }; this.pumpParallelInfoCtrl1.ResetEvent += () => { var list = this.pumpParallelInfoCtrl1.GetRunList(); SetParallel(list); }; this.pumpParallelInfoCtrl1.SaveEvent += () => { @@ -117,9 +122,7 @@ vm.Calc(); vm_list.Add(vm); } } this.pumpParallelInfoCtrl1.SetBindingData(vm_list, null); var run_list = this.pumpParallelInfoCtrl1.GetRunList(); var msg = SetParallel(run_list); @@ -137,16 +140,14 @@ } if (list.Count < 2) { CalcEqPoint(list); this.pumpSerialParallelChart.Add(list); Set(list); return "æ æ³è®¡ç® å¹¶èæ²çº¿!"; } var vm_parallel = CalcParallel(list); if (vm_parallel != null) { list.Add(vm_parallel); CalcEqPoint(list); this.pumpSerialParallelChart.Add(list); Set(list); return string.Empty; } else @@ -197,16 +198,26 @@ } private void CalcEqPoint(List<Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel> list) private void Set(List<Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel> list) { if (list == null || !list.Any()) { this.pumpSerialParallelChart.InitialChartData(); return; } double total_flow = list.Sum(x => x.CalcuQ ?? 0); double total_head = list.Average(x => x.CalcuH ?? 0); this.pumpParallelInfoCtrl1.SetDesignPoint(total_flow, total_head); this.pumpSerialParallelChart.Add(list); var run_list = list.Where(x => x.RunStatus).ToList(); if (run_list != null && run_list.Any()) { double total_flow = run_list.Sum(x => x.CalcuQ ?? 0); double total_head = run_list.Average(x => x.CalcuH ?? 0); total_flow = Math.Round(total_flow, 1); total_head = Math.Round(total_head, 1); this.pumpParallelInfoCtrl1.SetDesignPoint(total_flow, total_head); this.pumpSerialParallelChart.CalcWorkPointByQ(total_flow); } } WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/02-sim-ananly-pump/SimAnalyPumpInfoDlg.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,123 @@ namespace HStation.WinFrmUI.Xhs { partial class SIMAnalyPumpInfoDlg { /// <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() { ribbon = new DevExpress.XtraBars.Ribbon.RibbonControl(); ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage(); ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup(); pumpSerialParallelChart1 = new Yw.WinFrmUI.Phart.PumpSerialParallelChart(); sidePanel1 = new SidePanel(); barButtonItem1 = new DevExpress.XtraBars.BarButtonItem(); ((ISupportInitialize)ribbon).BeginInit(); SuspendLayout(); // // ribbon // ribbon.ExpandCollapseItem.Id = 0; ribbon.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbon.ExpandCollapseItem, barButtonItem1 }); ribbon.Location = new Point(0, 0); ribbon.MaxItemId = 2; ribbon.Name = "ribbon"; ribbon.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { ribbonPage1 }); ribbon.RibbonCaptionAlignment = DevExpress.XtraBars.Ribbon.RibbonCaptionAlignment.Left; ribbon.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonControlStyle.OfficeUniversal; ribbon.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False; ribbon.ShowExpandCollapseButton = DevExpress.Utils.DefaultBoolean.False; ribbon.ShowMoreCommandsButton = DevExpress.Utils.DefaultBoolean.False; ribbon.ShowPageHeadersInFormCaption = DevExpress.Utils.DefaultBoolean.False; ribbon.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide; ribbon.ShowQatLocationSelector = false; ribbon.ShowToolbarCustomizeItem = false; ribbon.Size = new Size(1400, 93); ribbon.Toolbar.ShowCustomizeItem = false; // // ribbonPage1 // ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { ribbonPageGroup1 }); ribbonPage1.Name = "ribbonPage1"; ribbonPage1.Text = "ribbonPage1"; // // ribbonPageGroup1 // ribbonPageGroup1.ItemLinks.Add(barButtonItem1); ribbonPageGroup1.Name = "ribbonPageGroup1"; ribbonPageGroup1.Text = "ribbonPageGroup1"; // // pumpSerialParallelChart1 // pumpSerialParallelChart1.Dock = DockStyle.Fill; pumpSerialParallelChart1.LineNameVisible = true; pumpSerialParallelChart1.LineVisible = false; pumpSerialParallelChart1.Location = new Point(0, 93); pumpSerialParallelChart1.Name = "pumpSerialParallelChart1"; pumpSerialParallelChart1.Size = new Size(1011, 929); pumpSerialParallelChart1.TabIndex = 2; // // sidePanel1 // sidePanel1.Dock = DockStyle.Right; sidePanel1.Location = new Point(1011, 93); sidePanel1.Name = "sidePanel1"; sidePanel1.Size = new Size(389, 929); sidePanel1.TabIndex = 3; sidePanel1.Text = "sidePanel1"; // // barButtonItem1 // barButtonItem1.Caption = "barButtonItem1"; barButtonItem1.Id = 1; barButtonItem1.Name = "barButtonItem1"; // // SIMAnalyPumpInfoDlg // AutoScaleDimensions = new SizeF(10F, 22F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(1400, 1022); Controls.Add(pumpSerialParallelChart1); Controls.Add(sidePanel1); Controls.Add(ribbon); Name = "SIMAnalyPumpInfoDlg"; Ribbon = ribbon; StartPosition = FormStartPosition.CenterScreen; Text = "泵信æ¯"; ((ISupportInitialize)ribbon).EndInit(); ResumeLayout(false); PerformLayout(); } #endregion private DevExpress.XtraBars.Ribbon.RibbonControl ribbon; private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1; private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1; private Yw.WinFrmUI.Phart.PumpSerialParallelChart pumpSerialParallelChart1; private SidePanel sidePanel1; private DevExpress.XtraBars.BarButtonItem barButtonItem1; } } WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/02-sim-ananly-pump/SimAnalyPumpInfoDlg.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,28 @@ using DevExpress.XtraBars; 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 HStation.WinFrmUI.Xhs { public partial class SIMAnalyPumpInfoDlg : DevExpress.XtraBars.Ribbon.RibbonForm { public SIMAnalyPumpInfoDlg() { InitializeComponent(); } public void SetBindindData(PumpMatchingViewModel pumpMatchingViewModel) { } } } WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/02-sim-ananly-pump/SimAnalyPumpInfoDlg.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> WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/SinglePumpInfoViewDLg.Designer.cs
@@ -32,10 +32,12 @@ // // SinglePumpInfoViewDlg // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleDimensions = new SizeF(10F, 22F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(873, 555); ClientSize = new Size(1283, 908); Margin = new Padding(4, 5, 4, 5); Name = "SinglePumpInfoViewDlg"; StartPosition = FormStartPosition.CenterScreen; Text = "XtraForm1"; ResumeLayout(false); } WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/SinglePumpInfoViewDLg.resx
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Microsoft ResX Schema Version 2.0 @@ -48,7 +48,7 @@ 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 WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user
@@ -232,6 +232,9 @@ <Compile Update="04-pump\PumpFullInfoViewDlg.cs"> <SubType>Form</SubType> </Compile> <Compile Update="04-pump\02-sim-ananly-pump\SimAnalyPumpInfoDlg.cs"> <SubType>Form</SubType> </Compile> <Compile Update="04-pump\SinglePumpInfoViewDlg.cs"> <SubType>Form</SubType> </Compile> WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpParallelInfoCtrl.Designer.cs
@@ -65,6 +65,8 @@ txtDesignQ = new DevExpress.XtraEditors.TextEdit(); txtDesignH = new DevExpress.XtraEditors.TextEdit(); btnSetDesignPoint = new DevExpress.XtraEditors.SimpleButton(); btnSave = new DevExpress.XtraEditors.SimpleButton(); btnReset = new DevExpress.XtraEditors.SimpleButton(); Root = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlGroup3 = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); @@ -74,11 +76,9 @@ layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem(); simpleLabelItem2 = new DevExpress.XtraLayout.SimpleLabelItem(); btnSave = new DevExpress.XtraEditors.SimpleButton(); layoutControlGroup5 = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem(); layoutControlGroup4 = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem(); ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit(); layoutControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)gridControl2).BeginInit(); @@ -98,10 +98,9 @@ ((System.ComponentModel.ISupportInitialize)layoutControlItem2).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem4).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem3).BeginInit(); ((System.ComponentModel.ISupportInitialize)simpleLabelItem1).BeginInit(); ((System.ComponentModel.ISupportInitialize)simpleLabelItem2).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup5).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem6).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup4).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem7).BeginInit(); SuspendLayout(); // // layoutControl1 @@ -112,23 +111,24 @@ layoutControl1.Controls.Add(txtDesignH); layoutControl1.Controls.Add(btnSetDesignPoint); layoutControl1.Controls.Add(btnSave); layoutControl1.Controls.Add(btnReset); layoutControl1.Dock = DockStyle.Fill; layoutControl1.Location = new Point(0, 0); layoutControl1.Name = "layoutControl1"; layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(1033, 536, 975, 600); layoutControl1.Root = Root; layoutControl1.Size = new Size(560, 891); layoutControl1.Size = new Size(694, 891); layoutControl1.TabIndex = 0; layoutControl1.Text = "layoutControl1"; // // gridControl2 // gridControl2.DataSource = pumpSerialParallelInfoViewModelBindingSource; gridControl2.Location = new Point(0, 572); gridControl2.Location = new Point(0, 627); gridControl2.MainView = gridView2; gridControl2.Name = "gridControl2"; gridControl2.Size = new Size(560, 271); gridControl2.TabIndex = 5; gridControl2.Size = new Size(694, 264); gridControl2.TabIndex = 7; gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView2 }); // // pumpSerialParallelInfoViewModelBindingSource @@ -205,8 +205,8 @@ gridControl1.MainView = gridView1; gridControl1.Name = "gridControl1"; gridControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repColor }); gridControl1.Size = new Size(560, 417); gridControl1.TabIndex = 4; gridControl1.Size = new Size(694, 472); gridControl1.TabIndex = 6; gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); // // gridView1 @@ -384,7 +384,7 @@ // // txtDesignQ // txtDesignQ.Location = new Point(66, 45); txtDesignQ.Location = new Point(114, 45); txtDesignQ.Name = "txtDesignQ"; txtDesignQ.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager)); txtDesignQ.Size = new Size(75, 28); @@ -393,12 +393,12 @@ // // txtDesignH // txtDesignH.Location = new Point(245, 45); txtDesignH.Location = new Point(269, 45); txtDesignH.Name = "txtDesignH"; txtDesignH.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager)); txtDesignH.Size = new Size(75, 28); txtDesignH.StyleController = layoutControl1; txtDesignH.TabIndex = 3; txtDesignH.TabIndex = 2; // // btnSetDesignPoint // @@ -406,34 +406,69 @@ btnSetDesignPoint.Appearance.Options.UseBackColor = true; btnSetDesignPoint.Appearance.Options.UseTextOptions = true; btnSetDesignPoint.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; btnSetDesignPoint.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; btnSetDesignPoint.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnSetDesignPoint.ImageOptions.SvgImage"); btnSetDesignPoint.ImageOptions.SvgImageSize = new Size(20, 20); btnSetDesignPoint.Location = new Point(370, 45); btnSetDesignPoint.ImageOptions.SvgImageSize = new Size(18, 18); btnSetDesignPoint.Location = new Point(348, 45); btnSetDesignPoint.Name = "btnSetDesignPoint"; btnSetDesignPoint.Size = new Size(178, 32); btnSetDesignPoint.Size = new Size(75, 32); btnSetDesignPoint.StyleController = layoutControl1; btnSetDesignPoint.TabIndex = 2; btnSetDesignPoint.TabIndex = 3; btnSetDesignPoint.Text = "设置"; btnSetDesignPoint.Click += btnSetDesignPoint_Click; // // btnSave // btnSave.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Question; btnSave.Appearance.ForeColor = Color.White; btnSave.Appearance.Options.UseBackColor = true; btnSave.Appearance.Options.UseForeColor = true; btnSave.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; btnSave.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnSave.ImageOptions.SvgImage"); btnSave.ImageOptions.SvgImageSize = new Size(18, 18); btnSave.Location = new Point(566, 45); btnSave.Name = "btnSave"; btnSave.Size = new Size(116, 32); btnSave.StyleController = layoutControl1; btnSave.TabIndex = 5; btnSave.Text = "ä¿å"; btnSave.Click += btnSave_Click; // // btnReset // btnReset.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Danger; btnReset.Appearance.ForeColor = Color.White; btnReset.Appearance.Options.UseBackColor = true; btnReset.Appearance.Options.UseForeColor = true; btnReset.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; btnReset.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnReset.ImageOptions.SvgImage"); btnReset.ImageOptions.SvgImageSize = new Size(18, 18); btnReset.Location = new Point(447, 45); btnReset.Name = "btnReset"; btnReset.Size = new Size(115, 32); btnReset.StyleController = layoutControl1; btnReset.TabIndex = 4; btnReset.Text = "éç½®"; btnReset.Click += btnReset_Click; // // Root // Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; Root.GroupBordersVisible = false; Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlGroup3, layoutControlGroup1, layoutControlGroup2, layoutControlGroup4 }); Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlGroup3, layoutControlGroup1, layoutControlGroup2, layoutControlGroup5 }); Root.Name = "Root"; Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); Root.Size = new Size(560, 891); Root.Size = new Size(694, 891); Root.TextVisible = false; // // layoutControlGroup3 // layoutControlGroup3.GroupStyle = DevExpress.Utils.GroupStyle.Title; layoutControlGroup3.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem5 }); layoutControlGroup3.Location = new Point(0, 539); layoutControlGroup3.Location = new Point(0, 594); layoutControlGroup3.Name = "layoutControlGroup3"; layoutControlGroup3.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup3.Size = new Size(560, 304); layoutControlGroup3.Size = new Size(694, 297); layoutControlGroup3.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup3.Text = "æ¥è¯¢ç¹"; // @@ -443,7 +478,7 @@ layoutControlItem5.Location = new Point(0, 0); layoutControlItem5.Name = "layoutControlItem5"; layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlItem5.Size = new Size(560, 271); layoutControlItem5.Size = new Size(694, 264); layoutControlItem5.TextSize = new Size(0, 0); layoutControlItem5.TextVisible = false; // @@ -454,7 +489,7 @@ layoutControlGroup1.Location = new Point(0, 89); layoutControlGroup1.Name = "layoutControlGroup1"; layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup1.Size = new Size(560, 450); layoutControlGroup1.Size = new Size(694, 505); layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup1.Text = "æ²çº¿å表"; // @@ -464,7 +499,7 @@ layoutControlItem1.Location = new Point(0, 0); layoutControlItem1.Name = "layoutControlItem1"; layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlItem1.Size = new Size(560, 417); layoutControlItem1.Size = new Size(694, 472); layoutControlItem1.Text = "æ²çº¿å表"; layoutControlItem1.TextSize = new Size(0, 0); layoutControlItem1.TextVisible = false; @@ -472,10 +507,10 @@ // layoutControlGroup2 // layoutControlGroup2.GroupStyle = DevExpress.Utils.GroupStyle.Title; layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem2, layoutControlItem4, layoutControlItem3, simpleLabelItem1, simpleLabelItem2 }); layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem2, layoutControlItem4, layoutControlItem3 }); layoutControlGroup2.Location = new Point(0, 0); layoutControlGroup2.Name = "layoutControlGroup2"; layoutControlGroup2.Size = new Size(560, 89); layoutControlGroup2.Size = new Size(435, 89); layoutControlGroup2.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup2.Text = "设计ç¹"; // @@ -484,79 +519,67 @@ layoutControlItem2.Control = txtDesignQ; layoutControlItem2.Location = new Point(0, 0); layoutControlItem2.Name = "layoutControlItem2"; layoutControlItem2.Size = new Size(133, 36); layoutControlItem2.Text = "æµé:"; layoutControlItem2.TextSize = new Size(42, 22); layoutControlItem2.Size = new Size(181, 36); layoutControlItem2.Text = "æµé(m³/h):"; layoutControlItem2.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize; layoutControlItem2.TextSize = new Size(97, 22); layoutControlItem2.TextToControlDistance = 5; // // layoutControlItem4 // layoutControlItem4.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center; layoutControlItem4.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; layoutControlItem4.Control = btnSetDesignPoint; layoutControlItem4.Location = new Point(358, 0); layoutControlItem4.MinSize = new Size(126, 36); layoutControlItem4.Location = new Point(336, 0); layoutControlItem4.Name = "layoutControlItem4"; layoutControlItem4.Size = new Size(182, 36); layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; layoutControlItem4.Size = new Size(79, 36); layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.SupportHorzAlignment; layoutControlItem4.TextSize = new Size(0, 0); layoutControlItem4.TextVisible = false; // // layoutControlItem3 // layoutControlItem3.Control = txtDesignH; layoutControlItem3.Location = new Point(179, 0); layoutControlItem3.Location = new Point(181, 0); layoutControlItem3.Name = "layoutControlItem3"; layoutControlItem3.Size = new Size(133, 36); layoutControlItem3.Text = "æ¬ç¨:"; layoutControlItem3.TextSize = new Size(42, 22); layoutControlItem3.Size = new Size(155, 36); layoutControlItem3.Text = "æ¬ç¨(m):"; layoutControlItem3.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize; layoutControlItem3.TextSize = new Size(71, 22); layoutControlItem3.TextToControlDistance = 5; // // simpleLabelItem1 // layoutControlGroup5 // simpleLabelItem1.AllowHotTrack = false; simpleLabelItem1.Location = new Point(133, 0); simpleLabelItem1.Name = "simpleLabelItem1"; simpleLabelItem1.Size = new Size(46, 36); simpleLabelItem1.Text = "m³/h"; simpleLabelItem1.TextSize = new Size(42, 22); // // simpleLabelItem2 // simpleLabelItem2.AllowHotTrack = false; simpleLabelItem2.Location = new Point(312, 0); simpleLabelItem2.Name = "simpleLabelItem2"; simpleLabelItem2.Size = new Size(46, 36); simpleLabelItem2.Text = "m"; simpleLabelItem2.TextSize = new Size(42, 22); // // btnSave // btnSave.Location = new Point(203, 851); btnSave.Name = "btnSave"; btnSave.Size = new Size(154, 32); btnSave.StyleController = layoutControl1; btnSave.TabIndex = 6; btnSave.Text = "ä¿å"; btnSave.Click += btnSave_Click; layoutControlGroup5.GroupStyle = DevExpress.Utils.GroupStyle.Title; layoutControlGroup5.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem6, layoutControlItem7 }); layoutControlGroup5.Location = new Point(435, 0); layoutControlGroup5.Name = "layoutControlGroup5"; layoutControlGroup5.Size = new Size(259, 89); layoutControlGroup5.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup5.Text = "æä½"; // // layoutControlItem6 // layoutControlItem6.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center; layoutControlItem6.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; layoutControlItem6.Control = btnSave; layoutControlItem6.Location = new Point(0, 0); layoutControlItem6.Location = new Point(119, 0); layoutControlItem6.Name = "layoutControlItem6"; layoutControlItem6.Size = new Size(158, 36); layoutControlItem6.Size = new Size(120, 36); layoutControlItem6.TextSize = new Size(0, 0); layoutControlItem6.TextVisible = false; // // layoutControlGroup4 // layoutControlItem7 // layoutControlGroup4.GroupStyle = DevExpress.Utils.GroupStyle.Title; layoutControlGroup4.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem6 }); layoutControlGroup4.Location = new Point(0, 843); layoutControlGroup4.Name = "layoutControlGroup4"; layoutControlGroup4.Padding = new DevExpress.XtraLayout.Utils.Padding(200, 200, 5, 5); layoutControlGroup4.Size = new Size(560, 48); layoutControlGroup4.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup4.Text = "æä½"; layoutControlGroup4.TextLocation = DevExpress.Utils.Locations.Default; layoutControlGroup4.TextVisible = false; layoutControlItem7.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center; layoutControlItem7.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; layoutControlItem7.Control = btnReset; layoutControlItem7.Location = new Point(0, 0); layoutControlItem7.Name = "layoutControlItem7"; layoutControlItem7.Size = new Size(119, 36); layoutControlItem7.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.SupportHorzAlignment; layoutControlItem7.TextSize = new Size(0, 0); layoutControlItem7.TextVisible = false; // // PumpParallelInfoCtrl // @@ -564,7 +587,7 @@ AutoScaleMode = AutoScaleMode.Font; Controls.Add(layoutControl1); Name = "PumpParallelInfoCtrl"; Size = new Size(560, 891); Size = new Size(694, 891); ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit(); layoutControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)gridControl2).EndInit(); @@ -584,10 +607,9 @@ ((System.ComponentModel.ISupportInitialize)layoutControlItem2).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem4).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem3).EndInit(); ((System.ComponentModel.ISupportInitialize)simpleLabelItem1).EndInit(); ((System.ComponentModel.ISupportInitialize)simpleLabelItem2).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup5).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem6).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup4).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem7).EndInit(); ResumeLayout(false); } @@ -624,8 +646,6 @@ private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup2; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem1; private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem2; private DevExpress.XtraEditors.SimpleButton btnSetDesignPoint; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4; private DevExpress.XtraGrid.Columns.GridColumn colRunStatus; @@ -640,7 +660,9 @@ private DevExpress.XtraGrid.Columns.GridColumn colQueryP1; private DevExpress.XtraGrid.Columns.GridColumn colName1; private DevExpress.XtraEditors.SimpleButton btnSave; private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup4; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6; private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup5; private DevExpress.XtraEditors.SimpleButton btnReset; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7; } } WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpParallelInfoCtrl.cs
@@ -1,4 +1,6 @@ namespace Yw.WinFrmUI.Phart using DevExpress.XtraEditors; namespace Yw.WinFrmUI.Phart { public partial class PumpParallelInfoCtrl : DevExpress.XtraEditors.XtraUserControl { @@ -15,6 +17,7 @@ this.colRunStatus.OptionsColumn.AllowEdit = false; this.colRunStatus.OptionsColumn.ReadOnly = false; this.gridView1.RowCellClick += GridView1_RowCellClick; } @@ -44,37 +47,29 @@ /// </summary> public event Action<double, double> SetDesignPointEvent; /// <summary> /// ä¿åäºä»¶ /// </summary> public event Action ResetEvent; /// <summary> /// ä¿åäºä»¶ /// </summary> public event Action SaveEvent; private List<PumpSerialParallelInfoViewModel> _all_binding_list = null; private List<PumpSerialParallelInfoViewModel> _src_binding_list = null; public void SetBindingData(List<PumpSerialParallelInfoViewModel> vm_list, Yw.Geometry.Point2d design_pt = null) { _src_binding_list = new List<PumpSerialParallelInfoViewModel>(); _all_binding_list = new List<PumpSerialParallelInfoViewModel>(); if (vm_list != null && vm_list.Any()) { _all_binding_list = vm_list; //for (int i = 0; i < vm_list.Count; i++) //{ // var item = vm_list[i]; // var vm = new PumpSerialParallelInfoViewModel(); // vm.Id = item.Id; // vm.Name = item.Name; // vm.Color = item.Color; // vm.IsBp = item.IsBp; // vm.RatedSpeed = item.RatedSpeed; // vm.CurrentSpeed = item.CurrentSpeed; // vm.CurrentHz = Math.Round(item.CurrentSpeed / item.RatedSpeed * 50, 2); // vm.Qh = new Geometry.CubicSpline2d(item.Qh); // vm.Qe = new Geometry.CubicSpline2d(item.Qe); // vm.Qp = new Geometry.CubicSpline2d(item.Qp); // vm.ExtendRatio = 100; // vm.Calc(); // _all_binding_list.Add(vm); //} _src_binding_list = vm_list.Select(x => new PumpSerialParallelInfoViewModel(x)).ToList(); _all_binding_list = vm_list.Select(x => new PumpSerialParallelInfoViewModel(x)).ToList(); } this.txtDesignQ.EditValue = design_pt?.X; @@ -255,7 +250,21 @@ private void btnSave_Click(object sender, EventArgs e) { this.SaveEvent?.Invoke(); if (XtraMessageBox.Show("æ¯å¦ä¿åæ°æ®ï¼", "æç¤ºä¿¡æ¯", MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return; this.SaveEvent?.Invoke(); } private void btnReset_Click(object sender, EventArgs e) { if (XtraMessageBox.Show("æ¯å¦éç½®æ°æ®ï¼", "æç¤ºä¿¡æ¯", MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return; _all_binding_list = _src_binding_list?.Select(x => new PumpSerialParallelInfoViewModel(x)).ToList(); this.pumpSerialParallelInfoViewModelBindingSource.DataSource = _all_binding_list; this.pumpSerialParallelInfoViewModelBindingSource.ResetBindings(false); this.gridView1.BestFitColumns(); this.ResetEvent?.Invoke(); } } } WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpParallelInfoCtrl.resx
@@ -142,4 +142,40 @@ ICA8L2c+DQo8L3N2Zz4L </value> </data> <data name="btnSave.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAO4BAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh Y2U9InByZXNlcnZlIiBpZD0iU2F2ZSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIg MzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cjwvc3R5 bGU+DQogIDxwYXRoIGQ9Ik0yNyw0aC0zdjEwSDhWNEg1QzQuNCw0LDQsNC40LDQsNXYyMmMwLDAuNiww LjQsMSwxLDFoMjJjMC42LDAsMS0wLjQsMS0xVjVDMjgsNC40LDI3LjYsNCwyNyw0eiBNMjQsMjRIOHYt NiAgaDE2VjI0eiBNMTAsNHY4aDEwVjRIMTB6IE0xNCwxMGgtMlY2aDJWMTB6IiBjbGFzcz0iQmxhY2si IC8+DQo8L3N2Zz4L </value> </data> <data name="btnReset.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAANcCAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkdyZWVue2ZpbGw6IzAzOUMyMzt9Cgku QmxhY2t7ZmlsbDojNzI3MjcyO30KCS5SZWR7ZmlsbDojRDExQzFDO30KCS5ZZWxsb3d7ZmlsbDojRkZC MTE1O30KCS5CbHVle2ZpbGw6IzExNzdENzt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh Y2l0eTowLjU7fQoJLnN0MXtvcGFjaXR5OjAuNzU7fQo8L3N0eWxlPg0KICA8ZyBpZD0iUmVzZXRMYXlv dXRPcHRpb25zIj4NCiAgICA8cGF0aCBkPSJNMTYsNGMtMy4zLDAtNi4zLDEuMy04LjUsMy41TDQsNHYx MGgwLjJoNC4xSDE0bC0zLjYtMy42QzExLjgsOC45LDEzLjgsOCwxNiw4YzQuNCwwLDgsMy42LDgsOHMt My42LDgtOCw4ICAgYy0zLjcsMC02LjgtMi42LTcuNy02SDQuMmMxLDUuNyw1LjksMTAsMTEuOCwxMGM2 LjYsMCwxMi01LjQsMTItMTJTMjIuNiw0LDE2LDR6IiBjbGFzcz0iR3JlZW4iIC8+DQogIDwvZz4NCjwv c3ZnPgs= </value> </data> </root>