From 04ef5d66b53eff9175c2cb6dafda8b65872b9f52 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期三, 15 一月 2025 22:52:27 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.resx | 134 +++ WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.Designer.cs | 292 ++++++++ WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.cs | 155 ++++ WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.resx | 134 +++ WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/SetEffDlg.cs | 2 WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.cs | 234 +++++- WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/HStation.WinFrmUI.PhartRelation.Core.csproj | 9 WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/actions_deletecircled.svg | 15 WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/charttype_scatterline.svg | 18 WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.cs | 31 WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.Designer.cs | 188 +++- WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.resx | 12 WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.cs | 96 ++ WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.Designer.cs | 40 + WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.cs | 99 ++ WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/createstackedlinechart.svg | 11 WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.Designer.cs | 14 WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.Designer.cs | 225 ++++++ WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.Designer.cs | 237 ++++++ WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.resx | 134 +++ WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/actions_deletecircled1.svg | 15 WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChartViewModel.cs | 12 22 files changed, 1,999 insertions(+), 108 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.Designer.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.Designer.cs new file mode 100644 index 0000000..6c12dc6 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.Designer.cs @@ -0,0 +1,225 @@ +锘縩amespace HStation.WinFrmUI +{ + partial class DeleteEqualEDlg + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions2 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeleteEqualEDlg)); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject5 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject7 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject8 = new DevExpress.Utils.SerializableAppearanceObject(); + layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); + gridControl2 = new DevExpress.XtraGrid.GridControl(); + gridView2 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colEff = new DevExpress.XtraGrid.Columns.GridColumn(); + colDelete = new DevExpress.XtraGrid.Columns.GridColumn(); + repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); + generalOkAndCancelCtrl1 = new GeneralOkAndCancelCtrl(); + Root = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + dxErrorProvider1 = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(components); + ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit(); + layoutControl1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)gridControl2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)gridView2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)repositoryItemButtonEdit1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)Root).BeginInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem4).BeginInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)dxErrorProvider1).BeginInit(); + SuspendLayout(); + // + // layoutControl1 + // + layoutControl1.Controls.Add(gridControl2); + layoutControl1.Controls.Add(generalOkAndCancelCtrl1); + layoutControl1.Dock = DockStyle.Fill; + layoutControl1.Location = new Point(0, 0); + layoutControl1.Margin = new Padding(4, 5, 4, 5); + layoutControl1.Name = "layoutControl1"; + layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(960, 251, 975, 600); + layoutControl1.Root = Root; + layoutControl1.Size = new Size(424, 555); + layoutControl1.TabIndex = 0; + layoutControl1.Text = "layoutControl1"; + // + // gridControl2 + // + gridControl2.EmbeddedNavigator.Margin = new Padding(4, 5, 4, 5); + gridControl2.Location = new Point(12, 12); + gridControl2.MainView = gridView2; + gridControl2.Margin = new Padding(4, 5, 4, 5); + gridControl2.Name = "gridControl2"; + gridControl2.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repositoryItemButtonEdit1 }); + gridControl2.Size = new Size(400, 485); + gridControl2.TabIndex = 7; + gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView2 }); + // + // gridView2 + // + gridView2.Appearance.HeaderPanel.Options.UseTextOptions = true; + gridView2.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + gridView2.Appearance.Row.Options.UseTextOptions = true; + gridView2.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + gridView2.Appearance.ViewCaption.Options.UseTextOptions = true; + gridView2.Appearance.ViewCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; + gridView2.ColumnPanelRowHeight = 31; + gridView2.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colEff, colDelete }); + gridView2.DetailHeight = 550; + gridView2.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; + gridView2.GridControl = gridControl2; + gridView2.Name = "gridView2"; + gridView2.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True; + gridView2.OptionsCustomization.AllowFilter = false; + gridView2.OptionsCustomization.AllowQuickHideColumns = false; + gridView2.OptionsCustomization.AllowSort = false; + gridView2.OptionsMenu.EnableColumnMenu = false; + gridView2.OptionsView.EnableAppearanceEvenRow = true; + gridView2.OptionsView.EnableAppearanceOddRow = true; + gridView2.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom; + gridView2.OptionsView.ShowGroupPanel = false; + gridView2.OptionsView.ShowIndicator = false; + gridView2.RowHeight = 30; + gridView2.ViewCaptionHeight = 47; + gridView2.RowCellClick += gridView2_RowCellClick; + // + // colEff + // + colEff.Caption = "鏁堢巼"; + colEff.FieldName = "Eff"; + colEff.MinWidth = 29; + colEff.Name = "colEff"; + colEff.Visible = true; + colEff.VisibleIndex = 0; + colEff.Width = 291; + // + // colDelete + // + colDelete.Caption = "鍒犻櫎"; + colDelete.ColumnEdit = repositoryItemButtonEdit1; + colDelete.MaxWidth = 86; + colDelete.MinWidth = 86; + colDelete.Name = "colDelete"; + colDelete.OptionsColumn.AllowEdit = false; + colDelete.Visible = true; + colDelete.VisibleIndex = 1; + colDelete.Width = 86; + // + // repositoryItemButtonEdit1 + // + repositoryItemButtonEdit1.AutoHeight = false; + editorButtonImageOptions2.Image = (Image)resources.GetObject("editorButtonImageOptions2.Image"); + repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default) }); + repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; + repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; + // + // generalOkAndCancelCtrl1 + // + generalOkAndCancelCtrl1.ButtonCancelMaxSize = new Size(204, 64); + generalOkAndCancelCtrl1.ButtonCancelMinSize = new Size(143, 42); + generalOkAndCancelCtrl1.ButtonOkMaxSize = new Size(204, 64); + generalOkAndCancelCtrl1.ButtonOkMinSize = new Size(143, 42); + generalOkAndCancelCtrl1.Location = new Point(12, 501); + generalOkAndCancelCtrl1.Margin = new Padding(6, 8, 6, 8); + generalOkAndCancelCtrl1.Name = "generalOkAndCancelCtrl1"; + generalOkAndCancelCtrl1.Size = new Size(400, 42); + generalOkAndCancelCtrl1.TabIndex = 5; + // + // Root + // + Root.AppearanceItemCaption.Options.UseTextOptions = true; + Root.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; + Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; + Root.GroupBordersVisible = false; + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem4, layoutControlItem2 }); + Root.Name = "Root"; + Root.Size = new Size(424, 555); + Root.TextVisible = false; + // + // layoutControlItem4 + // + layoutControlItem4.Control = generalOkAndCancelCtrl1; + layoutControlItem4.Location = new Point(0, 489); + layoutControlItem4.Name = "layoutControlItem4"; + layoutControlItem4.Size = new Size(404, 46); + layoutControlItem4.TextSize = new Size(0, 0); + layoutControlItem4.TextVisible = false; + // + // layoutControlItem2 + // + layoutControlItem2.Control = gridControl2; + layoutControlItem2.Location = new Point(0, 0); + layoutControlItem2.Name = "layoutControlItem2"; + layoutControlItem2.Size = new Size(404, 489); + layoutControlItem2.TextSize = new Size(0, 0); + layoutControlItem2.TextVisible = false; + // + // dxErrorProvider1 + // + dxErrorProvider1.ContainerControl = this; + // + // DeleteEqualEDlg + // + AutoScaleDimensions = new SizeF(10F, 22F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(424, 555); + Controls.Add(layoutControl1); + Margin = new Padding(4, 5, 4, 5); + Name = "DeleteEqualEDlg"; + StartPosition = FormStartPosition.CenterParent; + Text = "鍒犻櫎"; + ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit(); + layoutControl1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)gridControl2).EndInit(); + ((System.ComponentModel.ISupportInitialize)gridView2).EndInit(); + ((System.ComponentModel.ISupportInitialize)repositoryItemButtonEdit1).EndInit(); + ((System.ComponentModel.ISupportInitialize)Root).EndInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem4).EndInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem2).EndInit(); + ((System.ComponentModel.ISupportInitialize)dxErrorProvider1).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraLayout.LayoutControl layoutControl1; + private GeneralOkAndCancelCtrl generalOkAndCancelCtrl1; + private DevExpress.XtraLayout.LayoutControlGroup Root; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4; + private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider1; + private DevExpress.XtraGrid.GridControl gridControl2; + private DevExpress.XtraGrid.Views.Grid.GridView gridView2; + private DevExpress.XtraGrid.Columns.GridColumn colEff; + private DevExpress.XtraGrid.Columns.GridColumn colDelete; + private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; + } +} \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.cs new file mode 100644 index 0000000..47293ae --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.cs @@ -0,0 +1,96 @@ +锘縩amespace HStation.WinFrmUI +{ + public partial class DeleteEqualEDlg : DevExpress.XtraEditors.XtraForm + { + public DeleteEqualEDlg() + { + InitializeComponent(); + this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; + this.layoutControl1.SetupLayoutControl(); + this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; + this.gridView2.SetNormalView(); + } + + /// <summary> + /// + /// </summary> + public event Func< List<double> , bool> ReloadDataEvent; + + private class CurrentViewModel + { + public double Eff { get; set; } + } + + private List<CurrentViewModel> _eff_list = null; + private List< double > _delete_id_list = null; + + /// <summary> + /// + /// </summary> + public void SetBindingData(List<double> list) + { + _eff_list = new List<CurrentViewModel>(); + _delete_id_list = new(); + if (list == null || !list.Any()) + return; + _eff_list = list.OrderByDescending(x => x).Select(x => new CurrentViewModel() + { + Eff = x + }).ToList(); + + this.gridControl2.DataSource = _eff_list; + this.gridControl2.RefreshDataSource(); + } + + //鍒犻櫎 + private void gridView2_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) + { + if (_eff_list == null || _eff_list.Count < 1) + return; + if (e.Column == this.colDelete) + { + var item = _eff_list.ElementAt(e.RowHandle); + _delete_id_list.Add(item.Eff); + _eff_list.RemoveAt(e.RowHandle); + this.gridControl2.RefreshDataSource(); + } + + } + + //楠岃瘉 + private bool Valid() + { + this.dxErrorProvider1.ClearErrors(); + + return true; + } + + //纭畾 + private void GeneralOkAndCancelCtrl1_OkEvent() + { + if (_delete_id_list == null || !_delete_id_list.Any()) + { + return; + } + + if (!Valid()) + { + return; + } + + if (this.ReloadDataEvent == null) + return; + + var bol = this.ReloadDataEvent.Invoke(_delete_id_list); + if (!bol) + { + return; + } + + this.DialogResult = DialogResult.OK; + this.Close(); + + } + + } +} \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.resx b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.resx new file mode 100644 index 0000000..ef8ad07 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteEqualEDlg.resx @@ -0,0 +1,134 @@ +锘�<?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="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="editorButtonImageOptions2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAApdEVYdFRpdGxlAFJlbW92ZTtEZWxldGU7QmFycztS + aWJib247U3RhbmRhcmQ7Y1ZIMAAAAKdJREFUOE+Nk0sKwlAMRbu4QEe6iWxA/CBUrNvMShRHTy68wGua + j4MLIbnn0A7e1FqbhOkgTAvmfyJMDzCYFf4KUxOmpy3bCNOrd8Ecsbj1hSaUDLDmrId7JXHgK/ZjIZRE + 8EYQSNYM3gkCSQi7gkSygzOB/WxktT1XEMChpIIvzu9sJCk83EJJCVcSHPAwUjiRLFjOwvSuYEfyAatL + SE62HKU/wBnzD9JAnMxlnre0AAAAAElFTkSuQmCC +</value> + </data> + <metadata name="dxErrorProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.Designer.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.Designer.cs new file mode 100644 index 0000000..7e4c90a --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.Designer.cs @@ -0,0 +1,237 @@ +锘縩amespace HStation.WinFrmUI +{ + partial class DeleteVariableSpeedDlg + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions2 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeleteVariableSpeedDlg)); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject5 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject7 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject8 = new DevExpress.Utils.SerializableAppearanceObject(); + layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); + gridControl2 = new DevExpress.XtraGrid.GridControl(); + gridView2 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colHz = new DevExpress.XtraGrid.Columns.GridColumn(); + colN = new DevExpress.XtraGrid.Columns.GridColumn(); + colDelete = new DevExpress.XtraGrid.Columns.GridColumn(); + repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); + generalOkAndCancelCtrl1 = new GeneralOkAndCancelCtrl(); + Root = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + dxErrorProvider1 = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(components); + ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit(); + layoutControl1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)gridControl2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)gridView2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)repositoryItemButtonEdit1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)Root).BeginInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem4).BeginInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)dxErrorProvider1).BeginInit(); + SuspendLayout(); + // + // layoutControl1 + // + layoutControl1.Controls.Add(gridControl2); + layoutControl1.Controls.Add(generalOkAndCancelCtrl1); + layoutControl1.Dock = DockStyle.Fill; + layoutControl1.Location = new Point(0, 0); + layoutControl1.Margin = new Padding(4, 5, 4, 5); + layoutControl1.Name = "layoutControl1"; + layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(960, 251, 975, 600); + layoutControl1.Root = Root; + layoutControl1.Size = new Size(424, 555); + layoutControl1.TabIndex = 0; + layoutControl1.Text = "layoutControl1"; + // + // gridControl2 + // + gridControl2.EmbeddedNavigator.Margin = new Padding(4, 5, 4, 5); + gridControl2.Location = new Point(12, 12); + gridControl2.MainView = gridView2; + gridControl2.Margin = new Padding(4, 5, 4, 5); + gridControl2.Name = "gridControl2"; + gridControl2.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repositoryItemButtonEdit1 }); + gridControl2.Size = new Size(400, 485); + gridControl2.TabIndex = 7; + gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView2 }); + // + // gridView2 + // + gridView2.Appearance.HeaderPanel.Options.UseTextOptions = true; + gridView2.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + gridView2.Appearance.Row.Options.UseTextOptions = true; + gridView2.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + gridView2.Appearance.ViewCaption.Options.UseTextOptions = true; + gridView2.Appearance.ViewCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; + gridView2.ColumnPanelRowHeight = 31; + gridView2.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colHz, colN, colDelete }); + gridView2.DetailHeight = 550; + gridView2.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; + gridView2.GridControl = gridControl2; + gridView2.Name = "gridView2"; + gridView2.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True; + gridView2.OptionsCustomization.AllowFilter = false; + gridView2.OptionsCustomization.AllowQuickHideColumns = false; + gridView2.OptionsCustomization.AllowSort = false; + gridView2.OptionsMenu.EnableColumnMenu = false; + gridView2.OptionsView.EnableAppearanceEvenRow = true; + gridView2.OptionsView.EnableAppearanceOddRow = true; + gridView2.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom; + gridView2.OptionsView.ShowGroupPanel = false; + gridView2.OptionsView.ShowIndicator = false; + gridView2.RowHeight = 30; + gridView2.ViewCaptionHeight = 47; + gridView2.RowCellClick += gridView2_RowCellClick; + // + // colHz + // + colHz.Caption = "棰戠巼"; + colHz.FieldName = "Hz"; + colHz.MinWidth = 29; + colHz.Name = "colHz"; + colHz.Visible = true; + colHz.VisibleIndex = 0; + colHz.Width = 697; + // + // colN + // + colN.Caption = "杞��"; + colN.FieldName = "N"; + colN.MinWidth = 30; + colN.Name = "colN"; + colN.Visible = true; + colN.VisibleIndex = 1; + colN.Width = 1078; + // + // colDelete + // + colDelete.Caption = "鍒犻櫎"; + colDelete.ColumnEdit = repositoryItemButtonEdit1; + colDelete.MaxWidth = 86; + colDelete.MinWidth = 86; + colDelete.Name = "colDelete"; + colDelete.OptionsColumn.AllowEdit = false; + colDelete.Visible = true; + colDelete.VisibleIndex = 2; + colDelete.Width = 86; + // + // repositoryItemButtonEdit1 + // + repositoryItemButtonEdit1.AutoHeight = false; + editorButtonImageOptions2.Image = (Image)resources.GetObject("editorButtonImageOptions2.Image"); + repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default) }); + repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; + repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; + // + // generalOkAndCancelCtrl1 + // + generalOkAndCancelCtrl1.ButtonCancelMaxSize = new Size(204, 64); + generalOkAndCancelCtrl1.ButtonCancelMinSize = new Size(143, 42); + generalOkAndCancelCtrl1.ButtonOkMaxSize = new Size(204, 64); + generalOkAndCancelCtrl1.ButtonOkMinSize = new Size(143, 42); + generalOkAndCancelCtrl1.Location = new Point(12, 501); + generalOkAndCancelCtrl1.Margin = new Padding(6, 8, 6, 8); + generalOkAndCancelCtrl1.Name = "generalOkAndCancelCtrl1"; + generalOkAndCancelCtrl1.Size = new Size(400, 42); + generalOkAndCancelCtrl1.TabIndex = 5; + // + // Root + // + Root.AppearanceItemCaption.Options.UseTextOptions = true; + Root.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; + Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; + Root.GroupBordersVisible = false; + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem4, layoutControlItem2 }); + Root.Name = "Root"; + Root.Size = new Size(424, 555); + Root.TextVisible = false; + // + // layoutControlItem4 + // + layoutControlItem4.Control = generalOkAndCancelCtrl1; + layoutControlItem4.Location = new Point(0, 489); + layoutControlItem4.Name = "layoutControlItem4"; + layoutControlItem4.Size = new Size(404, 46); + layoutControlItem4.TextSize = new Size(0, 0); + layoutControlItem4.TextVisible = false; + // + // layoutControlItem2 + // + layoutControlItem2.Control = gridControl2; + layoutControlItem2.Location = new Point(0, 0); + layoutControlItem2.Name = "layoutControlItem2"; + layoutControlItem2.Size = new Size(404, 489); + layoutControlItem2.TextSize = new Size(0, 0); + layoutControlItem2.TextVisible = false; + // + // dxErrorProvider1 + // + dxErrorProvider1.ContainerControl = this; + // + // DeleteVariableSpeedDlg + // + AutoScaleDimensions = new SizeF(10F, 22F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(424, 555); + Controls.Add(layoutControl1); + Margin = new Padding(4, 5, 4, 5); + Name = "DeleteVariableSpeedDlg"; + StartPosition = FormStartPosition.CenterParent; + Text = "鍒犻櫎"; + ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit(); + layoutControl1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)gridControl2).EndInit(); + ((System.ComponentModel.ISupportInitialize)gridView2).EndInit(); + ((System.ComponentModel.ISupportInitialize)repositoryItemButtonEdit1).EndInit(); + ((System.ComponentModel.ISupportInitialize)Root).EndInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem4).EndInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem2).EndInit(); + ((System.ComponentModel.ISupportInitialize)dxErrorProvider1).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraLayout.LayoutControl layoutControl1; + private GeneralOkAndCancelCtrl generalOkAndCancelCtrl1; + private DevExpress.XtraLayout.LayoutControlGroup Root; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4; + private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider1; + private DevExpress.XtraGrid.GridControl gridControl2; + private DevExpress.XtraGrid.Views.Grid.GridView gridView2; + private DevExpress.XtraGrid.Columns.GridColumn colHz; + private DevExpress.XtraGrid.Columns.GridColumn colDelete; + private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; + private DevExpress.XtraGrid.Columns.GridColumn colN; + } +} \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.cs new file mode 100644 index 0000000..ef968db --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.cs @@ -0,0 +1,99 @@ +锘縩amespace HStation.WinFrmUI +{ + public partial class DeleteVariableSpeedDlg : DevExpress.XtraEditors.XtraForm + { + public DeleteVariableSpeedDlg() + { + InitializeComponent(); + this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; + this.layoutControl1.SetupLayoutControl(); + this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; + this.gridView2.SetNormalView(); + } + + /// <summary> + /// + /// </summary> + public event Func<List<double>, bool> ReloadDataEvent; + + private class CurrentViewModel + { + public double Hz { get; set; } + public double N { get; set; } + } + + private List<CurrentViewModel> _hz_list = null; + private List<double> _delete_id_list = null; + + /// <summary> + /// + /// </summary> + public void SetBindingData(List<(double Hz, double N)> list) + { + _hz_list = new List<CurrentViewModel>(); ; + _delete_id_list = new(); + if (list == null || !list.Any()) + return; + list = list.DistinctBy(x => x.Hz).ToList(); + _hz_list = list.OrderByDescending(x => x.Hz).Select(x => new CurrentViewModel() + { + Hz = x.Hz, + N = x.N, + }).ToList(); + + this.gridControl2.DataSource = _hz_list; + this.gridControl2.RefreshDataSource(); + } + + //鍒犻櫎 + private void gridView2_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) + { + if (_hz_list == null || _hz_list.Count < 1) + return; + if (e.Column == this.colDelete) + { + var item = _hz_list.ElementAt(e.RowHandle); + _delete_id_list.Add(item.Hz); + _hz_list.RemoveAt(e.RowHandle); + this.gridControl2.RefreshDataSource(); + } + + } + + //楠岃瘉 + private bool Valid() + { + this.dxErrorProvider1.ClearErrors(); + + return true; + } + + //纭畾 + private void GeneralOkAndCancelCtrl1_OkEvent() + { + if (_delete_id_list == null || !_delete_id_list.Any()) + { + return; + } + + if (!Valid()) + { + return; + } + + if (this.ReloadDataEvent == null) + return; + + var bol = this.ReloadDataEvent.Invoke(_delete_id_list); + if (!bol) + { + return; + } + + this.DialogResult = DialogResult.OK; + this.Close(); + + } + + } +} \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.resx b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.resx new file mode 100644 index 0000000..ef8ad07 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/DeleteVariableSpeedDlg.resx @@ -0,0 +1,134 @@ +锘�<?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="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="editorButtonImageOptions2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAApdEVYdFRpdGxlAFJlbW92ZTtEZWxldGU7QmFycztS + aWJib247U3RhbmRhcmQ7Y1ZIMAAAAKdJREFUOE+Nk0sKwlAMRbu4QEe6iWxA/CBUrNvMShRHTy68wGua + j4MLIbnn0A7e1FqbhOkgTAvmfyJMDzCYFf4KUxOmpy3bCNOrd8Ecsbj1hSaUDLDmrId7JXHgK/ZjIZRE + 8EYQSNYM3gkCSQi7gkSygzOB/WxktT1XEMChpIIvzu9sJCk83EJJCVcSHPAwUjiRLFjOwvSuYEfyAatL + SE62HKU/wBnzD9JAnMxlnre0AAAAAElFTkSuQmCC +</value> + </data> + <metadata name="dxErrorProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.Designer.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.Designer.cs index 858db00..af7c639 100644 --- a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.Designer.cs +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.Designer.cs @@ -32,15 +32,17 @@ pumpViewChart1 = new Yw.WinFrmUI.Phart.PumpViewChart(); barManager1 = new DevExpress.XtraBars.BarManager(components); bar1 = new DevExpress.XtraBars.Bar(); + barCekSplitPanel = new DevExpress.XtraBars.BarCheckItem(); + barCekEffVisible = new DevExpress.XtraBars.BarCheckItem(); + barCekEqulEffVisible = new DevExpress.XtraBars.BarCheckItem(); barBtnAddVariableSpeedMenu = new DevExpress.XtraBars.BarSubItem(); barBtnAddVariableSpeedByN = new DevExpress.XtraBars.BarButtonItem(); barBtnAddVariableSpeedByHz = new DevExpress.XtraBars.BarButtonItem(); barBtnAddVariableSpeedByPoint = new DevExpress.XtraBars.BarButtonItem(); + barBtnDeleteVariableSpeed = new DevExpress.XtraBars.BarButtonItem(); barBtnAddEqualEffMenu = new DevExpress.XtraBars.BarSubItem(); barBtnAddEqualEffByEff = new DevExpress.XtraBars.BarButtonItem(); - barCekSplitPanel = new DevExpress.XtraBars.BarCheckItem(); - barCekEffVisible = new DevExpress.XtraBars.BarCheckItem(); - barCekPowerVisible = new DevExpress.XtraBars.BarCheckItem(); + barBtnDeleteEqualEff = new DevExpress.XtraBars.BarButtonItem(); barTxtPipeQ = new DevExpress.XtraBars.BarEditItem(); repTxtPipeQ = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit(); barTxtPipeHead = new DevExpress.XtraBars.BarEditItem(); @@ -48,26 +50,30 @@ barTxtStartHead = new DevExpress.XtraBars.BarEditItem(); repTxtStartHead = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit(); barBtnSetEqPt = new DevExpress.XtraBars.BarButtonItem(); - barCekEqulEffVisible = new DevExpress.XtraBars.BarCheckItem(); - barCekEqVisible = new DevExpress.XtraBars.BarCheckItem(); barBtnEqClear = new DevExpress.XtraBars.BarButtonItem(); + barImgCmbChartSel = new DevExpress.XtraBars.BarEditItem(); + repImgCmbCurveSel = new DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox(); barDockControlTop = new DevExpress.XtraBars.BarDockControl(); barDockControlBottom = new DevExpress.XtraBars.BarDockControl(); barDockControlLeft = new DevExpress.XtraBars.BarDockControl(); barDockControlRight = new DevExpress.XtraBars.BarDockControl(); + barCekPowerVisible = new DevExpress.XtraBars.BarCheckItem(); + barCekEqVisible = new DevExpress.XtraBars.BarCheckItem(); + barCekLineVisible = new DevExpress.XtraBars.BarCheckItem(); ((System.ComponentModel.ISupportInitialize)barManager1).BeginInit(); ((System.ComponentModel.ISupportInitialize)repTxtPipeQ).BeginInit(); ((System.ComponentModel.ISupportInitialize)repTxtPipeHead).BeginInit(); ((System.ComponentModel.ISupportInitialize)repTxtStartHead).BeginInit(); + ((System.ComponentModel.ISupportInitialize)repImgCmbCurveSel).BeginInit(); SuspendLayout(); // // pumpViewChart1 // pumpViewChart1.Dock = DockStyle.Fill; pumpViewChart1.LineVisible = false; - pumpViewChart1.Location = new Point(0, 34); + pumpViewChart1.Location = new Point(0, 68); pumpViewChart1.Name = "pumpViewChart1"; - pumpViewChart1.Size = new Size(1369, 890); + pumpViewChart1.Size = new Size(1369, 856); pumpViewChart1.SplitPanel = false; pumpViewChart1.TabIndex = 0; // @@ -79,9 +85,9 @@ barManager1.DockControls.Add(barDockControlLeft); barManager1.DockControls.Add(barDockControlRight); barManager1.Form = this; - barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { barCekSplitPanel, barCekEffVisible, barCekPowerVisible, barTxtStartHead, barTxtPipeQ, barTxtPipeHead, barBtnSetEqPt, barCekEqVisible, barCekEqulEffVisible, barBtnEqClear, barBtnAddVariableSpeedMenu, barBtnAddVariableSpeedByN, barBtnAddVariableSpeedByHz, barBtnAddVariableSpeedByPoint, barBtnAddEqualEffMenu, barBtnAddEqualEffByEff }); - barManager1.MaxItemId = 25; - barManager1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repTxtStartHead, repTxtPipeQ, repTxtPipeHead }); + barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { barCekSplitPanel, barCekEffVisible, barCekPowerVisible, barTxtStartHead, barTxtPipeQ, barTxtPipeHead, barBtnSetEqPt, barCekEqVisible, barCekEqulEffVisible, barBtnEqClear, barBtnAddVariableSpeedMenu, barBtnAddVariableSpeedByN, barBtnAddVariableSpeedByHz, barBtnAddVariableSpeedByPoint, barBtnAddEqualEffMenu, barBtnAddEqualEffByEff, barBtnDeleteVariableSpeed, barBtnDeleteEqualEff, barImgCmbChartSel, barCekLineVisible }); + barManager1.MaxItemId = 31; + barManager1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repTxtStartHead, repTxtPipeQ, repTxtPipeHead, repImgCmbCurveSel }); // // bar1 // @@ -89,19 +95,49 @@ bar1.DockCol = 0; bar1.DockRow = 0; bar1.DockStyle = DevExpress.XtraBars.BarDockStyle.Top; - bar1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(barBtnAddVariableSpeedMenu), new DevExpress.XtraBars.LinkPersistInfo(barBtnAddEqualEffMenu), new DevExpress.XtraBars.LinkPersistInfo(barCekSplitPanel), new DevExpress.XtraBars.LinkPersistInfo(barCekEffVisible), new DevExpress.XtraBars.LinkPersistInfo(barTxtPipeQ), new DevExpress.XtraBars.LinkPersistInfo(barTxtPipeHead), new DevExpress.XtraBars.LinkPersistInfo(barTxtStartHead), new DevExpress.XtraBars.LinkPersistInfo(barBtnSetEqPt), new DevExpress.XtraBars.LinkPersistInfo(barCekEqulEffVisible), new DevExpress.XtraBars.LinkPersistInfo(barBtnEqClear) }); + bar1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(barImgCmbChartSel), new DevExpress.XtraBars.LinkPersistInfo(barCekLineVisible), new DevExpress.XtraBars.LinkPersistInfo(barCekSplitPanel), new DevExpress.XtraBars.LinkPersistInfo(barCekEffVisible), new DevExpress.XtraBars.LinkPersistInfo(barCekEqulEffVisible), new DevExpress.XtraBars.LinkPersistInfo(barBtnAddVariableSpeedMenu), new DevExpress.XtraBars.LinkPersistInfo(barBtnAddEqualEffMenu), new DevExpress.XtraBars.LinkPersistInfo(barTxtPipeQ), new DevExpress.XtraBars.LinkPersistInfo(barTxtPipeHead), new DevExpress.XtraBars.LinkPersistInfo(barTxtStartHead), new DevExpress.XtraBars.LinkPersistInfo(barBtnSetEqPt), new DevExpress.XtraBars.LinkPersistInfo(barBtnEqClear) }); bar1.OptionsBar.AllowQuickCustomization = false; bar1.OptionsBar.DrawBorder = false; bar1.OptionsBar.MultiLine = true; bar1.OptionsBar.UseWholeRow = true; bar1.Text = "Tools"; // + // barCekSplitPanel + // + barCekSplitPanel.BindableChecked = true; + barCekSplitPanel.Caption = "鍒嗗壊鏉�"; + barCekSplitPanel.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; + barCekSplitPanel.Checked = true; + barCekSplitPanel.Id = 1; + barCekSplitPanel.Name = "barCekSplitPanel"; + barCekSplitPanel.CheckedChanged += barCekSplitPanel_CheckedChanged; + // + // barCekEffVisible + // + barCekEffVisible.BindableChecked = true; + barCekEffVisible.Caption = "鏁堢巼绾�"; + barCekEffVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; + barCekEffVisible.Checked = true; + barCekEffVisible.Id = 2; + barCekEffVisible.Name = "barCekEffVisible"; + barCekEffVisible.CheckedChanged += barCekEffVisible_CheckedChanged; + // + // barCekEqulEffVisible + // + barCekEqulEffVisible.BindableChecked = true; + barCekEqulEffVisible.Caption = "绛夋晥绾�"; + barCekEqulEffVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; + barCekEqulEffVisible.Checked = true; + barCekEqulEffVisible.Id = 11; + barCekEqulEffVisible.Name = "barCekEqulEffVisible"; + barCekEqulEffVisible.CheckedChanged += barCekEqulEffVisible_CheckedChanged; + // // barBtnAddVariableSpeedMenu // barBtnAddVariableSpeedMenu.Caption = "鍙橀�熸洸绾�"; barBtnAddVariableSpeedMenu.Id = 17; - barBtnAddVariableSpeedMenu.ImageOptions.SvgImage = PhartRelation.Core.Properties.Resources.actions_add; - barBtnAddVariableSpeedMenu.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(barBtnAddVariableSpeedByN), new DevExpress.XtraBars.LinkPersistInfo(barBtnAddVariableSpeedByHz), new DevExpress.XtraBars.LinkPersistInfo(barBtnAddVariableSpeedByPoint) }); + barBtnAddVariableSpeedMenu.ImageOptions.SvgImage = PhartRelation.Core.Properties.Resources.createstackedlinechart; + barBtnAddVariableSpeedMenu.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(barBtnAddVariableSpeedByN), new DevExpress.XtraBars.LinkPersistInfo(barBtnAddVariableSpeedByHz), new DevExpress.XtraBars.LinkPersistInfo(barBtnAddVariableSpeedByPoint), new DevExpress.XtraBars.LinkPersistInfo(barBtnDeleteVariableSpeed, true) }); barBtnAddVariableSpeedMenu.Name = "barBtnAddVariableSpeedMenu"; barBtnAddVariableSpeedMenu.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; // @@ -129,12 +165,20 @@ barBtnAddVariableSpeedByPoint.Name = "barBtnAddVariableSpeedByPoint"; barBtnAddVariableSpeedByPoint.ItemClick += barBtnAddVariableSpeedByPoint_ItemClick; // + // barBtnDeleteVariableSpeed + // + barBtnDeleteVariableSpeed.Caption = "鍒犻櫎"; + barBtnDeleteVariableSpeed.Id = 26; + barBtnDeleteVariableSpeed.ImageOptions.SvgImage = PhartRelation.Core.Properties.Resources.actions_deletecircled; + barBtnDeleteVariableSpeed.Name = "barBtnDeleteVariableSpeed"; + barBtnDeleteVariableSpeed.ItemClick += barBtnDeleteVariableSpeed_ItemClick; + // // barBtnAddEqualEffMenu // barBtnAddEqualEffMenu.Caption = "绛夋晥绾�"; barBtnAddEqualEffMenu.Id = 23; - barBtnAddEqualEffMenu.ImageOptions.SvgImage = PhartRelation.Core.Properties.Resources.actions_add1; - barBtnAddEqualEffMenu.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(barBtnAddEqualEffByEff) }); + barBtnAddEqualEffMenu.ImageOptions.SvgImage = PhartRelation.Core.Properties.Resources.charttype_scatterline; + barBtnAddEqualEffMenu.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(barBtnAddEqualEffByEff), new DevExpress.XtraBars.LinkPersistInfo(barBtnDeleteEqualEff, true) }); barBtnAddEqualEffMenu.Name = "barBtnAddEqualEffMenu"; barBtnAddEqualEffMenu.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; // @@ -146,35 +190,13 @@ barBtnAddEqualEffByEff.Name = "barBtnAddEqualEffByEff"; barBtnAddEqualEffByEff.ItemClick += barBtnAddEqualEffByEff_ItemClick; // - // barCekSplitPanel + // barBtnDeleteEqualEff // - barCekSplitPanel.BindableChecked = true; - barCekSplitPanel.Caption = "鍒嗗壊鏉�"; - barCekSplitPanel.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; - barCekSplitPanel.Checked = true; - barCekSplitPanel.Id = 1; - barCekSplitPanel.Name = "barCekSplitPanel"; - barCekSplitPanel.CheckedChanged += barCekSplitPanel_CheckedChanged; - // - // barCekEffVisible - // - barCekEffVisible.BindableChecked = true; - barCekEffVisible.Caption = "鏁堢巼绾�"; - barCekEffVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; - barCekEffVisible.Checked = true; - barCekEffVisible.Id = 2; - barCekEffVisible.Name = "barCekEffVisible"; - barCekEffVisible.CheckedChanged += barCekEffVisible_CheckedChanged; - // - // barCekPowerVisible - // - barCekPowerVisible.BindableChecked = true; - barCekPowerVisible.Caption = "鍔熺巼绾�"; - barCekPowerVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; - barCekPowerVisible.Checked = true; - barCekPowerVisible.Id = 3; - barCekPowerVisible.Name = "barCekPowerVisible"; - barCekPowerVisible.CheckedChanged += barCekPowerVisible_CheckedChanged; + barBtnDeleteEqualEff.Caption = "鍒犻櫎"; + barBtnDeleteEqualEff.Id = 27; + barBtnDeleteEqualEff.ImageOptions.SvgImage = PhartRelation.Core.Properties.Resources.actions_deletecircled1; + barBtnDeleteEqualEff.Name = "barBtnDeleteEqualEff"; + barBtnDeleteEqualEff.ItemClick += barBtnDeleteEqualEff_ItemClick; // // barTxtPipeQ // @@ -235,26 +257,6 @@ barBtnSetEqPt.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; barBtnSetEqPt.ItemClick += barBtnSetEqPt_ItemClick; // - // barCekEqulEffVisible - // - barCekEqulEffVisible.BindableChecked = true; - barCekEqulEffVisible.Caption = "绛夋晥绾�"; - barCekEqulEffVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; - barCekEqulEffVisible.Checked = true; - barCekEqulEffVisible.Id = 11; - barCekEqulEffVisible.Name = "barCekEqulEffVisible"; - barCekEqulEffVisible.CheckedChanged += barCekEqulEffVisible_CheckedChanged; - // - // barCekEqVisible - // - barCekEqVisible.BindableChecked = true; - barCekEqVisible.Caption = "瑁呯疆绾�"; - barCekEqVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; - barCekEqVisible.Checked = true; - barCekEqVisible.Id = 10; - barCekEqVisible.Name = "barCekEqVisible"; - barCekEqVisible.CheckedChanged += barCekEqVisible_CheckedChanged; - // // barBtnEqClear // barBtnEqClear.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right; @@ -265,13 +267,29 @@ barBtnEqClear.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; barBtnEqClear.ItemClick += barBtnEqClear_ItemClick; // + // barImgCmbChartSel + // + barImgCmbChartSel.Caption = "鏌ヨ:"; + barImgCmbChartSel.Edit = repImgCmbCurveSel; + barImgCmbChartSel.EditWidth = 80; + barImgCmbChartSel.Id = 28; + barImgCmbChartSel.Name = "barImgCmbChartSel"; + barImgCmbChartSel.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; + barImgCmbChartSel.EditValueChanged += barImgCmbChartSel_EditValueChanged; + // + // repImgCmbCurveSel + // + repImgCmbCurveSel.AutoHeight = false; + repImgCmbCurveSel.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); + repImgCmbCurveSel.Name = "repImgCmbCurveSel"; + // // barDockControlTop // barDockControlTop.CausesValidation = false; barDockControlTop.Dock = DockStyle.Top; barDockControlTop.Location = new Point(0, 0); barDockControlTop.Manager = barManager1; - barDockControlTop.Size = new Size(1369, 34); + barDockControlTop.Size = new Size(1369, 68); // // barDockControlBottom // @@ -285,17 +303,45 @@ // barDockControlLeft.CausesValidation = false; barDockControlLeft.Dock = DockStyle.Left; - barDockControlLeft.Location = new Point(0, 34); + barDockControlLeft.Location = new Point(0, 68); barDockControlLeft.Manager = barManager1; - barDockControlLeft.Size = new Size(0, 890); + barDockControlLeft.Size = new Size(0, 856); // // barDockControlRight // barDockControlRight.CausesValidation = false; barDockControlRight.Dock = DockStyle.Right; - barDockControlRight.Location = new Point(1369, 34); + barDockControlRight.Location = new Point(1369, 68); barDockControlRight.Manager = barManager1; - barDockControlRight.Size = new Size(0, 890); + barDockControlRight.Size = new Size(0, 856); + // + // barCekPowerVisible + // + barCekPowerVisible.BindableChecked = true; + barCekPowerVisible.Caption = "鍔熺巼绾�"; + barCekPowerVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; + barCekPowerVisible.Checked = true; + barCekPowerVisible.Id = 3; + barCekPowerVisible.Name = "barCekPowerVisible"; + barCekPowerVisible.CheckedChanged += barCekPowerVisible_CheckedChanged; + // + // barCekEqVisible + // + barCekEqVisible.BindableChecked = true; + barCekEqVisible.Caption = "瑁呯疆绾�"; + barCekEqVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; + barCekEqVisible.Checked = true; + barCekEqVisible.Id = 10; + barCekEqVisible.Name = "barCekEqVisible"; + barCekEqVisible.CheckedChanged += barCekEqVisible_CheckedChanged; + // + // barCekLineVisible + // + barCekLineVisible.Caption = "鏌ヨ"; + barCekLineVisible.CheckBoxVisibility = DevExpress.XtraBars.CheckBoxVisibility.BeforeText; + barCekLineVisible.Id = 30; + barCekLineVisible.Name = "barCekLineVisible"; + barCekLineVisible.CheckedChanged += barCekLineVisible_CheckedChanged; // // PumpChartViewCtrl // @@ -312,6 +358,7 @@ ((System.ComponentModel.ISupportInitialize)repTxtPipeQ).EndInit(); ((System.ComponentModel.ISupportInitialize)repTxtPipeHead).EndInit(); ((System.ComponentModel.ISupportInitialize)repTxtStartHead).EndInit(); + ((System.ComponentModel.ISupportInitialize)repImgCmbCurveSel).EndInit(); ResumeLayout(false); PerformLayout(); } @@ -344,5 +391,10 @@ private DevExpress.XtraBars.BarButtonItem barBtnAddVariableSpeedByPoint; private DevExpress.XtraBars.BarSubItem barBtnAddEqualEffMenu; private DevExpress.XtraBars.BarButtonItem barBtnAddEqualEffByEff; + private DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox repImgCmbCurveSel; + private DevExpress.XtraBars.BarButtonItem barBtnDeleteVariableSpeed; + private DevExpress.XtraBars.BarButtonItem barBtnDeleteEqualEff; + private DevExpress.XtraBars.BarEditItem barImgCmbChartSel; + private DevExpress.XtraBars.BarCheckItem barCekLineVisible; } } diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.cs index 6c3ccfa..18ca2ac 100644 --- a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.cs @@ -12,14 +12,12 @@ public PumpChartViewCtrl() { InitializeComponent(); - this.barCekEqVisible.Checked = true; this.barCekEqulEffVisible.Checked = true; this.barCekPowerVisible.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + this.barCekEqVisible.Checked = true; this.barCekEqVisible.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; - - //this.barBtnAddVariableSpeedMenu.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; - //this.barBtnAddEqualEffMenu.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; - //this.barCekEqulEffVisible.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; + + } @@ -31,7 +29,7 @@ private bool _eff_visible = true; private bool _equal_eff_visible = true; private bool _split_panel = true; - private double _nr; + private double _nr; /// <summary> /// 缁戝畾鏁版嵁 @@ -54,12 +52,14 @@ ClearBindingData(); return; } - _coordinate = vmo.DispParas; + _coordinate = vmo.DispParas; foreach (var graph in vmo.GraphList) { + bool is_default = false; double hz = 50; double n = nr; + double eff = -1; var curve_type = (Yw.Ahart.eCurveType)graph.GraphType; switch (curve_type) { @@ -68,6 +68,8 @@ var paras = PhartGraphHelper.GetGraphParas<Yw.WinFrmUI.Phart.QHGraphParasViewModel>(curve_type, graph.GraphParas); hz = paras.Hz; n = paras.N; + if (hz == 50) + is_default = true; } break; case Yw.Ahart.eCurveType.QP: @@ -75,6 +77,8 @@ var paras = PhartGraphHelper.GetGraphParas<Yw.WinFrmUI.Phart.QPGraphParasViewModel>(curve_type, graph.GraphParas); hz = paras.Hz; n = paras.N; + if (hz == 50) + is_default = true; } break; case Yw.Ahart.eCurveType.QE: @@ -82,6 +86,14 @@ var paras = PhartGraphHelper.GetGraphParas<Yw.WinFrmUI.Phart.QEGraphParasViewModel>(curve_type, graph.GraphParas); hz = paras.Hz; n = paras.N; + if (hz == 50) + is_default = true; + } + break; + case Yw.Ahart.eCurveType.EqualE: + { + var paras = PhartGraphHelper.GetGraphParas<EqualEGraphParasViewModel>(curve_type, graph.GraphParas); + eff = paras.Eff; } break; } @@ -91,28 +103,44 @@ var annotation_list = PhartGraphHelper.GetAnnotationParasList(curve_type, graph.AnnotationParas); if (curve_type == eCurveType.QE) annotation_list = null; - var vm = new Yw.WinFrmUI.Phart.PumpViewChartViewModel(); + var vm = new Yw.WinFrmUI.Phart.PumpViewChartViewModel(); vm.Id = graph.ID.ToString(); + vm.DbId = graph.ID; vm.Hz = hz; vm.N = n; + vm.Eff = eff; vm.AnnotationList = annotation_list; vm.CurveType = feat_curve.CurveType; vm.FeatType = feat_curve.FeatType; vm.DefPointList = geometry_paras?.DefinePoints; vm.FitPointList = feat_curve.FeatCurve.GetPointList(100); - if (vm.CurveType== eCurveType.EqualE) + if (vm.CurveType == eCurveType.EqualE) vm.FitPointList = feat_curve.FeatCurve.GetPointList(10); + vm.IsDefault = is_default; vm.GraphParas = graph.GraphParas; vm_list.Add(vm); } - + _vm_list = vm_list; - _vm_list[0].IsSelect = true; - + var list = _vm_list.Select(x => x.Hz).OrderByDescending(x => x).ToList(); + list = list.Distinct().ToList(); + + this.repImgCmbCurveSel.BeginInit(); + this.repImgCmbCurveSel.Items.Clear(); + foreach (var hz in list) + { + this.repImgCmbCurveSel.Items.Add($"{hz}hz", hz, -1); + } + this.repImgCmbCurveSel.EndInit(); + this.barImgCmbChartSel.EditValue = null; + + SetColor(_vm_list); SetBindingData(_vm_list, _coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); + } + /// <summary> /// @@ -135,9 +163,11 @@ vm.Color = Color.DarkGreen; } } + } else { + var item = group.ElementAt(0); foreach (var vm in item) { @@ -147,9 +177,14 @@ case Yw.Ahart.eCurveType.QP: vm.Color = Yw.WinFrmUI.Phart.PumpChartDisplay.CurveColorQP; break; case Yw.Ahart.eCurveType.QE: vm.Color = Yw.WinFrmUI.Phart.PumpChartDisplay.CurveColorQE; break; } - } + } + } + + } + + /// <summary> /// 缁戝畾鏁版嵁 @@ -199,10 +234,12 @@ { if (_vm_list == null || !_vm_list.Any()) { + TipFormHelper.ShowInfo("鏃犳暟鎹�"); return true; } if (!_vm_list.Exists(x => x.CurveType == Yw.Ahart.eCurveType.QH)) { + TipFormHelper.ShowInfo("鏃犳暟鎹�"); return true; } return false; @@ -215,7 +252,6 @@ { this.pumpViewChart1.Clear(); } - private void SetEquip() { @@ -265,22 +301,60 @@ this.pumpViewChart1.SetEquip(equip_pt_list, pump_sect_pt); } + + private void barImgCmbChartSel_EditValueChanged(object sender, EventArgs e) + { + if (this.barImgCmbChartSel.EditValue==null) + { + return; + } + var hz = Convert.ToDouble(this.barImgCmbChartSel.EditValue); + _vm_list.ForEach(x => x.IsSelect = false); + foreach (var vm in _vm_list) + { + if (vm.Hz != hz) + continue; + switch (vm.CurveType) + { + case Yw.Ahart.eCurveType.QH: + { + vm.IsSelect = true; + } + break; + case Yw.Ahart.eCurveType.QP: + { + vm.IsSelect = true; + } + break; + case Yw.Ahart.eCurveType.QE: + { + vm.IsSelect = true; + } + break; + } + } + SetBindingData(_vm_list, _coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); + } + private void barCekLineVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + { + this.pumpViewChart1.LineVisible=this.barCekLineVisible.Checked; + } private void barCekEffVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { _eff_visible = this.barCekEffVisible.Checked; - SetBindingData(_vm_list,_coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); + SetBindingData(_vm_list, _coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); } private void barCekPowerVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { _power_visible = this.barCekPowerVisible.Checked; - SetBindingData(_vm_list,_coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); + SetBindingData(_vm_list, _coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); } private void barCekSplitPanel_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { _split_panel = this.barCekSplitPanel.Checked; - SetBindingData(_vm_list,_coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); + SetBindingData(_vm_list, _coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); } private void barCekEqVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) @@ -291,14 +365,14 @@ } else { - this.pumpViewChart1.SetEquip(null,null); + this.pumpViewChart1.SetEquip(null, null); } } private void barCekEqulEffVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { _equal_eff_visible = this.barCekEqulEffVisible.Checked; - SetBindingData(_vm_list,_coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); + SetBindingData(_vm_list, _coordinate, _split_panel, _eff_visible, _power_visible, _equal_eff_visible); } private void barBtnEqClear_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) @@ -306,7 +380,6 @@ this.barTxtStartHead.EditValue = 0; this.barTxtPipeQ.EditValue = null; this.barTxtPipeHead.EditValue = null; - this.pumpViewChart1.SetEquip(null, null); } @@ -335,6 +408,55 @@ AddByEff(); } + private void barBtnDeleteVariableSpeed_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + { + if (IsInvalidData()) + { + return; + } + if (!_vm_list.Exists(x => x.Hz != 50)) + { + TipFormHelper.ShowInfo("鏃犲彉閫熺嚎"); + return; + } + var list = _vm_list.Where(x => x.Hz != 50).Select(x => (x.Hz, x.N)).ToList(); + var dlg = new DeleteVariableSpeedDlg(); + dlg.SetBindingData(list); + dlg.ReloadDataEvent += (del_list) => + { + var del_info_list = _vm_list.Where(x => del_list.Contains(x.Hz)).Select(x => (x.DbId, x.Hz)).ToList(); + Delete(del_info_list); + return true; + }; + dlg.ShowDialog(); + } + + private void barBtnDeleteEqualEff_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + { + if (IsInvalidData()) + { + return; + } + if (!_vm_list.Exists(x => x.CurveType == eCurveType.EqualE)) + { + TipFormHelper.ShowInfo("鏃犵瓑鏁堢嚎"); + return; + } + var _vm_eff_list = _vm_list.Where(x => x.CurveType == eCurveType.EqualE).ToList(); + var list = _vm_eff_list.Select(x => x.Eff).ToList(); + var dlg = new DeleteEqualEDlg(); + dlg.SetBindingData(list); + dlg.ReloadDataEvent += (del_list) => + { + var del_info_list = _vm_eff_list.Where(x => del_list.Contains(x.Eff)).Select(x => (x.DbId, x.Eff)).ToList(); + Delete(del_info_list); + return true; + }; + dlg.ShowDialog(); + + } + + private void AddByN() { if (IsInvalidData()) @@ -359,13 +481,13 @@ TipFormHelper.ShowWarn("杞�熷凡瀛樺湪"); return false; } - hz = Math.Round(hz, 1); + hz = Math.Round(hz, 1); var pt_qh_list = qh50.FitPointList.GetQHPointListByN(50, hz); var pt_qe_list = qe50?.FitPointList?.GetQEPointListByN(50, hz); var pt_qp_list = qp50?.FitPointList?.GetQPPointListByN(50, hz); - Insert(hz,speed,pt_qh_list,pt_qe_list,pt_qp_list); + Insert(hz, speed, pt_qh_list, pt_qe_list, pt_qp_list); return true; }; dlg.ShowDialog(); @@ -396,13 +518,13 @@ } var speed = Math.Round(hz / 50 * _nr); speed = Math.Round(speed, 1); - + var pt_qh_list = qh50.FitPointList.GetQHPointListByN(50, hz); var pt_qe_list = qe50?.FitPointList?.GetQEPointListByN(50, hz); - var pt_qp_list = qp50?.FitPointList?.GetQPPointListByN(50, hz); + var pt_qp_list = qp50?.FitPointList?.GetQPPointListByN(50, hz); - Insert(hz, speed, pt_qh_list, pt_qe_list, pt_qp_list); + Insert(hz, speed, pt_qh_list, pt_qe_list, pt_qp_list); return true; }; dlg.ShowDialog(); @@ -424,7 +546,7 @@ dlg.VerifyValueChanged += (x, y) => { var pt = new Yw.Geometry.Point2d(x, y); - var curve = new Yw.Pump. CurveQH(qh50.FeatType, qh50.DefPointList); + var curve = new Yw.Pump.CurveQH(qh50.FeatType, qh50.DefPointList); var sect_pt = Yw.Pump.PerformParabolaHelper.GetQHSectPoint(curve, pt); if (sect_pt == null || sect_pt.IsZeroPoint()) return false; @@ -477,25 +599,29 @@ foreach (var eff in eff_double_list) { + if (_vm_list.Exists(x => x.Eff == eff)) + { + continue; + } + var eff_list = EqualParaCurveEListHelper.CalcEqualParaCurveE(qh, qe, max_hz, min_hz, eff); if (eff_list != null && eff_list.Any()) { foreach (var item in eff_list) - { - Insert(item.Eff,item.Tension,item.IsClosed,item.IsUShaped,item.DefinePoints); + { + Insert(item.Eff, item.Tension, item.IsClosed, item.IsUShaped, item.DefinePoints); } } } - + return true; }; dlg.ShowDialog(); } - private async void Insert(double hz, double speed, List<Yw.Geometry.Point2d> pt_qh_list, List<Yw.Geometry.Point2d> pt_qe_list, List<Yw.Geometry.Point2d> pt_qp_list) - { + { var list = new List<Yw.Vmo.PhartGraphVmo>(); var graph_qh = new Yw.Vmo.PhartGraphVmo() { @@ -590,7 +716,7 @@ list.Add(graph_qp); } - + list.ForEach(x => x.DiagramID = _vmo.ID); var bol = await new Yw.BLL.PhartGraph().Inserts(list); if (!bol) @@ -598,7 +724,7 @@ TipFormHelper.ShowWarn("娣诲姞澶辫触!"); return; } - + var newVmo = await new Yw.BLL.PhartDiagramExtensions().GetByID(_vmo.ID); if (newVmo == null) { @@ -610,9 +736,9 @@ SetEquip(); } - private async void Insert(double eff, double tension, bool is_closed,bool is_u, List<Yw.Geometry.Point2d> pt_equal_e_list) + private async void Insert(double eff, double tension, bool is_closed, bool is_u, List<Yw.Geometry.Point2d> pt_equal_e_list) { - if (tension<=0) + if (tension <= 0) { tension = 0.5; } @@ -633,7 +759,7 @@ }.ToJson(), GeometryStyle = (int)HStation.PhartRelation.eGeometryStyle.FeatCurve, GeometryInfo = pt_equal_e_list.ToDbString(Yw.Ahart.eCurveType.EqualE, Yw.Ahart.eFeatType.Cubic), - + }; var annotation_list = new List<Yw.WinFrmUI.Phart.AnnotationParasViewModel>(); @@ -676,6 +802,40 @@ SetEquip(); } + private async void Delete(List<(long Id, double Basis)> graph_ids) + { + if (graph_ids == null || !graph_ids.Any()) + { + return; + } + var bll = new Yw.BLL.PhartGraph(); + var err_hz_list = new List<double>(); + foreach (var graph_info in graph_ids) + { + var bol = await bll.DeleteByID(graph_info.Id); + if (!bol) + { + err_hz_list.Add(graph_info.Basis); + return; + } + } + if (err_hz_list != null && err_hz_list.Any()) + { + var info = Yw.Untity.DoubleListHelper.ToString(err_hz_list); + TipFormHelper.ShowError($"{info}鍒犻櫎澶辫触!"); + } + + var newVmo = await new Yw.BLL.PhartDiagramExtensions().GetByID(_vmo.ID); + if (newVmo == null) + { + TipFormHelper.ShowWarn("鑾峰彇澶辫触!"); + return; + } + + SetBindingData(newVmo, _nr); + SetEquip(); + } + /// <summary> /// 鑾峰彇 /// </summary> @@ -684,6 +844,6 @@ return new Yw.Vmo.PhartDiagramExGraphListVmo(); } - + } } diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.Designer.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.Designer.cs new file mode 100644 index 0000000..c59f5e1 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.Designer.cs @@ -0,0 +1,292 @@ +锘� +namespace IStation.WinFrmUI.Monitor +{ + partial class SingleMappingMatrixDlg + { + /// <summary> + /// 蹇呴渶鐨勮璁″櫒鍙橀噺銆� + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// 娓呯悊鎵�鏈夋鍦ㄤ娇鐢ㄧ殑璧勬簮銆� + /// </summary> + /// <param name="disposing">濡傛灉搴旈噴鏀炬墭绠¤祫婧愶紝涓� true锛涘惁鍒欎负 false銆�</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 缁勪欢璁捐鍣ㄧ敓鎴愮殑浠g爜 + + /// <summary> + /// 璁捐鍣ㄦ敮鎸佹墍闇�鐨勬柟娉� - 涓嶈淇敼 + /// 浣跨敤浠g爜缂栬緫鍣ㄤ慨鏀规鏂规硶鐨勫唴瀹广�� + /// </summary> + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SingleMappingMatrixDlg)); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject(); + DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject(); + bindingSource1 = new BindingSource(components); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colKey = new DevExpress.XtraGrid.Columns.GridColumn(); + colValue = new DevExpress.XtraGrid.Columns.GridColumn(); + repImgCmbValue = new DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox(); + colDelete = new DevExpress.XtraGrid.Columns.GridColumn(); + repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); + layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); + btnOk = new SimpleButton(); + btnCancel = new SimpleButton(); + Root = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); + emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); + ((System.ComponentModel.ISupportInitialize)bindingSource1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)gridControl1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)gridView1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)repImgCmbValue).BeginInit(); + ((System.ComponentModel.ISupportInitialize)repositoryItemButtonEdit1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit(); + layoutControl1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)Root).BeginInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem3).BeginInit(); + ((System.ComponentModel.ISupportInitialize)emptySpaceItem1).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = bindingSource1; + gridControl1.EmbeddedNavigator.Margin = new Padding(4, 5, 4, 5); + gridControl1.Location = new Point(12, 12); + gridControl1.MainView = gridView1; + gridControl1.Margin = new Padding(4, 5, 4, 5); + gridControl1.Name = "gridControl1"; + gridControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repositoryItemButtonEdit1, repImgCmbValue }); + gridControl1.Size = new Size(574, 293); + gridControl1.TabIndex = 2; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.Appearance.HeaderPanel.Options.UseTextOptions = true; + gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + gridView1.Appearance.Row.Options.UseTextOptions = true; + gridView1.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; + gridView1.Appearance.ViewCaption.Options.UseTextOptions = true; + gridView1.Appearance.ViewCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; + gridView1.ColumnPanelRowHeight = 31; + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colKey, colValue, colDelete }); + gridView1.DetailHeight = 550; + gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True; + gridView1.OptionsCustomization.AllowFilter = false; + gridView1.OptionsCustomization.AllowQuickHideColumns = false; + gridView1.OptionsCustomization.AllowSort = false; + gridView1.OptionsMenu.EnableColumnMenu = false; + gridView1.OptionsView.EnableAppearanceEvenRow = true; + gridView1.OptionsView.EnableAppearanceOddRow = true; + gridView1.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom; + gridView1.OptionsView.ShowGroupPanel = false; + gridView1.OptionsView.ShowIndicator = false; + gridView1.RowHeight = 30; + gridView1.ViewCaptionHeight = 47; + gridView1.RowCellClick += gridView1_RowCellClick; + gridView1.ShowingEditor += gridView1_ShowingEditor; + gridView1.ValidatingEditor += gridView1_ValidatingEditor; + // + // colKey + // + colKey.Caption = "閿�"; + colKey.FieldName = "Key"; + colKey.MinWidth = 29; + colKey.Name = "colKey"; + colKey.Visible = true; + colKey.VisibleIndex = 0; + colKey.Width = 291; + // + // colValue + // + colValue.Caption = "鍊�"; + colValue.ColumnEdit = repImgCmbValue; + colValue.FieldName = "Value"; + colValue.MinWidth = 29; + colValue.Name = "colValue"; + colValue.Visible = true; + colValue.VisibleIndex = 1; + colValue.Width = 264; + // + // repImgCmbValue + // + repImgCmbValue.AutoHeight = false; + repImgCmbValue.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); + repImgCmbValue.Name = "repImgCmbValue"; + // + // colDelete + // + colDelete.Caption = "鍒犻櫎"; + colDelete.ColumnEdit = repositoryItemButtonEdit1; + colDelete.MaxWidth = 86; + colDelete.MinWidth = 86; + colDelete.Name = "colDelete"; + colDelete.OptionsColumn.AllowEdit = false; + colDelete.Visible = true; + colDelete.VisibleIndex = 2; + colDelete.Width = 86; + // + // repositoryItemButtonEdit1 + // + repositoryItemButtonEdit1.AutoHeight = false; + editorButtonImageOptions1.Image = (Image)resources.GetObject("editorButtonImageOptions1.Image"); + repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default) }); + repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; + repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; + // + // layoutControl1 + // + layoutControl1.Controls.Add(btnOk); + layoutControl1.Controls.Add(btnCancel); + layoutControl1.Controls.Add(gridControl1); + layoutControl1.Dock = DockStyle.Fill; + layoutControl1.Location = new Point(0, 0); + layoutControl1.Name = "layoutControl1"; + layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(1424, 67, 975, 600); + layoutControl1.Root = Root; + layoutControl1.Size = new Size(598, 353); + layoutControl1.TabIndex = 3; + layoutControl1.Text = "layoutControl1"; + // + // btnOk + // + btnOk.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Primary; + btnOk.Appearance.Options.UseBackColor = true; + btnOk.Location = new Point(390, 309); + btnOk.Margin = new Padding(4, 5, 4, 5); + btnOk.Name = "btnOk"; + btnOk.Size = new Size(96, 32); + btnOk.StyleController = layoutControl1; + btnOk.TabIndex = 6; + btnOk.Text = "纭畾"; + btnOk.Click += btnOk_Click; + // + // btnCancel + // + btnCancel.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Warning; + btnCancel.Appearance.Options.UseBackColor = true; + btnCancel.DialogResult = DialogResult.Cancel; + btnCancel.Location = new Point(490, 309); + btnCancel.Margin = new Padding(4, 5, 4, 5); + btnCancel.Name = "btnCancel"; + btnCancel.Size = new Size(96, 32); + btnCancel.StyleController = layoutControl1; + btnCancel.TabIndex = 7; + btnCancel.Text = "鍙栨秷"; + // + // Root + // + Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; + Root.GroupBordersVisible = false; + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1, layoutControlItem2, layoutControlItem3, emptySpaceItem1 }); + Root.Name = "Root"; + Root.Size = new Size(598, 353); + Root.TextVisible = false; + // + // layoutControlItem1 + // + layoutControlItem1.Control = gridControl1; + layoutControlItem1.Location = new Point(0, 0); + layoutControlItem1.Name = "layoutControlItem1"; + layoutControlItem1.Size = new Size(578, 297); + layoutControlItem1.TextSize = new Size(0, 0); + layoutControlItem1.TextVisible = false; + // + // layoutControlItem2 + // + layoutControlItem2.Control = btnOk; + layoutControlItem2.Location = new Point(378, 297); + layoutControlItem2.MaxSize = new Size(100, 36); + layoutControlItem2.MinSize = new Size(100, 36); + layoutControlItem2.Name = "layoutControlItem2"; + layoutControlItem2.Size = new Size(100, 36); + layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; + layoutControlItem2.TextSize = new Size(0, 0); + layoutControlItem2.TextVisible = false; + // + // layoutControlItem3 + // + layoutControlItem3.Control = btnCancel; + layoutControlItem3.Location = new Point(478, 297); + layoutControlItem3.MaxSize = new Size(100, 36); + layoutControlItem3.MinSize = new Size(100, 36); + layoutControlItem3.Name = "layoutControlItem3"; + layoutControlItem3.Size = new Size(100, 36); + layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; + layoutControlItem3.TextSize = new Size(0, 0); + layoutControlItem3.TextVisible = false; + // + // emptySpaceItem1 + // + emptySpaceItem1.AllowHotTrack = false; + emptySpaceItem1.Location = new Point(0, 297); + emptySpaceItem1.Name = "emptySpaceItem1"; + emptySpaceItem1.Size = new Size(378, 36); + emptySpaceItem1.TextSize = new Size(0, 0); + // + // SingleMappingMatrixDlg + // + AutoScaleDimensions = new SizeF(10F, 22F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(598, 353); + Controls.Add(layoutControl1); + Margin = new Padding(4, 5, 4, 5); + Name = "SingleMappingMatrixDlg"; + StartPosition = FormStartPosition.CenterScreen; + Text = "鍗曚竴鏄犲皠"; + ((System.ComponentModel.ISupportInitialize)bindingSource1).EndInit(); + ((System.ComponentModel.ISupportInitialize)gridControl1).EndInit(); + ((System.ComponentModel.ISupportInitialize)gridView1).EndInit(); + ((System.ComponentModel.ISupportInitialize)repImgCmbValue).EndInit(); + ((System.ComponentModel.ISupportInitialize)repositoryItemButtonEdit1).EndInit(); + ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit(); + layoutControl1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)Root).EndInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem1).EndInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem2).EndInit(); + ((System.ComponentModel.ISupportInitialize)layoutControlItem3).EndInit(); + ((System.ComponentModel.ISupportInitialize)emptySpaceItem1).EndInit(); + ResumeLayout(false); + } + + #endregion + private System.Windows.Forms.BindingSource bindingSource1; + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colKey; + private DevExpress.XtraGrid.Columns.GridColumn colValue; + private DevExpress.XtraGrid.Columns.GridColumn colDelete; + private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1; + private DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox repImgCmbValue; + private DevExpress.XtraLayout.LayoutControl layoutControl1; + private DevExpress.XtraLayout.LayoutControlGroup Root; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; + private DevExpress.XtraEditors.SimpleButton btnOk; + private DevExpress.XtraEditors.SimpleButton btnCancel; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; + private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1; + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.cs new file mode 100644 index 0000000..c174103 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.cs @@ -0,0 +1,155 @@ +锘縰sing DevExpress.XtraEditors; +using System; +using System.ComponentModel; +using System.Linq; + +namespace IStation.WinFrmUI.Monitor +{ + /// <summary> + /// 鍗曚竴鏄犲皠鎺т欢 + /// </summary> + public partial class SingleMappingMatrixDlg : XtraForm + { + public SingleMappingMatrixDlg() + { + InitializeComponent(); + } + + + public event Func<string, bool> ReloadDataEvent; + private BindingList<Model.SingleMappingMatrix> _bindingList = null; + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + public void Set(string paras, Model.SignalType signalType) + { + var list = Model.SingleMappingMatrix.ToList(paras); + if (list == null) + list = new System.Collections.Generic.List<Model.SingleMappingMatrix>(); + _bindingList = new BindingList<Model.SingleMappingMatrix>(list); + if (signalType != null) + { + var formatParas = signalType.GetEnumFormatParas(); + if (formatParas != null && formatParas.Items != null) + { + this.repImgCmbValue.BeginUpdate(); + this.repImgCmbValue.Items.Clear(); + foreach (var item in formatParas.Items) + { + this.repImgCmbValue.Items.Add(item.Name, (double)item.Value, -1); + } + this.repImgCmbValue.EndUpdate(); + } + } + + this.bindingSource1.DataSource = _bindingList; + this.bindingSource1.ResetBindings(false); + } + + //楠岃瘉 + public bool Valid() + { + this.gridView1.CloseEditor(); + this.gridView1.UpdateCurrentRow(); + if (_bindingList.Count > 0) + { + for (int i = 0; i < _bindingList.Count; i++) + { + var vm = _bindingList[i]; + if (string.IsNullOrEmpty(vm.Value.ToString())) + { + this.gridView1.FocusedRowHandle = i; + this.gridView1.SetColumnError(colValue, "蹇呭~椤�"); + //XtraMessageBox.Show("璇峰皢鍊兼槧灏勪俊鎭缃畬鏁�!"); + return false; + } + } + } + return true; + } + + #region GridView + + //鍒犻櫎 + private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) + { + if (_bindingList == null || _bindingList.Count < 1) + return; + var row = this.gridView1.GetFocusedRow() as Model.SingleMappingMatrix; + if (row == null) + return; + if (e.Column == this.colDelete) + _bindingList.Remove(row); + } + + //鏂板灞炴�ф椂蹇呴』鍏堣緭鍏ュ睘鎬у悕 + private void gridView1_ShowingEditor(object sender, CancelEventArgs e) + { + if (_bindingList == null) + { + e.Cancel = true; + return; + } + if (this.gridView1.FocusedColumn != this.colKey) + { + var row = this.gridView1.GetFocusedRow() as Model.SingleMappingMatrix; + if (row == null) + { + e.Cancel = true; + return; + } + } + } + + //楠岃瘉鍚嶇О鐨勫敮涓�鎬� + private void gridView1_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e) + { + if (_bindingList == null || _bindingList.Count < 1) + return; + if (this.gridView1.FocusedColumn == this.colKey) + { + var row = this.gridView1.GetFocusedRow() as Model.SingleMappingMatrix; + var list = _bindingList.ToList(); + list.Remove(row); + System.Text.RegularExpressions.Regex rex = new System.Text.RegularExpressions.Regex(@"^\d+$"); + if (rex.IsMatch(e.Value.ToString())) + if (list.Find(x => x.Key == Convert.ToDouble(e.Value)) != null) + { + e.ErrorText = "鍊兼槧灏勯噸澶�"; + e.Valid = false; + } + } + } + + #endregion + + private void btnOk_Click(object sender, EventArgs e) + { + if (!Valid()) + return; + + string json = string.Empty; + if (_bindingList.Any()) + { + json = Model.SingleMappingMatrix.ToJson(_bindingList.ToList()); + } + + if (this.ReloadDataEvent != null) + { + var bol = this.ReloadDataEvent(json); + if (!bol) + { + XtraMessageBox.Show("璁剧疆澶辫触!"); + return; + } + XtraMessageBox.Show("璁剧疆鎴愬姛!"); + } + + this.DialogResult = System.Windows.Forms.DialogResult.OK; + this.Close(); + + } + + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.resx b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.resx new file mode 100644 index 0000000..d3f19a3 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/SingleMappingMatrixDlg.resx @@ -0,0 +1,134 @@ +锘�<?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="bindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="editorButtonImageOptions1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAApdEVYdFRpdGxlAFJlbW92ZTtEZWxldGU7QmFycztS + aWJib247U3RhbmRhcmQ7Y1ZIMAAAAKdJREFUOE+Nk0sKwlAMRbu4QEe6iWxA/CBUrNvMShRHTy68wGua + j4MLIbnn0A7e1FqbhOkgTAvmfyJMDzCYFf4KUxOmpy3bCNOrd8Ecsbj1hSaUDLDmrId7JXHgK/ZjIZRE + 8EYQSNYM3gkCSQi7gkSygzOB/WxktT1XEMChpIIvzu9sJCk83EJJCVcSHPAwUjiRLFjOwvSuYEfyAatL + SE62HKU/wBnzD9JAnMxlnre0AAAAAElFTkSuQmCC +</value> + </data> +</root> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/HStation.WinFrmUI.PhartRelation.Core.csproj b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/HStation.WinFrmUI.PhartRelation.Core.csproj index 26af384..dae5498 100644 --- a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/HStation.WinFrmUI.PhartRelation.Core.csproj +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/HStation.WinFrmUI.PhartRelation.Core.csproj @@ -40,6 +40,8 @@ <ItemGroup> <Compile Remove="01-pump\01-view\PumpChartViewCtrl - 澶嶅埗.cs" /> <Compile Remove="01-pump\01-view\PumpChartViewCtrl - 澶嶅埗.Designer.cs" /> + <Compile Remove="01-pump\01-view\SingleMappingMatrixDlg.cs" /> + <Compile Remove="01-pump\01-view\SingleMappingMatrixDlg.Designer.cs" /> <Compile Remove="PumpCurveExpandDlg.cs" /> <Compile Remove="PumpCurveExpandDlg.Designer.cs" /> <Compile Remove="PumpParallelAnalyDlg - 澶嶅埗.cs" /> @@ -50,6 +52,7 @@ <ItemGroup> <EmbeddedResource Remove="01-pump\01-view\PumpChartViewCtrl - 澶嶅埗.resx" /> + <EmbeddedResource Remove="01-pump\01-view\SingleMappingMatrixDlg.resx" /> <EmbeddedResource Remove="PumpCurveExpandDlg.resx" /> <EmbeddedResource Remove="PumpParallelAnalyDlg - 澶嶅埗.resx" /> <EmbeddedResource Remove="PumpParallelAnalyDlg.resx" /> @@ -73,6 +76,12 @@ </ItemGroup> <ItemGroup> + <Compile Update="01-pump\01-view\DeleteEqualEDlg.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Update="01-pump\01-view\DeleteVariableSpeedDlg.cs"> + <SubType>Form</SubType> + </Compile> <Compile Update="01-pump\02-edit\PumpChartEditCtrl.cs"> <SubType>UserControl</SubType> </Compile> diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.Designer.cs b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.Designer.cs index 3f5f7c1..c950b8c 100644 --- a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.Designer.cs +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.Designer.cs @@ -123,6 +123,36 @@ /// <summary> /// 鏌ユ壘 DevExpress.Utils.Svg.SvgImage 绫诲瀷鐨勬湰鍦板寲璧勬簮銆� /// </summary> + internal static DevExpress.Utils.Svg.SvgImage actions_deletecircled { + get { + object obj = ResourceManager.GetObject("actions_deletecircled", resourceCulture); + return ((DevExpress.Utils.Svg.SvgImage)(obj)); + } + } + + /// <summary> + /// 鏌ユ壘 DevExpress.Utils.Svg.SvgImage 绫诲瀷鐨勬湰鍦板寲璧勬簮銆� + /// </summary> + internal static DevExpress.Utils.Svg.SvgImage actions_deletecircled1 { + get { + object obj = ResourceManager.GetObject("actions_deletecircled1", resourceCulture); + return ((DevExpress.Utils.Svg.SvgImage)(obj)); + } + } + + /// <summary> + /// 鏌ユ壘 DevExpress.Utils.Svg.SvgImage 绫诲瀷鐨勬湰鍦板寲璧勬簮銆� + /// </summary> + internal static DevExpress.Utils.Svg.SvgImage charttype_scatterline { + get { + object obj = ResourceManager.GetObject("charttype_scatterline", resourceCulture); + return ((DevExpress.Utils.Svg.SvgImage)(obj)); + } + } + + /// <summary> + /// 鏌ユ壘 DevExpress.Utils.Svg.SvgImage 绫诲瀷鐨勬湰鍦板寲璧勬簮銆� + /// </summary> internal static DevExpress.Utils.Svg.SvgImage clearall { get { object obj = ResourceManager.GetObject("clearall", resourceCulture); @@ -133,6 +163,16 @@ /// <summary> /// 鏌ユ壘 DevExpress.Utils.Svg.SvgImage 绫诲瀷鐨勬湰鍦板寲璧勬簮銆� /// </summary> + internal static DevExpress.Utils.Svg.SvgImage createstackedlinechart { + get { + object obj = ResourceManager.GetObject("createstackedlinechart", resourceCulture); + return ((DevExpress.Utils.Svg.SvgImage)(obj)); + } + } + + /// <summary> + /// 鏌ユ壘 DevExpress.Utils.Svg.SvgImage 绫诲瀷鐨勬湰鍦板寲璧勬簮銆� + /// </summary> internal static DevExpress.Utils.Svg.SvgImage menu { get { object obj = ResourceManager.GetObject("menu", resourceCulture); diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.resx b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.resx index daf2aae..7e36b91 100644 --- a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.resx +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Properties/Resources.resx @@ -151,4 +151,16 @@ <data name="actions_addcircled3" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\actions_addcircled3.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> </data> + <data name="charttype_scatterline" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\charttype_scatterline.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> + </data> + <data name="createstackedlinechart" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\createstackedlinechart.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> + </data> + <data name="actions_deletecircled" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\actions_deletecircled.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> + </data> + <data name="actions_deletecircled1" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\actions_deletecircled1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> + </data> </root> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/actions_deletecircled.svg b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/actions_deletecircled.svg new file mode 100644 index 0000000..d8c9bb3 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/actions_deletecircled.svg @@ -0,0 +1,15 @@ +锘�<?xml version='1.0' encoding='UTF-8'?> +<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32"> + <style type="text/css"> + .Blue{fill:#1177D7;} + .Yellow{fill:#FFB115;} + .Black{fill:#727272;} + .Green{fill:#039C23;} + .Red{fill:#D11C1C;} + .st0{opacity:0.75;} + .st1{opacity:0.5;} +</style> + <g id="DeleteCircled"> + <path d="M16,4C9.4,4,4,9.4,4,16s5.4,12,12,12s12-5.4,12-12S22.6,4,16,4z M23.1,20.2l-2.8,2.8L16,18.8l-4.2,4.2 l-2.8-2.8l4.2-4.2l-4.2-4.2l2.8-2.8l4.2,4.2l4.2-4.2l2.8,2.8L18.8,16L23.1,20.2z" class="Red" /> + </g> +</svg> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/actions_deletecircled1.svg b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/actions_deletecircled1.svg new file mode 100644 index 0000000..d8c9bb3 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/actions_deletecircled1.svg @@ -0,0 +1,15 @@ +锘�<?xml version='1.0' encoding='UTF-8'?> +<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32"> + <style type="text/css"> + .Blue{fill:#1177D7;} + .Yellow{fill:#FFB115;} + .Black{fill:#727272;} + .Green{fill:#039C23;} + .Red{fill:#D11C1C;} + .st0{opacity:0.75;} + .st1{opacity:0.5;} +</style> + <g id="DeleteCircled"> + <path d="M16,4C9.4,4,4,9.4,4,16s5.4,12,12,12s12-5.4,12-12S22.6,4,16,4z M23.1,20.2l-2.8,2.8L16,18.8l-4.2,4.2 l-2.8-2.8l4.2-4.2l-4.2-4.2l2.8-2.8l4.2,4.2l4.2-4.2l2.8,2.8L18.8,16L23.1,20.2z" class="Red" /> + </g> +</svg> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/charttype_scatterline.svg b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/charttype_scatterline.svg new file mode 100644 index 0000000..3ddc3b8 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/charttype_scatterline.svg @@ -0,0 +1,18 @@ +锘�<?xml version='1.0' encoding='UTF-8'?> +<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32"> + <style type="text/css"> + .Red{fill:#D11C1C;} + .Yellow{fill:#FFB115;} + .Blue{fill:#1177D7;} + .Green{fill:#039C23;} + .Black{fill:#727272;} + .White{fill:#FFFFFF;} + .st0{opacity:0.5;} + .st1{opacity:0.75;} + .st2{opacity:0.35;} + .st3{opacity:0.65;} +</style> + <g id="ScatterLine"> + <path d="M28,10c0-1.7-1.3-3-3-3c-0.5,0-0.9,0.1-1.3,0.3c-1.6-1.4-3.6-2.5-5.7-3v0C17.6,3,16.4,2,15,2s-2.6,1-2.9,2.3 v0C9.5,4.9,7.3,6.2,5.6,8.1C5.4,8,5.2,8,5,8c-1.7,0-3,1.3-3,3c0,0.7,0.3,1.4,0.7,1.9C2.2,14.2,2,15.6,2,17c0,3.1,0.9,6.1,2.4,8.6 C4.1,26,4,26.5,4,27c0,1.7,1.3,3,3,3s3-1.3,3-3s-1.3-3-3-3c-0.4,0-0.8,0.1-1.1,0.2C4.7,22.1,4,19.6,4,17c0-1.1,0.2-2.1,0.4-3.1 C4.6,14,4.8,14,5,14c1.7,0,3-1.3,3-3c0-0.7-0.3-1.4-0.7-1.9c1.4-1.3,3.1-2.3,5-2.8l0,0C12.8,7.3,13.8,8,15,8s2.2-0.7,2.7-1.7l0,0 c1.7,0.4,3.3,1.3,4.6,2.4C22.1,9.1,22,9.6,22,10c0,1.7,1.3,3,3,3c0.1,0,0.2,0,0.2,0l0,0c0.5,1.2,0.8,2.6,0.8,4c0,3.9-3.1,7-7,7 c-0.7,0-1.4-0.1-2.1-0.3C17,23.5,17,23.2,17,23c0-1.7-1.3-3-3-3c-0.4,0-0.8,0.1-1.2,0.3c-0.5-1-0.8-2.1-0.8-3.3c0-1.7,1.3-3,3-3 c0.8,0,1.5,0.3,2,0.8c-0.6,0.5-1,1.3-1,2.2c0,1.7,1.3,3,3,3s3-1.3,3-3s-1.3-3-3-3c0,0,0,0,0,0c-0.9-1.2-2.3-2-4-2c-2.8,0-5,2.2-5,5 c0,1.7,0.5,3.3,1.3,4.7C11.1,22.1,11,22.5,11,23c0,1.7,1.3,3,3,3c0.7,0,1.3-0.2,1.8-0.6l0,0c1,0.4,2.1,0.6,3.2,0.6c5,0,9-4,9-9 c0-1.7-0.3-3.3-0.9-4.8C27.6,11.6,28,10.9,28,10z M7,26c0.6,0,1,0.4,1,1c0,0.6-0.4,1-1,1s-1-0.4-1-1C6,26.4,6.4,26,7,26z M5,12 c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1s1,0.4,1,1C6,11.6,5.6,12,5,12z M15,6c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1s1,0.4,1,1 C16,5.6,15.6,6,15,6z M19,16c0.6,0,1,0.4,1,1c0,0.6-0.4,1-1,1s-1-0.4-1-1C18,16.4,18.4,16,19,16z M14,24c-0.6,0-1-0.4-1-1 c0-0.6,0.4-1,1-1s1,0.4,1,1C15,23.6,14.6,24,14,24z M25,11c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1s1,0.4,1,1C26,10.6,25.6,11,25,11z" class="Green" /> + </g> +</svg> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/createstackedlinechart.svg b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/createstackedlinechart.svg new file mode 100644 index 0000000..5e75422 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/Resources/createstackedlinechart.svg @@ -0,0 +1,11 @@ +锘�<?xml version='1.0' encoding='UTF-8'?> +<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Create_Stacked_Line_Chart" style="enable-background:new 0 0 32 32"> + <style type="text/css"> + .Blue{fill:#1177D7;} + .Yellow{fill:#FFB115;} + .Red{fill:#D11C1C;} +</style> + <path d="M29,0c-1.7,0-3,1.3-3,3c0,0.2,0,0.4,0.1,0.5l-9.1,5.2C16.4,8.3,15.7,8,15,8c-0.8,0-1.5,0.3-2.1,0.8L6,5.4 C6,5.3,6,5.1,6,5c0-1.7-1.3-3-3-3C1.3,2,0,3.4,0,5c0,1.7,1.3,3,3,3c0.8,0,1.5-0.3,2.1-0.8l7,3.5c0,0.1,0,0.2,0,0.4c0,1.7,1.3,3,3,3 c1.7,0,3-1.3,3-3c0-0.2,0-0.4-0.1-0.5l9.1-5.2C27.6,5.7,28.3,6,29,6c1.7,0,3-1.3,3-3C32,1.4,30.7,0,29,0z M3,6C2.4,6,2,5.6,2,5 c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1C4,5.6,3.6,6,3,6z M15,12c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1C16,11.6,15.6,12,15,12 z M29,4c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1C30,3.6,29.6,4,29,4z" class="Red" /> + <path d="M29,12c-1.6,0-2.9,1.2-3,2.8l-8.6,2.5C16.9,16.5,16,16,15,16c-1,0-1.8,0.5-2.4,1.2L6,15C6,13.3,4.6,12,3,12 c-1.7,0-3,1.3-3,3c0,1.7,1.3,3,3,3c1,0,1.8-0.5,2.4-1.2l6.7,2.2c0,1.6,1.4,2.9,3,2.9c1.6,0,2.9-1.2,3-2.8l8.6-2.5 C27.1,17.5,28,18,29,18c1.7,0,3-1.3,3-3C32,13.4,30.7,12,29,12z M3,16c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1 C4,15.6,3.6,16,3,16z M15,20c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1C16,19.6,15.6,20,15,20z M29,16c-0.6,0-1-0.4-1-1 c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1C30,15.6,29.6,16,29,16z" class="Yellow" /> + <path d="M29,26c-1.2,0-2.2,0.7-2.7,1.6l-8.4-1.2C17.7,25.1,16.5,24,15,24c-1.3,0-2.4,0.8-2.8,2H5.8 c-0.4-1.2-1.5-2-2.8-2c-1.7,0-3,1.3-3,3c0,1.7,1.3,3,3,3c1.3,0,2.4-0.8,2.8-2h6.4c0.4,1.2,1.5,2,2.8,2c1.1,0,2.1-0.6,2.6-1.6 l8.4,1.2C26.3,31,27.6,32,29,32c1.7,0,3-1.3,3-3C32,27.4,30.7,26,29,26z M3,28c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1 C4,27.6,3.6,28,3,28z M15,28c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1C16,27.6,15.6,28,15,28z M29,30c-0.6,0-1-0.4-1-1 c0-0.6,0.4-1,1-1c0.6,0,1,0.4,1,1C30,29.6,29.6,30,29,30z" class="Blue" /> +</svg> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.Designer.cs index 1bf5539..4b1d274 100644 --- a/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.Designer.cs +++ b/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.Designer.cs @@ -28,6 +28,9 @@ /// </summary> private void InitializeComponent() { + DevExpress.XtraCharts.TextAnnotation textAnnotation1 = new DevExpress.XtraCharts.TextAnnotation(); + DevExpress.XtraCharts.ChartAnchorPoint chartAnchorPoint1 = new DevExpress.XtraCharts.ChartAnchorPoint(); + DevExpress.XtraCharts.RelativePosition relativePosition1 = new DevExpress.XtraCharts.RelativePosition(); DevExpress.XtraCharts.XYDiagram xyDiagram1 = new DevExpress.XtraCharts.XYDiagram(); DevExpress.XtraCharts.ConstantLine constantLine1 = new DevExpress.XtraCharts.ConstantLine(); DevExpress.XtraCharts.ConstantLine constantLine2 = new DevExpress.XtraCharts.ConstantLine(); @@ -46,6 +49,7 @@ chartControl1 = new DevExpress.XtraCharts.ChartControl(); bar1 = new DevExpress.XtraBars.Bar(); ((System.ComponentModel.ISupportInitialize)chartControl1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)textAnnotation1).BeginInit(); ((System.ComponentModel.ISupportInitialize)xyDiagram1).BeginInit(); ((System.ComponentModel.ISupportInitialize)constantLine1).BeginInit(); ((System.ComponentModel.ISupportInitialize)constantLine2).BeginInit(); @@ -62,6 +66,15 @@ // // chartControl1 // + chartAnchorPoint1.X = 200; + chartAnchorPoint1.Y = 200; + textAnnotation1.AnchorPoint = chartAnchorPoint1; + textAnnotation1.AnnotationID = 0; + textAnnotation1.AutoHeight = true; + textAnnotation1.AutoWidth = true; + textAnnotation1.Name = "Annotation 1"; + textAnnotation1.ShapePosition = relativePosition1; + chartControl1.AnnotationRepository.AddRange(new DevExpress.XtraCharts.Annotation[] { textAnnotation1 }); chartControl1.BorderOptions.Visibility = DevExpress.Utils.DefaultBoolean.False; constantLine1.AxisValueSerializable = "1"; constantLine1.ConstantLineID = 0; @@ -174,6 +187,7 @@ Controls.Add(chartControl1); Name = "PumpViewChart"; Size = new Size(1023, 857); + ((System.ComponentModel.ISupportInitialize)textAnnotation1).EndInit(); ((System.ComponentModel.ISupportInitialize)constantLine1).EndInit(); ((System.ComponentModel.ISupportInitialize)constantLine2).EndInit(); ((System.ComponentModel.ISupportInitialize)xyDiagramPane1).EndInit(); diff --git a/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.cs b/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.cs index 222759f..feb1a9d 100644 --- a/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.cs +++ b/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.cs @@ -63,6 +63,7 @@ _line_visible = value; _const_line_x.Visible = value; _const_line_y.Visible = value; + _anno_txt_query_info.Visible = value; SetAxisXValue(); } } @@ -94,7 +95,10 @@ { this.chartControl1.SetChartDisplay(); this.chartControl1.RuntimeHitTesting = true; - this.chartControl1.AnimationStartMode = ChartAnimationMode.OnLoad; + //this.chartControl1.AnimationStartMode = ChartAnimationMode.OnLoad; + //this.chartControl1.SeriesSelectionMode = SeriesSelectionMode.Series; + //this.chartControl1.SelectionMode = ElementSelectionMode.Single; + this.chartControl1.ObjectHotTracked += new DevExpress.XtraCharts.HotTrackEventHandler(this.chartControl1_ObjectHotTracked); this.chartControl1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chartControl1_MouseMove); this.chartControl1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.chartControl1_MouseUp); @@ -117,6 +121,7 @@ _axis_y_power = _diagram.SecondaryAxesY.GetAxisByName("AxisYPower"); _axis_y_power.SetSecondaryAxisYQPDisplay(); + _const_line_x = (ConstantLine)_diagram.AxisX.ConstantLines.GetElementByName("ConstantLineX"); _const_line_x.SetWorkPointLineDisplay(); @@ -133,8 +138,14 @@ _axis_y_power.GridLines.Visible = false; _const_line_x.Visible = false; - _const_line_y.Visible = false; + _const_line_y.Visible = false; + + _anno_txt_query_info = this.chartControl1.AnnotationRepository[0] as TextAnnotation; + _anno_txt_query_info.SetTextAnnoWorkPointDisplay(); + _anno_txt_query_info.Visible = false; } + + /// <summary> /// 鍒濆鍖栧潗鏍囪酱 @@ -257,8 +268,13 @@ private void chartControl1_Resize(object sender, EventArgs e) { + var x = this.chartControl1.Location.X + this.chartControl1.Width; + var y = this.chartControl1.Location.Y + 100; + (_anno_txt_query_info.AnchorPoint as ChartAnchorPoint).X = x; + (_anno_txt_query_info.AnchorPoint as ChartAnchorPoint).Y = y; } + private void ChartControl1_CustomPaint(object sender, CustomPaintEventArgs e) { @@ -901,6 +917,7 @@ _const_line_x.Title.Visible = false; _const_line_y.Visible = false; _const_line_y.Title.Visible = false; + _anno_txt_query_info.Visible = false; return; } else @@ -909,6 +926,7 @@ _const_line_x.Title.Visible = true; _const_line_y.Visible = true; _const_line_y.Title.Visible = true; + _anno_txt_query_info.Visible = true; } if (this.IsInvalidData()) return; @@ -937,6 +955,15 @@ _const_line_y.AxisValue = y_value; _const_line_y.Title.Text = $"{y_value:N1}"; + + var query_info_builder = new StringBuilder(); + query_info_builder.AppendLine($"{x_value:N2} m鲁/h "); + query_info_builder.AppendLine($"{y_value:N2} m"); + + _anno_txt_query_info.Text = query_info_builder.ToString(); + _anno_txt_query_info.AutoSize = true; + _anno_txt_query_info.Visible = true; + } /// <summary> diff --git a/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChartViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChartViewModel.cs index 045a74b..3126c4e 100644 --- a/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChartViewModel.cs +++ b/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChartViewModel.cs @@ -6,6 +6,11 @@ /// /// </summary> public string Id { get; set; } + + /// <summary> + /// + /// </summary> + public long DbId { get; set; } /// <summary> /// @@ -16,6 +21,8 @@ /// /// </summary> public double N { get; set; } + + public double Eff { get; set; } /// <summary> /// @@ -51,6 +58,11 @@ /// /// </summary> public string GraphParas { get; set; } + + /// <summary> + /// + /// </summary> + public bool IsDefault { get; set; } /// <summary> diff --git a/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/SetEffDlg.cs b/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/SetEffDlg.cs index e9fa1ab..c5fa628 100644 --- a/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/SetEffDlg.cs +++ b/WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/SetEffDlg.cs @@ -9,7 +9,7 @@ InitializeComponent(); } - public event Func<List<double>?, bool> VerifyValueChanged; + public event Func<List<double>, bool> VerifyValueChanged; public void SetBindingData(double? value = null) { -- Gitblit v1.9.3