Service/HStation.Service.PhartRelation.Core/HStation.Service.PhartRelation.Core.csproj
@@ -27,7 +27,7 @@ </ItemGroup> <ItemGroup> <PackageReference Include="Yw.Geometry.Core" Version="3.2.5" /> <PackageReference Include="Yw.Geometry.Core" Version="3.2.6" /> <PackageReference Include="Yw.Pump.Core" Version="3.1.1" /> <PackageReference Include="Yw.Service.Phart.Core" Version="3.2.5" /> </ItemGroup> WinFrmUI/HStation.WinFrmUI.Common.Core/HStation.WinFrmUI.Common.Core.csproj.user
@@ -1,2 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" /> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Compile Update="UserControl1.cs"> <SubType>UserControl</SubType> </Compile> </ItemGroup> </Project> WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/02-view-model/PerformPoint2dViewModel.cs
@@ -11,8 +11,7 @@ } public double X { get; set; } public double Y { get; set; } } } WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/03-analysis/XhsSinglePumpViewModel.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,117 @@ using System.ComponentModel.DataAnnotations; namespace HStation.WinFrmUI.PhartRelation { /// <summary> /// /// </summary> public class XhsSinglePumpViewModel { public XhsSinglePumpViewModel() { } public XhsSinglePumpViewModel(XhsSinglePumpViewModel rhs) { this.ID = rhs.ID; this.Name = rhs.Name; this.Code = rhs.Code; this.IsBp = rhs.IsBp; this.RunStatus = rhs.RunStatus; this.RatedHz = rhs.RatedHz; this.CurrentHz = rhs.CurrentHz; this.RatedSpeed = rhs.RatedSpeed; this.CurrentSpeed = rhs.CurrentSpeed; this.CurveQH = rhs.CurveQH?.Select(x => new XhsSplinePointViewModel(x)).ToList(); this.CurveQE = rhs.CurveQE?.Select(x => new XhsSplinePointViewModel(x)).ToList(); this.CurveQP = rhs.CurveQP?.Select(x => new XhsSplinePointViewModel(x)).ToList(); this.CalcuQ = rhs.CalcuQ; this.CalcuH = rhs.CalcuH; } /// <summary> /// id /// </summary> public long ID { get; set; } /// <summary> /// åç§° /// </summary> [Display(Name = "åç§°")] public string Name { get; set; } /// <summary> /// ç¼ç /// </summary> [Display(Name = "ç¼ç ")] public string Code { get; set; } /// <summary> /// åé¢ /// </summary> [Display(Name = "åé¢")] public bool IsBp { get; set; } /// <summary> /// è¿è¡ç¶æ /// </summary> [Display(Name = "è¿è¡ç¶æ")] public bool RunStatus { get; set; } /// <summary> /// é¢å®é¢ç /// </summary> [Display(Name = "é¢å®é¢ç")] public double RatedHz { get; set; } /// <summary> /// 设å®é¢ç /// </summary> [Display(Name = "设å®é¢ç")] public double CurrentHz { get; set; } /// <summary> /// é¢å®è½¬é /// </summary> [Display(Name = "é¢å®è½¬é")] public double RatedSpeed { get; set; } /// <summary> /// 设å®è½¬é /// </summary> [Display(Name = "设å®è½¬é")] public double CurrentSpeed { get; set; } /// <summary> /// æµéæ¬ç¨çº¿ /// </summary> [Display(Name = "æµéæ¬ç¨çº¿")] public List<XhsSplinePointViewModel> CurveQH { get; set; } /// <summary> /// æµéåç线 /// </summary> [Display(Name = "æµéåç线")] public List<XhsSplinePointViewModel> CurveQP { get; set; } /// <summary> /// æµéæç线 /// </summary> [Display(Name = "æµéæç线")] public List<XhsSplinePointViewModel> CurveQE { get; set; } /// <summary> /// è®¡ç®æµé /// </summary> [Display(Name = "è®¡ç®æµé")] public double? CalcuQ { get; set; } /// <summary> /// è®¡ç®æ¬ç¨ /// </summary> [Display(Name = "è®¡ç®æ¬ç¨")] public double? CalcuH { get; set; } } } WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/03-analysis/XhsSingleResultViewModel.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,57 @@ using System.ComponentModel.DataAnnotations; namespace HStation.WinFrmUI.PhartRelation { public class XhsSingleResultViewModel { public XhsSingleResultViewModel() { } public XhsSingleResultViewModel(XhsSingleResultViewModel rhs) { this.ID = rhs.ID; this.Name = rhs.Name; this.Code = rhs.Code; this.IsBp = rhs.IsBp; this.RunStatus = rhs.RunStatus; this.CurrentHz = rhs.CurrentHz; } /// <summary> /// id /// </summary> public long ID { get; set; } /// <summary> /// åç§° /// </summary> [Display(Name = "åç§°")] public string Name { get; set; } /// <summary> /// ç¼ç /// </summary> [Display(Name = "ç¼ç ")] public string Code { get; set; } /// <summary> /// åé¢ /// </summary> [Display(Name = "åé¢")] public bool IsBp { get; set; } /// <summary> /// è¿è¡ç¶æ /// </summary> [Display(Name = "è¿è¡ç¶æ")] public bool RunStatus { get; set; } /// <summary> /// 设å®é¢ç /// </summary> [Display(Name = "设å®é¢ç")] public double CurrentHz { get; set; } } } WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/03-analysis/XhsSplinePointViewModel.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,24 @@ namespace HStation.WinFrmUI.PhartRelation { /// <summary> /// /// </summary> public class XhsSplinePointViewModel { public XhsSplinePointViewModel() { } public XhsSplinePointViewModel(double x, double y) { this.X = x; this.Y = y; } public XhsSplinePointViewModel(XhsSplinePointViewModel rhs) { this.X = rhs.X; this.Y = rhs.Y; } public double X { get; set; } public double Y { get; set; } } } WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/PumpParallelChartDlg.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,88 @@  using Yw.WinFrmUI.Phart; namespace HStation.WinFrmUI.PhartRelation { partial class PumpParallelChartDlg { /// <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() { pumpSerialParallelChart = new PumpSerialParallelChart(); sidePanel1 = new SidePanel(); pumpParallelInfoCtrl1 = new PumpParallelInfoCtrl(); sidePanel1.SuspendLayout(); SuspendLayout(); // // pumpSerialParallelChart // pumpSerialParallelChart.Dock = DockStyle.Fill; pumpSerialParallelChart.LineNameVisible = true; pumpSerialParallelChart.LineVisible = false; pumpSerialParallelChart.Location = new Point(0, 0); pumpSerialParallelChart.Name = "pumpSerialParallelChart"; pumpSerialParallelChart.Size = new Size(639, 1062); pumpSerialParallelChart.TabIndex = 4; // // sidePanel1 // sidePanel1.Controls.Add(pumpParallelInfoCtrl1); sidePanel1.Dock = DockStyle.Right; sidePanel1.Location = new Point(639, 0); sidePanel1.Name = "sidePanel1"; sidePanel1.Size = new Size(700, 1062); sidePanel1.TabIndex = 5; sidePanel1.Text = "sidePanel1"; // // pumpSerialParallelInfoCtrl1 // pumpParallelInfoCtrl1.Dock = DockStyle.Fill; pumpParallelInfoCtrl1.Location = new Point(1, 0); pumpParallelInfoCtrl1.Name = "pumpSerialParallelInfoCtrl1"; pumpParallelInfoCtrl1.Size = new Size(699, 1062); pumpParallelInfoCtrl1.TabIndex = 0; // // PumpParallelChartDlg // AutoScaleDimensions = new SizeF(10F, 22F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(1339, 1062); Controls.Add(pumpSerialParallelChart); Controls.Add(sidePanel1); Margin = new Padding(4, 5, 4, 5); Name = "PumpParallelChartDlg"; StartPosition = FormStartPosition.CenterParent; Text = "å¹¶èæ²çº¿"; sidePanel1.ResumeLayout(false); ResumeLayout(false); } #endregion private PumpSerialParallelChart pumpSerialParallelChart; private SidePanel sidePanel1; private PumpParallelInfoCtrl pumpParallelInfoCtrl1; } } WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/PumpParallelChartDlg.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,245 @@ using Yw.Geometry; namespace HStation.WinFrmUI.PhartRelation { public partial class PumpParallelChartDlg : XtraForm { public PumpParallelChartDlg() { InitializeComponent(); this.Text = "å¹¶èåæ"; this.WindowState = FormWindowState.Maximized; 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); }; this.pumpParallelInfoCtrl1.SetDesignPointEvent += (q, h) => { this.pumpSerialParallelChart.SetDesignPt(new Point2d(q, h)); }; this.pumpParallelInfoCtrl1.AddEvent += (vm) => { var list = this.pumpParallelInfoCtrl1.GetRunList(); SetParallel(list); }; this.pumpParallelInfoCtrl1.DeleteEvent += (id) => { var list = this.pumpParallelInfoCtrl1.GetRunList(); SetParallel(list); }; this.pumpSerialParallelChart.OnCalcQueryPoint += (id, pt) => { this.pumpParallelInfoCtrl1.SetQueryInfo(id, pt); }; this.pumpParallelInfoCtrl1.SaveEvent += () => { var run_list = this.pumpParallelInfoCtrl1.GetRunList(); var list = new List<XhsSingleResultViewModel>(); if (run_list != null && run_list.Any()) { foreach (var x in run_list) { var vm = new XhsSingleResultViewModel(); vm.ID = x.ID; vm.Name = x.Name; vm.Code = x.Code; vm.IsBp = x.IsBp; vm.RunStatus = x.RunStatus; vm.CurrentHz = x.CurrentHz; list.Add(vm); } } this.ReloadDataEvent?.Invoke(list); }; } private string _parallel_id = "parallel"; public event Func<List<XhsSingleResultViewModel>, Task<bool>> ReloadDataEvent; /// <summary> /// 设置 /// </summary> /// <param name="list"></param> /// <returns></returns> public string SetBindingData( List<XhsSinglePumpViewModel> list) { if (list == null || !list.Any()) { return "æ°æ®ä¸ºç©º!"; } var vm_list = new List<Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel>(); for (int i = 0; i < list.Count; i++) { var x = list[i]; if (x.CurveQH == null || !x.CurveQH.Any()) { continue; } var vm = new Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel(); vm.ID= x.ID; vm.Id = x.ID.ToString(); vm.Name = x.Name; vm.Code = x.Code; vm.IsBp = x.IsBp; vm.RatedSpeed = x.RatedSpeed; vm.CurrentSpeed = x.CurrentSpeed; vm.RunStatus = x.RunStatus; vm.CurrentHz = x.CurrentHz; var qh_pt_list = x.CurveQH.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); vm.Qh = new CubicSpline2d(qh_pt_list); if (x.CurveQE != null && x.CurveQE.Any()) { var qe_pt_list = x.CurveQE.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); vm.Qe = new CubicSpline2d(qe_pt_list); } if (x.CurveQP != null && x.CurveQP.Any()) { var qp_pt_list = x.CurveQP.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); vm.Qp = new CubicSpline2d(qp_pt_list); } vm.CalcuQ = x.CalcuQ; vm.CalcuH = x.CalcuH; vm.Color = GetRandomColor(i); vm.Calc(); vm_list.Add(vm); } this.pumpParallelInfoCtrl1.SetBindingData(vm_list, null); var run_list = this.pumpParallelInfoCtrl1.GetRunList(); var msg = SetParallel(run_list); if (!string.IsNullOrEmpty(msg)) return msg; return string.Empty; } private string SetParallel(List<Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel> list) { this.pumpSerialParallelChart.Delete(); if (list == null || !list.Any()) { return "æ æ°æ®!"; } if (list.Count < 2) { CalcEqPoint(list); this.pumpSerialParallelChart.Add(list); return "æ æ³è®¡ç® å¹¶èæ²çº¿!"; } var vm_parallel = CalcParallel(list); if (vm_parallel != null) { list.Add(vm_parallel); CalcEqPoint(list); this.pumpSerialParallelChart.Add(list); return string.Empty; } else { return "æ æ³è®¡ç® å¹¶èæ²çº¿!"; } } private Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel CalcParallel(List<Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel> list) { if (list == null || !list.Any()) { return default; } var calc_bol = false; var line_name = ""; List<Yw.Geometry.Point2d> calc_pt_qh_list; List<Yw.Geometry.Point2d> calc_pt_qe_list; List<Yw.Geometry.Point2d> calc_pt_qp_list; var helper = new Yw.WinFrmUI.Phart.PumpParallelConnectionHelper(); list.ForEach(x => helper.Add(x.QhCalc, x.QpCalc)); line_name = "å¹¶èæ²çº¿"; calc_bol = helper.CalculateParallel(out calc_pt_qh_list, out calc_pt_qe_list, out calc_pt_qp_list); if (!calc_bol || calc_pt_qh_list.Count < 3) { return default; } var vm_sp = new Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel(); vm_sp.Id = _parallel_id; vm_sp.Name = line_name; vm_sp.Qh = new Yw.Geometry.CubicSpline2d(calc_pt_qh_list); vm_sp.Qe = new Yw.Geometry.CubicSpline2d(calc_pt_qe_list); vm_sp.Qp = new Yw.Geometry.CubicSpline2d(calc_pt_qp_list); vm_sp.QhCalc = vm_sp.Qh; vm_sp.QeCalc = vm_sp.Qe; vm_sp.QpCalc = vm_sp.Qp; vm_sp.Color = Color.Black; vm_sp.IsBp = true; vm_sp.IsDefault = true; var pt_list = vm_sp.Qp.GetPointList(12); return vm_sp; } private void CalcEqPoint(List<Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel> list) { if (list == null || !list.Any()) { 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); } #region Color private List<Color> _color_array = new List<Color>() { Color.Red, Color.Blue, Color.Green,Color.DodgerBlue, Color.Fuchsia, Color.MidnightBlue, Color.Maroon, Color.Aquamarine, Color.Bisque,Color.BurlyWood }; /// <summary> /// è·åéæºé¢è² /// </summary> /// <returns></returns> private Color GetRandomColor(int count) { if (count < _color_array.Count) { return _color_array[count]; } var _random = new Random(); int r = _random.Next(1, 256); int g = _random.Next(1, 256); int b = _random.Next(1, 256); return Color.FromArgb(r, g, b); } #endregion } } WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/99-common/PumpParallelChartDlg.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.PhartRelation.Core/99-common/PumpSerialParallelChartDlg.Designer.cs
@@ -40,8 +40,7 @@ // pumpSerialParallelChart // pumpSerialParallelChart.Dock = DockStyle.Fill; pumpSerialParallelChart.LineNameVisible = true; pumpSerialParallelChart.LineVisible = false; pumpSerialParallelChart.LineNameVisible = true; pumpSerialParallelChart.Location = new Point(0, 0); pumpSerialParallelChart.Name = "pumpSerialParallelChart"; pumpSerialParallelChart.Size = new Size(639, 1062); WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/HStation.WinFrmUI.PhartRelation.Core.csproj
@@ -52,6 +52,9 @@ <Compile Update="02-valve-main\XhsValveMainPhartListCtrl.cs"> <SubType>UserControl</SubType> </Compile> <Compile Update="99-common\PumpParallelChartDlg.cs"> <SubType>Form</SubType> </Compile> <Compile Update="99-common\PumpVariableSpeedChartDlg.cs"> <SubType>Form</SubType> </Compile> WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -1,5 +1,6 @@ global using Yw.EPAnet; using DevExpress.Mvvm.Native; using HStation.WinFrmUI.PhartRelation; using Yw.WinFrmUI.Bimface; using Yw.WinFrmUI.Hydro; @@ -692,14 +693,14 @@ //{ // return; //} var pumps = _hydroInfo.Pumps?.Where(x => x.LinkStatus == Yw.Hydro.LinkStatus.Open).ToList(); //var pumps = _hydroInfo.Pumps?.Where(x => x.LinkStatus == Yw.Hydro.LinkStatus.Open).ToList(); var pumps = _hydroInfo.Pumps; var curve_list = _hydroInfo.Curves; if (curve_list == null || !curve_list.Any()) { return; } var vmList = new List<Yw.WinFrmUI.Phart.PumpSerialParallelViewModel>(); var vmList = new List<XhsSinglePumpViewModel>(); foreach (var x in pumps) { if (!x.RatedN.HasValue) @@ -718,26 +719,33 @@ var rated_speed = x.RatedN.Value; var speed_ratio = x.SpeedRatio; var qh_pt_list = qh.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); var qe_pt_list = qe?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); var qp_pt_list = qp?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); var qh_pt_list = qh.Select(x => new XhsSplinePointViewModel(x.X, x.Y)).ToList(); var qe_pt_list = qe?.Select(x => new XhsSplinePointViewModel(x.X, x.Y)).ToList(); var qp_pt_list = qp?.Select(x => new XhsSplinePointViewModel(x.X, x.Y)).ToList(); var vm = new Yw.WinFrmUI.Phart.PumpSerialParallelViewModel(); vm.Id = x.Code; var vm = new XhsSinglePumpViewModel(); vm.ID = x.ID; vm.Name = x.Name; //vm.IsBp = ; vm.ID = x.ID; vm.Name = x.Name; vm.Code = x.Code; //vm.IsBp = x.IsBp; vm.RunStatus = x.LinkStatus == Yw.Hydro.LinkStatus.Open; vm.RatedHz = x.RatedHz; vm.CurrentHz = x.RatedHz; vm.RatedSpeed = rated_speed; vm.CurrentSpeed = Math.Round(rated_speed * speed_ratio); vm.CurrentHz = Math.Round(vm.CurrentSpeed / vm.RatedSpeed * 50, 1); vm.CurrentSpeed = rated_speed; vm.CurveQH = qh_pt_list; vm.CurveQE = qe_pt_list; vm.CurveQP = qp_pt_list; //vm.CalcuQ = x.c; //vm.CalcuH = x.CalcuH; vm.Qh = new Yw.Geometry.CubicSpline2d(qh_pt_list); vm.Qe = new Yw.Geometry.CubicSpline2d(qe_pt_list); vm.Qp = new Yw.Geometry.CubicSpline2d(qp_pt_list); vmList.Add(vm); } var dlg = new HStation.WinFrmUI.PhartRelation.PumpSerialParallelChartDlg(); dlg.SetBindingData(vmList, null, true); var dlg = new HStation.WinFrmUI.PhartRelation.PumpParallelChartDlg(); dlg.SetBindingData(vmList); dlg.ShowDialog(); } WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpParallelInfoCtrl.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,646 @@ namespace Yw.WinFrmUI.Phart { partial class PumpParallelInfoCtrl { /// <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 System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PumpParallelInfoCtrl)); layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); gridControl2 = new DevExpress.XtraGrid.GridControl(); pumpSerialParallelInfoViewModelBindingSource = new BindingSource(components); gridView2 = new DevExpress.XtraGrid.Views.Grid.GridView(); colColor1 = new DevExpress.XtraGrid.Columns.GridColumn(); colQueryQ1 = new DevExpress.XtraGrid.Columns.GridColumn(); colQueryH1 = new DevExpress.XtraGrid.Columns.GridColumn(); colQueryE1 = new DevExpress.XtraGrid.Columns.GridColumn(); colQueryP1 = new DevExpress.XtraGrid.Columns.GridColumn(); colName1 = new DevExpress.XtraGrid.Columns.GridColumn(); gridControl1 = new DevExpress.XtraGrid.GridControl(); gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); colQueryQ = new DevExpress.XtraGrid.Columns.GridColumn(); colQueryH = new DevExpress.XtraGrid.Columns.GridColumn(); colQueryE = new DevExpress.XtraGrid.Columns.GridColumn(); colQueryP = new DevExpress.XtraGrid.Columns.GridColumn(); colExtendRatio = new DevExpress.XtraGrid.Columns.GridColumn(); colQhCalc = new DevExpress.XtraGrid.Columns.GridColumn(); colQeCalc = new DevExpress.XtraGrid.Columns.GridColumn(); colQpCalc = new DevExpress.XtraGrid.Columns.GridColumn(); colId = new DevExpress.XtraGrid.Columns.GridColumn(); colName = new DevExpress.XtraGrid.Columns.GridColumn(); colColor = new DevExpress.XtraGrid.Columns.GridColumn(); repColor = new DevExpress.XtraEditors.Repository.RepositoryItemColorEdit(); colIsBp = new DevExpress.XtraGrid.Columns.GridColumn(); colRatedSpeed = new DevExpress.XtraGrid.Columns.GridColumn(); colCurrentSpeed = new DevExpress.XtraGrid.Columns.GridColumn(); colCurrentHz = new DevExpress.XtraGrid.Columns.GridColumn(); colQh = new DevExpress.XtraGrid.Columns.GridColumn(); colQe = new DevExpress.XtraGrid.Columns.GridColumn(); colQp = new DevExpress.XtraGrid.Columns.GridColumn(); colRunStatus = new DevExpress.XtraGrid.Columns.GridColumn(); txtDesignQ = new DevExpress.XtraEditors.TextEdit(); txtDesignH = new DevExpress.XtraEditors.TextEdit(); btnSetDesignPoint = new DevExpress.XtraEditors.SimpleButton(); Root = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlGroup3 = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup(); 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(); layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem(); layoutControlGroup4 = new DevExpress.XtraLayout.LayoutControlGroup(); ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit(); layoutControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)gridControl2).BeginInit(); ((System.ComponentModel.ISupportInitialize)pumpSerialParallelInfoViewModelBindingSource).BeginInit(); ((System.ComponentModel.ISupportInitialize)gridView2).BeginInit(); ((System.ComponentModel.ISupportInitialize)gridControl1).BeginInit(); ((System.ComponentModel.ISupportInitialize)gridView1).BeginInit(); ((System.ComponentModel.ISupportInitialize)repColor).BeginInit(); ((System.ComponentModel.ISupportInitialize)txtDesignQ.Properties).BeginInit(); ((System.ComponentModel.ISupportInitialize)txtDesignH.Properties).BeginInit(); ((System.ComponentModel.ISupportInitialize)Root).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup3).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem5).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup1).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem1).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup2).BeginInit(); ((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)layoutControlItem6).BeginInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup4).BeginInit(); SuspendLayout(); // // layoutControl1 // layoutControl1.Controls.Add(gridControl2); layoutControl1.Controls.Add(gridControl1); layoutControl1.Controls.Add(txtDesignQ); layoutControl1.Controls.Add(txtDesignH); layoutControl1.Controls.Add(btnSetDesignPoint); layoutControl1.Controls.Add(btnSave); 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.TabIndex = 0; layoutControl1.Text = "layoutControl1"; // // gridControl2 // gridControl2.DataSource = pumpSerialParallelInfoViewModelBindingSource; gridControl2.Location = new Point(0, 572); gridControl2.MainView = gridView2; gridControl2.Name = "gridControl2"; gridControl2.Size = new Size(560, 271); gridControl2.TabIndex = 5; gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView2 }); // // pumpSerialParallelInfoViewModelBindingSource // pumpSerialParallelInfoViewModelBindingSource.DataSource = typeof(PumpSerialParallelInfoViewModel); // // gridView2 // gridView2.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colColor1, colQueryQ1, colQueryH1, colQueryE1, colQueryP1, colName1 }); gridView2.GridControl = gridControl2; gridView2.Name = "gridView2"; // // colColor1 // colColor1.FieldName = "Color"; colColor1.MinWidth = 30; colColor1.Name = "colColor1"; colColor1.Width = 112; // // colQueryQ1 // colQueryQ1.Caption = "æµé(m³/h)"; colQueryQ1.FieldName = "QueryQ"; colQueryQ1.MinWidth = 30; colQueryQ1.Name = "colQueryQ1"; colQueryQ1.Visible = true; colQueryQ1.VisibleIndex = 1; colQueryQ1.Width = 112; // // colQueryH1 // colQueryH1.Caption = "æ¬ç¨(m)"; colQueryH1.FieldName = "QueryH"; colQueryH1.MinWidth = 30; colQueryH1.Name = "colQueryH1"; colQueryH1.Visible = true; colQueryH1.VisibleIndex = 2; colQueryH1.Width = 112; // // colQueryE1 // colQueryE1.Caption = "æç(%)"; colQueryE1.FieldName = "QueryE"; colQueryE1.MinWidth = 30; colQueryE1.Name = "colQueryE1"; colQueryE1.Visible = true; colQueryE1.VisibleIndex = 3; colQueryE1.Width = 112; // // colQueryP1 // colQueryP1.Caption = "åç(kW)"; colQueryP1.FieldName = "QueryP"; colQueryP1.MinWidth = 30; colQueryP1.Name = "colQueryP1"; colQueryP1.Visible = true; colQueryP1.VisibleIndex = 4; colQueryP1.Width = 112; // // colName1 // colName1.Caption = "åç§°"; colName1.FieldName = "Name"; colName1.MinWidth = 30; colName1.Name = "colName1"; colName1.Visible = true; colName1.VisibleIndex = 0; colName1.Width = 112; // // gridControl1 // gridControl1.DataSource = pumpSerialParallelInfoViewModelBindingSource; gridControl1.Location = new Point(0, 122); 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.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); // // gridView1 // gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colQueryQ, colQueryH, colQueryE, colQueryP, colExtendRatio, colQhCalc, colQeCalc, colQpCalc, colId, colName, colColor, colIsBp, colRatedSpeed, colCurrentSpeed, colCurrentHz, colQh, colQe, colQp, colRunStatus }); gridView1.GridControl = gridControl1; gridView1.Name = "gridView1"; gridView1.CellValueChanged += gridView1_CellValueChanged; // // colQueryQ // colQueryQ.Caption = "æµé(m³/h)"; colQueryQ.FieldName = "QueryQ"; colQueryQ.MinWidth = 30; colQueryQ.Name = "colQueryQ"; colQueryQ.OptionsColumn.ReadOnly = true; colQueryQ.Width = 112; // // colQueryH // colQueryH.Caption = "æ¬ç¨(m)"; colQueryH.FieldName = "QueryH"; colQueryH.MinWidth = 30; colQueryH.Name = "colQueryH"; colQueryH.OptionsColumn.ReadOnly = true; colQueryH.Width = 112; // // colQueryE // colQueryE.Caption = "æç(%)"; colQueryE.FieldName = "QueryE"; colQueryE.MinWidth = 30; colQueryE.Name = "colQueryE"; colQueryE.OptionsColumn.ReadOnly = true; colQueryE.Width = 112; // // colQueryP // colQueryP.Caption = "åç(kW)"; colQueryP.FieldName = "QueryP"; colQueryP.MinWidth = 30; colQueryP.Name = "colQueryP"; colQueryP.OptionsColumn.ReadOnly = true; colQueryP.Width = 112; // // colExtendRatio // colExtendRatio.Caption = "å»¶é¿(%)"; colExtendRatio.FieldName = "ExtendRatio"; colExtendRatio.MinWidth = 30; colExtendRatio.Name = "colExtendRatio"; colExtendRatio.Visible = true; colExtendRatio.VisibleIndex = 3; colExtendRatio.Width = 112; // // colQhCalc // colQhCalc.FieldName = "QhCalc"; colQhCalc.MinWidth = 30; colQhCalc.Name = "colQhCalc"; colQhCalc.Width = 112; // // colQeCalc // colQeCalc.FieldName = "QeCalc"; colQeCalc.MinWidth = 30; colQeCalc.Name = "colQeCalc"; colQeCalc.Width = 112; // // colQpCalc // colQpCalc.FieldName = "QpCalc"; colQpCalc.MinWidth = 30; colQpCalc.Name = "colQpCalc"; colQpCalc.Width = 112; // // colId // colId.FieldName = "Id"; colId.MinWidth = 30; colId.Name = "colId"; colId.Width = 112; // // colName // colName.Caption = "åç§°"; colName.FieldName = "Name"; colName.MinWidth = 30; colName.Name = "colName"; colName.Visible = true; colName.VisibleIndex = 0; colName.Width = 112; // // colColor // colColor.Caption = "é¢è²"; colColor.ColumnEdit = repColor; colColor.FieldName = "Color"; colColor.MinWidth = 30; colColor.Name = "colColor"; colColor.Visible = true; colColor.VisibleIndex = 1; colColor.Width = 112; // // repColor // repColor.AutoHeight = false; repColor.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); repColor.Name = "repColor"; repColor.NullColor = Color.Empty; // // colIsBp // colIsBp.Caption = "åé¢"; colIsBp.FieldName = "IsBp"; colIsBp.MinWidth = 30; colIsBp.Name = "colIsBp"; colIsBp.OptionsColumn.ReadOnly = true; colIsBp.Width = 112; // // colRatedSpeed // colRatedSpeed.FieldName = "RatedSpeed"; colRatedSpeed.MinWidth = 30; colRatedSpeed.Name = "colRatedSpeed"; colRatedSpeed.Width = 112; // // colCurrentSpeed // colCurrentSpeed.FieldName = "CurrentSpeed"; colCurrentSpeed.MinWidth = 30; colCurrentSpeed.Name = "colCurrentSpeed"; colCurrentSpeed.Width = 112; // // colCurrentHz // colCurrentHz.Caption = "é¢ç(hz)"; colCurrentHz.FieldName = "CurrentHz"; colCurrentHz.MinWidth = 30; colCurrentHz.Name = "colCurrentHz"; colCurrentHz.Visible = true; colCurrentHz.VisibleIndex = 2; colCurrentHz.Width = 112; // // colQh // colQh.FieldName = "Qh"; colQh.MinWidth = 30; colQh.Name = "colQh"; colQh.Width = 112; // // colQe // colQe.FieldName = "Qe"; colQe.MinWidth = 30; colQe.Name = "colQe"; colQe.Width = 112; // // colQp // colQp.FieldName = "Qp"; colQp.MinWidth = 30; colQp.Name = "colQp"; colQp.Width = 112; // // colRunStatus // colRunStatus.Caption = "è¿è¡ç¶æ"; colRunStatus.FieldName = "RunStatus"; colRunStatus.MinWidth = 30; colRunStatus.Name = "colRunStatus"; colRunStatus.Visible = true; colRunStatus.VisibleIndex = 4; colRunStatus.Width = 112; // // txtDesignQ // txtDesignQ.Location = new Point(66, 45); txtDesignQ.Name = "txtDesignQ"; txtDesignQ.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager)); txtDesignQ.Size = new Size(75, 28); txtDesignQ.StyleController = layoutControl1; txtDesignQ.TabIndex = 0; // // txtDesignH // txtDesignH.Location = new Point(245, 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; // // btnSetDesignPoint // btnSetDesignPoint.Appearance.BackColor = Color.White; btnSetDesignPoint.Appearance.Options.UseBackColor = true; btnSetDesignPoint.Appearance.Options.UseTextOptions = true; btnSetDesignPoint.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; 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.Name = "btnSetDesignPoint"; btnSetDesignPoint.Size = new Size(178, 32); btnSetDesignPoint.StyleController = layoutControl1; btnSetDesignPoint.TabIndex = 2; btnSetDesignPoint.Text = "设置"; btnSetDesignPoint.Click += btnSetDesignPoint_Click; // // Root // Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; Root.GroupBordersVisible = false; Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlGroup3, layoutControlGroup1, layoutControlGroup2, layoutControlGroup4 }); Root.Name = "Root"; Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); Root.Size = new Size(560, 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.Name = "layoutControlGroup3"; layoutControlGroup3.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup3.Size = new Size(560, 304); layoutControlGroup3.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup3.Text = "æ¥è¯¢ç¹"; // // layoutControlItem5 // layoutControlItem5.Control = gridControl2; 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.TextSize = new Size(0, 0); layoutControlItem5.TextVisible = false; // // layoutControlGroup1 // layoutControlGroup1.GroupStyle = DevExpress.Utils.GroupStyle.Title; layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1 }); 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.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup1.Text = "æ²çº¿å表"; // // layoutControlItem1 // layoutControlItem1.Control = gridControl1; 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.Text = "æ²çº¿å表"; layoutControlItem1.TextSize = new Size(0, 0); layoutControlItem1.TextVisible = false; // // layoutControlGroup2 // layoutControlGroup2.GroupStyle = DevExpress.Utils.GroupStyle.Title; layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem2, layoutControlItem4, layoutControlItem3, simpleLabelItem1, simpleLabelItem2 }); layoutControlGroup2.Location = new Point(0, 0); layoutControlGroup2.Name = "layoutControlGroup2"; layoutControlGroup2.Size = new Size(560, 89); layoutControlGroup2.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlGroup2.Text = "设计ç¹"; // // layoutControlItem2 // 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); // // layoutControlItem4 // layoutControlItem4.Control = btnSetDesignPoint; layoutControlItem4.Location = new Point(358, 0); layoutControlItem4.MinSize = new Size(126, 36); layoutControlItem4.Name = "layoutControlItem4"; layoutControlItem4.Size = new Size(182, 36); layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; layoutControlItem4.TextSize = new Size(0, 0); layoutControlItem4.TextVisible = false; // // layoutControlItem3 // layoutControlItem3.Control = txtDesignH; layoutControlItem3.Location = new Point(179, 0); layoutControlItem3.Name = "layoutControlItem3"; layoutControlItem3.Size = new Size(133, 36); layoutControlItem3.Text = "æ¬ç¨:"; layoutControlItem3.TextSize = new Size(42, 22); // // simpleLabelItem1 // 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; // // layoutControlItem6 // layoutControlItem6.Control = btnSave; layoutControlItem6.Location = new Point(0, 0); layoutControlItem6.Name = "layoutControlItem6"; layoutControlItem6.Size = new Size(158, 36); layoutControlItem6.TextSize = new Size(0, 0); layoutControlItem6.TextVisible = false; // // layoutControlGroup4 // 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; // // PumpParallelInfoCtrl // AutoScaleDimensions = new SizeF(10F, 22F); AutoScaleMode = AutoScaleMode.Font; Controls.Add(layoutControl1); Name = "PumpParallelInfoCtrl"; Size = new Size(560, 891); ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit(); layoutControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)gridControl2).EndInit(); ((System.ComponentModel.ISupportInitialize)pumpSerialParallelInfoViewModelBindingSource).EndInit(); ((System.ComponentModel.ISupportInitialize)gridView2).EndInit(); ((System.ComponentModel.ISupportInitialize)gridControl1).EndInit(); ((System.ComponentModel.ISupportInitialize)gridView1).EndInit(); ((System.ComponentModel.ISupportInitialize)repColor).EndInit(); ((System.ComponentModel.ISupportInitialize)txtDesignQ.Properties).EndInit(); ((System.ComponentModel.ISupportInitialize)txtDesignH.Properties).EndInit(); ((System.ComponentModel.ISupportInitialize)Root).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup3).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem5).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup1).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlItem1).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup2).EndInit(); ((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)layoutControlItem6).EndInit(); ((System.ComponentModel.ISupportInitialize)layoutControlGroup4).EndInit(); ResumeLayout(false); } #endregion private DevExpress.XtraLayout.LayoutControl layoutControl1; private DevExpress.XtraLayout.LayoutControlGroup Root; private DevExpress.XtraGrid.GridControl gridControl1; private DevExpress.XtraGrid.Views.Grid.GridView gridView1; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; private DevExpress.XtraEditors.Repository.RepositoryItemColorEdit repColor; private BindingSource pumpSerialParallelInfoViewModelBindingSource; private DevExpress.XtraGrid.Columns.GridColumn colQueryQ; private DevExpress.XtraGrid.Columns.GridColumn colQueryH; private DevExpress.XtraGrid.Columns.GridColumn colQueryE; private DevExpress.XtraGrid.Columns.GridColumn colQueryP; private DevExpress.XtraGrid.Columns.GridColumn colExtendRatio; private DevExpress.XtraGrid.Columns.GridColumn colQhCalc; private DevExpress.XtraGrid.Columns.GridColumn colQeCalc; private DevExpress.XtraGrid.Columns.GridColumn colQpCalc; private DevExpress.XtraGrid.Columns.GridColumn colId; private DevExpress.XtraGrid.Columns.GridColumn colName; private DevExpress.XtraGrid.Columns.GridColumn colColor; private DevExpress.XtraGrid.Columns.GridColumn colIsBp; private DevExpress.XtraGrid.Columns.GridColumn colRatedSpeed; private DevExpress.XtraGrid.Columns.GridColumn colCurrentSpeed; private DevExpress.XtraGrid.Columns.GridColumn colCurrentHz; private DevExpress.XtraGrid.Columns.GridColumn colQh; private DevExpress.XtraGrid.Columns.GridColumn colQe; private DevExpress.XtraGrid.Columns.GridColumn colQp; private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1; private DevExpress.XtraEditors.TextEdit txtDesignQ; private DevExpress.XtraEditors.TextEdit txtDesignH; 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; private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup3; private DevExpress.XtraGrid.GridControl gridControl2; private DevExpress.XtraGrid.Views.Grid.GridView gridView2; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5; private DevExpress.XtraGrid.Columns.GridColumn colColor1; private DevExpress.XtraGrid.Columns.GridColumn colQueryQ1; private DevExpress.XtraGrid.Columns.GridColumn colQueryH1; private DevExpress.XtraGrid.Columns.GridColumn colQueryE1; 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; } } WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpParallelInfoCtrl.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,261 @@ namespace Yw.WinFrmUI.Phart { public partial class PumpParallelInfoCtrl : DevExpress.XtraEditors.XtraUserControl { public PumpParallelInfoCtrl() { InitializeComponent(); this.gridView1.SetNormalEditView(); this.gridView2.SetNormalView(); this.repColor.ColorChanged += RepColor_ColorChanged; this.repColor.ColorAlignment = DevExpress.Utils.HorzAlignment.Center; this.repColor.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; this.repColor.ButtonsStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; this.colRunStatus.OptionsColumn.AllowEdit = false; this.colRunStatus.OptionsColumn.ReadOnly = false; this.gridView1.RowCellClick += GridView1_RowCellClick; } /// <summary> /// 设置æ²çº¿ /// </summary> public event Action<string, Yw.Geometry.CubicSpline2d, Yw.Geometry.CubicSpline2d, Yw.Geometry.CubicSpline2d> SetEvent; /// <summary> /// 设置æ²çº¿ä¿¡æ¯ /// </summary> public event Action<string, string, Color> SetInfoEvent; /// <summary> /// æ·»å æ²çº¿äºä»¶ /// </summary> public event Action<PumpSerialParallelInfoViewModel> AddEvent; /// <summary> /// å 餿²çº¿äºä»¶ /// </summary> public event Action<string> DeleteEvent; /// <summary> /// è®¾ç½®è®¾è®¡ç¹ /// </summary> public event Action<double, double> SetDesignPointEvent; /// <summary> /// ä¿åäºä»¶ /// </summary> public event Action SaveEvent; private List<PumpSerialParallelInfoViewModel> _all_binding_list = null; public void SetBindingData(List<PumpSerialParallelInfoViewModel> vm_list, Yw.Geometry.Point2d design_pt = null) { _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); //} } this.txtDesignQ.EditValue = design_pt?.X; this.txtDesignH.EditValue = design_pt?.Y; this.pumpSerialParallelInfoViewModelBindingSource.DataSource = _all_binding_list; this.pumpSerialParallelInfoViewModelBindingSource.ResetBindings(false); this.gridView1.BestFitColumns(); } public void SetDesignPoint(double flow, double head) { this.txtDesignQ.EditValue = flow; this.txtDesignH.EditValue = head; } /// <summary> /// è·å /// </summary> public Yw.Geometry.Point2d GetDesignPoint() { if (!double.TryParse(this.txtDesignQ.Text, out double x)) { return default; } if (!double.TryParse(this.txtDesignH.Text, out double y)) { return default; } return new Geometry.Point2d(x, y); } #region Color private List<Color> _color_array = new List<Color>() { Color.Red, Color.Blue, Color.Green,Color.DodgerBlue, Color.Fuchsia, Color.MidnightBlue, Color.Maroon, Color.Aquamarine, Color.Bisque,Color.BurlyWood }; /// <summary> /// è·åéæºé¢è² /// </summary> /// <returns></returns> private Color GetRandomColor(int count) { if (count < _color_array.Count) { return _color_array[count]; } var _random = new Random(); int r = _random.Next(1, 256); int g = _random.Next(1, 256); int b = _random.Next(1, 256); return Color.FromArgb(r, g, b); } #endregion //é¢è²åæ¢ private void RepColor_ColorChanged(object sender, EventArgs e) { if (this.gridView1.GetCurrentViewModel(_all_binding_list) is not PumpSerialParallelInfoViewModel vm) return; vm.Color = (sender as DevExpress.XtraEditors.ColorEdit).Color; this.SetInfoEvent?.Invoke(vm.Id, vm.Name, vm.Color); } private void GridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { if (e.Column == this.colRunStatus) { var vm = this.gridView1.GetRow(e.RowHandle) as PumpSerialParallelInfoViewModel; vm.RunStatus = !vm.RunStatus; this.gridView1.RefreshRow(e.RowHandle); if (_all_binding_list != null && _all_binding_list.Any()) { foreach (var item in _all_binding_list) { item.QueryH = string.Empty; item.QueryE = string.Empty; item.QueryQ = string.Empty; item.QueryP = string.Empty; } } this.pumpSerialParallelInfoViewModelBindingSource.ResetBindings(false); if (vm.RunStatus) { vm.Calc(); this.AddEvent?.Invoke(vm); } else { this.DeleteEvent?.Invoke(vm.Id); } } } //å¼åæ¢ private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == this.colName) { this.pumpSerialParallelInfoViewModelBindingSource.ResetBindings(false); var vm = this.gridView1.GetRow(e.RowHandle) as PumpSerialParallelInfoViewModel; this.SetInfoEvent?.Invoke(vm.Id, vm.Name, vm.Color); } else if (e.Column == this.colCurrentHz) { this.pumpSerialParallelInfoViewModelBindingSource.ResetBindings(false); var vm = this.gridView1.GetRow(e.RowHandle) as PumpSerialParallelInfoViewModel; if (vm.CurrentHz < 10 || vm.CurrentHz > 50) { return; } vm.Calc(); this.SetEvent?.Invoke(vm.Id, vm.QhCalc, vm.QeCalc, vm.QpCalc); } else if (e.Column == this.colExtendRatio) { this.pumpSerialParallelInfoViewModelBindingSource.ResetBindings(false); var vm = this.gridView1.GetRow(e.RowHandle) as PumpSerialParallelInfoViewModel; vm.Calc(); this.SetEvent?.Invoke(vm.Id, vm.QhCalc, vm.QeCalc, vm.QpCalc); } } /// <summary> /// 设置æ¥è¯¢ä¿¡æ¯ /// </summary> /// <param name="id"></param> /// <param name="query_pt"></param> public void SetQueryInfo(string id, PumpGroupPt query_pt) { if (query_pt == null) return; if (_all_binding_list == null || !_all_binding_list.Any()) return; var vm = _all_binding_list.Find(x => x.Id == id); if (vm == null) return; vm.QueryQ = query_pt.Q > 0 ? $"{query_pt.Q:N1}" : string.Empty; vm.QueryH = query_pt.H > 0 ? $"{query_pt.H:N1}" : string.Empty; vm.QueryE = query_pt.E > 0 ? $"{query_pt.E:N1}" : string.Empty; vm.QueryP = query_pt.P > 0 ? $"{query_pt.P:N1}" : string.Empty; this.pumpSerialParallelInfoViewModelBindingSource.ResetBindings(false); } //è®¾ç½®è®¾è®¡ç¹ private void btnSetDesignPoint_Click(object sender, EventArgs e) { if (!double.TryParse(this.txtDesignQ.Text, out double design_q)) return; if (!double.TryParse(this.txtDesignH.Text, out double design_h)) return; this.SetDesignPointEvent?.Invoke(design_q, design_h); } public List<PumpSerialParallelInfoViewModel> GetRunList() { if (_all_binding_list == null || !_all_binding_list.Any()) { return default; } return _all_binding_list.Where(x => x.RunStatus).Select(x => new PumpSerialParallelInfoViewModel(x)).ToList(); } private void btnSave_Click(object sender, EventArgs e) { this.SaveEvent?.Invoke(); } } } WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpParallelInfoCtrl.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,145 @@ <?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="pumpSerialParallelInfoViewModelBindingSource.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="btnSetDesignPoint.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAB0DAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5Z ZWxsb3d7ZmlsbDojRkZCMTE1O30KCS5CbGFja3tmaWxsOiM3MjcyNzI7fQoJLkdyZWVue2ZpbGw6IzAz OUMyMzt9CgkuUmVke2ZpbGw6I0QxMUMxQzt9Cgkuc3Qwe29wYWNpdHk6MC43NTt9Cgkuc3Qxe29wYWNp dHk6MC41O30KPC9zdHlsZT4NCiAgPGcgaWQ9IkVkaXQiPg0KICAgIDxwYXRoIGQ9Ik0yNy42LDguMmwt My44LTMuOGMtMC41LTAuNS0xLjQtMC41LTEuOSwwbC0yLjUsMi41bDUuOCw1LjhsMi41LTIuNUMyOC4x LDkuNiwyOC4xLDguOCwyNy42LDguMnoiIGNsYXNzPSJCbHVlIiAvPg0KICAgIDxwb2x5Z29uIHBvaW50 cz0iNCwyOCA5LjgsMjggNCwyMi4yICAiIGNsYXNzPSJCbHVlIiAvPg0KICAgIDxyZWN0IHg9IjUuOCIg eT0iMTMuNCIgd2lkdGg9IjE3LjYiIGhlaWdodD0iOC4yIiBjbGFzcz0iQmx1ZSIgdHJhbnNmb3JtPSJt YXRyaXgoMC43MDcsIC0wLjcwNzIsIDAuNzA3MiwgMC43MDcsIC04LjA3MjEsIDE1LjQwNDgpIiAvPg0K ICA8L2c+DQo8L3N2Zz4L </value> </data> </root> WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpSerialParallelChart.cs
@@ -1,7 +1,6 @@ using DevExpress.Utils; using DevExpress.XtraCharts; using System.Text; using System.Windows.Forms; using Yw.Geometry; namespace Yw.WinFrmUI.Phart @@ -15,9 +14,7 @@ { InitializeComponent(); InitialChart(); this.chartControl1.RuntimeHitTesting = true; //this.chartControl1.SelectionMode = ElementSelectionMode.Single; //this.chartControl1.SeriesSelectionMode = SeriesSelectionMode.Series; this.chartControl1.RuntimeHitTesting = true; } #region Private Variable @@ -153,7 +150,7 @@ #endregion #region Add Update Curve #region Add Set /// <summary> /// æ·»å æ²çº¿ @@ -165,6 +162,20 @@ return; _vm_list = new List<PumpSerialParallelInfoViewModel>(); _design_pt = design_pt; _initialData = true; _vm_list.AddRange(vm_list); UpdateChart(true); } /// <summary> /// æ·»å æ²çº¿ /// </summary> /// <param name="vm_list"></param> public void Add(List<PumpSerialParallelInfoViewModel> vm_list) { if (vm_list == null || !vm_list.Any()) return; _vm_list = new List<PumpSerialParallelInfoViewModel>(); _initialData = true; _vm_list.AddRange(vm_list); UpdateChart(true); @@ -185,6 +196,23 @@ _vm_list.Add(vm); UpdateChart(true); } /// <summary> /// æ·»å æ²çº¿ /// </summary> /// <param name="vm"></param> public void Add(PumpSerialParallelInfoViewModel vm) { if (vm == null) return; if (_vm_list == null) _vm_list = new List<PumpSerialParallelInfoViewModel>(); _initialData = true; _vm_list.Add(vm); UpdateChart(true); } /// <summary> /// 设置æ²çº¿ @@ -243,7 +271,7 @@ } } } /// <summary> /// è®¾ç½®è®¾è®¡ç¹ /// </summary> @@ -251,7 +279,7 @@ public void SetDesignPt(Yw.Geometry.Point2d design_pt) { _design_pt = design_pt; UpdateChart(true); UpdateChart(true,true); } @@ -286,7 +314,7 @@ /// æ´æ°å¾è¡¨ /// </summary> /// <param name="calc_coordinate">计ç®åæ </param> public void UpdateChart(bool calc_coordinate = false) public void UpdateChart(bool calc_coordinate = false, bool calc_eq = false) { if (calc_coordinate || _coordinate_paras == null) { @@ -294,14 +322,13 @@ CalcCoordinate(); } CalcSeries(); CalcSeries(calc_eq); CalcChartAxis(); CalcWorkPointByQ(); CalcTextAnchorPoint(); } #endregion @@ -484,17 +511,38 @@ _axis_y_qp.GridLines.Visible = true; } var minQ = _coordinate_paras.CoordMinQ; var maxQ = _coordinate_paras.DispMaxQ(); _axis_x_q.SetAxisRange(_coordinate_paras.CoordMinQ, _coordinate_paras.DispMaxQ()); _axis_y_qh.SetAxisRange(_coordinate_paras.DispMinH(), _coordinate_paras.DispMaxH()); _axis_y_qe.SetAxisRange(_coordinate_paras.DispMinE(), _coordinate_paras.DispMaxE()); _axis_y_qp.SetAxisRange(_coordinate_paras.DispMinP(), _coordinate_paras.DispMaxP()); var minH = _coordinate_paras.DispMinH(); var maxH = _coordinate_paras.DispMaxH(); var minE = _coordinate_paras.DispMinE(); var maxE = _coordinate_paras.DispMaxE(); var minP = _coordinate_paras.DispMinP(); var maxP = _coordinate_paras.DispMaxP(); if (double.IsNaN(minP)||double.IsNaN(maxP)) { minP = 0; maxP = 1000; } _axis_x_q.SetAxisRange(minQ, maxQ); _axis_y_qh.SetAxisRange(minH, maxH); _axis_y_qe.SetAxisRange(minE, maxE); _axis_y_qp.SetAxisRange(minP, maxP); } /// <summary> /// 计ç®ç³»å /// </summary> private void CalcSeries() private void CalcSeries(bool calc_eq) { this.chartControl1.BeginInit(); this.chartControl1.Series.Clear(); @@ -519,13 +567,14 @@ else { CreateLineSeries(vm); CreateEqSeries(vm, _design_pt); if (calc_eq) CreateEqSeries(vm, _design_pt); } } } else { LineVisible = false; //LineVisible = false; } this.chartControl1.EndInit(); } WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpSerialParallelInfoViewModel.cs
@@ -1,4 +1,6 @@ namespace Yw.WinFrmUI.Phart using System.ComponentModel.DataAnnotations; namespace Yw.WinFrmUI.Phart { public class PumpSerialParallelInfoViewModel: PumpSerialParallelViewModel { @@ -17,6 +19,10 @@ this.QueryP = rhs.QueryP; this.QueryE = rhs.QueryE; this.ExtendRatio = rhs.ExtendRatio; this.IsDefault = rhs.IsDefault; this.RunStatus = rhs.RunStatus; this.CalcuQ = rhs.CalcuQ; this.CalcuH = rhs.CalcuH; this.Calc(); } @@ -25,14 +31,15 @@ public string QueryH { get; set; } public string QueryE { get; set; } public string QueryP { get; set; } public double ExtendRatio { get; set; } = 100; public double ExtendRatio { get; set; } = 100; public Yw.Geometry.CubicSpline2d QhCalc { get; set; } public Yw.Geometry.CubicSpline2d QeCalc { get; set; } public Yw.Geometry.CubicSpline2d QpCalc { get; set; } public bool IsDefault { get; set; } public Yw.Geometry.CubicSpline2d QpCalc { get; set; } public bool IsDefault { get; set; } public bool RunStatus { get; set; } public double? CalcuQ { get; set; } public double? CalcuH { get; set; } public void Calc() { this.CurrentSpeed = Math.Round(this.CurrentHz / 50 * this.RatedSpeed); WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/01-pump-chart/01-chart/03-serial-parallel/PumpSerialParallelViewModel.cs
@@ -5,6 +5,7 @@ public PumpSerialParallelViewModel() { } public PumpSerialParallelViewModel(PumpSerialParallelViewModel rhs) { this.ID = rhs.ID; this.Id = rhs.Id; this.Name = rhs.Name; this.IsBp = rhs.IsBp; @@ -19,12 +20,22 @@ /// <summary> /// æ è¯ /// </summary> public long ID { get; set; } /// <summary> /// æ è¯ /// </summary> public string Id { get; set; } /// <summary> /// åç§° /// </summary> public string Name { get; set; } public string Name { get; set; } /// <summary> /// ç¼ç /// </summary> public string Code { get; set; } /// <summary> /// æ¯å¦åé¢ WinFrmUI/Yw.WinFrmUI.Phart.Core/01-perform/99-models/01-coordinate/PumpCoordinate_Disp.cs
@@ -395,11 +395,11 @@ coordinate_paras.CoordMinP = GetByPlacesLength(disMaxP - (double)coordinate_paras.EndLineNoP * coordinate_paras.CoordSpaceP, 3); if (minP > 0 && minP < 10) if (minP > 0 && minP < 3) { coordinate_paras.StartLineNoP = 0; coordinate_paras.EndLineNoP = endLineNoP; coordinate_paras.CoordSpaceP = coordSpaceP; //coordinate_paras.EndLineNoP = endLineNoP; //coordinate_paras.CoordSpaceP = coordSpaceP; coordinate_paras.CoordMinP = Math.Floor(minP); } } WinFrmUI/Yw.WinFrmUI.Phart.Core/Yw.WinFrmUI.Phart.Core.csproj
@@ -63,7 +63,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.1" /> <PackageReference Include="Yw.Pump.Core" Version="3.1.2" /> </ItemGroup> <ItemGroup> @@ -86,6 +86,9 @@ <Compile Update="01-perform\01-pump-chart\01-chart\02-perform-compare\PumpPerformCompareInfoCtrl.cs"> <SubType>UserControl</SubType> </Compile> <Compile Update="01-perform\01-pump-chart\01-chart\03-serial-parallel\PumpParallelInfoCtrl.cs"> <SubType>UserControl</SubType> </Compile> <Compile Update="01-perform\01-pump-chart\01-chart\04-variable-speed\PumpVariableSpeedChart.cs"> <SubType>UserControl</SubType> </Compile>