2023-07-16 16:24:26 +08:00
|
|
|
|
using Aitex.Core.RT.DataCenter;
|
2023-11-22 13:21:41 +08:00
|
|
|
|
using Aitex.Core.RT.SCCore;
|
2023-07-14 17:49:01 +08:00
|
|
|
|
using Aitex.Core.Util;
|
2023-07-16 16:24:26 +08:00
|
|
|
|
using MECF.Framework.Common.Aitex.Core.Common.DeviceData;
|
2023-07-16 21:26:41 +08:00
|
|
|
|
using System;
|
2023-07-14 17:49:01 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
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; }
|
|
|
|
|
|
2023-07-16 16:24:26 +08:00
|
|
|
|
public string ModuleName { get; set; }
|
|
|
|
|
|
|
|
|
|
public List<GasFlowSum> GasFlowSumList { get; set; }
|
|
|
|
|
|
2023-07-16 21:26:41 +08:00
|
|
|
|
private DateTime start;
|
|
|
|
|
private DateTime end;
|
|
|
|
|
|
2023-07-14 17:49:01 +08:00
|
|
|
|
public void Initialize(string moduleName)
|
|
|
|
|
{
|
2023-07-16 16:24:26 +08:00
|
|
|
|
IniGasUnit(moduleName);
|
|
|
|
|
|
|
|
|
|
DATA.Subscribe($"{ModuleName}.PMGasFlowSumList", () => GasFlowSumList);
|
|
|
|
|
var _thread = new PeriodicJob(1000, OnTimer, $"{moduleName}.ModuleGsaFlow", true);
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-16 21:26:41 +08:00
|
|
|
|
private bool OnTimer()
|
|
|
|
|
{
|
2023-08-10 16:18:48 +08:00
|
|
|
|
foreach (GasFlowUnit Unit in GasFlowUnitList)
|
2023-07-16 21:26:41 +08:00
|
|
|
|
{
|
|
|
|
|
Unit.GetGasFlowFeedBack();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化单个气体和界面气体统计对象
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="moduleName"></param>
|
2023-07-16 16:24:26 +08:00
|
|
|
|
private void IniGasUnit(string moduleName)
|
|
|
|
|
{
|
|
|
|
|
ModuleName = moduleName;
|
|
|
|
|
|
|
|
|
|
GasFlowSumList = new();
|
|
|
|
|
|
2023-08-10 16:18:48 +08:00
|
|
|
|
//单种气体初始化
|
2023-07-14 17:49:01 +08:00
|
|
|
|
foreach (var unit in GasFlowUnitList)
|
|
|
|
|
{
|
2023-07-16 16:24:26 +08:00
|
|
|
|
unit.Initialize(moduleName);
|
2023-07-17 15:22:15 +08:00
|
|
|
|
|
|
|
|
|
string gasName = unit.GasName.Split('_')[0];//气体格式定位为H2_Run H2_Vent,所以根据下划线来拆分
|
2023-11-22 15:24:47 +08:00
|
|
|
|
|
|
|
|
|
var gfs = new GasFlowSum();
|
|
|
|
|
gfs.Name = gasName;
|
|
|
|
|
gfs.Display = gasName;
|
|
|
|
|
if (unit.scBasePath != "")
|
2023-11-22 13:21:41 +08:00
|
|
|
|
{
|
2023-11-22 15:24:47 +08:00
|
|
|
|
gfs.Display = SC.GetStringValue(unit.scBasePath);
|
|
|
|
|
}
|
|
|
|
|
if (!GasFlowSumList.Exists(t => t.Name == gasName))
|
|
|
|
|
{
|
|
|
|
|
GasFlowSumList.Add(gfs);
|
2023-11-22 13:21:41 +08:00
|
|
|
|
}
|
2023-07-16 16:24:26 +08:00
|
|
|
|
}
|
2023-07-14 17:49:01 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-22 15:24:47 +08:00
|
|
|
|
}
|