WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -3420,8 +3420,7 @@ return; } var dlg = new HydroLossCurveWorkingDlg(); dlg.HydroClickEvent += (code) => SelectVisual(code, eSimulationVisualSource.None); var dlg = new HydroLossCurveMultiWorkingDlg(); dlg.SetBindingData(_hydroInfo, workingList, node, _calcuPressModeIsHead, allEvaluationList); dlg.ShowDialog(); } WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalViewCtrl.cs
ÎļþÒÑɾ³ý WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj
@@ -389,6 +389,9 @@ <Compile Update="accuracy\scale\HydroAccuracyScaleChartCtrl.cs"> <SubType>UserControl</SubType> </Compile> <Compile Update="energy-analy\03-control\HydroEnergyAnalyTotalCtrl.cs"> <SubType>UserControl</SubType> </Compile> <Compile Update="loss-curve\07-control\HydroLossCurveCtrl.cs"> <SubType>UserControl</SubType> </Compile> @@ -398,6 +401,9 @@ <Compile Update="loss-curve\08-dlg\HydroLossCurveDlg.cs"> <SubType>Form</SubType> </Compile> <Compile Update="loss-curve\09-working\HydroLossCurveMultiWorkingDlg.cs"> <SubType>Form</SubType> </Compile> <Compile Update="loss-curve\09-working\HydroLossCurveWorkingDlg.cs"> <SubType>Form</SubType> </Compile> WinFrmUI/Yw.WinFrmUI.Hydro.Core/Yw.WinFrmUI.Hydro.Core.csproj.user
@@ -79,9 +79,6 @@ <Compile Update="19-pump\08-energy\HydroPumpGroupEnergyListCtrl.cs"> <SubType>UserControl</SubType> </Compile> <Compile Update="20-energy\02-total\HydroEnergyTotalViewCtrl.cs"> <SubType>UserControl</SubType> </Compile> <Compile Update="21-curve\HydroCurveEditCtrl.cs"> <SubType>UserControl</SubType> </Compile> @@ -121,5 +118,8 @@ <Compile Update="06-visual\01-reservoir\SetHydroReservoirDlg.cs"> <SubType>Form</SubType> </Compile> <Compile Update="loss-curve\07-control\HydroLossCurveCompareCtrl.cs"> <SubType>UserControl</SubType> </Compile> </ItemGroup> </Project> WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/01-core/HydroEnergyAnalyHelper.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,137 @@ namespace Yw.WinFrmUI { /// <summary> /// è½æåæè¾ å©ç±» /// </summary> public class HydroEnergyAnalyHelper { /// <summary> /// å建 /// </summary> public static HydroEnergyAnalyViewModel Create ( Yw.Model.HydroModelInfo hydroInfo, Yw.Vmo.HydroWorkingVmo working, HydroCalcuResult calcuResult = null, bool isHead = false, List<Yw.Vmo.HydroEvaluationVmo> allEvaluationList = null ) { //éªè¯ if (hydroInfo == null) { return default; } if (hydroInfo.Pumps == null || hydroInfo.Pumps.Count < 1) { return default; } if (working == null) { return default; } var vm = new HydroEnergyAnalyViewModel(); //计ç®ç»æ if (calcuResult == null) { hydroInfo.UpdateWorkingInfo(working.WorkingInfo); calcuResult = hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, isHead, allEvaluationList); if (!calcuResult.Succeed) { return vm; } } var allCalcuVisualDict = calcuResult.GetVisualDict(); //éåæ°´æ³µ vm.Items = new List<HydroEnergyAnalyItemViewModel>(); foreach (var pump in hydroInfo.Pumps) { var item = new HydroEnergyAnalyItemViewModel(); vm.Items.Add(item); item.BeginGroup = string.IsNullOrEmpty(pump.BeginGroup) ? string.Empty : pump.BeginGroup; item.Name = pump.Name; item.Code = pump.Code; item.RatedQ = pump.RatedQ; item.RatedH = pump.RatedH; item.RatedP = pump.RatedP; item.RatedN = pump.RatedN; item.RatedHz = pump.RatedHz; var curveqh = hydroInfo.Curves?.Find(x => x.Code == pump.CurveQH); if (curveqh != null) { var qh_pts = curveqh.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); if (qh_pts != null && qh_pts.Count > 3) { item.RatedCurveQH = qh_pts; } } var curveqp = hydroInfo.Curves?.Find(x => x.Code == pump.CurveQP); if (curveqp != null) { var qp_pts = curveqp.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); if (qp_pts != null && qp_pts.Count > 3) { item.RatedCurveQP = qp_pts; } } var curveqe = hydroInfo.Curves?.Find(x => x.Code == pump.CurveQE); if (curveqe != null) { var qe_pts = curveqe.CurveData?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList(); if (qe_pts != null && qe_pts.Count > 3) { item.RatedCurveQE = qe_pts; } } item.LinkStatus = pump.LinkStatus; if (item.LinkStatus == Yw.Hydro.LinkStatus.Open) { item.CurrentColor = HydroPumpCurveColorHelper.GetRandomColor(hydroInfo.Pumps.IndexOf(pump)); item.CurrentN = Math.Round(item.RatedN * pump.SpeedRatio, 1); item.CurrentHz = Math.Round(item.RatedHz * pump.SpeedRatio, 1); var calcuPumpResult = allCalcuVisualDict?.GetValue(pump.Code) as HydroCalcuPumpResult; if (calcuPumpResult != null) { item.CurrentQ = calcuPumpResult.CalcuQ; item.CurrentH = calcuPumpResult.CalcuH; item.CurrentPr1 = calcuPumpResult.CalcuPr1; item.CurrentPr2 = calcuPumpResult.CalcuPr2; item.CurrentP = calcuPumpResult.CalcuP; item.CurrentE = calcuPumpResult.CalcuE; } if (item.RatedCurveQH != null) { var qh_pts = item.RatedCurveQH; var qh_run_pts = qh_pts.GetQHPointListByN(item.RatedHz, item.CurrentHz); item.CurrentCurveQH = qh_run_pts; } if (item.RatedCurveQP != null) { var qp_pts = item.RatedCurveQP; var qp_run_pts = qp_pts.GetQPPointListByN(item.RatedHz, item.CurrentHz); item.CurrentCurveQP = qp_pts; } if (item.RatedCurveQE != null) { var qe_pts = item.RatedCurveQE; var qe_run_pts = qe_pts.GetQEPointListByN(item.RatedHz, item.CurrentHz); item.CurrentCurveQE = qe_run_pts; } } } vm.Total = new HydroEnergyAnalyTotalViewModel(vm.Items); vm.Pipe = new HydroEnergyAnalyPipeViewModel(hydroInfo, allCalcuVisualDict); return vm; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/01-core/HydroEnergyAnalyItemViewModel.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,142 @@ namespace Yw.WinFrmUI { /// <summary> /// è½æåæé¡¹è§å¾ /// </summary> public class HydroEnergyAnalyItemViewModel { /// <summary> /// /// </summary> public HydroEnergyAnalyItemViewModel() { } /// <summary> /// åç» /// </summary> public string BeginGroup { get; set; } /// <summary> /// åç§° /// </summary> public string Name { get; set; } /// <summary> /// ç¼ç /// </summary> public string Code { get; set; } /// <summary> /// åå· /// </summary> public string ModelType { get; set; } /// <summary> /// é¢å®æµé /// </summary> public double RatedQ { get; set; } /// <summary> /// é¢å®æ¬ç¨ /// </summary> public double RatedH { get; set; } /// <summary> /// é¢å®åç /// </summary> public double RatedP { get; set; } /// <summary> /// é¢å®è½¬é /// </summary> public double RatedN { get; set; } /// <summary> /// é¢å®é¢ç /// </summary> public double RatedHz { get; set; } /// <summary> /// é¢å®æµéæ¬ç¨çº¿ /// </summary> public List<Yw.Geometry.Point2d> RatedCurveQH { get; set; } /// <summary> /// é¢å®æµéæç线 /// </summary> public List<Yw.Geometry.Point2d> RatedCurveQE { get; set; } /// <summary> /// é¢å®æµéåç线 /// </summary> public List<Yw.Geometry.Point2d> RatedCurveQP { get; set; } /// <summary> /// è¿è¡ç¶æ /// </summary> public string LinkStatus { get; set; } /// <summary> /// è¿è¡é¢è² /// </summary> public Color CurrentColor { get; set; } /// <summary> /// è¿è¡è½¬é /// </summary> public double CurrentN { get; set; } /// <summary> /// è¿è¡é¢ç /// </summary> public double CurrentHz { get; set; } /// <summary> /// è¿è¡æµé /// </summary> public double? CurrentQ { get; set; } /// <summary> /// è¿è¡æ¬ç¨ /// </summary> public double? CurrentH { get; set; } /// <summary> /// è¿å£åå /// </summary> public double? CurrentPr1 { get; set; } /// <summary> /// åºå£åå /// </summary> public double? CurrentPr2 { get; set; } /// <summary> /// è¿è¡åç /// </summary> public double? CurrentP { get; set; } /// <summary> /// è¿è¡æç /// </summary> public double? CurrentE { get; set; } /// <summary> /// è¿è¡æµéæ¬ç¨çº¿ /// </summary> public List<Yw.Geometry.Point2d> CurrentCurveQH { get; set; } /// <summary> /// è¿è¡æµéæç线 /// </summary> public List<Yw.Geometry.Point2d> CurrentCurveQE { get; set; } /// <summary> /// è¿è¡æµéåç线 /// </summary> public List<Yw.Geometry.Point2d> CurrentCurveQP { get; set; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/01-core/HydroEnergyAnalyViewModel.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,29 @@ namespace Yw.WinFrmUI { /// <summary> /// è½èè§å¾ /// </summary> public class HydroEnergyAnalyViewModel { /// <summary> /// æ±æ» /// </summary> public HydroEnergyAnalyTotalViewModel Total { get; set; } /// <summary> /// 管é /// </summary> public HydroEnergyAnalyPipeViewModel Pipe { get; set; } /// <summary> /// å级å表 /// </summary> public List<HydroEnergyAnalyItemViewModel> Items { get; set; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/01-total/HydroEnergyAnalyTotalViewModel.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,56 @@ namespace Yw.WinFrmUI { /// <summary> /// è½èåææ»è§å¾ /// </summary> public class HydroEnergyAnalyTotalViewModel { /// <summary> /// /// </summary> public HydroEnergyAnalyTotalViewModel() { } /// <summary> /// /// </summary> public HydroEnergyAnalyTotalViewModel(List<HydroEnergyAnalyItemViewModel> allItemList) { if (allItemList == null || allItemList.Count < 1) { return; } var qs = allItemList.Where(x => x.CurrentQ.HasValue).ToList(); if (qs != null && qs.Count > 0) { this.TotalQ = qs.Sum(x => x.CurrentQ.Value); } var ps = allItemList.Where(x => x.CurrentP.HasValue).ToList(); if (ps != null && ps.Count > 0) { this.TotalP = ps.Sum(x => x.CurrentP.Value); } var es = allItemList.Where(x => x.CurrentE.HasValue).ToList(); if (es != null && es.Count > 0) { this.TotalE = es.Average(x => x.CurrentE.Value); } } /// <summary> /// æ»æµé /// </summary> public double? TotalQ { get; set; } /// <summary> /// æ»åç /// </summary> public double? TotalP { get; set; } /// <summary> /// æ»æç /// </summary> public double? TotalE { get; set; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/02-pipe/HydroEnergyAnalyPipeItemViewModel.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,49 @@ namespace Yw.WinFrmUI { /// <summary> /// è½æåæç®¡é项è§å¾ /// </summary> public class HydroEnergyAnalyPipeItemViewModel { /// <summary> /// /// </summary> public HydroEnergyAnalyPipeItemViewModel() { } /// <summary> /// /// </summary> public HydroEnergyAnalyPipeItemViewModel ( Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuVisualDict, string beginGroup ) { this.BeginGroup = string.IsNullOrEmpty(beginGroup) ? string.Empty : beginGroup; this.StartH = hydroInfo.GetHead(); this.PipeQ = hydroInfo.GetPipeQ(allCalcuVisualDict); this.PipeH = hydroInfo.GetPipeHead(allCalcuVisualDict); } /// <summary> /// åç» /// </summary> public string BeginGroup { get; set; } /// <summary> /// å¼å§æ¬ç¨ /// </summary> public double StartH { get; set; } /// <summary> /// ç®¡éæµé /// </summary> public double? PipeQ { get; set; } /// <summary> /// ç®¡éæ¬ç¨ /// </summary> public double? PipeH { get; set; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/02-pipe/HydroEnergyAnalyPipeViewModel.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,51 @@ namespace Yw.WinFrmUI { /// <summary> /// è½æåæç®¡éè§å¾ /// </summary> public class HydroEnergyAnalyPipeViewModel { /// <summary> /// /// </summary> public HydroEnergyAnalyPipeViewModel() { } /// <summary> /// /// </summary> public HydroEnergyAnalyPipeViewModel ( Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuVisualDict ) { if (hydroInfo == null) { return; } if (hydroInfo.Pumps == null || hydroInfo.Pumps.Count < 1) { return; } var beginGroups = hydroInfo.Pumps.Select(x => string.IsNullOrEmpty(x.BeginGroup) ? string.Empty : x.BeginGroup).Distinct().ToList(); this.Items = new List<HydroEnergyAnalyPipeItemViewModel>(); foreach (var beginGroup in beginGroups) { var item = new HydroEnergyAnalyPipeItemViewModel ( hydroInfo, allCalcuVisualDict, beginGroup ); this.Items.Add(item); } } /// <summary> /// å级å表 /// </summary> public List<HydroEnergyAnalyPipeItemViewModel> Items { get; set; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/03-control/HydroEnergyAnalyTotalCtrl.Designer.cs
ÎļþÃû´Ó WinFrmUI/Yw.WinFrmUI.Hydro.Core/20-energy/02-total/HydroEnergyTotalViewCtrl.Designer.cs ÐÞ¸Ä @@ -1,6 +1,6 @@ namespace Yw.WinFrmUI { partial class HydroEnergyTotalViewCtrl partial class HydroEnergyAnalyTotalCtrl { /// <summary> /// Required designer variable. @@ -34,9 +34,9 @@ txtQ = new DevExpress.XtraEditors.TextEdit(); Root = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); ((ISupportInitialize)layoutControl1).BeginInit(); layoutControl1.SuspendLayout(); ((ISupportInitialize)txtE.Properties).BeginInit(); @@ -44,9 +44,9 @@ ((ISupportInitialize)txtQ.Properties).BeginInit(); ((ISupportInitialize)Root).BeginInit(); ((ISupportInitialize)layoutControlItem1).BeginInit(); ((ISupportInitialize)emptySpaceItem1).BeginInit(); ((ISupportInitialize)layoutControlItem2).BeginInit(); ((ISupportInitialize)layoutControlItem3).BeginInit(); ((ISupportInitialize)emptySpaceItem1).BeginInit(); SuspendLayout(); // // layoutControl1 @@ -57,38 +57,39 @@ layoutControl1.Dock = DockStyle.Fill; layoutControl1.Location = new Point(0, 0); layoutControl1.Name = "layoutControl1"; layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(1177, 0, 650, 400); layoutControl1.Root = Root; layoutControl1.Size = new Size(238, 78); layoutControl1.Size = new Size(707, 33); layoutControl1.TabIndex = 0; layoutControl1.Text = "layoutControl1"; // // txtE // txtE.Location = new Point(54, 50); txtE.Location = new Point(414, 6); txtE.Name = "txtE"; txtE.Properties.ReadOnly = true; txtE.Properties.UseReadOnlyAppearance = false; txtE.Size = new Size(182, 20); txtE.Size = new Size(124, 20); txtE.StyleController = layoutControl1; txtE.TabIndex = 6; // // txtP // txtP.Location = new Point(54, 26); txtP.Location = new Point(234, 6); txtP.Name = "txtP"; txtP.Properties.ReadOnly = true; txtP.Properties.UseReadOnlyAppearance = false; txtP.Size = new Size(182, 20); txtP.Size = new Size(124, 20); txtP.StyleController = layoutControl1; txtP.TabIndex = 5; // // txtQ // txtQ.Location = new Point(54, 2); txtQ.Location = new Point(54, 6); txtQ.Name = "txtQ"; txtQ.Properties.ReadOnly = true; txtQ.Properties.UseReadOnlyAppearance = false; txtQ.Size = new Size(182, 20); txtQ.Size = new Size(124, 20); txtQ.StyleController = layoutControl1; txtQ.TabIndex = 4; // @@ -96,10 +97,10 @@ // Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; Root.GroupBordersVisible = false; Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1, emptySpaceItem1, layoutControlItem2, layoutControlItem3 }); Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1, layoutControlItem2, layoutControlItem3, emptySpaceItem1 }); Root.Name = "Root"; Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); Root.Size = new Size(238, 78); Root.Size = new Size(707, 33); Root.TextVisible = false; // // layoutControlItem1 @@ -107,28 +108,24 @@ layoutControlItem1.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; layoutControlItem1.Control = txtQ; layoutControlItem1.Location = new Point(0, 0); layoutControlItem1.MaxSize = new Size(180, 24); layoutControlItem1.MinSize = new Size(180, 24); layoutControlItem1.Name = "layoutControlItem1"; layoutControlItem1.Size = new Size(238, 24); layoutControlItem1.Size = new Size(180, 33); layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; layoutControlItem1.Text = "æ»æµé:"; layoutControlItem1.TextSize = new Size(40, 14); // // emptySpaceItem1 // emptySpaceItem1.AllowHotTrack = false; emptySpaceItem1.Location = new Point(0, 72); emptySpaceItem1.MinSize = new Size(1, 1); emptySpaceItem1.Name = "emptySpaceItem1"; emptySpaceItem1.Size = new Size(238, 6); emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; emptySpaceItem1.TextSize = new Size(0, 0); // // layoutControlItem2 // layoutControlItem2.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; layoutControlItem2.Control = txtP; layoutControlItem2.Location = new Point(0, 24); layoutControlItem2.Location = new Point(180, 0); layoutControlItem2.MaxSize = new Size(180, 24); layoutControlItem2.MinSize = new Size(180, 24); layoutControlItem2.Name = "layoutControlItem2"; layoutControlItem2.Size = new Size(238, 24); layoutControlItem2.Size = new Size(180, 33); layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; layoutControlItem2.Text = "æ»åç:"; layoutControlItem2.TextSize = new Size(40, 14); // @@ -136,19 +133,32 @@ // layoutControlItem3.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; layoutControlItem3.Control = txtE; layoutControlItem3.Location = new Point(0, 48); layoutControlItem3.Location = new Point(360, 0); layoutControlItem3.MaxSize = new Size(180, 24); layoutControlItem3.MinSize = new Size(180, 24); layoutControlItem3.Name = "layoutControlItem3"; layoutControlItem3.Size = new Size(238, 24); layoutControlItem3.Size = new Size(180, 33); layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; layoutControlItem3.Text = "æ»æç:"; layoutControlItem3.TextSize = new Size(40, 14); // // HydroEnergyTotalViewCtrl // emptySpaceItem1 // emptySpaceItem1.AllowHotTrack = false; emptySpaceItem1.Location = new Point(540, 0); emptySpaceItem1.MinSize = new Size(1, 1); emptySpaceItem1.Name = "emptySpaceItem1"; emptySpaceItem1.Size = new Size(167, 33); emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; emptySpaceItem1.TextSize = new Size(0, 0); // // HydroEnergyAnalyTotalCtrl // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; Controls.Add(layoutControl1); Name = "HydroEnergyTotalViewCtrl"; Size = new Size(238, 78); Name = "HydroEnergyAnalyTotalCtrl"; Size = new Size(707, 33); ((ISupportInitialize)layoutControl1).EndInit(); layoutControl1.ResumeLayout(false); ((ISupportInitialize)txtE.Properties).EndInit(); @@ -156,9 +166,9 @@ ((ISupportInitialize)txtQ.Properties).EndInit(); ((ISupportInitialize)Root).EndInit(); ((ISupportInitialize)layoutControlItem1).EndInit(); ((ISupportInitialize)emptySpaceItem1).EndInit(); ((ISupportInitialize)layoutControlItem2).EndInit(); ((ISupportInitialize)layoutControlItem3).EndInit(); ((ISupportInitialize)emptySpaceItem1).EndInit(); ResumeLayout(false); } @@ -169,9 +179,9 @@ private DevExpress.XtraEditors.TextEdit txtQ; private DevExpress.XtraLayout.LayoutControlGroup Root; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; private DevExpress.XtraEditors.TextEdit txtE; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1; } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/03-control/HydroEnergyAnalyTotalCtrl.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,44 @@ namespace Yw.WinFrmUI { public partial class HydroEnergyAnalyTotalCtrl : DevExpress.XtraEditors.XtraUserControl { public HydroEnergyAnalyTotalCtrl() { InitializeComponent(); this.layoutControl1.SetupLayoutControl(); } /// <summary> /// ç»å®æ°æ® /// </summary> public void SetBindingData(List<HydroEnergyAnalyItemViewModel> items) { var vm = new HydroEnergyAnalyTotalViewModel(items); SetBindingData(vm); } /// <summary> /// ç»å®æ°æ® /// </summary> public void SetBindingData(HydroEnergyAnalyTotalViewModel vm) { if (vm == null) { return; } if (vm.TotalQ.HasValue) { this.txtQ.EditValue = $"{Math.Round(vm.TotalQ.Value, 1)}m³/h"; } if (vm.TotalP.HasValue) { this.txtP.EditValue = $"{Math.Round(vm.TotalP.Value, 1)}kW"; } if (vm.TotalE.HasValue) { this.txtE.EditValue = $"{Math.Round(vm.TotalE.Value, 1)}%"; } } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/energy-analy/03-control/HydroEnergyAnalyTotalCtrl.resx
WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/07-control/HydroLossCurveCompareCtrl.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,133 @@ namespace Yw.WinFrmUI { partial class HydroLossCurveCompareCtrl { /// <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(); DevExpress.XtraCharts.XYDiagram xyDiagram1 = new DevExpress.XtraCharts.XYDiagram(); DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series(); DevExpress.XtraCharts.AreaSeriesView areaSeriesView1 = new DevExpress.XtraCharts.AreaSeriesView(); elevBindingSource = new BindingSource(components); chartControl1 = new DevExpress.XtraCharts.ChartControl(); ((ISupportInitialize)elevBindingSource).BeginInit(); ((ISupportInitialize)chartControl1).BeginInit(); ((ISupportInitialize)xyDiagram1).BeginInit(); ((ISupportInitialize)series1).BeginInit(); ((ISupportInitialize)areaSeriesView1).BeginInit(); SuspendLayout(); // // elevBindingSource // elevBindingSource.DataSource = typeof(HydroLossCurvePointVieModel); // // chartControl1 // chartControl1.CrosshairOptions.ContentShowMode = DevExpress.XtraCharts.CrosshairContentShowMode.Label; chartControl1.CrosshairOptions.ShowArgumentLabels = true; chartControl1.CrosshairOptions.ShowValueLabels = true; chartControl1.CrosshairOptions.ShowValueLine = true; xyDiagram1.AxisX.CrosshairAxisLabelOptions.Visibility = DevExpress.Utils.DefaultBoolean.True; xyDiagram1.AxisX.GridLines.Visible = true; xyDiagram1.AxisX.MinorCount = 1; xyDiagram1.AxisX.NumericScaleOptions.AutoGrid = false; xyDiagram1.AxisX.Tickmarks.MinorVisible = false; xyDiagram1.AxisX.Title.Text = "è·ç¦»"; xyDiagram1.AxisX.Visibility = DevExpress.Utils.DefaultBoolean.True; xyDiagram1.AxisX.VisibleInPanesSerializable = "-1"; xyDiagram1.AxisX.WholeRange.EndSideMargin = 0D; xyDiagram1.AxisX.WholeRange.StartSideMargin = 0D; xyDiagram1.AxisY.GridLines.Visible = false; xyDiagram1.AxisY.MinorCount = 1; xyDiagram1.AxisY.NumericScaleOptions.AutoGrid = false; xyDiagram1.AxisY.Tickmarks.MinorVisible = false; xyDiagram1.AxisY.VisibleInPanesSerializable = "-1"; xyDiagram1.EnableAxisXScrolling = true; xyDiagram1.EnableAxisXZooming = true; chartControl1.Diagram = xyDiagram1; chartControl1.Dock = DockStyle.Fill; chartControl1.Legend.AlignmentHorizontal = DevExpress.XtraCharts.LegendAlignmentHorizontal.Center; chartControl1.Legend.Direction = DevExpress.XtraCharts.LegendDirection.LeftToRight; chartControl1.Legend.LegendID = -1; chartControl1.Legend.MarkerMode = DevExpress.XtraCharts.LegendMarkerMode.CheckBox; chartControl1.Location = new Point(0, 0); chartControl1.Name = "chartControl1"; chartControl1.Padding.Bottom = 10; chartControl1.Padding.Left = 20; chartControl1.Padding.Right = 10; chartControl1.Padding.Top = 10; series1.ArgumentDataMember = "X"; series1.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.True; series1.CrosshairHighlightPoints = DevExpress.Utils.DefaultBoolean.True; series1.CrosshairLabelPattern = "é«ç¨:{V:N1}m"; series1.CrosshairLabelVisibility = DevExpress.Utils.DefaultBoolean.True; series1.CrosshairTextOptions.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True; series1.DataSource = elevBindingSource; series1.LegendTextPattern = "é«ç¨"; series1.Name = "SeriesElev"; series1.SeriesID = 1; series1.ToolTipHintDataMember = "Name"; series1.ToolTipSeriesPattern = ""; series1.ValueDataMembersSerializable = "Y"; areaSeriesView1.Color = Color.FromArgb(79, 129, 189); areaSeriesView1.EmptyPointOptions.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Solid; areaSeriesView1.Transparency = 0; series1.View = areaSeriesView1; chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series1 }; chartControl1.SeriesTemplate.ArgumentDataMember = "X"; chartControl1.SeriesTemplate.ToolTipHintDataMember = "Name"; chartControl1.SeriesTemplate.ValueDataMembersSerializable = "Y"; chartControl1.Size = new Size(861, 581); chartControl1.TabIndex = 1; chartControl1.ToolTipEnabled = DevExpress.Utils.DefaultBoolean.True; chartControl1.ToolTipOptions.ShowForSeries = true; chartControl1.CustomPaint += chartControl1_CustomPaint; // // HydroLossCurveCompareCtrl // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; Controls.Add(chartControl1); Name = "HydroLossCurveCompareCtrl"; Size = new Size(861, 581); ((ISupportInitialize)elevBindingSource).EndInit(); ((ISupportInitialize)xyDiagram1).EndInit(); ((ISupportInitialize)areaSeriesView1).EndInit(); ((ISupportInitialize)series1).EndInit(); ((ISupportInitialize)chartControl1).EndInit(); ResumeLayout(false); } #endregion private DevExpress.XtraCharts.ChartControl chartControl1; private BindingSource elevBindingSource; } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/07-control/HydroLossCurveCompareCtrl.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,304 @@ using DevExpress.Charts.Native; using DevExpress.Pdf.Native; using DevExpress.Utils.Drawing; using DevExpress.XtraCharts; using DevExpress.XtraCharts.Native; using DevExpress.XtraEditors; using Dm.Config; using Mapster; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Yw.WinFrmUI { public partial class HydroLossCurveCompareCtrl : DevExpress.XtraEditors.XtraUserControl { public HydroLossCurveCompareCtrl() { InitializeComponent(); } /// <summary> /// æ°´åç¹å»äºä»¶ /// </summary> public event Action<string> HydroClickEvent; private Yw.Model.HydroModelInfo _hydroInfo = null;//æ°´åä¿¡æ¯ private Dictionary<HydroWorkingVmo, HydroCalcuResult> _calcuWorkingDict = null;//å·¥åµè®¡ç®åå ¸ private Yw.Model.HydroNodeInfo _node = null;//èç¹ /// <summary> /// ç»å®æ°æ® /// 计ç®ä¸ä¼æ¹ååææ°´åä¿¡æ¯ /// </summary> public void SetBindingData ( Yw.Model.HydroModelInfo hydroInfo, List<HydroWorkingVmo> allWorkingList, Yw.Model.HydroNodeInfo node, bool isHead = false, List<HydroEvaluationVmo> allEvaluationList = null ) { if (hydroInfo == null) { return; } if (allWorkingList == null || allWorkingList.Count < 1) { return; } if (node == null) { return; } var rhs = hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); var calcuWorkingDict = new Dictionary<HydroWorkingVmo, HydroCalcuResult>(); foreach (var working in allWorkingList) { rhs.UpdateWorkingInfo(working.WorkingInfo); var calcuResult = rhs.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, isHead, allEvaluationList); calcuWorkingDict.Add(working, calcuResult); } SetBindingData(rhs, calcuWorkingDict, node); } /// <summary> /// ç»å®æ°æ® /// </summary> public void SetBindingData ( Yw.Model.HydroModelInfo hydroInfo, Dictionary<HydroWorkingVmo, HydroCalcuResult> calcuWorkingDict, Yw.Model.HydroNodeInfo node ) { if (hydroInfo == null) { return; } if (calcuWorkingDict == null || calcuWorkingDict.Count < 1) { return; } if (node == null) { return; } _hydroInfo = hydroInfo; _calcuWorkingDict = calcuWorkingDict; _node = node; List<HydroLossCurvePointVieModel> elevList = null; foreach (var calcuWorking in calcuWorkingDict) { var vm = HydroLossCurveHelper.Create(hydroInfo, calcuWorking.Key, node, calcuWorking.Value); if (vm == null) { continue; } if (elevList == null) { elevList = vm.Elev?.Items; if (elevList != null && elevList.Count > 0) { this.elevBindingSource.DataSource = elevList; this.elevBindingSource.ResetBindings(false); } } var series = new DevExpress.XtraCharts.Series(); var lineSeriesView = new DevExpress.XtraCharts.LineSeriesView(); series.View = lineSeriesView; series.LegendTextPattern = calcuWorking.Key.Name; series.Name = calcuWorking.Key.Name; series.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.True; series.CrosshairHighlightPoints = DevExpress.Utils.DefaultBoolean.True; series.CrosshairLabelPattern = calcuWorking.Key.Name + "æ»æ°´å¤´:{V:N1}m"; series.CrosshairLabelVisibility = DevExpress.Utils.DefaultBoolean.True; series.CrosshairTextOptions.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True; series.ToolTipSeriesPattern = ""; this.chartControl1.Series.Add(series); if (vm.Lower != null && vm.Lower.Items != null && vm.Lower.Items.Count > 0) { foreach (var item in vm.Lower.Items) { var seriesPoint = new SeriesPoint(item.X, item.Y); seriesPoint.Tag = item; series.Points.Add(seriesPoint); } } AutoFitAxisesY(vm.Items); } AutoFitAxisesX(elevList); } //èªéåºå»åº¦X private void AutoFitAxisesX(List<HydroLossCurvePointVieModel> items) { if (items == null || items.Count < 1) { return; } var diagram = this.chartControl1.Diagram as XYDiagram; #region Xè½´ var allDistances = items.Select(x => x.X).Distinct().ToList(); var distanceMax = allDistances.Max(); diagram.AxisX.Tickmarks.MinorVisible = false; diagram.AxisX.WholeRange.SideMarginsValue = 0; if (distanceMax <= 10) { var maxValue = Math.Ceiling(distanceMax); diagram.AxisX.WholeRange.MinValue = 0; diagram.AxisX.WholeRange.MaxValue = maxValue; diagram.AxisX.NumericScaleOptions.GridSpacing = 1; } else if (distanceMax <= 50) { var maxValue = Math.Ceiling(distanceMax / 10); diagram.AxisX.WholeRange.MinValue = 0; diagram.AxisX.WholeRange.MaxValue = maxValue * 10; diagram.AxisX.NumericScaleOptions.GridSpacing = 5; } else if (distanceMax <= 100) { var maxValue = Math.Ceiling(distanceMax / 10); diagram.AxisX.WholeRange.MinValue = 0; diagram.AxisX.WholeRange.MaxValue = maxValue * 10; diagram.AxisX.NumericScaleOptions.GridSpacing = 10; } else if (distanceMax <= 500) { var maxValue = Math.Ceiling(distanceMax / 100); diagram.AxisX.WholeRange.MinValue = 0; diagram.AxisX.WholeRange.MaxValue = maxValue * 100; diagram.AxisX.NumericScaleOptions.GridSpacing = 50; } else if (distanceMax <= 3000) { var maxValue = Math.Ceiling(distanceMax / 100); diagram.AxisX.WholeRange.MinValue = 0; diagram.AxisX.WholeRange.MaxValue = maxValue * 100; diagram.AxisX.NumericScaleOptions.GridSpacing = 100; } else if (distanceMax <= 5000) { var maxValue = Math.Ceiling(distanceMax / 1000); diagram.AxisX.WholeRange.MinValue = 0; diagram.AxisX.WholeRange.MaxValue = maxValue * 1000; diagram.AxisX.NumericScaleOptions.GridSpacing = 200; } else if (distanceMax <= 10000) { var maxValue = Math.Ceiling(distanceMax / 1000); diagram.AxisX.WholeRange.MinValue = 0; diagram.AxisX.WholeRange.MaxValue = maxValue * 1000; diagram.AxisX.NumericScaleOptions.GridSpacing = 1000; } else { } #endregion } //èªéåºå»åº¦Y private void AutoFitAxisesY(List<HydroLossCurveItemViewModel> items) { if (items == null || items.Count < 1) { return; } var diagram = this.chartControl1.Diagram as XYDiagram; #region åå var allPressMinList = items.Select(x => Math.Min(Math.Min(x.StartHead, x.EndHead), x.Elev)).ToList(); var allPressMaxList = items.Select(x => Math.Max(Math.Max(x.StartHead, x.EndHead), x.Elev)).ToList(); var pressMin = allPressMinList.Min(); pressMin = Math.Min(pressMin, (double)diagram.AxisY.WholeRange.MinValue); var pressMax = allPressMaxList.Max(); pressMax = Math.Max(pressMax, (double)diagram.AxisY.WholeRange.MaxValue); diagram.AxisY.Tickmarks.MinorVisible = false; diagram.AxisY.WholeRange.SideMarginsValue = 0; diagram.AxisY.CrosshairAxisLabelOptions.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True; if (pressMax <= 10) { diagram.AxisY.WholeRange.MinValue = Math.Floor(pressMin); diagram.AxisY.WholeRange.MaxValue = 10; diagram.AxisY.NumericScaleOptions.GridSpacing = 1; diagram.AxisY.VisualRange.SetMinMaxValues(0, 10); } else if (pressMax <= 100) { var maxValue = Math.Ceiling(pressMax / 10); diagram.AxisY.WholeRange.MinValue = Math.Floor(pressMin); diagram.AxisY.WholeRange.MaxValue = maxValue * 10; diagram.AxisY.NumericScaleOptions.GridSpacing = 5; diagram.AxisY.VisualRange.SetMinMaxValues(0, maxValue * 10); } else if (pressMax <= 3000) { var maxValue = Math.Ceiling(pressMax / 100); diagram.AxisY.WholeRange.MinValue = Math.Floor(pressMin); diagram.AxisY.WholeRange.MaxValue = maxValue * 100; diagram.AxisY.NumericScaleOptions.GridSpacing = 50; diagram.AxisY.VisualRange.SetMinMaxValues(0, maxValue * 100); } else if (pressMax <= 6000) { var maxValue = Math.Ceiling(pressMax / 1000); diagram.AxisY.WholeRange.MinValue = Math.Floor(pressMin); diagram.AxisY.WholeRange.MaxValue = maxValue * 1000; diagram.AxisY.NumericScaleOptions.GridSpacing = 100; diagram.AxisY.VisualRange.SetMinMaxValues(0, maxValue * 1000); } else { } #endregion } //èªå®ä¹ç»ç» private void chartControl1_CustomPaint(object sender, DevExpress.XtraCharts.CustomPaintEventArgs e) { DXCustomPaintEventArgs args = e as DXCustomPaintEventArgs; if (args == null) { return; } GraphicsCache g = args.Cache; var series = this.chartControl1.Series; var lineSeries = series?.Where(x => x.SeriesView is LineSeriesView).ToList(); if (lineSeries == null || lineSeries.Count < 2) { return; } } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/07-control/HydroLossCurveCompareCtrl.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="elevBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>47, 30</value> </metadata> </root> WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/07-control/HydroLossCurveCtrl.cs
@@ -44,7 +44,7 @@ AutoFitAxises(vm?.Items); this.elevBindingSource.DataSource = vm?.Elev?.Items; this.elevBindingSource.ResetBindings(false); this.lossBindingSource.DataSource = vm?.Lower; this.lossBindingSource.DataSource = vm?.Lower?.Items; this.lossBindingSource.ResetBindings(false); if (vm?.Total != null) { WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/07-control/HydroLossCurveInteropCtrl.Designer.cs
@@ -298,12 +298,12 @@ emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; emptySpaceItem1.TextSize = new Size(0, 0); // // HydroSingleWorkingLossCurveInteropCtrl // HydroLossCurveInteropCtrl // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; Controls.Add(layoutControl1); Name = "HydroSingleWorkingLossCurveInteropCtrl"; Name = "HydroLossCurveInteropCtrl"; Size = new Size(993, 731); ((ISupportInitialize)lossBindingSource).EndInit(); ((ISupportInitialize)elevBindingSource).EndInit(); WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/07-control/HydroLossCurveInteropCtrl.cs
@@ -82,7 +82,7 @@ AutoFitAxises(vm?.Items); this.elevBindingSource.DataSource = vm?.Elev?.Items; this.elevBindingSource.ResetBindings(false); this.lossBindingSource.DataSource = vm?.Lower; this.lossBindingSource.DataSource = vm?.Lower?.Items; this.lossBindingSource.ResetBindings(false); if (vm?.Total != null) { WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/09-working/HydroLossCurveMultiWorkingDlg.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,255 @@ namespace Yw.WinFrmUI { partial class HydroLossCurveMultiWorkingDlg { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { ComponentResourceManager resources = new ComponentResourceManager(typeof(HydroLossCurveMultiWorkingDlg)); ribbon = new DevExpress.XtraBars.Ribbon.RibbonControl(); ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage(); ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup(); layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); hydroLossCurveCtrl1 = new HydroLossCurveCtrl(); hydroWorkingListViewCtrl1 = new HydroWorkingListViewCtrl(); Root = new DevExpress.XtraLayout.LayoutControlGroup(); groupForWorkingList = new DevExpress.XtraLayout.LayoutControlGroup(); layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); splitter = new DevExpress.XtraLayout.SplitterItem(); itemForLossCurve = new DevExpress.XtraLayout.LayoutControlItem(); navigationFrame1 = new DevExpress.XtraBars.Navigation.NavigationFrame(); navigationPage1 = new DevExpress.XtraBars.Navigation.NavigationPage(); navigationPage2 = new DevExpress.XtraBars.Navigation.NavigationPage(); hydroLossCurveCompareCtrl1 = new HydroLossCurveCompareCtrl(); barBtnChange = new DevExpress.XtraBars.BarButtonItem(); ((ISupportInitialize)ribbon).BeginInit(); ((ISupportInitialize)layoutControl1).BeginInit(); layoutControl1.SuspendLayout(); ((ISupportInitialize)Root).BeginInit(); ((ISupportInitialize)groupForWorkingList).BeginInit(); ((ISupportInitialize)layoutControlItem1).BeginInit(); ((ISupportInitialize)splitter).BeginInit(); ((ISupportInitialize)itemForLossCurve).BeginInit(); ((ISupportInitialize)navigationFrame1).BeginInit(); navigationFrame1.SuspendLayout(); navigationPage1.SuspendLayout(); navigationPage2.SuspendLayout(); SuspendLayout(); // // ribbon // ribbon.CaptionBarItemLinks.Add(barBtnChange); ribbon.ExpandCollapseItem.Id = 0; ribbon.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbon.ExpandCollapseItem, barBtnChange }); ribbon.Location = new Point(0, 0); ribbon.MaxItemId = 2; ribbon.Name = "ribbon"; ribbon.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { ribbonPage1 }); ribbon.RibbonCaptionAlignment = DevExpress.XtraBars.Ribbon.RibbonCaptionAlignment.Left; ribbon.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False; ribbon.Size = new Size(994, 32); // // ribbonPage1 // ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { ribbonPageGroup1 }); ribbonPage1.Name = "ribbonPage1"; ribbonPage1.Text = "ribbonPage1"; // // ribbonPageGroup1 // ribbonPageGroup1.Name = "ribbonPageGroup1"; ribbonPageGroup1.Text = "ribbonPageGroup1"; // // layoutControl1 // layoutControl1.Controls.Add(hydroLossCurveCtrl1); layoutControl1.Controls.Add(hydroWorkingListViewCtrl1); layoutControl1.Dock = DockStyle.Fill; layoutControl1.Location = new Point(0, 0); layoutControl1.Name = "layoutControl1"; layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new Rectangle(551, 346, 650, 400); layoutControl1.Root = Root; layoutControl1.Size = new Size(994, 573); layoutControl1.TabIndex = 1; layoutControl1.Text = "layoutControl1"; // // hydroLossCurveCtrl1 // hydroLossCurveCtrl1.Location = new Point(177, 2); hydroLossCurveCtrl1.Name = "hydroLossCurveCtrl1"; hydroLossCurveCtrl1.Size = new Size(815, 569); hydroLossCurveCtrl1.TabIndex = 5; // // hydroWorkingListViewCtrl1 // hydroWorkingListViewCtrl1.BorderVisible = false; hydroWorkingListViewCtrl1.Location = new Point(3, 24); hydroWorkingListViewCtrl1.Name = "hydroWorkingListViewCtrl1"; hydroWorkingListViewCtrl1.Size = new Size(159, 546); hydroWorkingListViewCtrl1.TabIndex = 0; // // Root // Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; Root.GroupBordersVisible = false; Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { groupForWorkingList, splitter, itemForLossCurve }); Root.Name = "Root"; Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); Root.Size = new Size(994, 573); Root.TextVisible = false; // // groupForWorkingList // groupForWorkingList.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1 }); groupForWorkingList.Location = new Point(0, 0); groupForWorkingList.Name = "groupForWorkingList"; groupForWorkingList.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); groupForWorkingList.Size = new Size(165, 573); groupForWorkingList.Text = "å·¥åµå表"; // // layoutControlItem1 // layoutControlItem1.Control = hydroWorkingListViewCtrl1; layoutControlItem1.Location = new Point(0, 0); layoutControlItem1.Name = "layoutControlItem1"; layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); layoutControlItem1.Size = new Size(159, 546); layoutControlItem1.TextSize = new Size(0, 0); layoutControlItem1.TextVisible = false; // // splitter // splitter.AllowHotTrack = true; splitter.Location = new Point(165, 0); splitter.Name = "splitter"; splitter.Size = new Size(10, 573); // // itemForLossCurve // itemForLossCurve.Control = hydroLossCurveCtrl1; itemForLossCurve.Location = new Point(175, 0); itemForLossCurve.Name = "itemForLossCurve"; itemForLossCurve.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); itemForLossCurve.Size = new Size(819, 573); itemForLossCurve.Spacing = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2); itemForLossCurve.TextSize = new Size(0, 0); itemForLossCurve.TextVisible = false; // // navigationFrame1 // navigationFrame1.Controls.Add(navigationPage1); navigationFrame1.Controls.Add(navigationPage2); navigationFrame1.Dock = DockStyle.Fill; navigationFrame1.Location = new Point(0, 32); navigationFrame1.Name = "navigationFrame1"; navigationFrame1.Pages.AddRange(new DevExpress.XtraBars.Navigation.NavigationPageBase[] { navigationPage1, navigationPage2 }); navigationFrame1.SelectedPage = navigationPage1; navigationFrame1.Size = new Size(994, 573); navigationFrame1.TabIndex = 3; navigationFrame1.Text = "navigationFrame1"; // // navigationPage1 // navigationPage1.Caption = "navigationPage1"; navigationPage1.Controls.Add(layoutControl1); navigationPage1.Name = "navigationPage1"; navigationPage1.Size = new Size(994, 573); // // navigationPage2 // navigationPage2.Caption = "navigationPage2"; navigationPage2.Controls.Add(hydroLossCurveCompareCtrl1); navigationPage2.Name = "navigationPage2"; navigationPage2.Size = new Size(994, 573); // // hydroLossCurveCompareCtrl1 // hydroLossCurveCompareCtrl1.Dock = DockStyle.Fill; hydroLossCurveCompareCtrl1.Location = new Point(0, 0); hydroLossCurveCompareCtrl1.Name = "hydroLossCurveCompareCtrl1"; hydroLossCurveCompareCtrl1.Size = new Size(994, 573); hydroLossCurveCompareCtrl1.TabIndex = 0; // // barBtnChange // barBtnChange.Caption = "忢"; barBtnChange.Hint = "忢"; barBtnChange.Id = 1; barBtnChange.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("barBtnChange.ImageOptions.SvgImage"); barBtnChange.Name = "barBtnChange"; barBtnChange.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText; barBtnChange.ItemClick += barBtnChange_ItemClick; // // HydroLossCurveMultiWorkingDlg // AutoScaleDimensions = new SizeF(7F, 14F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(994, 605); Controls.Add(navigationFrame1); Controls.Add(ribbon); FormBorderStyle = FormBorderStyle.SizableToolWindow; Name = "HydroLossCurveMultiWorkingDlg"; Ribbon = ribbon; RibbonVisibility = DevExpress.XtraBars.Ribbon.RibbonVisibility.Hidden; StartPosition = FormStartPosition.CenterParent; Text = "æå¤±æ²çº¿"; ((ISupportInitialize)ribbon).EndInit(); ((ISupportInitialize)layoutControl1).EndInit(); layoutControl1.ResumeLayout(false); ((ISupportInitialize)Root).EndInit(); ((ISupportInitialize)groupForWorkingList).EndInit(); ((ISupportInitialize)layoutControlItem1).EndInit(); ((ISupportInitialize)splitter).EndInit(); ((ISupportInitialize)itemForLossCurve).EndInit(); ((ISupportInitialize)navigationFrame1).EndInit(); navigationFrame1.ResumeLayout(false); navigationPage1.ResumeLayout(false); navigationPage2.ResumeLayout(false); ResumeLayout(false); PerformLayout(); } #endregion private DevExpress.XtraBars.Ribbon.RibbonControl ribbon; private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1; private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1; private DevExpress.XtraLayout.LayoutControl layoutControl1; private HydroWorkingListViewCtrl hydroWorkingListViewCtrl1; private DevExpress.XtraLayout.LayoutControlGroup Root; private DevExpress.XtraLayout.LayoutControlGroup groupForWorkingList; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; private DevExpress.XtraLayout.SplitterItem splitter; private HydroLossCurveCtrl hydroLossCurveCtrl1; private DevExpress.XtraLayout.LayoutControlItem itemForLossCurve; private DevExpress.XtraBars.Navigation.NavigationFrame navigationFrame1; private DevExpress.XtraBars.Navigation.NavigationPage navigationPage1; private DevExpress.XtraBars.Navigation.NavigationPage navigationPage2; private DevExpress.XtraBars.BarButtonItem barBtnChange; private HydroLossCurveCompareCtrl hydroLossCurveCompareCtrl1; } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/09-working/HydroLossCurveMultiWorkingDlg.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,102 @@ using Mapster; namespace Yw.WinFrmUI { public partial class HydroLossCurveMultiWorkingDlg : DevExpress.XtraBars.Ribbon.RibbonForm { public HydroLossCurveMultiWorkingDlg() { InitializeComponent(); this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; this.layoutControl1.SetupLayoutControl(); this.hydroWorkingListViewCtrl1.SelectedChangedEvent += HydroWorkingListViewCtrl1_SelectedChangedEvent; } private Yw.Model.HydroModelInfo _hydroInfo = null;//æ°´åä¿¡æ¯ private Dictionary<HydroWorkingVmo, HydroCalcuResult> _calcuWorkingDict = null;//å·¥åµè®¡ç®åå ¸ private Yw.Model.HydroNodeInfo _node = null;//èç¹ /// <summary> /// ç»å®æ°æ® /// 计ç®ä¸ä¼æ¹ååææ°´åä¿¡æ¯ /// </summary> public void SetBindingData ( Yw.Model.HydroModelInfo hydroInfo, List<HydroWorkingVmo> allWorkingList, Yw.Model.HydroNodeInfo node, bool isHead = false, List<HydroEvaluationVmo> allEvaluationList = null ) { if (hydroInfo == null) { return; } if (allWorkingList == null || allWorkingList.Count < 1) { return; } if (node == null) { return; } _hydroInfo = hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); _node = node; _calcuWorkingDict = new Dictionary<HydroWorkingVmo, HydroCalcuResult>(); foreach (var working in allWorkingList) { _hydroInfo.UpdateWorkingInfo(working.WorkingInfo); var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, isHead, allEvaluationList); _calcuWorkingDict.Add(working, calcuResult); } if (allWorkingList.Count < 2) { var working = allWorkingList[0]; this.Text = $"æå¤±æ²çº¿({working.Name})"; this.groupForWorkingList.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; this.splitter.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; } this.hydroWorkingListViewCtrl1.SetBindingData(allWorkingList); this.hydroLossCurveCompareCtrl1.SetBindingData(_hydroInfo, _calcuWorkingDict, _node); } //å·¥åµéæ©æ¹å private void HydroWorkingListViewCtrl1_SelectedChangedEvent(HydroWorkingVmo working) { if (_hydroInfo == null) { return; } if (_node == null) { return; } if (_calcuWorkingDict == null || _calcuWorkingDict.Count < 1) { return; } if (working == null) { return; } if (!_calcuWorkingDict.ContainsKey(working)) { return; } this.hydroLossCurveCtrl1.SetBindingData(_hydroInfo, working, _node, _calcuWorkingDict[working]); } //忢 private void barBtnChange_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var index = this.navigationFrame1.SelectedPageIndex == 0 ? 1 : 0; this.navigationFrame1.SelectedPageIndex = index; } } } WinFrmUI/Yw.WinFrmUI.Hydro.Core/loss-curve/09-working/HydroLossCurveMultiWorkingDlg.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,140 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <data name="barBtnChange.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAJkCAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMzU3NUJCO30KCS5C bGFja3tmaWxsOiM3MzczNzQ7fQoJLldoaXRle2ZpbGw6I0ZGRkZGRjt9CgkuWWVsbG93e2ZpbGw6I0ZD QjAxQjt9CgkuUmVke2ZpbGw6I0QwMjAyNzt9CgkuR3JlZW57ZmlsbDojMTI5QzQ5O30KCS5zdDB7b3Bh Y2l0eTowLjU7fQo8L3N0eWxlPg0KICA8cGF0aCBkPSJNMzEsMkgxMWMtMC41LDAtMSwwLjUtMSwxdjlo MlY0aDE4djI0SDEydi04aC0ydjljMCwwLjUsMC41LDEsMSwxaDIwYzAuNSwwLDEtMC41LDEtMVYzQzMy LDIuNSwzMS41LDIsMzEsMnogICIgY2xhc3M9IkJsYWNrIiAvPg0KICA8cG9seWdvbiBwb2ludHM9IjQs MTQgMTQsMTQgMTQsOCAyMiwxNiAxNCwyNCAxNCwxOCA0LDE4ICIgY2xhc3M9IkJsdWUiIC8+DQo8L3N2 Zz4L </value> </data> </root>