| | |
| | | dockManager1 = new DevExpress.XtraBars.Docking.DockManager(components); |
| | | dockPanel1 = new DevExpress.XtraBars.Docking.DockPanel(); |
| | | dockPanel1_Container = new DevExpress.XtraBars.Docking.ControlContainer(); |
| | | barBtnCopyAndExpand = new DevExpress.XtraBars.BarButtonItem(); |
| | | sidePanel2.SuspendLayout(); |
| | | sidePanel1.SuspendLayout(); |
| | | ((System.ComponentModel.ISupportInitialize)tabPane1).BeginInit(); |
| | |
| | | xtrPerform2dChart1.DefinePointVisible = false; |
| | | xtrPerform2dChart1.Dock = DockStyle.Fill; |
| | | xtrPerform2dChart1.LineVisible = false; |
| | | xtrPerform2dChart1.Location = new Point(336, 148); |
| | | xtrPerform2dChart1.Location = new Point(235, 148); |
| | | xtrPerform2dChart1.Margin = new Padding(1, 2, 1, 2); |
| | | xtrPerform2dChart1.Name = "xtrPerform2dChart1"; |
| | | xtrPerform2dChart1.Size = new Size(224, 657); |
| | | xtrPerform2dChart1.Size = new Size(325, 657); |
| | | xtrPerform2dChart1.TabIndex = 1; |
| | | // |
| | | // sidePanel2 |
| | |
| | | sidePanel2.Dock = DockStyle.Fill; |
| | | sidePanel2.Location = new Point(0, 0); |
| | | sidePanel2.Name = "sidePanel2"; |
| | | sidePanel2.Size = new Size(335, 623); |
| | | sidePanel2.Size = new Size(234, 623); |
| | | sidePanel2.TabIndex = 4; |
| | | sidePanel2.Text = "sidePanel2"; |
| | | // |
| | |
| | | xhsPumpMainPhartListCtrl1.Location = new Point(0, 0); |
| | | xhsPumpMainPhartListCtrl1.Margin = new Padding(6, 8, 6, 8); |
| | | xhsPumpMainPhartListCtrl1.Name = "xhsPumpMainPhartListCtrl1"; |
| | | xhsPumpMainPhartListCtrl1.Size = new Size(335, 623); |
| | | xhsPumpMainPhartListCtrl1.Size = new Size(234, 623); |
| | | xhsPumpMainPhartListCtrl1.TabIndex = 0; |
| | | // |
| | | // sidePanel1 |
| | |
| | | ribbonControl1.EmptyAreaImageOptions.ImagePadding = new Padding(43, 47, 43, 47); |
| | | ribbonControl1.ExpandCollapseItem.Id = 0; |
| | | ribbonControl1.ItemPanelStyle = DevExpress.XtraBars.Ribbon.RibbonItemPanelStyle.Classic; |
| | | ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbonControl1.ExpandCollapseItem, BtnAdd, BtnEdit, BtnDelete, barBtnEditPumpCurve, BarBtnEidtPumpPart, barCheckItem1, barBtnImportByExcel, barBtnImportByPicture, barButtonItem3, barButtonItem4, barBtnDelete, barBtnAddText, barBtnUpdateimportance, barBtnOtherName, barBtnEditChart, barBtnImportByOnePoint, barBtnVariableSpeed }); |
| | | ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbonControl1.ExpandCollapseItem, BtnAdd, BtnEdit, BtnDelete, barBtnEditPumpCurve, BarBtnEidtPumpPart, barCheckItem1, barBtnImportByExcel, barBtnImportByPicture, barButtonItem3, barButtonItem4, barBtnDelete, barBtnAddText, barBtnUpdateimportance, barBtnOtherName, barBtnEditChart, barBtnImportByOnePoint, barBtnVariableSpeed, barBtnCopyAndExpand }); |
| | | ribbonControl1.Location = new Point(0, 0); |
| | | ribbonControl1.Margin = new Padding(4, 5, 4, 5); |
| | | ribbonControl1.MaxItemId = 34; |
| | | ribbonControl1.MaxItemId = 35; |
| | | ribbonControl1.Name = "ribbonControl1"; |
| | | ribbonControl1.OptionsMenuMinWidth = 471; |
| | | ribbonControl1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { ribbonPage1 }); |
| | |
| | | ribbonPageGroup2.ItemLinks.Add(barBtnEditChart); |
| | | ribbonPageGroup2.ItemLinks.Add(barBtnOtherName); |
| | | ribbonPageGroup2.ItemLinks.Add(barBtnUpdateimportance); |
| | | ribbonPageGroup2.ItemLinks.Add(barBtnVariableSpeed, true); |
| | | ribbonPageGroup2.ItemLinks.Add(barBtnCopyAndExpand, true); |
| | | ribbonPageGroup2.ItemLinks.Add(barBtnVariableSpeed); |
| | | ribbonPageGroup2.ItemLinks.Add(barBtnDelete, true); |
| | | ribbonPageGroup2.Name = "ribbonPageGroup2"; |
| | | ribbonPageGroup2.Text = "æä½"; |
| | |
| | | dockPanel1.Location = new Point(0, 148); |
| | | dockPanel1.Name = "dockPanel1"; |
| | | dockPanel1.OriginalSize = new Size(235, 200); |
| | | dockPanel1.Size = new Size(336, 657); |
| | | dockPanel1.Size = new Size(235, 657); |
| | | dockPanel1.Text = "æ²çº¿å表"; |
| | | // |
| | | // dockPanel1_Container |
| | |
| | | dockPanel1_Container.Controls.Add(sidePanel2); |
| | | dockPanel1_Container.Location = new Point(0, 34); |
| | | dockPanel1_Container.Name = "dockPanel1_Container"; |
| | | dockPanel1_Container.Size = new Size(335, 623); |
| | | dockPanel1_Container.Size = new Size(234, 623); |
| | | dockPanel1_Container.TabIndex = 0; |
| | | // |
| | | // barBtnCopyAndExpand |
| | | // |
| | | barBtnCopyAndExpand.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True; |
| | | barBtnCopyAndExpand.Caption = "å¤å¶-å»¶é¿"; |
| | | barBtnCopyAndExpand.Id = 34; |
| | | barBtnCopyAndExpand.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("barBtnExpandAndSave.ImageOptions.SvgImage"); |
| | | barBtnCopyAndExpand.Name = "barBtnCopyAndExpand"; |
| | | barBtnCopyAndExpand.ItemClick += barBtnCopyAndExpand_ItemClick; |
| | | // |
| | | // XhsPumpMainPhartPanel |
| | | // |
| | |
| | | private DevExpress.XtraBars.BarButtonItem barBtnImportByOnePoint; |
| | | private DevExpress.XtraBars.BarButtonItem barBtnVariableSpeed; |
| | | private Yw.WinFrmUI.Phart.PumpPerformInfoCtrl pumpPerformInfoCtrl1; |
| | | private DevExpress.XtraBars.BarButtonItem barBtnCopyAndExpand; |
| | | } |
| | | } |
| | |
| | | var bol = await Import(other_name, qh, qe, qp); |
| | | return bol; |
| | | }; |
| | | dlg.ShowDialog(); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //åç¹ å¯¼å
¥ |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //å¤å¶å¹¶å»¶é¿ |
| | | private void barBtnCopyAndExpand_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | |
| | | } |
| | | |
| | | #region å é¤ |
| | | |
| | | //å é¤ |
| | |
| | | #endregion å é¤ |
| | | |
| | | #endregion æä½ |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | MTZ2LTJoMTBWMjJ6IiBjbGFzcz0iQmx1ZSIgLz4NCiAgPC9nPg0KPC9zdmc+Cw== |
| | | </value> |
| | | </data> |
| | | <data name="barBtnExpandAndSave.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
| | | <value> |
| | | AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi40 |
| | | LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl |
| | | dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAADACAAAC77u/ |
| | | PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi |
| | | IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv |
| | | MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh |
| | | Y2U9InByZXNlcnZlIiBpZD0iQ29weSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIg |
| | | MzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cjwvc3R5 |
| | | bGU+DQogIDxwYXRoIGQ9Ik0yMSwwSDlDOC40LDAsOCwwLjQsOCwxdjVIM0MyLjQsNiwyLDYuNCwyLDd2 |
| | | MjJjMCwwLjYsMC40LDEsMSwxaDE4YzAuNiwwLDEtMC40LDEtMXYtNWg1YzAuNiwwLDEtMC40LDEtMVY3 |
| | | ICBMMjEsMHogTTIwLDI4SDRWOGg0aDJoNHY1YzAsMC42LDAuNCwxLDEsMWg1djR2NHYyVjI4eiBNMjYs |
| | | MTJ2MTBoLTR2LTlsLTctN2gtNVYyaDRoNnY0djFjMCwwLjYsMC40LDEsMSwxaDVWMTJ6IiBjbGFzcz0i |
| | | QmxhY2siIC8+DQo8L3N2Zz4L |
| | | </value> |
| | | </data> |
| | | <metadata name="dockManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
| | | <value>17, 17</value> |
| | | </metadata> |
| | |
| | | var run_list = this.pumpParallelInfoCtrl1.GetRunList(); |
| | | var msg = SetParallel(run_list); |
| | | if (!string.IsNullOrEmpty(msg)) |
| | | { |
| | | //TipFormHelper.ShowWarn(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) |
| | | { |
| | | Set(list); |
| | | return "æ æ³è®¡ç® å¹¶èæ²çº¿!"; |
| | | } |
| | | var msg = string.Empty; |
| | | var vm_parallel = CalcParallel(list); |
| | | if (vm_parallel != null) |
| | | { |
| | | list.Add(vm_parallel); |
| | | Set(list); |
| | | return string.Empty; |
| | | } |
| | | else |
| | | { |
| | | return "æ æ³è®¡ç® å¹¶èæ²çº¿!"; |
| | | msg = "æ æ³è®¡ç® å¹¶èæ²çº¿!"; |
| | | } |
| | | Set(list); |
| | | return msg; |
| | | } |
| | | |
| | | |
| | |
| | | <Compile Update="99-common\PumpPerform2dMultiViewDlg.cs"> |
| | | <SubType>Form</SubType> |
| | | </Compile> |
| | | <Compile Update="PumpCurveExpandDlg.cs"> |
| | | <SubType>Form</SubType> |
| | | </Compile> |
| | | <Compile Update="PumpParallelAnalyDlg.cs"> |
| | | <SubType>Form</SubType> |
| | | </Compile> |
| | | </ItemGroup> |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.WinFrmUI.PhartRelation |
| | | { |
| | | partial class PumpCurveExpandDlg |
| | | { |
| | | /// <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() |
| | | { |
| | | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PumpCurveExpandDlg)); |
| | | ribbon = new DevExpress.XtraBars.Ribbon.RibbonControl(); |
| | | barEditTrackBar = new DevExpress.XtraBars.BarEditItem(); |
| | | repTrackBar1 = new DevExpress.XtraEditors.Repository.RepositoryItemTrackBar(); |
| | | barBtnSave = new DevExpress.XtraBars.BarButtonItem(); |
| | | ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage(); |
| | | ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup(); |
| | | repRangeTrackBar1 = new DevExpress.XtraEditors.Repository.RepositoryItemRangeTrackBar(); |
| | | pumpPerformChart1 = new Yw.WinFrmUI.Phart.PumpPerformChart(); |
| | | ((System.ComponentModel.ISupportInitialize)ribbon).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)repTrackBar1).BeginInit(); |
| | | ((System.ComponentModel.ISupportInitialize)repRangeTrackBar1).BeginInit(); |
| | | SuspendLayout(); |
| | | // |
| | | // ribbon |
| | | // |
| | | ribbon.ExpandCollapseItem.Id = 0; |
| | | ribbon.ItemPanelStyle = DevExpress.XtraBars.Ribbon.RibbonItemPanelStyle.Classic; |
| | | ribbon.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbon.ExpandCollapseItem, barEditTrackBar, barBtnSave }); |
| | | ribbon.Location = new Point(0, 0); |
| | | ribbon.MaxItemId = 11; |
| | | ribbon.Name = "ribbon"; |
| | | ribbon.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { ribbonPage1 }); |
| | | ribbon.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repRangeTrackBar1, repTrackBar1 }); |
| | | ribbon.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonControlStyle.TabletOffice; |
| | | ribbon.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False; |
| | | ribbon.ShowDisplayOptionsMenuButton = 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(1147, 85); |
| | | ribbon.Toolbar.ShowCustomizeItem = false; |
| | | // |
| | | // barEditTrackBar |
| | | // |
| | | barEditTrackBar.Caption = "å»¶é¿æ¯:"; |
| | | barEditTrackBar.Edit = repTrackBar1; |
| | | barEditTrackBar.EditValue = "100"; |
| | | barEditTrackBar.EditWidth = 200; |
| | | barEditTrackBar.Id = 9; |
| | | barEditTrackBar.Name = "barEditTrackBar"; |
| | | barEditTrackBar.EditValueChanged += barEditTrackBar_EditValueChanged; |
| | | // |
| | | // repTrackBar1 |
| | | // |
| | | repTrackBar1.LabelAppearance.Options.UseTextOptions = true; |
| | | repTrackBar1.LabelAppearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; |
| | | repTrackBar1.Maximum = 200; |
| | | repTrackBar1.Minimum = 100; |
| | | repTrackBar1.Name = "repTrackBar1"; |
| | | repTrackBar1.ShowLabels = true; |
| | | repTrackBar1.ShowValueToolTip = true; |
| | | repTrackBar1.TickStyle = TickStyle.None; |
| | | // |
| | | // barBtnSave |
| | | // |
| | | barBtnSave.Caption = "ä¿å"; |
| | | barBtnSave.Id = 10; |
| | | barBtnSave.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("barBtnSave.ImageOptions.SvgImage"); |
| | | barBtnSave.Name = "barBtnSave"; |
| | | barBtnSave.ItemClick += barBtnSave_ItemClick; |
| | | // |
| | | // ribbonPage1 |
| | | // |
| | | ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { ribbonPageGroup1 }); |
| | | ribbonPage1.Name = "ribbonPage1"; |
| | | ribbonPage1.Text = "ribbonPage1"; |
| | | // |
| | | // ribbonPageGroup1 |
| | | // |
| | | ribbonPageGroup1.ItemLinks.Add(barEditTrackBar); |
| | | ribbonPageGroup1.ItemLinks.Add(barBtnSave); |
| | | ribbonPageGroup1.Name = "ribbonPageGroup1"; |
| | | ribbonPageGroup1.Text = "ribbonPageGroup1"; |
| | | // |
| | | // repRangeTrackBar1 |
| | | // |
| | | repRangeTrackBar1.LabelAppearance.Options.UseTextOptions = true; |
| | | repRangeTrackBar1.LabelAppearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; |
| | | repRangeTrackBar1.Maximum = 200; |
| | | repRangeTrackBar1.Minimum = 100; |
| | | repRangeTrackBar1.Name = "repRangeTrackBar1"; |
| | | // |
| | | // pumpPerformChart1 |
| | | // |
| | | pumpPerformChart1.DefinePointVisible = false; |
| | | pumpPerformChart1.Dock = DockStyle.Fill; |
| | | pumpPerformChart1.LineVisible = false; |
| | | pumpPerformChart1.Location = new Point(0, 85); |
| | | pumpPerformChart1.Name = "pumpPerformChart1"; |
| | | pumpPerformChart1.Size = new Size(1147, 927); |
| | | pumpPerformChart1.TabIndex = 1; |
| | | // |
| | | // PumpCurveExpandDlg |
| | | // |
| | | AutoScaleDimensions = new SizeF(10F, 22F); |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | ClientSize = new Size(1147, 1012); |
| | | Controls.Add(pumpPerformChart1); |
| | | Controls.Add(ribbon); |
| | | Name = "PumpCurveExpandDlg"; |
| | | Ribbon = ribbon; |
| | | StartPosition = FormStartPosition.CenterScreen; |
| | | Text = "æ²çº¿å»¶é¿"; |
| | | ((System.ComponentModel.ISupportInitialize)ribbon).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)repTrackBar1).EndInit(); |
| | | ((System.ComponentModel.ISupportInitialize)repRangeTrackBar1).EndInit(); |
| | | ResumeLayout(false); |
| | | PerformLayout(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private DevExpress.XtraBars.Ribbon.RibbonControl ribbon; |
| | | private DevExpress.XtraBars.BarEditItem barEditTrackBar; |
| | | private DevExpress.XtraEditors.Repository.RepositoryItemTrackBar repTrackBar1; |
| | | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1; |
| | | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1; |
| | | private DevExpress.XtraEditors.Repository.RepositoryItemRangeTrackBar repRangeTrackBar1; |
| | | private DevExpress.XtraBars.BarButtonItem barBtnSave; |
| | | private Yw.WinFrmUI.Phart.PumpPerformChart pumpPerformChart1; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.WinFrmUI.PhartRelation |
| | | { |
| | | public partial class PumpCurveExpandDlg : DevExpress.XtraBars.Ribbon.RibbonForm |
| | | { |
| | | public PumpCurveExpandDlg() |
| | | { |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åè°äºä»¶ |
| | | /// </summary> |
| | | public event Func<Yw.Geometry.CubicSpline2d, Yw.Geometry.CubicSpline2d, Yw.Geometry.CubicSpline2d, Task<bool>> ReloadDataEvent; |
| | | |
| | | private Yw.Geometry.CubicSpline2d _qh = null; |
| | | private Yw.Geometry.CubicSpline2d _qe = null; |
| | | private Yw.Geometry.CubicSpline2d _qp = null; |
| | | |
| | | /// <summary> |
| | | /// åå§åæ°æ® |
| | | /// </summary> |
| | | public void SetBindingData( |
| | | Yw.Pump.CurveQH curve_qh, |
| | | Yw.Pump.CurveQE curve_qe, |
| | | Yw.Pump.CurveQP curve_qp) |
| | | { |
| | | if (curve_qh == null) |
| | | { |
| | | return; |
| | | } |
| | | Yw.Geometry.CubicSpline2d qh = null, qe = null, qp = null; |
| | | |
| | | qh = new Yw.Geometry.CubicSpline2d(curve_qh.FeatCurve.GetPointList()); |
| | | if (curve_qe != null) |
| | | qe = new Yw.Geometry.CubicSpline2d(curve_qe.FeatCurve.GetPointList()); |
| | | if (curve_qp != null) |
| | | qp = new Yw.Geometry.CubicSpline2d(curve_qp.FeatCurve.GetPointList()); |
| | | |
| | | _qh = qh; |
| | | _qe = qe; |
| | | _qp = qp; |
| | | this.pumpPerformChart1.SetBindingData(qh, qe, qp); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå§åæ°æ® |
| | | /// </summary> |
| | | public void SetBindingData(Yw.Geometry.CubicSpline2d qh, |
| | | Yw.Geometry.CubicSpline2d qe, |
| | | Yw.Geometry.CubicSpline2d qp) |
| | | { |
| | | |
| | | _qh = qh; |
| | | _qe = qe; |
| | | _qp = qp; |
| | | this.pumpPerformChart1.SetBindingData(qh, qe, qp); |
| | | } |
| | | |
| | | |
| | | private void barEditTrackBar_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | | if (this.barEditTrackBar.EditValue is not double ratio) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var bol = Out(ratio, out Yw.Geometry.CubicSpline2d qh, out Yw.Geometry.CubicSpline2d qe, out Yw.Geometry.CubicSpline2d qp); |
| | | if (!bol) |
| | | return; |
| | | this.pumpPerformChart1.SetBindingData(qh, qe, qp); |
| | | } |
| | | |
| | | private async void barBtnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | |
| | | if (this.barEditTrackBar.EditValue is not double ratio) |
| | | { |
| | | return; |
| | | } |
| | | var bol = Out(ratio, out Yw.Geometry.CubicSpline2d qh, out Yw.Geometry.CubicSpline2d qe, out Yw.Geometry.CubicSpline2d qp); |
| | | if (!bol) |
| | | return; |
| | | var result = await this.ReloadDataEvent?.Invoke(qh, qe, qp); |
| | | if (!result) |
| | | { |
| | | XtraMessageBox.Show("ä¿å失败ï¼"); |
| | | return; |
| | | } |
| | | |
| | | XtraMessageBox.Show("ä¿åæåï¼"); |
| | | this.DialogResult = DialogResult.OK; |
| | | this.Close(); |
| | | } |
| | | |
| | | private bool Out(double ratio, out Yw.Geometry.CubicSpline2d qh, out Yw.Geometry.CubicSpline2d qe, out Yw.Geometry.CubicSpline2d qp) |
| | | { |
| | | qh = _qh; |
| | | qe = _qe; |
| | | qp = _qp; |
| | | if (qh == null) |
| | | return false; |
| | | |
| | | qh.MaxX = qh.MaxX * ratio / 100; |
| | | |
| | | if (qe != null) |
| | | qe.MaxX = qe.MaxX * ratio / 100; |
| | | |
| | | if (qp != null) |
| | | qp.MaxX = qp.MaxX * ratio / 100; |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
| | | <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> |
| | | <data name="barBtnSave.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
| | | <value> |
| | | AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi40 |
| | | LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl |
| | | dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAMICAAAC77u/ |
| | | PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi |
| | | IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv |
| | | MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh |
| | | Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg |
| | | MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzczNzM3NDt9Cgku |
| | | WWVsbG93e2ZpbGw6I0ZDQjAxQjt9CgkuR3JlZW57ZmlsbDojMTI5QzQ5O30KCS5CbHVle2ZpbGw6IzM4 |
| | | N0NCNzt9CgkuUmVke2ZpbGw6I0QwMjEyNzt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh |
| | | Y2l0eTowLjU7fQoJLnN0MXtvcGFjaXR5OjAuNzU7fQoJLnN0MntvcGFjaXR5OjAuMjU7fQoJLnN0M3tk |
| | | aXNwbGF5Om5vbmU7ZmlsbDojNzM3Mzc0O30KPC9zdHlsZT4NCiAgPHBhdGggZD0iTTI3LDRoLTN2MTBI |
| | | OFY0SDVDNC40LDQsNCw0LjQsNCw1djIyYzAsMC42LDAuNCwxLDEsMWgyMmMwLjYsMCwxLTAuNCwxLTFW |
| | | NUMyOCw0LjQsMjcuNiw0LDI3LDR6IE0yNCwyNEg4di02ICBoMTZWMjR6IE0xMCw0djhoMTBWNEgxMHog |
| | | TTE0LDEwaC0yVjZoMlYxMHoiIGNsYXNzPSJCbGFjayIgLz4NCjwvc3ZnPgs= |
| | | </value> |
| | | </data> |
| | | </root> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace HStation.WinFrmUI.PhartRelation |
| | | { |
| | | partial class PumpParallelAnalyDlg |
| | | { |
| | | /// <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(); |
| | | sidePanel1 = new SidePanel(); |
| | | pumpParallelInfoCtrl1 = new Yw.WinFrmUI.Phart.PumpParallelInfoCtrl(); |
| | | pumpSerialParallelChart = new Yw.WinFrmUI.Phart.PumpSerialParallelChart(); |
| | | ribbonStatusBar = new DevExpress.XtraBars.Ribbon.RibbonStatusBar(); |
| | | barInfo = new DevExpress.XtraBars.BarStaticItem(); |
| | | ((System.ComponentModel.ISupportInitialize)ribbon).BeginInit(); |
| | | sidePanel1.SuspendLayout(); |
| | | SuspendLayout(); |
| | | // |
| | | // ribbon |
| | | // |
| | | ribbon.ExpandCollapseItem.Id = 0; |
| | | ribbon.ItemPanelStyle = DevExpress.XtraBars.Ribbon.RibbonItemPanelStyle.Classic; |
| | | ribbon.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbon.ExpandCollapseItem, barInfo }); |
| | | ribbon.Location = new Point(0, 0); |
| | | ribbon.MaxItemId = 4; |
| | | ribbon.Name = "ribbon"; |
| | | ribbon.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonControlStyle.TabletOffice; |
| | | ribbon.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False; |
| | | ribbon.ShowDisplayOptionsMenuButton = 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(1490, 48); |
| | | ribbon.StatusBar = ribbonStatusBar; |
| | | ribbon.Toolbar.ShowCustomizeItem = false; |
| | | // |
| | | // sidePanel1 |
| | | // |
| | | sidePanel1.Controls.Add(pumpParallelInfoCtrl1); |
| | | sidePanel1.Dock = DockStyle.Right; |
| | | sidePanel1.Location = new Point(790, 48); |
| | | sidePanel1.Name = "sidePanel1"; |
| | | sidePanel1.Size = new Size(700, 1005); |
| | | sidePanel1.TabIndex = 1; |
| | | sidePanel1.Text = "sidePanel1"; |
| | | // |
| | | // pumpParallelInfoCtrl1 |
| | | // |
| | | pumpParallelInfoCtrl1.Dock = DockStyle.Fill; |
| | | pumpParallelInfoCtrl1.Location = new Point(1, 0); |
| | | pumpParallelInfoCtrl1.Name = "pumpParallelInfoCtrl1"; |
| | | pumpParallelInfoCtrl1.Size = new Size(699, 1005); |
| | | pumpParallelInfoCtrl1.TabIndex = 7; |
| | | // |
| | | // pumpSerialParallelChart |
| | | // |
| | | pumpSerialParallelChart.Dock = DockStyle.Fill; |
| | | pumpSerialParallelChart.LineNameVisible = true; |
| | | pumpSerialParallelChart.LineVisible = false; |
| | | pumpSerialParallelChart.Location = new Point(0, 48); |
| | | pumpSerialParallelChart.Name = "pumpSerialParallelChart"; |
| | | pumpSerialParallelChart.Size = new Size(790, 1005); |
| | | pumpSerialParallelChart.TabIndex = 7; |
| | | // |
| | | // ribbonStatusBar |
| | | // |
| | | ribbonStatusBar.ItemLinks.Add(barInfo); |
| | | ribbonStatusBar.Location = new Point(0, 1053); |
| | | ribbonStatusBar.Name = "ribbonStatusBar"; |
| | | ribbonStatusBar.Ribbon = ribbon; |
| | | ribbonStatusBar.Size = new Size(1490, 36); |
| | | // |
| | | // barInfo |
| | | // |
| | | barInfo.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right; |
| | | barInfo.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True; |
| | | barInfo.Id = 3; |
| | | barInfo.Name = "barInfo"; |
| | | // |
| | | // PumpParallelAnalyDlg |
| | | // |
| | | AutoScaleDimensions = new SizeF(10F, 22F); |
| | | AutoScaleMode = AutoScaleMode.Font; |
| | | ClientSize = new Size(1490, 1089); |
| | | Controls.Add(pumpSerialParallelChart); |
| | | Controls.Add(sidePanel1); |
| | | Controls.Add(ribbonStatusBar); |
| | | Controls.Add(ribbon); |
| | | Name = "PumpParallelAnalyDlg"; |
| | | Ribbon = ribbon; |
| | | StartPosition = FormStartPosition.CenterScreen; |
| | | StatusBar = ribbonStatusBar; |
| | | Text = "å¹¶èåæ"; |
| | | ((System.ComponentModel.ISupportInitialize)ribbon).EndInit(); |
| | | sidePanel1.ResumeLayout(false); |
| | | ResumeLayout(false); |
| | | PerformLayout(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private DevExpress.XtraBars.Ribbon.RibbonControl ribbon; |
| | | private SidePanel sidePanel1; |
| | | private Yw.WinFrmUI.Phart.PumpParallelInfoCtrl pumpParallelInfoCtrl1; |
| | | private Yw.WinFrmUI.Phart.PumpSerialParallelChart pumpSerialParallelChart; |
| | | private DevExpress.XtraBars.Ribbon.RibbonStatusBar ribbonStatusBar; |
| | | private DevExpress.XtraBars.BarStaticItem barInfo; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Data; |
| | | using Yw.Geometry; |
| | | |
| | | namespace HStation.WinFrmUI.PhartRelation |
| | | { |
| | | public partial class PumpParallelAnalyDlg : DevExpress.XtraBars.Ribbon.RibbonForm |
| | | { |
| | | public PumpParallelAnalyDlg() |
| | | { |
| | | InitializeComponent(); |
| | | 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); |
| | | }; |
| | | |
| | | 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.ResetEvent += () => |
| | | { |
| | | var list = this.pumpParallelInfoCtrl1.GetRunList(); |
| | | SetParallel(list); |
| | | }; |
| | | 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); |
| | | } |
| | | } |
| | | var bol = this.ReloadDataEvent?.Invoke(list); |
| | | if (bol.HasValue && bol.Value) |
| | | { |
| | | this.Close(); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | private string _parallel_id = "parallel"; |
| | | public event Func<List<XhsSingleResultViewModel>, 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) |
| | | { |
| | | var msg = "å¹¶èæå"; |
| | | this.pumpSerialParallelChart.Delete(); |
| | | if (list == null || !list.Any()) |
| | | { |
| | | msg = "æ æ°æ®"; |
| | | return msg; |
| | | } |
| | | else |
| | | { |
| | | if (list.Count < 2) |
| | | { |
| | | msg = "å¹¶è失败"; |
| | | } |
| | | else |
| | | { |
| | | var vm_parallel = CalcParallel(list); |
| | | if (vm_parallel != null) |
| | | { |
| | | list.Add(vm_parallel); |
| | | } |
| | | else |
| | | { |
| | | msg = "å¹¶è失败"; |
| | | } |
| | | } |
| | | } |
| | | Set(list); |
| | | this.barInfo.Caption = $"<b><color=red>{msg}</color></b>"; |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | 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 Set(List<Yw.WinFrmUI.Phart.PumpSerialParallelInfoViewModel> list) |
| | | { |
| | | if (list == null || !list.Any()) |
| | | { |
| | | this.pumpSerialParallelChart.InitialChartData(); |
| | | return; |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | #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 |
| | | |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
| | |
| | | var item = pump_main_list[i]; |
| | | var vm = new PumpSingleMatchingViewModel(item); |
| | | _pump_mian_vm_list.Add(vm); |
| | | if (vm.ID.ToString()==pump_matching_vm.DbId.ToString()) |
| | | if (vm.ID.ToString() == pump_matching_vm.DbId.ToString()) |
| | | { |
| | | sel_index = i; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | this.gridControlPumpMain.RefreshDataSource(); |
| | | this.gridViewPumpMain.BestFitColumns(); |
| | | |
| | | this.gridViewPumpMain.FocusedRowHandle = sel_index; |
| | | this.gridViewPumpMain.FocusedRowHandle = sel_index; |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | var dlg = new PumpParallelChartDlg(); |
| | | var dlg = new PumpParallelAnalyDlg(); |
| | | dlg.SetBindingData(vmList); |
| | | dlg.ReloadDataEvent += (list) => |
| | | { |
| | |
| | | //设置å¾è¡¨æ°æ® |
| | | private async void SetChart(PumpMatchingViewModel pump_math) |
| | | { |
| | | var db_id = pump_math.DbId; |
| | | var db_pump_mian_id = pump_math.DbId; |
| | | var db_curve_id = pump_math.CurveDbId; |
| | | if (pump_math.MatchingDbId != null) |
| | | { |
| | | db_id = pump_math.MatchingDbId; |
| | | db_pump_mian_id = pump_math.MatchingDbId; |
| | | db_curve_id = pump_math.MatchingCurveDbId; |
| | | } |
| | | if (!long.TryParse(db_id, out long pump_main_id)) |
| | | if (!long.TryParse(db_pump_mian_id, out long pump_main_id)) |
| | | { |
| | | return; |
| | | } |
| | | if (!long.TryParse(db_curve_id, out long curve_id)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var phart_list = await new BLL.XhsPumpMainPhartMappingExtensions().GetByPumpMainID(pump_main_id); |
| | | if (phart_list == null || !phart_list.Any()) |
| | | var phart = await new BLL.XhsPumpMainPhartMappingExtensions().GetByID(curve_id); |
| | | if (phart == null) |
| | | { |
| | | return; |
| | | } |
| | | var phart = phart_list.OrderBy(x => x.Importance).First(); |
| | | var diagram = phart.Diagram; |
| | | if (diagram == null) |
| | | { |
| | |
| | | private List<Yw.Geometry.Point2d> _def_qe_pt_list; |
| | | private List<Yw.Geometry.Point2d> _def_qp_pt_list; |
| | | |
| | | |
| | | private PumpGroupPt _design_pt = new(0, 0, 0, 0, 0); |
| | | |
| | | private PumpGroupPt _work_point = new(0, 0, 0, 0, 0); |
| | | |
| | | |
| | |
| | | _series_qp.SetCurveQPDisplay(); |
| | | |
| | | _series_cubic_spline_eq = this.chartControl1.GetSeriesByName("SeriesEquipCurve"); |
| | | ((SplineSeriesView)_series_cubic_spline_eq.View).LineTensionPercent = 40; |
| | | |
| | | _series_qh_pt = this.chartControl1.GetSeriesByName("SeriesPointQH"); |
| | | _series_qh_pt.SetPointQHDisplay(); |
| | |
| | | |
| | | _series_qh_pt.Visible = false; |
| | | _series_qe_pt.Visible = false; |
| | | _series_qp_pt.Visible = false; |
| | | _series_qp_pt.Visible = false; |
| | | |
| | | |
| | | this.chartControl1.ObjectHotTracked += new DevExpress.XtraCharts.HotTrackEventHandler(this.chartControl1_ObjectHotTracked); |
| | |
| | | _def_qp_pt_list = null; |
| | | |
| | | _coordinate_paras = null; |
| | | _work_point = new PumpGroupPt(0, 0, 0, 0, 0); |
| | | _design_pt = new PumpGroupPt(0, 0, 0, 0, 0); |
| | | _work_point = new PumpGroupPt(0, 0, 0, 0, 0); |
| | | |
| | | UpdateChart(false); |
| | | } |
| | |
| | | if (design_pt_q < minQ || design_pt_q > maxQ) |
| | | return; |
| | | |
| | | double design_flow = 0, design_head = 0; |
| | | |
| | | _design_pt.Q = design_pt_q.Value; |
| | | design_flow = design_pt_q.Value; |
| | | if (design_pt_h.HasValue) |
| | | { |
| | | _design_pt.H = design_pt_h.Value; |
| | | design_head = design_pt_h.Value; |
| | | } |
| | | else |
| | | { |
| | | _design_pt.H = _qh.GetPointY(_design_pt.Q); |
| | | design_head = _qh.GetPointY(design_flow); |
| | | } |
| | | |
| | | |
| | | _series_cubic_spline_eq.Visible = _eq_visible; |
| | | var design_pt = new Yw.Geometry.Point2d(_design_pt.Q, _design_pt.H); |
| | | var design_pt = new Yw.Geometry.Point2d(design_flow, design_head); |
| | | var eq_paras = EquipCurveHelper.CalcEquipCurve(_qh, design_pt, out Yw.Geometry.Point2d sect_pt); |
| | | if (eq_paras != null && eq_paras.EquipCurve != null) |
| | | { |
| | |
| | | _series_cubic_spline_eq.Points.Add(series_pt); |
| | | } |
| | | } |
| | | if (sect_pt == null) |
| | | return; |
| | | |
| | | double flow = 0, head = 0, eff = 0, power = 0; |
| | | flow = Math.Round(sect_pt.X,1); |
| | | head = Math.Round(sect_pt.Y, 2); ; |
| | | |
| | | var design_qh_pt = CreatePointSeries(Pump.eCurveType.QH, sect_pt.X, sect_pt.Y); |
| | | var design_qh_pt = CreatePointSeries(Pump.eCurveType.QH, flow, head); |
| | | _series_eq_pt_list.Add(design_qh_pt); |
| | | this.chartControl1.Series.Add(design_qh_pt); |
| | | if (_qe != null) |
| | | { |
| | | _design_pt.E = _qe.GetPointY(_design_pt.Q); |
| | | var design_qe_pt = CreatePointSeries(Pump.eCurveType.QE, _design_pt.Q, _design_pt.E); |
| | | eff = _qe.GetPointY(sect_pt.X); |
| | | var design_qe_pt = CreatePointSeries(Pump.eCurveType.QE, flow, eff); |
| | | _series_eq_pt_list.Add(design_qe_pt); |
| | | this.chartControl1.Series.Add(design_qe_pt); |
| | | |
| | |
| | | |
| | | if (_qp != null) |
| | | { |
| | | _design_pt.P = _qp.GetPointY(_design_pt.Q); |
| | | var design_qp_pt = CreatePointSeries(Pump.eCurveType.QP, _design_pt.Q, _design_pt.P); |
| | | power = _qp.GetPointY(sect_pt.X); |
| | | var design_qp_pt = CreatePointSeries(Pump.eCurveType.QP, flow, power); |
| | | _series_eq_pt_list.Add(design_qp_pt); |
| | | this.chartControl1.Series.Add(design_qp_pt); |
| | | } |