79 lines
2.3 KiB
C#
79 lines
2.3 KiB
C#
using Aitex.Core.RT.DataCenter;
|
||
using Aitex.Core.RT.OperationCenter;
|
||
using Aitex.Core.Util;
|
||
using MECF.Framework.Common.Aitex.Core.Common.DeviceData;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Threading.Tasks;
|
||
using System.Xml.Serialization;
|
||
|
||
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.GasFlow
|
||
{
|
||
[XmlType(typeName: "PMGsaFlow")]
|
||
public class PMAllGsa
|
||
{
|
||
/// <summary>
|
||
/// PM腔体中气体
|
||
/// </summary>
|
||
[XmlElement("GasFlowUnit")]
|
||
public List<GasFlowUnit> GasFlowUnitList { get; set; }
|
||
|
||
public string ModuleName { get; set; }
|
||
|
||
public List<string> GasNameList { get; set; }
|
||
|
||
public List<GasFlowSum> GasFlowSumList { get; set; }
|
||
|
||
private DateTime start;
|
||
private DateTime end;
|
||
|
||
public void Initialize(string moduleName)
|
||
{
|
||
IniGasUnit(moduleName);
|
||
|
||
DATA.Subscribe($"{ModuleName}.PMGasNameList", () => GasNameList);
|
||
DATA.Subscribe($"{ModuleName}.PMGasFlowSumList", () => GasFlowSumList);
|
||
var _thread = new PeriodicJob(1000, OnTimer, $"{moduleName}.ModuleGsaFlow", true);
|
||
}
|
||
|
||
private bool OnTimer()
|
||
{
|
||
foreach (GasFlowUnit Unit in GasFlowUnitList)
|
||
{
|
||
Unit.GetGasFlowFeedBack();
|
||
}
|
||
return true;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 初始化单个气体和界面气体统计对象
|
||
/// </summary>
|
||
/// <param name="moduleName"></param>
|
||
private void IniGasUnit(string moduleName)
|
||
{
|
||
ModuleName = moduleName;
|
||
|
||
GasFlowSumList = new();
|
||
|
||
GasNameList = new() { "All" };//添加总的查询选项
|
||
|
||
//单种气体初始化
|
||
foreach (var unit in GasFlowUnitList)
|
||
{
|
||
unit.Initialize(moduleName);
|
||
|
||
string gasName = unit.GasName.Split('_')[0];//气体格式定位为H2_Run H2_Vent,所以根据下划线来拆分
|
||
|
||
if (!GasNameList.Contains(gasName))
|
||
GasNameList.Add(gasName);
|
||
}
|
||
|
||
for (int i = 1; i < GasNameList.Count; i++)//第一个是All选项,不参与对象生成
|
||
{
|
||
GasFlowSumList.Add(new GasFlowSum() { Name = GasNameList[i] });
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|