Sic.Framework/MECF.Framework.RT.Equipment.../HardwareUnits/GasFlow/GasFlowUnit.cs

76 lines
2.4 KiB
C#
Raw Normal View History

using Aitex.Core.RT.SCCore;
using System;
2023-07-11 17:46:32 +08:00
using System.Collections.Generic;
using System.Linq;
2023-07-12 17:48:06 +08:00
using System.Reflection;
2023-07-11 17:46:32 +08:00
using System.Text;
using System.Threading.Tasks;
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-12 17:48:06 +08:00
/// 单个气体对象的真值表数据,所有配置行数据集合,气体需要的属性数据
2023-07-11 17:46:32 +08:00
/// </summary>
[XmlType(typeName: "GasFlowUnit")]
2023-07-11 17:46:32 +08:00
public class GasFlowUnit
{
2023-07-12 17:48:06 +08:00
[XmlElement("GasTrueTableRows")]
public List<GasTrueTableRows> GasTrueTableRowList { get; set; }
2023-07-12 17:48:06 +08:00
[XmlAttribute()]
2023-07-12 17:48:06 +08:00
public string GasName { get; set; }
[XmlAttribute()]
2023-07-12 17:48:06 +08:00
public string GasFlowRatioName { get; set; }
/// <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;
public double GetGasFlowFeedBack(string moduleName)
{
double _feedBack = 0;
//循环检测气阀状态
if (GasTrueTableRowList.Count > 0)
{
for (int i = 0; i < GasTrueTableRowList.Count; i++)
{
//PN2是特殊计算
if (GasName == "PN2_Run")
_feedBack += GasTrueTableRowList[i].AccumulationPN2Run(moduleName);
else if (GasName == "PN2_Vent")
{
double cache = GasTrueTableRowList[i].AccumulationPN2Run(moduleName);
if (i == 2)
PN2_VentSpecial = cache;//洪膺只要输出项的第三条数据作为显示
else
_feedBack += cache;//储存前面两行
}
else
_feedBack += GasTrueTableRowList[i].Accumulation(moduleName);
}
if (_feedBack < 0)
_feedBack = 0;
GasFlowFeedBack = _feedBack * GasFlowRatioValue;//计算得到的结果*系数
}
return GasFlowFeedBack;
}
2023-07-11 17:46:32 +08:00
}
}