2023-07-14 17:49:01 +08:00
|
|
|
|
using Aitex.Core.RT.DataCenter;
|
|
|
|
|
using Aitex.Core.RT.SCCore;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Xml.Linq;
|
2023-07-12 17:48:06 +08:00
|
|
|
|
using System.Xml.Serialization;
|
2023-07-11 17:46:32 +08:00
|
|
|
|
|
|
|
|
|
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.GasFlow
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2023-07-14 09:31:26 +08:00
|
|
|
|
/// 单个气体的真值表数据,所有配置行数据集合,气体需要的属性数据
|
2023-07-11 17:46:32 +08:00
|
|
|
|
/// </summary>
|
2023-07-13 14:03:54 +08:00
|
|
|
|
[XmlType(typeName: "GasFlowUnit")]
|
2023-07-11 17:46:32 +08:00
|
|
|
|
public class GasFlowUnit
|
|
|
|
|
{
|
2023-07-14 09:31:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 单个真值表内所有的行数据
|
|
|
|
|
/// </summary>
|
2023-07-13 14:03:54 +08:00
|
|
|
|
[XmlElement("GasTrueTableRows")]
|
|
|
|
|
public List<GasTrueTableRows> GasTrueTableRowList { get; set; }
|
2023-07-12 17:48:06 +08:00
|
|
|
|
|
2023-07-14 17:49:01 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 气体名称
|
|
|
|
|
/// </summary>
|
2023-07-13 14:03:54 +08:00
|
|
|
|
[XmlAttribute()]
|
2023-07-12 17:48:06 +08:00
|
|
|
|
public string GasName { get; set; }
|
|
|
|
|
|
2023-07-14 17:49:01 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 气体流量系数名称
|
|
|
|
|
/// </summary>
|
2023-07-13 14:03:54 +08:00
|
|
|
|
[XmlAttribute()]
|
2023-07-12 17:48:06 +08:00
|
|
|
|
public string GasFlowRatioName { get; set; }
|
|
|
|
|
|
2023-07-14 17:49:01 +08:00
|
|
|
|
public string ModuleName { get; set; }
|
|
|
|
|
|
2023-07-12 17:48:06 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 系统中配置的气体流量系数
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double GasFlowRatioValue { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 气体流量计算值
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double GasFlowFeedBack { get; set; } = 0;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// PN2的特殊计算
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double PN2_VentSpecial { get; set; } = 0;
|
|
|
|
|
|
2023-07-14 17:49:01 +08:00
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
SC.RegisterValueChangedCallback($"PM.{ModuleName}.Efficiency.{GasFlowRatioName}", (o) => { Set_Callback(o.ToString()); });
|
|
|
|
|
GasFlowRatioValue = SC.GetValue<double>($"PM.{ModuleName}.Efficiency.{GasFlowRatioName}");
|
|
|
|
|
|
2023-07-15 10:37:45 +08:00
|
|
|
|
DATA.Subscribe($"{ModuleName}.GasRealTimeFlow.{GasName}.FeedBack", () => GasFlowFeedBack);
|
2023-07-14 17:49:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Set_Callback(string str = "")
|
|
|
|
|
{
|
|
|
|
|
GasFlowRatioValue = SC.GetValue<double>($"PM.{ModuleName}.Efficiency.{GasFlowRatioName}");
|
|
|
|
|
}
|
2023-07-12 17:48:06 +08:00
|
|
|
|
|
2023-07-14 17:49:01 +08:00
|
|
|
|
public double GetGasFlowFeedBack()
|
2023-07-12 17:48:06 +08:00
|
|
|
|
{
|
|
|
|
|
double _feedBack = 0;
|
|
|
|
|
//循环检测气阀状态
|
|
|
|
|
if (GasTrueTableRowList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < GasTrueTableRowList.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
//PN2是特殊计算
|
|
|
|
|
if (GasName == "PN2_Run")
|
2023-07-14 17:49:01 +08:00
|
|
|
|
_feedBack += GasTrueTableRowList[i].AccumulationPN2Run(ModuleName);
|
2023-07-12 17:48:06 +08:00
|
|
|
|
else if (GasName == "PN2_Vent")
|
|
|
|
|
{
|
2023-07-14 17:49:01 +08:00
|
|
|
|
double cache = GasTrueTableRowList[i].AccumulationPN2Run(ModuleName);
|
2023-07-12 17:48:06 +08:00
|
|
|
|
if (i == 2)
|
|
|
|
|
PN2_VentSpecial = cache;//洪膺只要输出项的第三条数据作为显示
|
|
|
|
|
else
|
|
|
|
|
_feedBack += cache;//储存前面两行
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
2023-07-14 17:49:01 +08:00
|
|
|
|
_feedBack += GasTrueTableRowList[i].Accumulation(ModuleName);
|
2023-07-12 17:48:06 +08:00
|
|
|
|
}
|
|
|
|
|
if (_feedBack < 0)
|
|
|
|
|
_feedBack = 0;
|
|
|
|
|
GasFlowFeedBack = _feedBack * GasFlowRatioValue;//计算得到的结果*系数
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return GasFlowFeedBack;
|
|
|
|
|
}
|
2023-07-11 17:46:32 +08:00
|
|
|
|
}
|
|
|
|
|
}
|