物性参数更改1
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user