From 3872f8d9080a87d01c7257a5fd3d45e501d159e8 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期一, 12 八月 2024 17:57:51 +0800 Subject: [PATCH] 新增水力组件列表控件 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroBluntheadViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadViewModel.cs | 108 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantViewModel.cs | 116 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionViewModel.cs | 108 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterViewModel.cs | 108 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.Designer.cs | 162 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroThreelinkViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj.user | 11 WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroElbowViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterViewModel.cs | 108 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroMeterViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkViewModel.cs | 108 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroFourlinkViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowViewModel.cs | 108 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/00-core/HydroParterPropertyViewModel.cs | 2 WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroJunctionViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/00-core/HydroParterCatalogHelper.cs | 4 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterViewModel.cs | 108 + WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs | 2 WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroHydrantViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroPressmeterViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj | 30 WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroReservoirViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.Designer.cs | 153 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.resx | 123 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkViewModel.cs | 108 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroNozzleViewModel.datasource | 10 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.Designer.cs | 162 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleViewModel.cs | 116 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.cs | 48 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.cs | 51 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirViewModel.cs | 108 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroFlowmeterViewModel.datasource | 10 60 files changed, 4,942 insertions(+), 6 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs index 06e530d..eedcf0b 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs @@ -80,7 +80,7 @@ var revitModel = HStation.Service.RevitParseHelper.FromJsonFile(jsonFileInfo.FullName, out msg); if (revitModel == null) { - feedBackMsg?.Invoke("msg锛侊紒锛�"); + feedBackMsg?.Invoke($"{msg}锛侊紒锛�"); return false; } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/00-core/HydroPropertyCatalogHelper.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/00-core/HydroParterCatalogHelper.cs similarity index 94% rename from WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/00-core/HydroPropertyCatalogHelper.cs rename to WinFrmUI/Yw.WinFrmUI.Hydro.Core/00-core/HydroParterCatalogHelper.cs index 23ed4a4..875433d 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/00-core/HydroPropertyCatalogHelper.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/00-core/HydroParterCatalogHelper.cs @@ -1,9 +1,9 @@ 锘縩amespace Yw.WinFrmUI { /// <summary> - /// 姘村姏灞炴�х被鍒緟鍔╃被 + /// 姘村姏鏋勪欢绫诲埆杈呭姪绫� /// </summary> - public class HydroPropertyCatalogHelper + public class HydroParterCatalogHelper { //瀛楀吀 private static readonly Dictionary<string, string> _dict = new Dictionary<string, string>() diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/00-core/HydroParterPropertyViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/00-core/HydroParterPropertyViewModel.cs index 9175d10..afa5c6f 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/00-core/HydroParterPropertyViewModel.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/00-core/HydroParterPropertyViewModel.cs @@ -17,7 +17,7 @@ public HydroParterPropertyViewModel(Yw.Model.HydroParterInfo rhs) { this.ID = rhs.ID; - this.Catalog = HydroPropertyCatalogHelper.GetCatalogName(rhs.Catalog); + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); this.Name = rhs.Name; this.Code = rhs.Code; this.Flags = rhs.Flags; diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.Designer.cs new file mode 100644 index 0000000..1bc1c99 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroJunctionListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + hydroJunctionViewModelBindingSource = new BindingSource(components); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)hydroJunctionViewModelBindingSource).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroJunctionViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(799, 568); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // hydroJunctionViewModelBindingSource + // + hydroJunctionViewModelBindingSource.DataSource = typeof(HydroJunctionViewModel); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // HydroJunctionListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroJunctionListCtrl"; + Size = new Size(799, 568); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)hydroJunctionViewModelBindingSource).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private BindingSource hydroJunctionViewModelBindingSource; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.cs new file mode 100644 index 0000000..637b1a6 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.cs @@ -0,0 +1,51 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroJunctionListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroJunctionListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroJunctionInfo> HydroClickEvent; + + private List<HydroJunctionViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allJunctionList"></param> + public void SetBindingData(List<Yw.Model.HydroJunctionInfo> allJunctionList) + { + _allBindingList = new List<HydroJunctionViewModel>(); + if (allJunctionList != null && allJunctionList.Count > 0) + { + foreach (var junction in allJunctionList) + { + var vm = new HydroJunctionViewModel(junction); + _allBindingList.Add(vm); + } + } + this.hydroJunctionViewModelBindingSource.DataSource = _allBindingList; + this.hydroJunctionViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroJunctionViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + + + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.resx new file mode 100644 index 0000000..ed4cd5d --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroJunctionViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionViewModel.cs new file mode 100644 index 0000000..57da2db --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/01-junction/HydroJunctionViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroJunctionViewModel + { + /// <summary> + /// + /// </summary> + public HydroJunctionViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroJunctionViewModel(Yw.Model.HydroJunctionInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroJunctionInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.Designer.cs new file mode 100644 index 0000000..113699b --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.Designer.cs @@ -0,0 +1,162 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroNozzleListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + hydroNozzleViewModelBindingSource = new BindingSource(components); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colCoefficient = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)hydroNozzleViewModelBindingSource).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroNozzleViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // hydroNozzleViewModelBindingSource + // + hydroNozzleViewModelBindingSource.DataSource = typeof(HydroNozzleViewModel); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colCoefficient, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colCoefficient + // + colCoefficient.FieldName = "Coefficient"; + colCoefficient.Name = "colCoefficient"; + colCoefficient.Visible = true; + colCoefficient.VisibleIndex = 7; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 8; + // + // HydroNozzleListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroNozzleListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)hydroNozzleViewModelBindingSource).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private BindingSource hydroNozzleViewModelBindingSource; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colCoefficient; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.cs new file mode 100644 index 0000000..58029c6 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroNozzleListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroNozzleListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroNozzleInfo> HydroClickEvent; + + private List<HydroNozzleViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allNozzleList"></param> + public void SetBindingData(List<Yw.Model.HydroNozzleInfo> allNozzleList) + { + _allBindingList = new List<HydroNozzleViewModel>(); + if (allNozzleList != null && allNozzleList.Count > 0) + { + foreach (var nozzle in allNozzleList) + { + var vm = new HydroNozzleViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroNozzleViewModelBindingSource.DataSource = _allBindingList; + this.hydroNozzleViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroNozzleViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.resx new file mode 100644 index 0000000..14b4ff4 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroNozzleViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleViewModel.cs new file mode 100644 index 0000000..b54e8d4 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-nozzle/HydroNozzleViewModel.cs @@ -0,0 +1,116 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroNozzleViewModel + { + /// <summary> + /// + /// </summary> + public HydroNozzleViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroNozzleViewModel(Yw.Model.HydroNozzleInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + this.Coefficient = rhs.Coefficient; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// 鍠峰皠绯绘暟 + /// </summary> + [DisplayName("鍠峰皠绯绘暟")] + [Display(Name = "鍠峰皠绯绘暟")] + public double Coefficient { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroNozzleInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.Designer.cs new file mode 100644 index 0000000..4badd2c --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.Designer.cs @@ -0,0 +1,162 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroHydrantListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colCoefficient = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + hydroHydrantViewModelBindingSource = new BindingSource(components); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + ((ISupportInitialize)hydroHydrantViewModelBindingSource).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroHydrantViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colCoefficient, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colCoefficient + // + colCoefficient.FieldName = "Coefficient"; + colCoefficient.Name = "colCoefficient"; + colCoefficient.Visible = true; + colCoefficient.VisibleIndex = 7; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 8; + // + // hydroHydrantViewModelBindingSource + // + hydroHydrantViewModelBindingSource.DataSource = typeof(HydroHydrantViewModel); + // + // HydroHydrantListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroHydrantListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ((ISupportInitialize)hydroHydrantViewModelBindingSource).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colCoefficient; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroHydrantViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.cs new file mode 100644 index 0000000..499fc8a --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroHydrantListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroHydrantListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroHydrantInfo> HydroClickEvent; + + private List<HydroHydrantViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allHydrantList"></param> + public void SetBindingData(List<Yw.Model.HydroHydrantInfo> allHydrantList) + { + _allBindingList = new List<HydroHydrantViewModel>(); + if (allHydrantList != null && allHydrantList.Count > 0) + { + foreach (var nozzle in allHydrantList) + { + var vm = new HydroHydrantViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroHydrantViewModelBindingSource.DataSource = _allBindingList; + this.hydroHydrantViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroHydrantViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.resx new file mode 100644 index 0000000..58d99bb --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroHydrantViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantViewModel.cs new file mode 100644 index 0000000..8a96b4a --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/03-hydrant/HydroHydrantViewModel.cs @@ -0,0 +1,116 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroHydrantViewModel + { + /// <summary> + /// + /// </summary> + public HydroHydrantViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroHydrantViewModel(Yw.Model.HydroHydrantInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + this.Coefficient = rhs.Coefficient; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// 娴侀噺绯绘暟 + /// </summary> + [DisplayName("娴侀噺绯绘暟")] + [Display(Name = "娴侀噺绯绘暟")] + public double Coefficient { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroHydrantInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.Designer.cs new file mode 100644 index 0000000..a09b9ee --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroElbowListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + hydroElbowViewModelBindingSource = new BindingSource(components); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)hydroElbowViewModelBindingSource).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroElbowViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // hydroElbowViewModelBindingSource + // + hydroElbowViewModelBindingSource.DataSource = typeof(HydroElbowViewModel); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // HydroElbowListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroElbowListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)hydroElbowViewModelBindingSource).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroElbowViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.cs new file mode 100644 index 0000000..10a8011 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroElbowListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroElbowListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroElbowInfo> HydroClickEvent; + + private List<HydroElbowViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allElbowList"></param> + public void SetBindingData(List<Yw.Model.HydroElbowInfo> allElbowList) + { + _allBindingList = new List<HydroElbowViewModel>(); + if (allElbowList != null && allElbowList.Count > 0) + { + foreach (var nozzle in allElbowList) + { + var vm = new HydroElbowViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroElbowViewModelBindingSource.DataSource = _allBindingList; + this.hydroElbowViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroElbowViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.resx new file mode 100644 index 0000000..c7eb585 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroElbowViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowViewModel.cs new file mode 100644 index 0000000..34cb6e4 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/04-elbow/HydroElbowViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroElbowViewModel + { + /// <summary> + /// + /// </summary> + public HydroElbowViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroElbowViewModel(Yw.Model.HydroElbowInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroElbowInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.Designer.cs new file mode 100644 index 0000000..faa0447 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroThreelinkListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + hydroThreelinkViewModelBindingSource = new BindingSource(components); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + ((ISupportInitialize)hydroThreelinkViewModelBindingSource).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroThreelinkViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // hydroThreelinkViewModelBindingSource + // + hydroThreelinkViewModelBindingSource.DataSource = typeof(HydroThreelinkViewModel); + // + // HydroThreelinkListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroThreelinkListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ((ISupportInitialize)hydroThreelinkViewModelBindingSource).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroThreelinkViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.cs new file mode 100644 index 0000000..574d190 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroThreelinkListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroThreelinkListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroThreelinkInfo> HydroClickEvent; + + private List<HydroThreelinkViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allThreelinkList"></param> + public void SetBindingData(List<Yw.Model.HydroThreelinkInfo> allThreelinkList) + { + _allBindingList = new List<HydroThreelinkViewModel>(); + if (allThreelinkList != null && allThreelinkList.Count > 0) + { + foreach (var nozzle in allThreelinkList) + { + var vm = new HydroThreelinkViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroThreelinkViewModelBindingSource.DataSource = _allBindingList; + this.hydroThreelinkViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroThreelinkViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.resx new file mode 100644 index 0000000..ac61b6d --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroThreelinkViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkViewModel.cs new file mode 100644 index 0000000..d120ba0 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/05-threelink/HydroThreelinkViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroThreelinkViewModel + { + /// <summary> + /// + /// </summary> + public HydroThreelinkViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroThreelinkViewModel(Yw.Model.HydroThreelinkInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroThreelinkInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.Designer.cs new file mode 100644 index 0000000..89ff934 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroFourlinkListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + hydroFourlinkViewModelBindingSource = new BindingSource(components); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + ((ISupportInitialize)hydroFourlinkViewModelBindingSource).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroFourlinkViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // hydroFourlinkViewModelBindingSource + // + hydroFourlinkViewModelBindingSource.DataSource = typeof(HydroFourlinkViewModel); + // + // HydroFourlinkListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroFourlinkListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ((ISupportInitialize)hydroFourlinkViewModelBindingSource).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroFourlinkViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.cs new file mode 100644 index 0000000..5cbcc84 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroFourlinkListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroFourlinkListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroFourlinkInfo> HydroClickEvent; + + private List<HydroFourlinkViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allFourlinkList"></param> + public void SetBindingData(List<Yw.Model.HydroFourlinkInfo> allFourlinkList) + { + _allBindingList = new List<HydroFourlinkViewModel>(); + if (allFourlinkList != null && allFourlinkList.Count > 0) + { + foreach (var nozzle in allFourlinkList) + { + var vm = new HydroFourlinkViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroFourlinkViewModelBindingSource.DataSource = _allBindingList; + this.hydroFourlinkViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroFourlinkViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.resx new file mode 100644 index 0000000..e5fa491 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroFourlinkViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkViewModel.cs new file mode 100644 index 0000000..adfed42 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-fourlink/HydroFourlinkViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroFourlinkViewModel + { + /// <summary> + /// + /// </summary> + public HydroFourlinkViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroFourlinkViewModel(Yw.Model.HydroFourlinkInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroFourlinkInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.Designer.cs new file mode 100644 index 0000000..e1f183a --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroMeterListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + hydroMeterViewModelBindingSource = new BindingSource(components); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + ((ISupportInitialize)hydroMeterViewModelBindingSource).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroMeterViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // hydroMeterViewModelBindingSource + // + hydroMeterViewModelBindingSource.DataSource = typeof(HydroMeterViewModel); + // + // HydroMeterListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroMeterListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ((ISupportInitialize)hydroMeterViewModelBindingSource).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroMeterViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.cs new file mode 100644 index 0000000..e0d7ae1 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroMeterListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroMeterListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroMeterInfo> HydroClickEvent; + + private List<HydroMeterViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allMeterList"></param> + public void SetBindingData(List<Yw.Model.HydroMeterInfo> allMeterList) + { + _allBindingList = new List<HydroMeterViewModel>(); + if (allMeterList != null && allMeterList.Count > 0) + { + foreach (var nozzle in allMeterList) + { + var vm = new HydroMeterViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroMeterViewModelBindingSource.DataSource = _allBindingList; + this.hydroMeterViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroMeterViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.resx new file mode 100644 index 0000000..c50d77c --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroMeterViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterViewModel.cs new file mode 100644 index 0000000..84e4761 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/06-meter/HydroMeterViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroMeterViewModel + { + /// <summary> + /// + /// </summary> + public HydroMeterViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroMeterViewModel(Yw.Model.HydroMeterInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroMeterInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.Designer.cs new file mode 100644 index 0000000..85c0e63 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroFlowmeterListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + hydroFlowmeterViewModelBindingSource = new BindingSource(components); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + ((ISupportInitialize)hydroFlowmeterViewModelBindingSource).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroFlowmeterViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // hydroFlowmeterViewModelBindingSource + // + hydroFlowmeterViewModelBindingSource.DataSource = typeof(HydroFlowmeterViewModel); + // + // HydroFlowmeterListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroFlowmeterListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ((ISupportInitialize)hydroFlowmeterViewModelBindingSource).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroFlowmeterViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.cs new file mode 100644 index 0000000..4bd186b --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroFlowmeterListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroFlowmeterListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroFlowmeterInfo> HydroClickEvent; + + private List<HydroFlowmeterViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allFlowmeterList"></param> + public void SetBindingData(List<Yw.Model.HydroFlowmeterInfo> allFlowmeterList) + { + _allBindingList = new List<HydroFlowmeterViewModel>(); + if (allFlowmeterList != null && allFlowmeterList.Count > 0) + { + foreach (var nozzle in allFlowmeterList) + { + var vm = new HydroFlowmeterViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroFlowmeterViewModelBindingSource.DataSource = _allBindingList; + this.hydroFlowmeterViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroFlowmeterViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.resx new file mode 100644 index 0000000..b2ccd16 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroFlowmeterViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterViewModel.cs new file mode 100644 index 0000000..c5d8fe9 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/07-flowmeter/HydroFlowmeterViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroFlowmeterViewModel + { + /// <summary> + /// + /// </summary> + public HydroFlowmeterViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroFlowmeterViewModel(Yw.Model.HydroFlowmeterInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroFlowmeterInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.Designer.cs new file mode 100644 index 0000000..84f83b3 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroPressmeterListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + hydroPressmeterViewModelBindingSource = new BindingSource(components); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + ((ISupportInitialize)hydroPressmeterViewModelBindingSource).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroPressmeterViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // hydroPressmeterViewModelBindingSource + // + hydroPressmeterViewModelBindingSource.DataSource = typeof(HydroPressmeterViewModel); + // + // HydroPressmeterListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroPressmeterListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ((ISupportInitialize)hydroPressmeterViewModelBindingSource).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroPressmeterViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.cs new file mode 100644 index 0000000..e6cf834 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroPressmeterListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroPressmeterListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroPressmeterInfo> HydroClickEvent; + + private List<HydroPressmeterViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allPressmeterList"></param> + public void SetBindingData(List<Yw.Model.HydroPressmeterInfo> allPressmeterList) + { + _allBindingList = new List<HydroPressmeterViewModel>(); + if (allPressmeterList != null && allPressmeterList.Count > 0) + { + foreach (var nozzle in allPressmeterList) + { + var vm = new HydroPressmeterViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroPressmeterViewModelBindingSource.DataSource = _allBindingList; + this.hydroPressmeterViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroPressmeterViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.resx new file mode 100644 index 0000000..84a093b --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroPressmeterViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterViewModel.cs new file mode 100644 index 0000000..c5dd259 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/08-pressmeter/HydroPressmeterViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroPressmeterViewModel + { + /// <summary> + /// + /// </summary> + public HydroPressmeterViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroPressmeterViewModel(Yw.Model.HydroPressmeterInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroPressmeterInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.Designer.cs new file mode 100644 index 0000000..8c65879 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroBluntheadListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemand = new DevExpress.XtraGrid.Columns.GridColumn(); + colDemandPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + hydroBluntheadViewModelBindingSource = new BindingSource(components); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + ((ISupportInitialize)hydroBluntheadViewModelBindingSource).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroBluntheadViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colElev, colDemand, colDemandPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colElev + // + colElev.FieldName = "Elev"; + colElev.Name = "colElev"; + colElev.Visible = true; + colElev.VisibleIndex = 4; + // + // colDemand + // + colDemand.FieldName = "Demand"; + colDemand.Name = "colDemand"; + colDemand.Visible = true; + colDemand.VisibleIndex = 5; + // + // colDemandPattern + // + colDemandPattern.FieldName = "DemandPattern"; + colDemandPattern.Name = "colDemandPattern"; + colDemandPattern.Visible = true; + colDemandPattern.VisibleIndex = 6; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // hydroBluntheadViewModelBindingSource + // + hydroBluntheadViewModelBindingSource.DataSource = typeof(HydroBluntheadViewModel); + // + // HydroBluntheadListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroBluntheadListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ((ISupportInitialize)hydroBluntheadViewModelBindingSource).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colElev; + private DevExpress.XtraGrid.Columns.GridColumn colDemand; + private DevExpress.XtraGrid.Columns.GridColumn colDemandPattern; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroBluntheadViewModelBindingSource; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.cs new file mode 100644 index 0000000..c521d72 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroBluntheadListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroBluntheadListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroBluntheadInfo> HydroClickEvent; + + private List<HydroBluntheadViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allBluntheadList"></param> + public void SetBindingData(List<Yw.Model.HydroBluntheadInfo> allBluntheadList) + { + _allBindingList = new List<HydroBluntheadViewModel>(); + if (allBluntheadList != null && allBluntheadList.Count > 0) + { + foreach (var nozzle in allBluntheadList) + { + var vm = new HydroBluntheadViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroBluntheadViewModelBindingSource.DataSource = _allBindingList; + this.hydroBluntheadViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroBluntheadViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.resx new file mode 100644 index 0000000..40b80f3 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroBluntheadViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadViewModel.cs new file mode 100644 index 0000000..4678cb3 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/09-blunthead/HydroBluntheadViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroBluntheadViewModel + { + /// <summary> + /// + /// </summary> + public HydroBluntheadViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroBluntheadViewModel(Yw.Model.HydroBluntheadInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.Elev = rhs.Elev; + this.Demand = rhs.Demand; + this.DemandPattern = rhs.DemandPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 鏍囬珮 + /// </summary> + [DisplayName("鏍囬珮")] + [Display(Name = "鏍囬珮")] + public double Elev { get; set; } + + /// <summary> + /// 闇�姘撮噺 + /// </summary> + [DisplayName("闇�姘撮噺")] + [Display(Name = "闇�姘撮噺")] + public double? Demand { get; set; } + + /// <summary> + /// 闇�姘存ā寮� + /// </summary> + [DisplayName("闇�姘存ā寮�")] + [Display(Name = "闇�姘存ā寮�")] + public string DemandPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroBluntheadInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.Designer.cs new file mode 100644 index 0000000..e96b2a1 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.Designer.cs @@ -0,0 +1,153 @@ +锘縩amespace Yw.WinFrmUI +{ + partial class HydroReservoirListCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + components = new Container(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + hydroReservoirViewModelBindingSource = new BindingSource(components); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + colCode = new DevExpress.XtraGrid.Columns.GridColumn(); + colName = new DevExpress.XtraGrid.Columns.GridColumn(); + colFlagsString = new DevExpress.XtraGrid.Columns.GridColumn(); + colQuality = new DevExpress.XtraGrid.Columns.GridColumn(); + colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); + colPoolElev = new DevExpress.XtraGrid.Columns.GridColumn(); + colHead = new DevExpress.XtraGrid.Columns.GridColumn(); + colHeadPattern = new DevExpress.XtraGrid.Columns.GridColumn(); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)hydroReservoirViewModelBindingSource).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + SuspendLayout(); + // + // gridControl1 + // + gridControl1.DataSource = hydroReservoirViewModelBindingSource; + gridControl1.Dock = DockStyle.Fill; + gridControl1.Location = new Point(0, 0); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(818, 590); + gridControl1.TabIndex = 0; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // hydroReservoirViewModelBindingSource + // + hydroReservoirViewModelBindingSource.DataSource = typeof(HydroReservoirViewModel); + // + // gridView1 + // + gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colCode, colName, colFlagsString, colQuality, colPoolElev, colHead, colHeadPattern, colDescription }); + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + gridView1.RowClick += gridView1_RowClick; + // + // colCode + // + colCode.FieldName = "Code"; + colCode.Name = "colCode"; + colCode.Visible = true; + colCode.VisibleIndex = 0; + // + // colName + // + colName.FieldName = "Name"; + colName.Name = "colName"; + colName.Visible = true; + colName.VisibleIndex = 1; + // + // colFlagsString + // + colFlagsString.FieldName = "FlagsString"; + colFlagsString.Name = "colFlagsString"; + colFlagsString.Visible = true; + colFlagsString.VisibleIndex = 2; + // + // colQuality + // + colQuality.FieldName = "Quality"; + colQuality.Name = "colQuality"; + colQuality.Visible = true; + colQuality.VisibleIndex = 3; + // + // colDescription + // + colDescription.FieldName = "Description"; + colDescription.Name = "colDescription"; + colDescription.Visible = true; + colDescription.VisibleIndex = 7; + // + // colPoolElev + // + colPoolElev.FieldName = "PoolElev"; + colPoolElev.Name = "colPoolElev"; + colPoolElev.Visible = true; + colPoolElev.VisibleIndex = 4; + // + // colHead + // + colHead.FieldName = "Head"; + colHead.Name = "colHead"; + colHead.Visible = true; + colHead.VisibleIndex = 5; + // + // colHeadPattern + // + colHeadPattern.FieldName = "HeadPattern"; + colHeadPattern.Name = "colHeadPattern"; + colHeadPattern.Visible = true; + colHeadPattern.VisibleIndex = 6; + // + // HydroReservoirListCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(gridControl1); + Name = "HydroReservoirListCtrl"; + Size = new Size(818, 590); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)hydroReservoirViewModelBindingSource).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraGrid.Columns.GridColumn colCode; + private DevExpress.XtraGrid.Columns.GridColumn colName; + private DevExpress.XtraGrid.Columns.GridColumn colFlagsString; + private DevExpress.XtraGrid.Columns.GridColumn colQuality; + private DevExpress.XtraGrid.Columns.GridColumn colDescription; + private BindingSource hydroReservoirViewModelBindingSource; + private DevExpress.XtraGrid.Columns.GridColumn colPoolElev; + private DevExpress.XtraGrid.Columns.GridColumn colHead; + private DevExpress.XtraGrid.Columns.GridColumn colHeadPattern; + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.cs new file mode 100644 index 0000000..2ea3644 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.cs @@ -0,0 +1,48 @@ +锘縩amespace Yw.WinFrmUI +{ + public partial class HydroReservoirListCtrl : DevExpress.XtraEditors.XtraUserControl + { + public HydroReservoirListCtrl() + { + InitializeComponent(); + this.gridView1.SetNormalView(30); + } + + /// <summary> + /// 姘村姏鐐瑰嚮浜嬩欢 + /// </summary> + public event Action<Yw.Model.HydroReservoirInfo> HydroClickEvent; + + private List<HydroReservoirViewModel> _allBindingList = null;//鎵�鏈夌粦瀹氬垪琛� + + /// <summary> + /// 缁戝畾鏁版嵁 + /// </summary> + /// <param name="allReservoirList"></param> + public void SetBindingData(List<Yw.Model.HydroReservoirInfo> allReservoirList) + { + _allBindingList = new List<HydroReservoirViewModel>(); + if (allReservoirList != null && allReservoirList.Count > 0) + { + foreach (var nozzle in allReservoirList) + { + var vm = new HydroReservoirViewModel(nozzle); + _allBindingList.Add(vm); + } + } + this.hydroReservoirViewModelBindingSource.DataSource = _allBindingList; + this.hydroReservoirViewModelBindingSource.ResetBindings(false); + } + + //琛岀偣鍑讳簨浠� + private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) + { + var row = this.gridView1.GetRow(e.RowHandle) as HydroReservoirViewModel; + if (row == null) + { + return; + } + this.HydroClickEvent?.Invoke(row.Vmo); + } + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.resx b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.resx new file mode 100644 index 0000000..115ce3a --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirListCtrl.resx @@ -0,0 +1,123 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="hydroReservoirViewModelBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirViewModel.cs new file mode 100644 index 0000000..42ed989 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/10-reservoir/HydroReservoirViewModel.cs @@ -0,0 +1,108 @@ +锘縩amespace Yw.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class HydroReservoirViewModel + { + /// <summary> + /// + /// </summary> + public HydroReservoirViewModel() { } + + /// <summary> + /// + /// </summary> + public HydroReservoirViewModel(Yw.Model.HydroReservoirInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Code = rhs.Code; + this.Name = rhs.Name; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + this.Quality = rhs.Quality; + this.PoolElev = rhs.PoolElev; + this.Head = rhs.Head; + this.HeadPattern = rhs.HeadPattern; + + this.Vmo = rhs; + } + + /// <summary> + /// id + /// </summary> + [DisplayName("ID")] + [Display(Name = "ID")] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [DisplayName("鍒嗙被")] + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [DisplayName("缂栫爜")] + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [DisplayName("鍚嶇О")] + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [DisplayName("鏍囩")] + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [DisplayName("璇存槑")] + [Display(Name = "璇存槑")] + public string Description { get; set; } + + /// <summary> + /// 鍒濆姘磋川 + /// </summary> + [DisplayName("鍒濆姘磋川")] + [Display(Name = "鍒濆姘磋川")] + public double Quality { get; set; } + + /// <summary> + /// 姹犲簳鏍囬珮 + /// </summary> + [DisplayName("姹犲簳鏍囬珮")] + [Display(Name = "姹犲簳鏍囬珮")] + public double? PoolElev { get; set; } + + /// <summary> + /// 鎬绘按澶� + /// </summary> + [DisplayName("鎬绘按澶�")] + [Display(Name = "鎬绘按澶�")] + public double? Head { get; set; } + + /// <summary> + /// 姘村ご妯″紡 + /// </summary> + [DisplayName("姘村ご妯″紡")] + [Display(Name = "姘村ご妯″紡")] + public string HeadPattern { get; set; } + + /// <summary> + /// + /// </summary> + public Yw.Model.HydroReservoirInfo Vmo { get; set; } + + } +} diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroBluntheadViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroBluntheadViewModel.datasource new file mode 100644 index 0000000..d07f18e --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroBluntheadViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroBluntheadViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroBluntheadViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroElbowViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroElbowViewModel.datasource new file mode 100644 index 0000000..5be64ec --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroElbowViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroElbowViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroElbowViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroFlowmeterViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroFlowmeterViewModel.datasource new file mode 100644 index 0000000..49b175f --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroFlowmeterViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroFlowmeterViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroFlowmeterViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroFourlinkViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroFourlinkViewModel.datasource new file mode 100644 index 0000000..93605c8 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroFourlinkViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroFourlinkViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroFourlinkViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroHydrantViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroHydrantViewModel.datasource new file mode 100644 index 0000000..c34d993 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroHydrantViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroHydrantViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroHydrantViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroJunctionViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroJunctionViewModel.datasource new file mode 100644 index 0000000..969ff76 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroJunctionViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroJunctionViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroJunctionViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroMeterViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroMeterViewModel.datasource new file mode 100644 index 0000000..0939930 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroMeterViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroMeterViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroMeterViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroNozzleViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroNozzleViewModel.datasource new file mode 100644 index 0000000..4643749 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroNozzleViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroNozzleViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroNozzleViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroPressmeterViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroPressmeterViewModel.datasource new file mode 100644 index 0000000..1b4db94 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroPressmeterViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroPressmeterViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroPressmeterViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroReservoirViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroReservoirViewModel.datasource new file mode 100644 index 0000000..6c0a383 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroReservoirViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroReservoirViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroReservoirViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroThreelinkViewModel.datasource b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroThreelinkViewModel.datasource new file mode 100644 index 0000000..15498c7 --- /dev/null +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Properties/DataSources/Yw.WinFrmUI.HydroThreelinkViewModel.datasource @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<!-- + This file is automatically generated by Visual Studio. It is + used to store generic object data source configuration information. + Renaming the file extension or editing the content of this file may + cause the file to be unrecognizable by the program. +--> +<GenericObjectDataSource DisplayName="HydroThreelinkViewModel" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <TypeInfo>Yw.WinFrmUI.HydroThreelinkViewModel, Yw.WinFrmUI.Hydro.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> +</GenericObjectDataSource> \ No newline at end of file diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj index 2b2c5d3..2ad7101 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj @@ -8,7 +8,8 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Yw.BLL.Hydro.Core" Version="3.0.8" /> + <PackageReference Include="DevExpress.Win.Design" Version="23.2.4" /> + <PackageReference Include="Yw.BLL.Hydro.Core" Version="3.1.1" /> </ItemGroup> <ItemGroup> @@ -26,6 +27,33 @@ <Compile Update="03-property\HydroParterPropertyCtrl.cs"> <SubType>UserControl</SubType> </Compile> + <Compile Update="04-parter\09-blunthead\HydroBluntheadListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\08-pressmeter\HydroPressmeterListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\07-flowmeter\HydroFlowmeterListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\06-meter\HydroMeterListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\06-fourlink\HydroFourlinkListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\05-threelink\HydroThreelinkListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\04-elbow\HydroElbowListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\03-hydrant\HydroHydrantListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\10-reservoir\HydroReservoirListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> <Compile Update="Properties\Resources.Designer.cs"> <DesignTime>True</DesignTime> <AutoGen>True</AutoGen> diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj.user b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj.user index 317a8c7..870f23b 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj.user +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj.user @@ -1,2 +1,11 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" /> \ No newline at end of file +<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Compile Update="04-parter\01-junction\HydroJunctionListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Update="04-parter\02-nozzle\HydroNozzleListCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> + </ItemGroup> +</Project> \ No newline at end of file -- Gitblit v1.9.3