diff --git a/CapMachine.Wpf/Models/LightChart/ChartManager.cs b/CapMachine.Wpf/Models/LightChart/ChartManager.cs index 6dcf215..7f40c67 100644 --- a/CapMachine.Wpf/Models/LightChart/ChartManager.cs +++ b/CapMachine.Wpf/Models/LightChart/ChartManager.cs @@ -319,6 +319,18 @@ namespace CapMachine.Wpf.Models.LightChart return CurHistoryData.Select(a => new ChartPoint() { Value = a.Subcooling, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); case "过热度[K]": return CurHistoryData.Select(a => new ChartPoint() { Value = a.Superheat, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); + case "制热量Qh[W]": + return CurHistoryData.Select(a => new ChartPoint() { Value = a.HeatingCapacity, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); + case "压缩机性能系数(制热)": + return CurHistoryData.Select(a => new ChartPoint() { Value = a.COPHeat, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); + case "等熵效率ns[%]": + return CurHistoryData.Select(a => new ChartPoint() { Value = a.IsentrpEff, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); + case "制冷量Qc[W]": + return CurHistoryData.Select(a => new ChartPoint() { Value = a.CoolCapacity, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); + case "压缩机性能系数(制冷)": + return CurHistoryData.Select(a => new ChartPoint() { Value = a.COPCool, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); + case "容积效率nv[%]": + return CurHistoryData.Select(a => new ChartPoint() { Value = a.VoltricEff, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); default: return CurHistoryData.Select(a => new ChartPoint() { Value = a.Speed, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); break; diff --git a/CapMachine.Wpf/Services/DataRecordService.cs b/CapMachine.Wpf/Services/DataRecordService.cs index 7fd2683..8ac136e 100644 --- a/CapMachine.Wpf/Services/DataRecordService.cs +++ b/CapMachine.Wpf/Services/DataRecordService.cs @@ -165,6 +165,13 @@ namespace CapMachine.Wpf.Services new Columns(){ Name="过冷度[K]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="过热度[K]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="制热量Qh[W]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="压缩机性能系数(制热)",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="等熵效率ns[%]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="制冷量Qc[W]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="压缩机性能系数(制冷)",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="容积效率nv[%]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="创建时间",MapType="System.DateTime",IsIdentity=false,IsPrimary=false}, } } @@ -461,9 +468,10 @@ namespace CapMachine.Wpf.Services { //如果Execute执行的是一个很耗时的方法,会导致方法未执行完毕,定时器又启动了一个线程来执行Execute方法 //CycleTimer.Stop(); //先关闭定时器 - + var DataInfo = MachineRtDataService.TagManger.DicTags - .ToDictionary(kvp => kvp.Key, kvp => (object)MachineRtDataService.TagManger.TryGetRecordPVValue(kvp.Value.Name)); + //.ToDictionary(kvp => kvp.Key, kvp => (object)MachineRtDataService.TagManger.TryGetRecordPVValue(kvp.Value.Name)); + .ToDictionary(kvp => kvp.Key, kvp => (object)MachineRtDataService.TagManger.TryGetRecordPVValue(kvp.Key)); DataInfo.Add("创建时间", DateTime.Now); var RecordData = new RecordChannelData() diff --git a/CapMachine.Wpf/Services/PPCService.cs b/CapMachine.Wpf/Services/PPCService.cs index 87fcf4f..570a20e 100644 --- a/CapMachine.Wpf/Services/PPCService.cs +++ b/CapMachine.Wpf/Services/PPCService.cs @@ -492,7 +492,7 @@ namespace CapMachine.Wpf.Services { if (!string.IsNullOrWhiteSpace(thermoErr)) { - Logger?.Error($"六个物性结果计算警告: {thermoErr}"); + Logger?.Warn($"六个物性结果计算警告: {thermoErr}"); } } else @@ -1210,6 +1210,50 @@ namespace CapMachine.Wpf.Services return false; } + if (HVPwTag == null) + { + error = "缺少 HV[W] 功率标签"; + return false; + } + + var w_W = HVPwTag.PVModel.EngValue; + if (!double.IsNaN(w_W) && !double.IsInfinity(w_W) && w_W == 0) + { + HeatingCapacityQh_kW = 0; + CoolingCapacityQc_kW = 0; + COPHeating = 0; + COPCooling = 0; + IsentropicEfficiencyPct = 0; + VolumetricEfficiencyPct = 0; + + if (HeatingCapacityTag != null) + { + HeatingCapacityTag.PVModel.EngValue = 0; + } + if (COPHeatTag != null) + { + COPHeatTag.PVModel.EngValue = 0; + } + if (IsentrpEffTag != null) + { + IsentrpEffTag.PVModel.EngValue = 0; + } + if (CoolCapacityTag != null) + { + CoolCapacityTag.PVModel.EngValue = 0; + } + if (COPCoolTag != null) + { + COPCoolTag.PVModel.EngValue = 0; + } + if (VoltricEffTag != null) + { + VoltricEffTag.PVModel.EngValue = 0; + } + + return true; + } + if (!TryGetCompressorPower_kW(out var w_kW, out var wErr)) { error = wErr;