From 058adb7d84fa39cf4fc5ff1ab6ea337db6c21423 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期二, 24 十二月 2024 09:42:57 +0800 Subject: [PATCH] 增加报告泵曲线信息字段 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportCtrl.cs | 27 +++++-------- Component/HStation.ReportFile.SDK.Core/01-view/SimulationWorkingReportHelper.cs | 2 + Component/Yw.DiagramFile.SDK.Core/pump/PumpDiagram.cs | 11 +++-- Component/Yw.DiagramFile.SDK.Core/Yw.DiagramFile.SDK.Core.csproj | 1 Component/HStation.ReportFile.SDK.Core/01-view/SimulationAsposeWordHelper.cs | 0 Component/HStation.ReportFile.SDK.Core/02-item/SimulationWorkingReportViewModel.cs | 6 +++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs | 33 ++++++---------- Component/HStation.ReportFile.SDK.Core/00-core/Aspose.Words.dll | 0 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportDlg.cs | 2 Component/HStation.ReportFile.SDK.Core/01-view/SimulationWordReportHelper.cs | 23 +++++++++++ 10 files changed, 63 insertions(+), 42 deletions(-) diff --git a/Component/HStation.ReportFile.SDK.Core/Aspose.Words.dll b/Component/HStation.ReportFile.SDK.Core/00-core/Aspose.Words.dll similarity index 100% rename from Component/HStation.ReportFile.SDK.Core/Aspose.Words.dll rename to Component/HStation.ReportFile.SDK.Core/00-core/Aspose.Words.dll Binary files differ diff --git a/Component/HStation.ReportFile.SDK.Core/SimulationAsposeWordHelper.cs b/Component/HStation.ReportFile.SDK.Core/01-view/SimulationAsposeWordHelper.cs similarity index 100% rename from Component/HStation.ReportFile.SDK.Core/SimulationAsposeWordHelper.cs rename to Component/HStation.ReportFile.SDK.Core/01-view/SimulationAsposeWordHelper.cs diff --git a/Component/HStation.ReportFile.SDK.Core/SimulationWordReportHelper.cs b/Component/HStation.ReportFile.SDK.Core/01-view/SimulationWordReportHelper.cs similarity index 93% rename from Component/HStation.ReportFile.SDK.Core/SimulationWordReportHelper.cs rename to Component/HStation.ReportFile.SDK.Core/01-view/SimulationWordReportHelper.cs index fad11fb..be4584d 100644 --- a/Component/HStation.ReportFile.SDK.Core/SimulationWordReportHelper.cs +++ b/Component/HStation.ReportFile.SDK.Core/01-view/SimulationWordReportHelper.cs @@ -1,6 +1,8 @@ 锘縰sing Aspose.Words; using SkiaSharp; using System.Drawing; +using Yw.DiagramFile; +using Yw.DiagramFile.Image; namespace HStation.ReportFile { @@ -308,6 +310,27 @@ } /// <summary> + /// 鏋勫缓娉垫洸绾垮浘鐗� + /// </summary> + /// <param name="content">鏂囧瓧鍐呭</param> + /// <param name="address">鍥剧墖鍦板潃</param> + public void BuildingPumpCurvePicture(PumpChartViewModel pumpChartViewModel, double wide, double height) + { + if (pumpChartViewModel == null) + return; + var pumpDiagram = new PumpChart(); + var bitmap = pumpDiagram.Create(pumpChartViewModel); + _builder.ParagraphFormat.Alignment = _fontalignment; + _builder.SetBuilderFont(_font, _fontSize, _fontcolor, _isBlod); + if (bitmap == null) + { + return; + } + _builder.InsertImage(bitmap, wide, height); + _builder.Writeln(""); + } + + /// <summary> /// 鏋勫缓鍥剧墖 (鍚屼竴琛屽涓浘鐗�) /// </summary> /// <param name="addresses">鍥剧墖鍦板潃鍒楄〃</param> diff --git a/Component/HStation.ReportFile.SDK.Core/SimulationWorkingReportHelper.cs b/Component/HStation.ReportFile.SDK.Core/01-view/SimulationWorkingReportHelper.cs similarity index 99% rename from Component/HStation.ReportFile.SDK.Core/SimulationWorkingReportHelper.cs rename to Component/HStation.ReportFile.SDK.Core/01-view/SimulationWorkingReportHelper.cs index da03bd7..33fd5e8 100644 --- a/Component/HStation.ReportFile.SDK.Core/SimulationWorkingReportHelper.cs +++ b/Component/HStation.ReportFile.SDK.Core/01-view/SimulationWorkingReportHelper.cs @@ -594,6 +594,8 @@ var pathList = new List<string>() { vm.Working.EnergyInputImagePath, vm.Working.EnergyLossImagePath }; Text_left_12_black.structureImagesInRow(pathList, 80, 210); Text_left_12_black.structureTextAndImage(vm.Working.EnergyStatisticsImagePath, 50, 420); + //鏋勪欢娉垫洸绾垮浘 + Text_left_12_black.BuildingPumpCurvePicture(vm.pumpChartViewModel, 50, 420); Text_left_15_black.structureText("涓夛級\t鑺傝兘鎶�鏀规柟妗堜笌璁捐鎸囨爣"); Text_left_12_black.structureLeft20Text("3.1銆佽璁′緷鎹�"); diff --git a/Component/HStation.ReportFile.SDK.Core/02-item/SimulationWorkingReportViewModel.cs b/Component/HStation.ReportFile.SDK.Core/02-item/SimulationWorkingReportViewModel.cs index 8473755..d835059 100644 --- a/Component/HStation.ReportFile.SDK.Core/02-item/SimulationWorkingReportViewModel.cs +++ b/Component/HStation.ReportFile.SDK.Core/02-item/SimulationWorkingReportViewModel.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Yw.DiagramFile; namespace HStation.ReportFile { @@ -30,5 +31,10 @@ /// 宸ュ喌淇℃伅 /// </summary> public SimulationReportWorkingItemViewModel Working { get; set; } + + /// <summary> + /// 娉垫洸绾夸俊鎭� + /// </summary> + public PumpChartViewModel pumpChartViewModel { get; set; } } } \ No newline at end of file diff --git a/Component/Yw.DiagramFile.SDK.Core/Yw.DiagramFile.SDK.Core.csproj b/Component/Yw.DiagramFile.SDK.Core/Yw.DiagramFile.SDK.Core.csproj index 1fc1906..e09a774 100644 --- a/Component/Yw.DiagramFile.SDK.Core/Yw.DiagramFile.SDK.Core.csproj +++ b/Component/Yw.DiagramFile.SDK.Core/Yw.DiagramFile.SDK.Core.csproj @@ -8,6 +8,7 @@ <ItemGroup> <PackageReference Include="Yw.Pump.Core" Version="3.1.7" /> + <PackageReference Include="Yw.SkiaSharp.Core" Version="3.0.0" /> </ItemGroup> </Project> diff --git a/Component/Yw.DiagramFile.SDK.Core/pump/PumpDiagram.cs b/Component/Yw.DiagramFile.SDK.Core/pump/PumpDiagram.cs index 17d42e7..1db8aa0 100644 --- a/Component/Yw.DiagramFile.SDK.Core/pump/PumpDiagram.cs +++ b/Component/Yw.DiagramFile.SDK.Core/pump/PumpDiagram.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing SkiaSharp; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,9 +9,9 @@ { public class PumpChart { - /* public Image Create() - { - return null; - }*/ + public SKBitmap Create(PumpChartViewModel pumpChartViewModel) + { + return null; + } } } \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs index 7929d87..8173b76 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs @@ -809,6 +809,7 @@ #region 涓�閿樉闅� private List<string> _allDecoratorCodes = null; + //鑾峰彇瑁呴グ浠禼ode鍒楄〃 private async Task<List<string>> GetDecoratorCodes() { @@ -1751,7 +1752,7 @@ return await helper.GetAnalyseList(); } - #endregion + #endregion 鐩戞祴鐐� #region 鐩戞祴鍊� @@ -1804,7 +1805,7 @@ } } - #endregion + #endregion 鐩戞祴鍊� #region 浼犳劅鍣ㄦ祴鐐� @@ -1847,7 +1848,7 @@ SetMonitorDockingList(_visual); } - #endregion + #endregion 浼犳劅鍣ㄦ祴鐐� #region 浼犳劅鍣ㄦ祴鍊� @@ -1912,7 +1913,7 @@ ShowMonitorDockingValueListCtrl(); } - #endregion + #endregion 浼犳劅鍣ㄦ祴鍊� #region 鍒嗘瀽娴嬬偣 @@ -1951,7 +1952,7 @@ SetMonitorAnalyseList(_visual); } - #endregion + #endregion 鍒嗘瀽娴嬬偣 #region 娴嬬偣鏍囪 @@ -1978,7 +1979,7 @@ monitorMarkerHelper.Set(); } - #endregion + #endregion 娴嬬偣鏍囪 #region 妯″瀷妫�鏌� @@ -2247,7 +2248,7 @@ #endregion 璁$畻鏍囩 - #endregion + #endregion 妯″瀷璁$畻 #region 瀵煎嚭INP @@ -2495,7 +2496,7 @@ { return; } - var reportHelper = new SimulationWorkingReportHelper(); + var reportHelper = new HStation.ReportFile.SimulationWorkingReportHelper(); reportHelper.Create(fileName, vm); TipFormHelper.ShowInfo("瀵煎嚭鎴愬姛锛�"); }; @@ -2568,7 +2569,7 @@ AddWorking(); } - #endregion + #endregion 褰撳墠宸ュ喌 #region 閫夋嫨宸ュ喌 @@ -2707,7 +2708,7 @@ ShowMonitorAnalyListCtrl(); } - #endregion + #endregion 鐩戞祴鍒嗘瀽 #region 宸ュ喌鍒嗘瀽 @@ -2810,8 +2811,6 @@ } } - - //鎹熷け缁熻 private void barBtnWorkingLossStatistics_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { @@ -2884,7 +2883,7 @@ } } - #endregion + #endregion 宸ュ喌鍒嗘瀽 #region 鎹熷け鏇茬嚎 @@ -2984,7 +2983,7 @@ } } - #endregion + #endregion 鎹熷け鏇茬嚎 #region 鏂规绠$悊 @@ -3060,11 +3059,5 @@ } #endregion 鏂规绠$悊 - - - - - - } } \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportCtrl.cs index 4469731..0282f6e 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportCtrl.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportCtrl.cs @@ -30,7 +30,6 @@ private HydroSingleWorkingLossCurveCtrl _lossCurve = null; private HydroSingleWorkingLossStatisticsCtrl _lossStatistics = null; - private XhsProjectVmo _project = null; private Yw.Model.HydroModelInfo _hydroInfo = null; private List<HydroMonitorVmo> _allMonitorList = null; @@ -76,7 +75,7 @@ projectGroup.AllowBorderColorBlending = true; projectGroup.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); - #endregion + #endregion 椤圭洰淇℃伅 #region 鑳借�楀垎鏋� @@ -96,7 +95,7 @@ energyGroup.AllowBorderColorBlending = true; energyGroup.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); - #endregion + #endregion 鑳借�楀垎鏋� #region 鎹熷け鏇茬嚎 @@ -116,7 +115,7 @@ lossCurveGroup.AllowBorderColorBlending = true; lossCurveGroup.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); - #endregion + #endregion 鎹熷け鏇茬嚎 #region 鎹熷け缁熻 @@ -136,9 +135,7 @@ lossStatisticsGroup.AllowBorderColorBlending = true; lossStatisticsGroup.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); - #endregion - - + #endregion 鎹熷け缁熻 } private const string _tempFoler = "workingImageTemp"; @@ -165,20 +162,20 @@ /// <summary> /// 鑾峰彇瑙嗗浘 /// </summary> - public async Task<SimulationWorkingReportViewModel> GetViewModel() + public async Task<HStation.ReportFile.SimulationWorkingReportViewModel> GetViewModel() { - var vm = new SimulationWorkingReportViewModel(); + var vm = new HStation.ReportFile.SimulationWorkingReportViewModel(); vm.ReportType = "妯℃嫙宸ュ喌杩愯鎶ュ憡"; - vm.Info = new SimulationReportInfoItemViewModel() + vm.Info = new HStation.ReportFile.SimulationReportInfoItemViewModel() { Name = _project.Name, Description = _project.Description, }; - vm.Pumps = new List<SimulationReportPumpItemViewModel>(); + vm.Pumps = new List<HStation.ReportFile.SimulationReportPumpItemViewModel>(); var pumps = _hydroInfo.Pumps; foreach (var pump in _hydroInfo.Pumps) { - var pumpItem = new SimulationReportPumpItemViewModel(); + var pumpItem = new HStation.ReportFile.SimulationReportPumpItemViewModel(); pumpItem.Name = pump.Name; pumpItem.ModelType = pumpItem.ModelType; pumpItem.SerialNO = (_hydroInfo.Pumps.IndexOf(pump) + 1).ToString(); @@ -210,7 +207,7 @@ } } } - vm.Working = new SimulationReportWorkingItemViewModel(); + vm.Working = new HStation.ReportFile.SimulationReportWorkingItemViewModel(); vm.Working.Name = _working.Name; if (string.IsNullOrEmpty(vm.Working.Name)) { @@ -229,7 +226,5 @@ return vm; } - - } -} +} \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportDlg.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportDlg.cs index 9010e06..64363db 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportDlg.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/02-helper/SimulationWorkingReportDlg.cs @@ -23,7 +23,7 @@ this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; } - public event Action<SimulationWorkingReportViewModel> ReloadDataEvent; + public event Action<HStation.ReportFile.SimulationWorkingReportViewModel> ReloadDataEvent; /// <summary> /// 缁戝畾鏁版嵁 -- Gitblit v1.9.3