diff --git a/CapMachine.Wpf/App.config b/CapMachine.Wpf/App.config index ce3c408..f56f017 100644 --- a/CapMachine.Wpf/App.config +++ b/CapMachine.Wpf/App.config @@ -2,12 +2,12 @@ - + - + diff --git a/CapMachine.Wpf/Models/CsvRecordModel.cs b/CapMachine.Wpf/Models/CsvRecordModel.cs index 1376884..47b628a 100644 --- a/CapMachine.Wpf/Models/CsvRecordModel.cs +++ b/CapMachine.Wpf/Models/CsvRecordModel.cs @@ -146,15 +146,15 @@ namespace CapMachine.Wpf.Models public double EVAPExpTemp { get; set; } /// - /// 冷媒流量[L/min] + /// 冷媒流量[kg/h] /// - [Name("冷媒流量[L/min]")] + [Name("冷媒流量[kg/h]")] public double VRV { get; set; } /// - /// 润滑油流量[L/min] + /// 润滑油流量[kg/h] /// - [Name("润滑油流量[L/min]")] + [Name("润滑油流量[kg/h]")] public double LubeFlow { get; set; } /// @@ -211,17 +211,17 @@ namespace CapMachine.Wpf.Models [Name("PTC出水温度[℃]")] public double PTCExpTemp { get; set; } - /// - /// AT04_01[℃] - /// - [Name("AT04_01[℃]")] - public double AT04_01Temp { get; set; } + ///// + ///// AT04_01[℃] + ///// + //[Name("AT04_01[℃]")] + //public double AT04_01Temp { get; set; } - /// - /// AT04_02[℃] - /// - [Name("AT04_02[℃]")] - public double AT04_02Temp { get; set; } + ///// + ///// AT04_02[℃] + ///// + //[Name("AT04_02[℃]")] + //public double AT04_02Temp { get; set; } /// /// 通讯Cmp母线电流[A] diff --git a/CapMachine.Wpf/Models/CsvRecordModelMap.cs b/CapMachine.Wpf/Models/CsvRecordModelMap.cs index 0c45509..c0b4e68 100644 --- a/CapMachine.Wpf/Models/CsvRecordModelMap.cs +++ b/CapMachine.Wpf/Models/CsvRecordModelMap.cs @@ -37,8 +37,8 @@ namespace CapMachine.Wpf.Models Map(m => m.OS2Temp).Name("OS2温度[℃]"); Map(m => m.Cond2Temp).Name("COND2温度[℃]"); Map(m => m.EVAPExpTemp).Name("EVAP出口温度[℃]"); - Map(m => m.VRV).Name("冷媒流量[L/min]"); - Map(m => m.LubeFlow).Name("润滑油流量[L/min]"); + Map(m => m.VRV).Name("冷媒流量[kg/h]"); + Map(m => m.LubeFlow).Name("润滑油流量[kg/h]"); Map(m => m.ExTemp).Name("排气温度[℃]"); Map(m => m.TxvFrPress).Name("膨胀阀前压力[BarA]"); Map(m => m.TxvFrTemp).Name("膨胀阀前温度[℃]"); @@ -48,8 +48,8 @@ namespace CapMachine.Wpf.Models Map(m => m.PTCFlow).Name("PTC流量[L/min]"); Map(m => m.PTCEntTemp).Name("PTC入水温度[℃]"); Map(m => m.PTCExpTemp).Name("PTC出水温度[℃]"); - Map(m => m.AT04_01Temp).Name("AT04_01[℃]"); - Map(m => m.AT04_02Temp).Name("AT04_02[℃]"); + //Map(m => m.AT04_01Temp).Name("AT04_01[℃]"); + //Map(m => m.AT04_02Temp).Name("AT04_02[℃]"); Map(m => m.ComCapBusCur).Name("通讯Cmp母线电流[A]"); Map(m => m.ComCapBusVol).Name("通讯Cmp母线电压[V]"); Map(m => m.ComCapInvTemp).Name("通讯Cmp逆变器温度[℃]"); diff --git a/CapMachine.Wpf/Models/LightChart/ChartManager.cs b/CapMachine.Wpf/Models/LightChart/ChartManager.cs index 5935e8d..e5240a9 100644 --- a/CapMachine.Wpf/Models/LightChart/ChartManager.cs +++ b/CapMachine.Wpf/Models/LightChart/ChartManager.cs @@ -239,9 +239,9 @@ namespace CapMachine.Wpf.Models.LightChart return CurHistoryData.Select(a => new ChartPoint() { Value = a.Cond2Temp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); case "EVAP出口温度[℃]": return CurHistoryData.Select(a => new ChartPoint() { Value = a.EVAPExpTemp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); - case "冷媒流量[L/min]": + case "冷媒流量[kg/h]": return CurHistoryData.Select(a => new ChartPoint() { Value = a.VRV, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); - case "润滑油流量[L/min]": + case "润滑油流量[kg/h]": return CurHistoryData.Select(a => new ChartPoint() { Value = a.LubeFlow, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); case "排气温度[℃]": return CurHistoryData.Select(a => new ChartPoint() { Value = a.ExTemp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); @@ -261,10 +261,10 @@ namespace CapMachine.Wpf.Models.LightChart return CurHistoryData.Select(a => new ChartPoint() { Value = a.PTCEntTemp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); case "PTC出水温度[℃]": return CurHistoryData.Select(a => new ChartPoint() { Value = a.PTCExpTemp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); - case "AT04_01[℃]": - return CurHistoryData.Select(a => new ChartPoint() { Value = a.AT04_01Temp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); - case "AT04_02[℃]": - return CurHistoryData.Select(a => new ChartPoint() { Value = a.AT04_02Temp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); + //case "AT04_01[℃]": + // return CurHistoryData.Select(a => new ChartPoint() { Value = a.AT04_01Temp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); + //case "AT04_02[℃]": + // return CurHistoryData.Select(a => new ChartPoint() { Value = a.AT04_02Temp, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); case "通讯Cmp母线电流[A]": return CurHistoryData.Select(a => new ChartPoint() { Value = a.ComCapBusCur, Time = a.CreateTime }).OrderBy(a => a.Time).ToList(); case "通讯Cmp母线电压[V]": diff --git a/CapMachine.Wpf/Services/DataRecordService.cs b/CapMachine.Wpf/Services/DataRecordService.cs index 81b814f..de96d7e 100644 --- a/CapMachine.Wpf/Services/DataRecordService.cs +++ b/CapMachine.Wpf/Services/DataRecordService.cs @@ -123,8 +123,8 @@ namespace CapMachine.Wpf.Services new Columns(){ Name="OS2温度[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="COND2温度[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="EVAP出口温度[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, - new Columns(){ Name="冷媒流量[L/min]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, - new Columns(){ Name="润滑油流量[L/min]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="冷媒流量[kg/h]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + new Columns(){ Name="润滑油流量[kg/h]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="排气温度[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="膨胀阀前压力[BarA]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="膨胀阀前温度[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, @@ -134,8 +134,8 @@ namespace CapMachine.Wpf.Services new Columns(){ Name="PTC流量[L/min]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="PTC入水温度[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="PTC出水温度[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, - new Columns(){ Name="AT04_01[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, - new Columns(){ Name="AT04_02[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + //new Columns(){ Name="AT04_01[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, + //new Columns(){ Name="AT04_02[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="通讯Cmp母线电流[A]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="通讯Cmp母线电压[V]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, new Columns(){ Name="通讯Cmp逆变器温度[℃]",MapType=typeof(float).ToString(),IsIdentity=false,IsPrimary=false}, diff --git a/CapMachine.Wpf/Services/MachineRtDataService.cs b/CapMachine.Wpf/Services/MachineRtDataService.cs index aaf3dcd..dfd1898 100644 --- a/CapMachine.Wpf/Services/MachineRtDataService.cs +++ b/CapMachine.Wpf/Services/MachineRtDataService.cs @@ -164,8 +164,8 @@ namespace CapMachine.Wpf.Services TagManger.AddTag(new Tag("COND2温度", "COND2温度[℃]", "Cond2Temp", "程序", "VW15034", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag("EVAP出口温度", "EVAP出口温度[℃]", "EVAPExpTemp", "程序", "VW15036", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 }); //TagManger.AddTag(new Tag("冷媒流量", "冷媒流量[L/min]", "VRV", "程序", "VW15038", 100, 0, 1, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("冷媒流量", "冷媒流量[L/min]", "VRV", "程序", "VW15038", 100, 0, 10, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("润滑油流量", "润滑油流量[L/min]", "LubeFlow", "程序", "VW15040", 100, 0, 10, "L/min", new ShortTagValue(), false) { DecimalPoint = 1 }); + TagManger.AddTag(new Tag("冷媒流量", "冷媒流量[kg/h]", "VRV", "程序", "VW15038", 100, 0, 10, "kg/h", new ShortTagValue(), false) { DecimalPoint = 1 }); + TagManger.AddTag(new Tag("润滑油流量", "润滑油流量[kg/h]", "LubeFlow", "程序", "VW15040", 100, 0, 10, "kg/h", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag("排气温度", "排气温度[℃]", "ExTemp", "程序", "VW15042", 100, 0, 10, "℃", new ShortTagValue(), true) { DecimalPoint = 1 }); TagManger.AddTag(new Tag("膨胀阀前压力", "膨胀阀前压力[BarA]", "TxvFrPress", "程序", "VW15044", 100, 0, 100, "BarA", new ShortTagValue(), false) { DecimalPoint = 2 }); TagManger.AddTag(new Tag("膨胀阀前温度", "膨胀阀前温度[℃]", "TxvFrTemp", "程序", "VW15046", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 }); @@ -176,8 +176,8 @@ namespace CapMachine.Wpf.Services TagManger.AddTag(new Tag("PTC入水温度", "PTC入水温度[℃]", "PTCEntTemp", "程序", "VW15056", 100, 0, 100, "℃", new ShortTagValue(), false) { DecimalPoint = 2 }); TagManger.AddTag(new Tag("PTC出水温度", "PTC出水温度[℃]", "PTCExpTemp", "程序", "VW15058", 100, 0, 100, "℃", new ShortTagValue(), false) { DecimalPoint = 2 }); - TagManger.AddTag(new Tag("AT04_01", "AT04_01[℃]", "AT04_01Temp", "程序", "VW70", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("AT04_02", "AT04_02[℃]", "AT04_02Temp", "程序", "VW72", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 }); + //TagManger.AddTag(new Tag("AT04_01", "AT04_01[℃]", "AT04_01Temp", "程序", "VW70", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 }); + //TagManger.AddTag(new Tag("AT04_02", "AT04_02[℃]", "AT04_02Temp", "程序", "VW72", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 }); TagManger.AddTag(new Tag("通讯Cmp母线电流", "通讯Cmp母线电流[A]", "ComCapBusCur", "程序", "VW14102", 100, 0, 100, "A", new ShortTagValue(), false) { DecimalPoint = 2 }); TagManger.AddTag(new Tag("通讯Cmp母线电压", "通讯Cmp母线电压[V]", "ComCapBusVol", "程序", "VW14104", 100, 0, 1, "V", new ShortTagValue(), false) { DecimalPoint = 0 }); @@ -193,17 +193,15 @@ namespace CapMachine.Wpf.Services TagManger.AddTag(new Tag("通讯PTC膜温", "通讯PTC膜温[℃]", "ComPTCFlmTemp", "程序", "VW14128", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0 }); TagManger.AddTag(new Tag("通讯PTC模块温度", "通讯PTC模块温度[℃]", "ComPTCMdTemp", "程序", "VW14130", 100, 0, 1, "℃", new ShortTagValue(), false) { DecimalPoint = 0 }); + TagManger.AddTag(new Tag("过热度", "过热度[K]", "Superheat", "程序", string.Empty, 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); + TagManger.AddTag(new Tag("过冷度", "过冷度[K]", "Subcooling", "程序", string.Empty, 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("过热度", "过热度[K]", "Superheat", "程序", "VW14132", 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("过冷度", "过冷度[K]", "Subcooling", "程序", "VW14134", 100, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - - TagManger.AddTag(new Tag("制热量Qh", "制热量Qh[KW]", "HeatingCapacity", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("压缩机性能系数(制热)", "压缩机性能系数(制热)[K]", "COPHeat", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("等熵效率ns", "等熵效率ns[%]", "IsentrpEff", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("制冷量Qc", "制冷量Qc[KW]", "CoolCapacity", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("压缩机性能系数(制冷)", "压缩机性能系数(制冷)[K]", "COPCool", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - TagManger.AddTag(new Tag("容积效率nv", "容积效率nv[%]", "VoltricEff", "程序", "VW14134", 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); - + TagManger.AddTag(new Tag("制热量Qh", "制热量Qh[W]", "HeatingCapacity", "程序", string.Empty, 1000, 0, 1, "W", new ShortTagValue(), false) { DecimalPoint = 1 }); + TagManger.AddTag(new Tag("压缩机性能系数(制热COP)", "压缩机性能系数(制热COP)", "COPHeat", "程序", string.Empty, 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); + TagManger.AddTag(new Tag("等熵效率ns", "等熵效率ns[%]", "IsentrpEff", "程序", string.Empty, 1000, 0, 1, "%", new ShortTagValue(), false) { DecimalPoint = 1 }); + TagManger.AddTag(new Tag("制冷量Qc", "制冷量Qc[W]", "CoolCapacity", "程序", string.Empty, 1000, 0, 1, "W", new ShortTagValue(), false) { DecimalPoint = 1 }); + TagManger.AddTag(new Tag("压缩机性能系数(制冷COP)", "压缩机性能系数(制冷COP)", "COPCool", "程序", string.Empty, 1000, 0, 1, "K", new ShortTagValue(), false) { DecimalPoint = 1 }); + TagManger.AddTag(new Tag("容积效率nv", "容积效率nv[%]", "VoltricEff", "程序", string.Empty, 1000, 0, 1, "%", new ShortTagValue(), false) { DecimalPoint = 1 }); #endregion diff --git a/CapMachine.Wpf/Services/PPCService.cs b/CapMachine.Wpf/Services/PPCService.cs index d71834f..8babcfb 100644 --- a/CapMachine.Wpf/Services/PPCService.cs +++ b/CapMachine.Wpf/Services/PPCService.cs @@ -88,7 +88,7 @@ namespace CapMachine.Wpf.Services VRVTag = TagManager.DicTags.GetValueOrDefault("冷媒流量[kg/h]"); if (VRVTag == null) { - VRVTag = TagManager.DicTags.GetValueOrDefault("冷媒流量[L/min]"); + VRVTag = TagManager.DicTags.GetValueOrDefault("冷媒流量[kg/h]"); } LiqRefFlowTag = TagManager.DicTags.GetValueOrDefault("液冷媒流量[kg/h]"); @@ -100,18 +100,22 @@ namespace CapMachine.Wpf.Services LubeFlowTag = TagManager.DicTags.GetValueOrDefault("润滑油流量[kg/h]"); if (LubeFlowTag == null) { - LubeFlowTag = TagManager.DicTags.GetValueOrDefault("润滑油流量[L/min]"); + LubeFlowTag = TagManager.DicTags.GetValueOrDefault("润滑油流量[kg/h]"); } Superheat = TagManager.DicTags.GetValueOrDefault("过热度[K]"); Subcool = TagManager.DicTags.GetValueOrDefault("过冷度[K]"); - HeatingCapacity = TagManager.DicTags.GetValueOrDefault("制热量Qh[KW]"); - COPHeat = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制热)[K]"); + HeatingCapacity = TagManager.DicTags.GetValueOrDefault("制热量Qh[KW]") + ?? TagManager.DicTags.GetValueOrDefault("制热量Qh[W]"); + COPHeat = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制热)[K]") + ?? TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制热COP)"); IsentrpEff = TagManager.DicTags.GetValueOrDefault("等熵效率ns[%]"); - CoolCapacity = TagManager.DicTags.GetValueOrDefault("制冷量Qc[KW]"); - COPCool = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制冷)[K]"); + CoolCapacity = TagManager.DicTags.GetValueOrDefault("制冷量Qc[KW]") + ?? TagManager.DicTags.GetValueOrDefault("制冷量Qc[W]"); + COPCool = TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制冷)[K]") + ?? TagManager.DicTags.GetValueOrDefault("压缩机性能系数(制冷COP)"); VoltricEff = TagManager.DicTags.GetValueOrDefault("容积效率nv[%]"); SuperHeatCoolConfig.FluidsPath = ConfigHelper.GetValue("FluidsPath"); @@ -333,7 +337,7 @@ namespace CapMachine.Wpf.Services { while (RtCalcEnable) { - await Task.Delay(1000); + await Task.Delay(100); try { if (!TryUpdateSuperheatAndSubcool(out var superheatSubcoolErr)) @@ -344,33 +348,34 @@ namespace CapMachine.Wpf.Services } } - if (TryUpdateDryness(out var drynessErr)) - { - if (!string.IsNullOrWhiteSpace(drynessErr)) - { - Logger?.Error($"干度计算警告: {drynessErr}"); - } - } - else - { - if (!string.IsNullOrWhiteSpace(drynessErr)) - { - Logger?.Error($"干度计算失败: {drynessErr}"); - } - } + //if (TryUpdateDryness(out var drynessErr)) + //{ + // if (!string.IsNullOrWhiteSpace(drynessErr)) + // { + // Logger?.Error($"干度计算警告: {drynessErr}"); + // } + //} + //else + //{ + // if (!string.IsNullOrWhiteSpace(drynessErr)) + // { + // Logger?.Error($"干度计算失败: {drynessErr}"); + // } + //} + if (TryUpdateThermodynamicSixResults(out var thermoErr)) { if (!string.IsNullOrWhiteSpace(thermoErr)) { - Logger?.Error($"六个物性结果计算警告: {thermoErr}"); + //Logger?.Error($"六个物性结果计算警告: {thermoErr}"); } } else { if (!string.IsNullOrWhiteSpace(thermoErr)) { - Logger?.Error($"六个物性结果计算失败: {thermoErr}"); + //Logger?.Error($"六个物性结果计算失败: {thermoErr}"); } } @@ -540,18 +545,40 @@ namespace CapMachine.Wpf.Services IsentropicEfficiencyPct = result.IsentropicEfficiencyPct; // 再把结果回写到对应工程量标签。 - HeatingCapacity.EngPvValue = HeatingCapacityQh_kW; - COPHeat.EngPvValue = COPHeating; - IsentrpEff.EngPvValue = IsentropicEfficiencyPct; - CoolCapacity.EngPvValue = CoolingCapacityQc_kW; - COPCool.EngPvValue = COPCooling; + if (HeatingCapacity != null) + { + HeatingCapacity.EngPvValue = string.Equals(HeatingCapacity.Unit, "W", StringComparison.OrdinalIgnoreCase) + ? HeatingCapacityQh_kW * 1000.0 + : HeatingCapacityQh_kW; + } + if (COPHeat != null) + { + COPHeat.EngPvValue = COPHeating; + } + if (IsentrpEff != null) + { + IsentrpEff.EngPvValue = IsentropicEfficiencyPct; + } + if (CoolCapacity != null) + { + CoolCapacity.EngPvValue = string.Equals(CoolCapacity.Unit, "W", StringComparison.OrdinalIgnoreCase) + ? CoolingCapacityQc_kW * 1000.0 + : CoolingCapacityQc_kW; + } + if (COPCool != null) + { + COPCool.EngPvValue = COPCooling; + } // 容积效率在旧逻辑中允许单独失败; // 因此只有拿到有效数值时才回写,避免覆盖已有结果为 NaN/Inf。 if (!double.IsNaN(result.VolumetricEfficiencyPct) && !double.IsInfinity(result.VolumetricEfficiencyPct)) { VolumetricEfficiencyPct = result.VolumetricEfficiencyPct; - VoltricEff.EngPvValue = VolumetricEfficiencyPct; + if (VoltricEff != null) + { + VoltricEff.EngPvValue = VolumetricEfficiencyPct; + } } return true;