From 217756094e1f22763edf2b18d3723403786c82fc Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期五, 18 十月 2024 11:18:28 +0800 Subject: [PATCH] 提交错误修补 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.Designer.cs | 117 +++---- WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.cs | 46 ++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.Designer.cs | 226 ++++++++------- WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.Designer.cs | 88 ++--- WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs | 89 +++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.cs | 37 + WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.cs | 141 +++++++++ WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.Designer.cs | 95 ++---- 8 files changed, 512 insertions(+), 327 deletions(-) diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.Designer.cs index a55473e..ee1786b 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.Designer.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.Designer.cs @@ -28,56 +28,25 @@ /// </summary> private void InitializeComponent() { - tablePanel1 = new DevExpress.Utils.Layout.TablePanel(); - setWaterboxCalcuPrefixCtrl1 = new SetWaterboxCalcuPrefixCtrl(); - setWaterboxCalcuPrefixCtrl2 = new SetWaterboxCalcuPrefixCtrl(); - setWaterboxCalcuPrefixCtrl3 = new SetWaterboxCalcuPrefixCtrl(); + tabPanelBottom = new DevExpress.Utils.Layout.TablePanel(); labelControl1 = new DevExpress.XtraEditors.LabelControl(); - ((ISupportInitialize)tablePanel1).BeginInit(); - tablePanel1.SuspendLayout(); + tabPanelCore = new DevExpress.Utils.Layout.TablePanel(); + ((ISupportInitialize)tabPanelBottom).BeginInit(); + tabPanelBottom.SuspendLayout(); + ((ISupportInitialize)tabPanelCore).BeginInit(); SuspendLayout(); // - // tablePanel1 + // tabPanelBottom // - tablePanel1.AutoScroll = true; - tablePanel1.Columns.AddRange(new DevExpress.Utils.Layout.TablePanelColumn[] { new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 5F) }); - tablePanel1.Controls.Add(labelControl1); - tablePanel1.Controls.Add(setWaterboxCalcuPrefixCtrl3); - tablePanel1.Controls.Add(setWaterboxCalcuPrefixCtrl2); - tablePanel1.Controls.Add(setWaterboxCalcuPrefixCtrl1); - tablePanel1.Dock = DockStyle.Fill; - tablePanel1.Location = new Point(0, 0); - tablePanel1.Name = "tablePanel1"; - tablePanel1.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] { new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 20F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F) }); - tablePanel1.Size = new Size(322, 552); - tablePanel1.TabIndex = 0; - // - // setWaterboxCalcuPrefixCtrl1 - // - tablePanel1.SetColumn(setWaterboxCalcuPrefixCtrl1, 0); - setWaterboxCalcuPrefixCtrl1.Location = new Point(3, 23); - setWaterboxCalcuPrefixCtrl1.Name = "setWaterboxCalcuPrefixCtrl1"; - tablePanel1.SetRow(setWaterboxCalcuPrefixCtrl1, 1); - setWaterboxCalcuPrefixCtrl1.Size = new Size(316, 145); - setWaterboxCalcuPrefixCtrl1.TabIndex = 0; - // - // setWaterboxCalcuPrefixCtrl2 - // - tablePanel1.SetColumn(setWaterboxCalcuPrefixCtrl2, 0); - setWaterboxCalcuPrefixCtrl2.Location = new Point(3, 174); - setWaterboxCalcuPrefixCtrl2.Name = "setWaterboxCalcuPrefixCtrl2"; - tablePanel1.SetRow(setWaterboxCalcuPrefixCtrl2, 2); - setWaterboxCalcuPrefixCtrl2.Size = new Size(316, 145); - setWaterboxCalcuPrefixCtrl2.TabIndex = 1; - // - // setWaterboxCalcuPrefixCtrl3 - // - tablePanel1.SetColumn(setWaterboxCalcuPrefixCtrl3, 0); - setWaterboxCalcuPrefixCtrl3.Location = new Point(3, 325); - setWaterboxCalcuPrefixCtrl3.Name = "setWaterboxCalcuPrefixCtrl3"; - tablePanel1.SetRow(setWaterboxCalcuPrefixCtrl3, 3); - setWaterboxCalcuPrefixCtrl3.Size = new Size(316, 145); - setWaterboxCalcuPrefixCtrl3.TabIndex = 2; + tabPanelBottom.Columns.AddRange(new DevExpress.Utils.Layout.TablePanelColumn[] { new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 5F) }); + tabPanelBottom.Controls.Add(tabPanelCore); + tabPanelBottom.Controls.Add(labelControl1); + tabPanelBottom.Dock = DockStyle.Fill; + tabPanelBottom.Location = new Point(0, 0); + tabPanelBottom.Name = "tabPanelBottom"; + tabPanelBottom.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] { new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 20F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F) }); + tabPanelBottom.Size = new Size(344, 686); + tabPanelBottom.TabIndex = 0; // // labelControl1 // @@ -85,36 +54,46 @@ labelControl1.Appearance.ForeColor = Color.White; labelControl1.Appearance.Options.UseBackColor = true; labelControl1.Appearance.Options.UseForeColor = true; - tablePanel1.SetColumn(labelControl1, 0); + tabPanelBottom.SetColumn(labelControl1, 0); labelControl1.Dock = DockStyle.Fill; labelControl1.Location = new Point(0, 0); labelControl1.Margin = new Padding(0); labelControl1.Name = "labelControl1"; labelControl1.Padding = new Padding(5, 0, 0, 0); - tablePanel1.SetRow(labelControl1, 0); - labelControl1.Size = new Size(322, 20); + tabPanelBottom.SetRow(labelControl1, 0); + labelControl1.Size = new Size(344, 20); labelControl1.TabIndex = 3; labelControl1.Text = "姘寸"; + // + // tabPanelCore + // + tabPanelCore.AutoScroll = true; + tabPanelBottom.SetColumn(tabPanelCore, 0); + tabPanelCore.Dock = DockStyle.Fill; + tabPanelCore.Location = new Point(3, 23); + tabPanelCore.Name = "tabPanelCore"; + tabPanelBottom.SetRow(tabPanelCore, 1); + tabPanelCore.Size = new Size(338, 660); + tabPanelCore.TabIndex = 4; // // SetWaterboxCalcuPrefixListCtrl // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; - Controls.Add(tablePanel1); + Controls.Add(tabPanelBottom); Name = "SetWaterboxCalcuPrefixListCtrl"; - Size = new Size(322, 552); - ((ISupportInitialize)tablePanel1).EndInit(); - tablePanel1.ResumeLayout(false); - tablePanel1.PerformLayout(); + Size = new Size(344, 686); + ((ISupportInitialize)tabPanelBottom).EndInit(); + tabPanelBottom.ResumeLayout(false); + tabPanelBottom.PerformLayout(); + ((ISupportInitialize)tabPanelCore).EndInit(); ResumeLayout(false); } #endregion - private DevExpress.Utils.Layout.TablePanel tablePanel1; + private DevExpress.Utils.Layout.TablePanel tabPanelBottom; private DevExpress.XtraEditors.LabelControl labelControl1; - private SetWaterboxCalcuPrefixCtrl setWaterboxCalcuPrefixCtrl3; - private SetWaterboxCalcuPrefixCtrl setWaterboxCalcuPrefixCtrl2; - private SetWaterboxCalcuPrefixCtrl setWaterboxCalcuPrefixCtrl1; + private DevExpress.Utils.Layout.TablePanel tabPanelCore; } } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs index 3a6572b..3756408 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/01-waterbox/SetWaterboxCalcuPrefixListCtrl.cs @@ -1,4 +1,5 @@ -锘縰sing DevExpress.XtraEditors; +锘縰sing DevExpress.Utils.Layout; +using DevExpress.XtraEditors; using System; using System.Collections.Generic; using System.ComponentModel; @@ -7,7 +8,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Controls; using System.Windows.Forms; +using Yw.WinFrmUI; namespace Yw.WinFrmUI { @@ -18,7 +21,13 @@ InitializeComponent(); } + /// <summary> + /// 椤甸潰鐘舵�佸彂鐢熸敼鍙� + /// </summary> + public event Action PageStateChangedEvent; + private SetHydroCalcuPrefixViewModel _vm = null; + private List<SetWaterboxCalcuPrefixCtrl> _allCalcuPrefixCtrlList = null; /// <summary> /// 鍒濆鍖栭〉闈� @@ -26,26 +35,82 @@ public void InitialPage(SetHydroCalcuPrefixViewModel vm) { _vm = vm; - this. + InitialControls(); } - //鍗曠嫭鎺т欢楂樺害 - private const int SingleContorlHeight = 145; + //鍒濆鍖栨帶浠� + private void InitialControls() + { + if (_vm == null) + { + return; + } + if (_allCalcuPrefixCtrlList == null) + { + _allCalcuPrefixCtrlList = new List<SetWaterboxCalcuPrefixCtrl>(); + this.tabPanelCore.Columns.Add(new TablePanelColumn(TablePanelEntityStyle.Relative, 55F)); + if (_vm.HydroInfo.Waterboxs != null && _vm.HydroInfo.Waterboxs.Count > 0) + { + for (int i = 0; i < _vm.HydroInfo.Waterboxs.Count; i++) + { + this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F)); + var ctrl = new SetWaterboxCalcuPrefixCtrl(); + // ctrl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + ctrl.SetBindingData(_vm.HydroInfo.Waterboxs[i]); + //ctrl.Size = new Size(); + this.tabPanelCore.Controls.Add(ctrl); + this.tabPanelCore.SetCell(ctrl, i, 0); + } + this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F)); + } + } + } + //鍏佽涓婁竴姝� public bool AllowPrev { - + get + { + if (_vm == null) + { + return false; + } + if (_vm.FirstPage == this) + { + return false; + } + return true; + } } - public bool AllowNext { get { return true; } } + //鍏佽涓婁竴姝� + public bool AllowNext + { + get + { + if (_vm == null) + { + return false; + } + if (_vm.LastPage == this) + { + return false; + } + return true; + } + } - public bool AllowCancel { get { return true; } } + //鍏佽鍙栨秷 + public bool AllowCancel + { + get { return true; } + } - public bool AllowComplete { get { return true; } } - - public event Action PageStateChangedEvent; - - + //鍏佽瀹屾垚 + public bool AllowComplete + { + get { return true; } + } public bool CanPrev() { diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.Designer.cs index 5e0b67f..0449b3c 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.Designer.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.Designer.cs @@ -28,29 +28,13 @@ /// </summary> private void InitializeComponent() { - tablePanel1 = new DevExpress.Utils.Layout.TablePanel(); labelControl1 = new DevExpress.XtraEditors.LabelControl(); - setPumpCalcuPrefixCtrl1 = new SetPumpCalcuPrefixCtrl(); - setPumpCalcuPrefixCtrl2 = new SetPumpCalcuPrefixCtrl(); - setPumpCalcuPrefixCtrl3 = new SetPumpCalcuPrefixCtrl(); - ((ISupportInitialize)tablePanel1).BeginInit(); - tablePanel1.SuspendLayout(); + tabPanelBottom = new DevExpress.Utils.Layout.TablePanel(); + tabPanelCore = new DevExpress.Utils.Layout.TablePanel(); + ((ISupportInitialize)tabPanelBottom).BeginInit(); + tabPanelBottom.SuspendLayout(); + ((ISupportInitialize)tabPanelCore).BeginInit(); SuspendLayout(); - // - // tablePanel1 - // - tablePanel1.AutoScroll = true; - tablePanel1.Columns.AddRange(new DevExpress.Utils.Layout.TablePanelColumn[] { new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 5F) }); - tablePanel1.Controls.Add(setPumpCalcuPrefixCtrl3); - tablePanel1.Controls.Add(setPumpCalcuPrefixCtrl2); - tablePanel1.Controls.Add(setPumpCalcuPrefixCtrl1); - tablePanel1.Controls.Add(labelControl1); - tablePanel1.Dock = DockStyle.Fill; - tablePanel1.Location = new Point(0, 0); - tablePanel1.Name = "tablePanel1"; - tablePanel1.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] { new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 20F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F) }); - tablePanel1.Size = new Size(319, 529); - tablePanel1.TabIndex = 1; // // labelControl1 // @@ -58,64 +42,58 @@ labelControl1.Appearance.ForeColor = Color.White; labelControl1.Appearance.Options.UseBackColor = true; labelControl1.Appearance.Options.UseForeColor = true; - tablePanel1.SetColumn(labelControl1, 0); + tabPanelBottom.SetColumn(labelControl1, 0); labelControl1.Dock = DockStyle.Fill; labelControl1.Location = new Point(0, 0); labelControl1.Margin = new Padding(0); labelControl1.Name = "labelControl1"; labelControl1.Padding = new Padding(5, 0, 0, 0); - tablePanel1.SetRow(labelControl1, 0); + tabPanelBottom.SetRow(labelControl1, 0); labelControl1.Size = new Size(319, 20); labelControl1.TabIndex = 3; labelControl1.Text = "姘存车"; // - // setPumpCalcuPrefixCtrl1 + // tabPanelBottom // - tablePanel1.SetColumn(setPumpCalcuPrefixCtrl1, 0); - setPumpCalcuPrefixCtrl1.Dock = DockStyle.Fill; - setPumpCalcuPrefixCtrl1.Location = new Point(3, 23); - setPumpCalcuPrefixCtrl1.Name = "setPumpCalcuPrefixCtrl1"; - tablePanel1.SetRow(setPumpCalcuPrefixCtrl1, 1); - setPumpCalcuPrefixCtrl1.Size = new Size(313, 144); - setPumpCalcuPrefixCtrl1.TabIndex = 4; + tabPanelBottom.Columns.AddRange(new DevExpress.Utils.Layout.TablePanelColumn[] { new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 55F) }); + tabPanelBottom.Controls.Add(tabPanelCore); + tabPanelBottom.Controls.Add(labelControl1); + tabPanelBottom.Dock = DockStyle.Fill; + tabPanelBottom.Location = new Point(0, 0); + tabPanelBottom.Name = "tabPanelBottom"; + tabPanelBottom.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] { new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 20F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F) }); + tabPanelBottom.Size = new Size(319, 529); + tabPanelBottom.TabIndex = 1; // - // setPumpCalcuPrefixCtrl2 + // tabPanelCore // - tablePanel1.SetColumn(setPumpCalcuPrefixCtrl2, 0); - setPumpCalcuPrefixCtrl2.Location = new Point(3, 173); - setPumpCalcuPrefixCtrl2.Name = "setPumpCalcuPrefixCtrl2"; - tablePanel1.SetRow(setPumpCalcuPrefixCtrl2, 2); - setPumpCalcuPrefixCtrl2.Size = new Size(313, 144); - setPumpCalcuPrefixCtrl2.TabIndex = 5; - // - // setPumpCalcuPrefixCtrl3 - // - tablePanel1.SetColumn(setPumpCalcuPrefixCtrl3, 0); - setPumpCalcuPrefixCtrl3.Location = new Point(3, 323); - setPumpCalcuPrefixCtrl3.Name = "setPumpCalcuPrefixCtrl3"; - tablePanel1.SetRow(setPumpCalcuPrefixCtrl3, 3); - setPumpCalcuPrefixCtrl3.Size = new Size(313, 144); - setPumpCalcuPrefixCtrl3.TabIndex = 6; + tabPanelCore.AutoScroll = true; + tabPanelBottom.SetColumn(tabPanelCore, 0); + tabPanelCore.Dock = DockStyle.Fill; + tabPanelCore.Location = new Point(3, 23); + tabPanelCore.Name = "tabPanelCore"; + tabPanelBottom.SetRow(tabPanelCore, 1); + tabPanelCore.Size = new Size(313, 503); + tabPanelCore.TabIndex = 4; // // SetPumpCalcuPrefixListCtrl // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; - Controls.Add(tablePanel1); + Controls.Add(tabPanelBottom); Name = "SetPumpCalcuPrefixListCtrl"; Size = new Size(319, 529); - ((ISupportInitialize)tablePanel1).EndInit(); - tablePanel1.ResumeLayout(false); - tablePanel1.PerformLayout(); + ((ISupportInitialize)tabPanelBottom).EndInit(); + tabPanelBottom.ResumeLayout(false); + tabPanelBottom.PerformLayout(); + ((ISupportInitialize)tabPanelCore).EndInit(); ResumeLayout(false); } #endregion - private DevExpress.Utils.Layout.TablePanel tablePanel1; - private SetPumpCalcuPrefixCtrl setPumpCalcuPrefixCtrl3; - private SetPumpCalcuPrefixCtrl setPumpCalcuPrefixCtrl2; - private SetPumpCalcuPrefixCtrl setPumpCalcuPrefixCtrl1; private DevExpress.XtraEditors.LabelControl labelControl1; + private DevExpress.Utils.Layout.TablePanel tabPanelBottom; + private DevExpress.Utils.Layout.TablePanel tabPanelCore; } } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.cs index 57d1a38..0e49967 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/02-pump/SetPumpCalcuPrefixListCtrl.cs @@ -1,4 +1,5 @@ -锘縰sing DevExpress.XtraEditors; +锘縰sing DevExpress.Utils.Layout; +using DevExpress.XtraEditors; using System; using System.Collections.Generic; using System.ComponentModel; @@ -17,9 +18,13 @@ { InitializeComponent(); } + /// <summary> + /// 椤甸潰鐘舵�佸彂鐢熸敼鍙� + /// </summary> + public event Action PageStateChangedEvent; - //鍗曠嫭鎺т欢楂樺害 - private const int SingleContorlHeight = 145; + private SetHydroCalcuPrefixViewModel _vm = null; + private List<SetPumpCalcuPrefixCtrl> _allCalcuPrefixCtrlList = null; public bool AllowPrev { get { return true; } } @@ -29,11 +34,42 @@ public bool AllowComplete { get { return true; } } - public event Action PageStateChangedEvent; - public void InitialPage(SetHydroCalcuPrefixViewModel t) + /// <summary> + /// 鍒濆鍖栭〉闈� + /// </summary> + public void InitialPage(SetHydroCalcuPrefixViewModel vm) { + _vm = vm; + InitialControls(); + } + //鍒濆鍖栨帶浠� + private void InitialControls() + { + if (_vm == null) + { + return; + } + if (_allCalcuPrefixCtrlList == null) + { + _allCalcuPrefixCtrlList = new List<SetPumpCalcuPrefixCtrl>(); + this.tabPanelCore.Columns.Add(new TablePanelColumn(TablePanelEntityStyle.Relative, 55F)); + if (_vm.HydroInfo.Pumps != null && _vm.HydroInfo.Pumps.Count > 0) + { + for (int i = 0; i < _vm.HydroInfo.Pumps.Count; i++) + { + this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F)); + var ctrl = new SetPumpCalcuPrefixCtrl(); + // ctrl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + ctrl.SetBindingData(_vm.HydroInfo.Pumps[i]); + //ctrl.Size = new Size(); + this.tabPanelCore.Controls.Add(ctrl); + this.tabPanelCore.SetCell(ctrl, i, 0); + } + this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F)); + } + } } public bool CanPrev() diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.Designer.cs index be6ba00..9f62cf7 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.Designer.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.Designer.cs @@ -36,36 +36,36 @@ DevExpress.XtraLayout.RowDefinition rowDefinition2 = new DevExpress.XtraLayout.RowDefinition(); DevExpress.XtraLayout.RowDefinition rowDefinition3 = new DevExpress.XtraLayout.RowDefinition(); layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); + txtCoefficient = new DevExpress.XtraEditors.TextEdit(); + txtMinorLoss = new DevExpress.XtraEditors.TextEdit(); + txtDemand = new DevExpress.XtraEditors.TextEdit(); + txtElev = new DevExpress.XtraEditors.TextEdit(); Root = new DevExpress.XtraLayout.LayoutControlGroup(); - textEdit1 = new DevExpress.XtraEditors.TextEdit(); - layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); - textEdit2 = new DevExpress.XtraEditors.TextEdit(); - layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); - textEdit3 = new DevExpress.XtraEditors.TextEdit(); - layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); - textEdit4 = new DevExpress.XtraEditors.TextEdit(); - layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); layoutGroupCaption = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); + layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); ((ISupportInitialize)layoutControl1).BeginInit(); layoutControl1.SuspendLayout(); + ((ISupportInitialize)txtCoefficient.Properties).BeginInit(); + ((ISupportInitialize)txtMinorLoss.Properties).BeginInit(); + ((ISupportInitialize)txtDemand.Properties).BeginInit(); + ((ISupportInitialize)txtElev.Properties).BeginInit(); ((ISupportInitialize)Root).BeginInit(); - ((ISupportInitialize)textEdit1.Properties).BeginInit(); - ((ISupportInitialize)layoutControlItem1).BeginInit(); - ((ISupportInitialize)textEdit2.Properties).BeginInit(); - ((ISupportInitialize)layoutControlItem2).BeginInit(); - ((ISupportInitialize)textEdit3.Properties).BeginInit(); - ((ISupportInitialize)layoutControlItem3).BeginInit(); - ((ISupportInitialize)textEdit4.Properties).BeginInit(); - ((ISupportInitialize)layoutControlItem4).BeginInit(); ((ISupportInitialize)layoutGroupCaption).BeginInit(); + ((ISupportInitialize)layoutControlItem1).BeginInit(); + ((ISupportInitialize)layoutControlItem2).BeginInit(); + ((ISupportInitialize)layoutControlItem4).BeginInit(); + ((ISupportInitialize)layoutControlItem3).BeginInit(); SuspendLayout(); // // layoutControl1 // - layoutControl1.Controls.Add(textEdit4); - layoutControl1.Controls.Add(textEdit3); - layoutControl1.Controls.Add(textEdit2); - layoutControl1.Controls.Add(textEdit1); + layoutControl1.Controls.Add(txtCoefficient); + layoutControl1.Controls.Add(txtMinorLoss); + layoutControl1.Controls.Add(txtDemand); + layoutControl1.Controls.Add(txtElev); layoutControl1.Dock = DockStyle.Fill; layoutControl1.Location = new Point(0, 0); layoutControl1.Name = "layoutControl1"; @@ -74,8 +74,58 @@ layoutControl1.TabIndex = 0; layoutControl1.Text = "layoutControl1"; // + // txtCoefficient + // + txtCoefficient.Location = new Point(78, 61); + txtCoefficient.Name = "txtCoefficient"; + txtCoefficient.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False; + txtCoefficient.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager)); + txtCoefficient.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False"); + txtCoefficient.Size = new Size(127, 20); + txtCoefficient.StyleController = layoutControl1; + txtCoefficient.TabIndex = 7; + // + // txtMinorLoss + // + txtMinorLoss.Location = new Point(273, 61); + txtMinorLoss.Name = "txtMinorLoss"; + txtMinorLoss.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager)); + txtMinorLoss.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False"); + txtMinorLoss.Size = new Size(127, 20); + txtMinorLoss.StyleController = layoutControl1; + txtMinorLoss.TabIndex = 6; + // + // txtDemand + // + txtDemand.Location = new Point(273, 37); + txtDemand.Name = "txtDemand"; + txtDemand.Properties.DisplayFormat.FormatString = "{0}m鲁/h"; + txtDemand.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; + txtDemand.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager)); + txtDemand.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False"); + txtDemand.Properties.NullValuePrompt = "m鲁/h"; + txtDemand.Size = new Size(127, 20); + txtDemand.StyleController = layoutControl1; + txtDemand.TabIndex = 5; + // + // txtElev + // + txtElev.Location = new Point(78, 37); + txtElev.Name = "txtElev"; + txtElev.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False; + txtElev.Properties.DisplayFormat.FormatString = "{0}m"; + txtElev.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom; + txtElev.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager)); + txtElev.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False"); + txtElev.Properties.NullValuePrompt = "m"; + txtElev.Size = new Size(127, 20); + txtElev.StyleController = layoutControl1; + txtElev.TabIndex = 4; + // // Root // + Root.AppearanceItemCaption.Options.UseTextOptions = true; + Root.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; Root.GroupBordersVisible = false; Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutGroupCaption }); @@ -83,78 +133,6 @@ Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); Root.Size = new Size(414, 97); Root.TextVisible = false; - // - // textEdit1 - // - textEdit1.Location = new Point(78, 37); - textEdit1.Name = "textEdit1"; - textEdit1.Size = new Size(127, 20); - textEdit1.StyleController = layoutControl1; - textEdit1.TabIndex = 4; - // - // layoutControlItem1 - // - layoutControlItem1.Control = textEdit1; - layoutControlItem1.Location = new Point(0, 0); - layoutControlItem1.Name = "layoutControlItem1"; - layoutControlItem1.Size = new Size(195, 24); - layoutControlItem1.Text = "鏍囬珮:"; - layoutControlItem1.TextSize = new Size(52, 14); - // - // textEdit2 - // - textEdit2.Location = new Point(273, 37); - textEdit2.Name = "textEdit2"; - textEdit2.Size = new Size(127, 20); - textEdit2.StyleController = layoutControl1; - textEdit2.TabIndex = 5; - // - // layoutControlItem2 - // - layoutControlItem2.Control = textEdit2; - layoutControlItem2.Location = new Point(195, 0); - layoutControlItem2.Name = "layoutControlItem2"; - layoutControlItem2.OptionsTableLayoutItem.ColumnIndex = 1; - layoutControlItem2.Size = new Size(195, 24); - layoutControlItem2.Text = "闇�姘撮噺:"; - layoutControlItem2.TextSize = new Size(52, 14); - // - // textEdit3 - // - textEdit3.Location = new Point(273, 61); - textEdit3.Name = "textEdit3"; - textEdit3.Size = new Size(127, 20); - textEdit3.StyleController = layoutControl1; - textEdit3.TabIndex = 6; - // - // layoutControlItem3 - // - layoutControlItem3.Control = textEdit3; - layoutControlItem3.Location = new Point(195, 24); - layoutControlItem3.Name = "layoutControlItem3"; - layoutControlItem3.OptionsTableLayoutItem.ColumnIndex = 1; - layoutControlItem3.OptionsTableLayoutItem.RowIndex = 1; - layoutControlItem3.Size = new Size(195, 24); - layoutControlItem3.Text = "鎹熷け绯绘暟:"; - layoutControlItem3.TextSize = new Size(52, 14); - // - // textEdit4 - // - textEdit4.Location = new Point(78, 61); - textEdit4.Name = "textEdit4"; - textEdit4.Size = new Size(127, 20); - textEdit4.StyleController = layoutControl1; - textEdit4.TabIndex = 7; - // - // layoutControlItem4 - // - layoutControlItem4.Control = textEdit4; - layoutControlItem4.Location = new Point(0, 24); - layoutControlItem4.Name = "layoutControlItem4"; - layoutControlItem4.OptionsTableLayoutItem.RowIndex = 1; - layoutControlItem4.Size = new Size(195, 24); - layoutControlItem4.Text = "鍠峰皠绯绘暟:"; - layoutControlItem4.TextSize = new Size(52, 14); // // layoutGroupCaption // @@ -181,6 +159,46 @@ layoutGroupCaption.Size = new Size(414, 97); layoutGroupCaption.Text = "鍠峰槾"; // + // layoutControlItem1 + // + layoutControlItem1.Control = txtElev; + layoutControlItem1.Location = new Point(0, 0); + layoutControlItem1.Name = "layoutControlItem1"; + layoutControlItem1.Size = new Size(195, 24); + layoutControlItem1.Text = "鏍囬珮:"; + layoutControlItem1.TextSize = new Size(52, 14); + // + // layoutControlItem2 + // + layoutControlItem2.Control = txtDemand; + layoutControlItem2.Location = new Point(195, 0); + layoutControlItem2.Name = "layoutControlItem2"; + layoutControlItem2.OptionsTableLayoutItem.ColumnIndex = 1; + layoutControlItem2.Size = new Size(195, 24); + layoutControlItem2.Text = "闇�姘撮噺:"; + layoutControlItem2.TextSize = new Size(52, 14); + // + // layoutControlItem4 + // + layoutControlItem4.Control = txtCoefficient; + layoutControlItem4.Location = new Point(0, 24); + layoutControlItem4.Name = "layoutControlItem4"; + layoutControlItem4.OptionsTableLayoutItem.RowIndex = 1; + layoutControlItem4.Size = new Size(195, 24); + layoutControlItem4.Text = "鍠峰皠绯绘暟:"; + layoutControlItem4.TextSize = new Size(52, 14); + // + // layoutControlItem3 + // + layoutControlItem3.Control = txtMinorLoss; + layoutControlItem3.Location = new Point(195, 24); + layoutControlItem3.Name = "layoutControlItem3"; + layoutControlItem3.OptionsTableLayoutItem.ColumnIndex = 1; + layoutControlItem3.OptionsTableLayoutItem.RowIndex = 1; + layoutControlItem3.Size = new Size(195, 24); + layoutControlItem3.Text = "鎹熷け绯绘暟:"; + layoutControlItem3.TextSize = new Size(52, 14); + // // SetNozzleCalcuPrefixCtrl // AutoScaleDimensions = new SizeF(7F, 14F); @@ -190,16 +208,16 @@ Size = new Size(414, 97); ((ISupportInitialize)layoutControl1).EndInit(); layoutControl1.ResumeLayout(false); + ((ISupportInitialize)txtCoefficient.Properties).EndInit(); + ((ISupportInitialize)txtMinorLoss.Properties).EndInit(); + ((ISupportInitialize)txtDemand.Properties).EndInit(); + ((ISupportInitialize)txtElev.Properties).EndInit(); ((ISupportInitialize)Root).EndInit(); - ((ISupportInitialize)textEdit1.Properties).EndInit(); - ((ISupportInitialize)layoutControlItem1).EndInit(); - ((ISupportInitialize)textEdit2.Properties).EndInit(); - ((ISupportInitialize)layoutControlItem2).EndInit(); - ((ISupportInitialize)textEdit3.Properties).EndInit(); - ((ISupportInitialize)layoutControlItem3).EndInit(); - ((ISupportInitialize)textEdit4.Properties).EndInit(); - ((ISupportInitialize)layoutControlItem4).EndInit(); ((ISupportInitialize)layoutGroupCaption).EndInit(); + ((ISupportInitialize)layoutControlItem1).EndInit(); + ((ISupportInitialize)layoutControlItem2).EndInit(); + ((ISupportInitialize)layoutControlItem4).EndInit(); + ((ISupportInitialize)layoutControlItem3).EndInit(); ResumeLayout(false); } @@ -207,10 +225,10 @@ private DevExpress.XtraLayout.LayoutControl layoutControl1; private DevExpress.XtraLayout.LayoutControlGroup Root; - private DevExpress.XtraEditors.TextEdit textEdit4; - private DevExpress.XtraEditors.TextEdit textEdit3; - private DevExpress.XtraEditors.TextEdit textEdit2; - private DevExpress.XtraEditors.TextEdit textEdit1; + private DevExpress.XtraEditors.TextEdit txtCoefficient; + private DevExpress.XtraEditors.TextEdit txtMinorLoss; + private DevExpress.XtraEditors.TextEdit txtDemand; + private DevExpress.XtraEditors.TextEdit txtElev; private DevExpress.XtraLayout.LayoutControlGroup layoutGroupCaption; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.cs index 4ffaff7..1937235 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixCtrl.cs @@ -1,16 +1,4 @@ -锘縰sing DevExpress.Mvvm.POCO; -using DevExpress.XtraEditors; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace Yw.WinFrmUI +锘縩amespace Yw.WinFrmUI { public partial class SetNozzleCalcuPrefixCtrl : DevExpress.XtraEditors.XtraUserControl { @@ -27,7 +15,30 @@ /// </summary> public void SetBindingData(Yw.Model.HydroNozzleInfo nozzle) { + this.layoutGroupCaption.Text = "鍠峰槾"; + if (!string.IsNullOrEmpty(nozzle.Name)) + { + this.layoutGroupCaption.Text = nozzle.Name; + } + this.txtElev.EditValue = nozzle.Elev; + this.txtDemand.EditValue = nozzle.Demand; + this.txtCoefficient.EditValue = nozzle.Coefficient; + this.txtMinorLoss.EditValue = nozzle.MinorLoss; + } + /// <summary> + /// 鏇存柊缁戝畾鏁版嵁 + /// </summary> + public void UpdateBindingData() + { + if (_nozzle == null) + { + return; + } + _nozzle.Elev = double.Parse(this.txtElev.EditValue?.ToString()); + _nozzle.Demand = this.txtDemand.EditValue == null ? null : double.Parse(this.txtDemand.EditValue.ToString()); + _nozzle.Coefficient = double.Parse(this.txtCoefficient.EditValue?.ToString()); + _nozzle.MinorLoss = this.txtMinorLoss.EditValue == null ? null : double.Parse(this.txtMinorLoss.EditValue.ToString()); } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.Designer.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.Designer.cs index 9329bd4..2d6792a 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.Designer.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.Designer.cs @@ -28,93 +28,72 @@ /// </summary> private void InitializeComponent() { - tablePanel1 = new DevExpress.Utils.Layout.TablePanel(); - labelControl1 = new DevExpress.XtraEditors.LabelControl(); - setNozzleCalcuPrefixCtrl1 = new SetNozzleCalcuPrefixCtrl(); - setNozzleCalcuPrefixCtrl2 = new SetNozzleCalcuPrefixCtrl(); - setNozzleCalcuPrefixCtrl3 = new SetNozzleCalcuPrefixCtrl(); - ((ISupportInitialize)tablePanel1).BeginInit(); - tablePanel1.SuspendLayout(); + tabPanelBottom = new DevExpress.Utils.Layout.TablePanel(); + tabPanelCore = new DevExpress.Utils.Layout.TablePanel(); + labCaption = new DevExpress.XtraEditors.LabelControl(); + ((ISupportInitialize)tabPanelBottom).BeginInit(); + tabPanelBottom.SuspendLayout(); + ((ISupportInitialize)tabPanelCore).BeginInit(); SuspendLayout(); // - // tablePanel1 + // tabPanelBottom // - tablePanel1.AutoScroll = true; - tablePanel1.Columns.AddRange(new DevExpress.Utils.Layout.TablePanelColumn[] { new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 5F) }); - tablePanel1.Controls.Add(setNozzleCalcuPrefixCtrl3); - tablePanel1.Controls.Add(setNozzleCalcuPrefixCtrl2); - tablePanel1.Controls.Add(setNozzleCalcuPrefixCtrl1); - tablePanel1.Controls.Add(labelControl1); - tablePanel1.Dock = DockStyle.Fill; - tablePanel1.Location = new Point(0, 0); - tablePanel1.Name = "tablePanel1"; - tablePanel1.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] { new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 20F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F) }); - tablePanel1.Size = new Size(299, 554); - tablePanel1.TabIndex = 2; + tabPanelBottom.Columns.AddRange(new DevExpress.Utils.Layout.TablePanelColumn[] { new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 55F) }); + tabPanelBottom.Controls.Add(tabPanelCore); + tabPanelBottom.Controls.Add(labCaption); + tabPanelBottom.Dock = DockStyle.Fill; + tabPanelBottom.Location = new Point(0, 0); + tabPanelBottom.Name = "tabPanelBottom"; + tabPanelBottom.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] { new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 20F), new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 26F) }); + tabPanelBottom.Size = new Size(299, 554); + tabPanelBottom.TabIndex = 2; // - // labelControl1 + // tabPanelCore // - labelControl1.Appearance.BackColor = Color.FromArgb(0, 122, 204); - labelControl1.Appearance.ForeColor = Color.White; - labelControl1.Appearance.Options.UseBackColor = true; - labelControl1.Appearance.Options.UseForeColor = true; - tablePanel1.SetColumn(labelControl1, 0); - labelControl1.Dock = DockStyle.Fill; - labelControl1.Location = new Point(0, 0); - labelControl1.Margin = new Padding(0); - labelControl1.Name = "labelControl1"; - labelControl1.Padding = new Padding(5, 0, 0, 0); - tablePanel1.SetRow(labelControl1, 0); - labelControl1.Size = new Size(299, 20); - labelControl1.TabIndex = 3; - labelControl1.Text = "鍠峰槾"; + tabPanelCore.AutoScroll = true; + tabPanelBottom.SetColumn(tabPanelCore, 0); + tabPanelCore.Dock = DockStyle.Fill; + tabPanelCore.Location = new Point(3, 23); + tabPanelCore.Name = "tabPanelCore"; + tabPanelBottom.SetRow(tabPanelCore, 1); + tabPanelCore.Size = new Size(293, 528); + tabPanelCore.TabIndex = 4; // - // setNozzleCalcuPrefixCtrl1 + // labCaption // - tablePanel1.SetColumn(setNozzleCalcuPrefixCtrl1, 0); - setNozzleCalcuPrefixCtrl1.Location = new Point(3, 23); - setNozzleCalcuPrefixCtrl1.Name = "setNozzleCalcuPrefixCtrl1"; - tablePanel1.SetRow(setNozzleCalcuPrefixCtrl1, 1); - setNozzleCalcuPrefixCtrl1.Size = new Size(293, 97); - setNozzleCalcuPrefixCtrl1.TabIndex = 4; - // - // setNozzleCalcuPrefixCtrl2 - // - tablePanel1.SetColumn(setNozzleCalcuPrefixCtrl2, 0); - setNozzleCalcuPrefixCtrl2.Location = new Point(3, 126); - setNozzleCalcuPrefixCtrl2.Name = "setNozzleCalcuPrefixCtrl2"; - tablePanel1.SetRow(setNozzleCalcuPrefixCtrl2, 2); - setNozzleCalcuPrefixCtrl2.Size = new Size(293, 97); - setNozzleCalcuPrefixCtrl2.TabIndex = 5; - // - // setNozzleCalcuPrefixCtrl3 - // - tablePanel1.SetColumn(setNozzleCalcuPrefixCtrl3, 0); - setNozzleCalcuPrefixCtrl3.Location = new Point(3, 229); - setNozzleCalcuPrefixCtrl3.Name = "setNozzleCalcuPrefixCtrl3"; - tablePanel1.SetRow(setNozzleCalcuPrefixCtrl3, 3); - setNozzleCalcuPrefixCtrl3.Size = new Size(293, 97); - setNozzleCalcuPrefixCtrl3.TabIndex = 6; + labCaption.Appearance.BackColor = Color.FromArgb(0, 122, 204); + labCaption.Appearance.ForeColor = Color.White; + labCaption.Appearance.Options.UseBackColor = true; + labCaption.Appearance.Options.UseForeColor = true; + tabPanelBottom.SetColumn(labCaption, 0); + labCaption.Dock = DockStyle.Fill; + labCaption.Location = new Point(0, 0); + labCaption.Margin = new Padding(0); + labCaption.Name = "labCaption"; + labCaption.Padding = new Padding(5, 0, 0, 0); + tabPanelBottom.SetRow(labCaption, 0); + labCaption.Size = new Size(299, 20); + labCaption.TabIndex = 3; + labCaption.Text = "鍠峰槾"; // // SetNozzleCalcuPrefixListCtrl // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; - Controls.Add(tablePanel1); + Controls.Add(tabPanelBottom); Name = "SetNozzleCalcuPrefixListCtrl"; Size = new Size(299, 554); - ((ISupportInitialize)tablePanel1).EndInit(); - tablePanel1.ResumeLayout(false); - tablePanel1.PerformLayout(); + ((ISupportInitialize)tabPanelBottom).EndInit(); + tabPanelBottom.ResumeLayout(false); + tabPanelBottom.PerformLayout(); + ((ISupportInitialize)tabPanelCore).EndInit(); ResumeLayout(false); } #endregion - private DevExpress.Utils.Layout.TablePanel tablePanel1; - private SetNozzleCalcuPrefixCtrl setNozzleCalcuPrefixCtrl3; - private SetNozzleCalcuPrefixCtrl setNozzleCalcuPrefixCtrl2; - private SetNozzleCalcuPrefixCtrl setNozzleCalcuPrefixCtrl1; - private DevExpress.XtraEditors.LabelControl labelControl1; + private DevExpress.Utils.Layout.TablePanel tabPanelBottom; + private DevExpress.Utils.Layout.TablePanel tabPanelCore; + private DevExpress.XtraEditors.LabelControl labCaption; } } diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.cs index 9aa1639..69f71a1 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/11-prefix/03-nozzle/SetNozzleCalcuPrefixListCtrl.cs @@ -1,4 +1,5 @@ -锘縰sing DevExpress.XtraEditors; +锘縰sing DevExpress.Utils.Layout; +using DevExpress.XtraEditors; using System; using System.Collections.Generic; using System.ComponentModel; @@ -18,38 +19,156 @@ InitializeComponent(); } - public bool AllowPrev { get { return true; } } - - public bool AllowNext { get { return true; } } - - public bool AllowCancel { get { return true; } } - - public bool AllowComplete { get { return true; } } - + /// <summary> + /// 椤甸潰鐘舵�佸彂鐢熸敼鍙� + /// </summary> public event Action PageStateChangedEvent; - public void InitialPage(SetHydroCalcuPrefixViewModel t) - { + private SetHydroCalcuPrefixViewModel _vm = null; + private List<SetNozzleCalcuPrefixCtrl> _allCalcuPrefixCtrlList = null; + /// <summary> + /// 鍒濆鍖栭〉闈� + /// </summary> + public void InitialPage(SetHydroCalcuPrefixViewModel vm) + { + _vm = vm; + InitialControls(); } + //鍒濆鍖栨帶浠� + private void InitialControls() + { + if (_vm == null) + { + return; + } + if (_allCalcuPrefixCtrlList == null) + { + _allCalcuPrefixCtrlList = new List<SetNozzleCalcuPrefixCtrl>(); + this.tabPanelCore.Columns.Add(new TablePanelColumn(TablePanelEntityStyle.Relative, 55F)); + if (_vm.HydroInfo.Nozzles != null && _vm.HydroInfo.Nozzles.Count > 0) + { + for (int i = 0; i < _vm.HydroInfo.Nozzles.Count; i++) + { + this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F)); + var ctrl = new SetNozzleCalcuPrefixCtrl(); + this.tabPanelCore.Controls.Add(ctrl); + this.tabPanelCore.SetCell(ctrl, i, 0); + } + this.tabPanelCore.Rows.Add(new TablePanelRow(TablePanelEntityStyle.AutoSize, 150F)); + } + } + else + { + if (_vm.HydroInfo.Nozzles == null || _vm.HydroInfo.Nozzles.Count != _allCalcuPrefixCtrlList.Count) + { + return; + } + for (int i = 0; i < _allCalcuPrefixCtrlList.Count; i++) + { + _allCalcuPrefixCtrlList[i].SetBindingData(_vm.HydroInfo.Nozzles[i]); + } + } + } + + //鏇存柊椤甸潰 + private void UpdatePage() + { + if (_allCalcuPrefixCtrlList == null) + { + return; + } + _allCalcuPrefixCtrlList.ForEach(x => x.UpdateBindingData()); + } + + + /// <summary> + /// 鍏佽涓婁竴姝� + /// </summary> + public bool AllowPrev + { + get + { + if (_vm == null) + { + return false; + } + if (_vm.FirstPage == this) + { + return false; + } + return true; + } + } + + /// <summary> + /// 鍏佽涓婁竴姝� + /// </summary> + public bool AllowNext + { + get + { + if (_vm == null) + { + return false; + } + if (_vm.LastPage == this) + { + return false; + } + return true; + } + } + + /// <summary> + /// 鍏佽鍙栨秷 + /// </summary> + public bool AllowCancel + { + get { return true; } + } + + /// <summary> + /// 鍏佽瀹屾垚 + /// </summary> + public bool AllowComplete + { + get { return true; } + } + + + /// <summary> + /// 鑳藉惁涓婁竴姝� + /// </summary> public bool CanPrev() { return true; } + /// <summary> + /// 鑳藉惁涓嬩竴姝� + /// </summary> public bool CanNext() { + UpdatePage(); return true; } + /// <summary> + /// 鑳藉惁鍙栨秷 + /// </summary> public bool CanCancel() { return true; } + /// <summary> + /// 鑳藉惁瀹屾垚 + /// </summary> public bool CanComplete() { + UpdatePage(); return true; } } -- Gitblit v1.9.3