| | |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraLayout; |
| | | using DevExpress.XtraLayout.Utils; |
| | | using DevExpress.XtraRichEdit.Model; |
| | | using NPOI.HPSF; |
| | | 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; |
| | | using DevExpress.XtraLayout.Utils; |
| | | using Yw.Model; |
| | | using Yw.Vmo; |
| | | |
| | |
| | | |
| | | private SimulationProjectTitleCtrl _titleCtrl = null; |
| | | private SimulationPumpSingleWorkingChartCtrl _workingChart = null; |
| | | private HydroSingleWorkingLossCurveCtrl _lossCurve = null; |
| | | private HydroSingleWorkingLossStatisticsCtrl _lossStatistics = null; |
| | | |
| | | private HydroLossCurveCtrl _lossCurve = null; |
| | | private HydroLossStatisticsCtrl _lossStatistics = null; |
| | | |
| | | private XhsProjectVmo _project = null; |
| | | private Yw.Model.HydroModelInfo _hydroInfo = null; |
| | |
| | | projectGroup.AllowBorderColorBlending = true; |
| | | projectGroup.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); |
| | | |
| | | #endregion |
| | | #endregion 项目信息 |
| | | |
| | | #region 能耗分析 |
| | | |
| | |
| | | energyGroup.AllowBorderColorBlending = true; |
| | | energyGroup.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); |
| | | |
| | | #endregion |
| | | #endregion 能耗分析 |
| | | |
| | | #region 损失曲线 |
| | | |
| | |
| | | lossCurveGroup.Expanded = false; |
| | | lossCurveGroup.HeaderButtonsLocation = DevExpress.Utils.GroupElementLocation.AfterText; |
| | | lossCurveGroup.ExpandOnDoubleClick = true; |
| | | _lossCurve = new HydroSingleWorkingLossCurveCtrl(); |
| | | _lossCurve.SetBindingData(hydroInfo, calcuResult, visual); |
| | | _lossCurve = new HydroLossCurveCtrl(); |
| | | //_lossCurve.SetBindingData(hydroInfo, calcuResult, visual); |
| | | var lossCurveItem = lossCurveGroup.AddItem("损失曲线", _lossCurve); |
| | | lossCurveItem.TextVisible = false; |
| | | lossCurveItem.Height = 250; |
| | |
| | | lossCurveGroup.AllowBorderColorBlending = true; |
| | | lossCurveGroup.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); |
| | | |
| | | #endregion |
| | | #endregion 损失曲线 |
| | | |
| | | #region 损失统计 |
| | | |
| | |
| | | lossStatisticsGroup.Expanded = false; |
| | | lossStatisticsGroup.HeaderButtonsLocation = DevExpress.Utils.GroupElementLocation.AfterText; |
| | | lossStatisticsGroup.ExpandOnDoubleClick = true; |
| | | _lossStatistics = new HydroSingleWorkingLossStatisticsCtrl(); |
| | | _lossStatistics.SetBindingData(hydroInfo, calcuResult); |
| | | _lossStatistics = new HydroLossStatisticsCtrl(); |
| | | _lossStatistics.SetBindingData(hydroInfo, working, calcuResult); |
| | | var lossStatisticsItem = lossStatisticsGroup.AddItem("损失统计", _lossStatistics); |
| | | lossStatisticsItem.TextVisible = false; |
| | | lossStatisticsItem.Height = 250; |
| | |
| | | lossStatisticsGroup.AllowBorderColorBlending = true; |
| | | lossStatisticsGroup.AppearanceGroup.BorderColor = Color.FromArgb(0, 122, 204); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #endregion 损失统计 |
| | | } |
| | | |
| | | private const string _tempFoler = "workingImageTemp"; |
| | | private const string _pumpAnalyImageFileName = "pump_analy.png"; |
| | | private const string _energyAnalyImageFileName = "energy_analy.png"; |
| | | private const string _lossCurveImageFileName = "loss_curve.png"; |
| | | private const string _energyInputImageFileName = "energy_input.png"; |
| | | private const string _energyLossImageFileName = "energy_loss.png"; |
| | |
| | | /// <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(); |
| | | pumpItem.RatedQ = $"{pump.RatedQ ?? 0}m³/h"; |
| | | pumpItem.RatedH = $"{pump.RatedH ?? 0}m"; |
| | | pumpItem.RatedQ = $"{pump.RatedQ}m³/h"; |
| | | pumpItem.RatedH = $"{pump.RatedH}m"; |
| | | pumpItem.RatedP = $"{pump.RatedP}kW"; |
| | | pumpItem.RatedN = $"{pump.RatedN ?? 0}r/min"; |
| | | pumpItem.RatedN = $"{pump.RatedN}r/min"; |
| | | vm.Pumps.Add(pumpItem); |
| | | var pumpDb = await BLLFactory<HStation.BLL.AssetsPumpMain>.Instance.GetByIDEx(long.Parse(pump.DbId)); |
| | | if (pumpDb != null) |
| | |
| | | } |
| | | } |
| | | } |
| | | vm.Working = new SimulationReportWorkingItemViewModel(); |
| | | vm.Working = new HStation.ReportFile.SimulationReportWorkingItemViewModel(); |
| | | vm.Working.Name = _working.Name; |
| | | if (string.IsNullOrEmpty(vm.Working.Name)) |
| | | { |
| | | vm.Working.Name = "当前计算工况"; |
| | | } |
| | | vm.Working.EnergyAnalyImagePath = GetImageFilePath(_energyAnalyImageFileName); |
| | | _workingChart.ExportToImage(vm.Working.EnergyAnalyImagePath); |
| | | vm.Working.LossCurveImagePath = GetImageFilePath(_lossCurveImageFileName); |
| | | _lossCurve.ExportToImage(vm.Working.LossCurveImagePath); |
| | | vm.Working.EnergyInputImagePath = GetImageFilePath(_energyInputImageFileName); |
| | | _lossStatistics.ExportInputToImage(vm.Working.EnergyInputImagePath); |
| | | vm.Working.EnergyLossImagePath = GetImageFilePath(_energyLossImageFileName); |
| | | _lossStatistics.ExportLossToImage(vm.Working.EnergyLossImagePath); |
| | | _lossStatistics.ExportCatalogToImage(vm.Working.EnergyLossImagePath); |
| | | vm.Working.EnergyStatisticsImagePath = GetImageFilePath(_energyStatisticsImageFileName); |
| | | _lossStatistics.ExportStatisticsToImage(vm.Working.EnergyStatisticsImagePath); |
| | | _lossStatistics.ExportCategoryToImage(vm.Working.EnergyStatisticsImagePath); |
| | | |
| | | vm.PumpChart = new Yw.DiagramFile.PumpChartViewModel(); |
| | | |
| | | return vm; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |