using Aitex.Core.RT.Device.Devices; using Aitex.Core.RT.Device; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.MfcCalculation { /// /// 存储真值表中一行的数据对象,并提供计算气体流量的方法 /// public class MfcInputOutRow { public List InputList { get; set; } = new List(); public List OutputList { get; set; } = new List(); public double Accumulation(string module,double otherValue=0) { double volue = 0; //有一个集合为空,不用循环 if (InputList.Count == 0 || OutputList.Count == 0 ) return 0; //一行内单元格的输入输出配置 foreach (var rowInputs in InputList) { try { //Input配置的单元格 var value = rowInputs.Value; var ioValve = DEVICE.GetDevice($"{module}.{rowInputs.Name}"); //开、关时后的状态,和表配置对比,只要不满足就可以退出函数 if (ioValve.Status == true && value == 1) continue; if (ioValve.Status == false && value == 0) continue; } catch (Exception ex) { } return 0; } foreach (var rowOutputs in OutputList) { try { if (rowOutputs.ControlName.Contains("Mfc")) { //Output配置的单元格 var _mfc = DEVICE.GetDevice($"{module}.{rowOutputs.ControlName}"); volue += _mfc.FeedBack * rowOutputs.Value + otherValue; } else { //混合气体流量 switch (rowOutputs.ControlName) { case "HCL": volue += AddOther(MfcManager.HCL_Run, rowOutputs.Value); break; case "TMA": volue += AddOther(MfcManager.TMA_Run, rowOutputs.Value); break; case "TCS": volue += AddOther(MfcManager.TCS_Run, rowOutputs.Value); break; case "PN2": volue += AddOther(MfcManager.PN2_Run, rowOutputs.Value); break; default: break; } } } catch (Exception ex) { } } return volue; } private double AddOther(double other,double coefficient) { return other * coefficient; } } }