首次上传

This commit is contained in:
hanqiangqiang
2026-06-15 10:56:30 +08:00
commit b0213b94d6
4160 changed files with 736101 additions and 0 deletions
@@ -0,0 +1,6 @@
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs
{
public interface IPM
{
}
}
@@ -0,0 +1,247 @@
using System;
using System.Collections.Generic;
using Aitex.Core.RT.DataCenter;
using Aitex.Core.RT.Device;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.SCCore;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.Common.DBCore;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.Schedulers;
using MECF.Framework.Common.SubstrateTrackings;
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs
{
public class PM : BaseDevice, IDevice, IPM
{
//如果true,robot采用extend, retract指令
//如果false,robot采用pick,place指令
public bool IsActiveHandoff { get; set; }
//如果true,robot调用收尾PostTransfer
public bool IsNeedPostTransfer { get; set; }
public virtual double ChamberPressure { get; }
public virtual bool IsError { get; }
public virtual bool IsIdle { get; }
public virtual bool IsProcessing { get; }
public virtual bool IsInstalled { get; set; }
public virtual double ForelinePressure { get; set; }
protected readonly string _statNameWaferProcessed;
protected readonly string _statNameWaferProcessedSincePreviousClean;
public PM(string module) : base(module, module, module, module)
{
_statNameWaferProcessed = $"{module}.WaferProcessed";
_statNameWaferProcessedSincePreviousClean = $"{module}.WaferProcessedSincePreviousClean";
}
public virtual bool Initialize()
{
DATA.Subscribe($"{Name}.IsAtm", () => { return CheckAtm(); });
DATA.Subscribe($"{Name}.IsVacuum", () => { return CheckVacuum(); });
DATA.Subscribe($"{Name}.ChamberPressure", () => ChamberPressure);
IsInstalled = !SC.ContainsItem($"System.{Name}IsInstalled") || SC.GetValue<bool>($"System.{Name}IsInstalled");
StatsDataManager.Instance.Subscribe(_statNameWaferProcessed, $"{Name} Wafer processed", 0);
StatsDataManager.Instance.Subscribe(_statNameWaferProcessedSincePreviousClean, $"{Name} Wafer processed since previous clean", 0);
return true;
}
public virtual bool CheckAtm()
{
return false;
}
public virtual bool CheckVacuum()
{
return false;
}
public virtual bool CheckChuckState()
{
return false;
}
public virtual bool CheckServoTransferPos()
{
return false;
}
public virtual bool CheckChuckPos()
{
return false;
}
public virtual bool CheckHandoff(EnumTransferType type)
{
return false;
}
public virtual bool CheckEnableTransfer(EnumTransferType type, out string reason)
{
reason = string.Empty;
return false;
}
public virtual bool CheckEnableTransfer(EnumTransferType type, int slot, out string reason)
{
reason = string.Empty;
return false;
}
public virtual bool CheckEnablePump(out string reason)
{
reason = "Undefined";
return false;
}
public virtual void Monitor()
{
}
public virtual void Terminate()
{
}
public virtual void Reset()
{
}
public virtual bool PrepareTransfer(EnumTransferType type, out string reason)
{
reason = string.Empty;
return true;
}
public virtual bool Home()
{
return true;
}
public virtual void PostTransfer(EnumTransferType type)
{
}
public virtual void TransferHandoff(EnumTransferType type)
{
}
public virtual void StartProcess(string recipeName, string recipeContent, bool isClean)
{
}
public virtual bool SetPumpOn(out string reason)
{
throw new NotImplementedException();
}
public virtual void OnProcessStart(string guid, string recipeName, bool isClean)
{
ProcessDataRecorder.Start(guid, recipeName,
WaferManager.Instance.GetWafer(ModuleHelper.Converter(Module), 0).WaferInnerID.ToString(), Module);
if (!isClean)
{
int value1 = StatsDataManager.Instance.Increase(_statNameWaferProcessed);
int value2 = StatsDataManager.Instance.Increase(_statNameWaferProcessedSincePreviousClean);
LOG.Write($"{_statNameWaferProcessed} counter increase 1 to {value1}");
LOG.Write($"{_statNameWaferProcessedSincePreviousClean} counter increase 1 to {value2}");
}
LOG.Write($"{Module} start run recipe {recipeName}, guid {guid}, clean: {isClean}");
}
public virtual bool CheckPumpIsOn()
{
throw new NotImplementedException();
}
public virtual bool SetPumpOff(out string reason)
{
throw new NotImplementedException();
}
public virtual void OnProcessEnd(string guid, string recipeName, bool isClean, bool isSucceed)
{
if (isClean)
{
int value = StatsDataManager.Instance.Reset(_statNameWaferProcessedSincePreviousClean);
LOG.Write($"{_statNameWaferProcessedSincePreviousClean} counter reset from {value}");
}
LOG.Write($"{Module} end run recipe {recipeName}, guid {guid}, clean: {isClean}, result {isSucceed}");
ProcessDataRecorder.End(guid, isSucceed ? "Complete" : "Failed");
}
public virtual void OnProcessAbort(string guid, string recipeName, bool isClean, bool isSucceed)
{
if (isClean)
{
int value = StatsDataManager.Instance.Reset(_statNameWaferProcessedSincePreviousClean);
LOG.Write($"{_statNameWaferProcessedSincePreviousClean} counter reset from {value}");
}
LOG.Write($"{Module} end run recipe {recipeName}, guid {guid}, clean: {isClean}, result {isSucceed}");
ProcessDataRecorder.End(guid, "Abort" );
}
public virtual bool SetThrottleValvePosition(int slowPumpPosition, out string reason)
{
throw new NotImplementedException();
}
public virtual bool SetThrottleValvePressure(float pressure, out string reason)
{
throw new NotImplementedException();
}
public virtual bool CloseThrottleValve(out string reason)
{
throw new NotImplementedException();
}
public virtual bool SetFastPumpValve(bool isOpen, out string reason)
{
throw new NotImplementedException();
}
public virtual bool SetSlowPumpValve(bool isOpen, out string reason)
{
throw new NotImplementedException();
}
public virtual bool OpenThrottleValve(out string reason)
{
throw new NotImplementedException();
}
public virtual bool SetAllValves(bool isOpen, out string reason)
{
reason = string.Empty;
return true;
}
public virtual bool CheckNoError(out List<string> reason)
{
reason = new List<string>();
return true;
}
}
}
@@ -0,0 +1,174 @@
using Aitex.Core.RT.Device;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.SCCore;
using Aitex.Sorter.Common;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.Fsm;
using MECF.Framework.Common.Schedulers;
using MECF.Framework.Common.SubstrateTrackings;
using MECF.Framework.RT.EquipmentLibrary.LogicUnits;
using System;
using System.Collections.Generic;
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs
{
public abstract class PMModuleBase : ModuleFsmDevice, ITransferTarget, IModuleDevice
{
#region Variables
private int _slot = 1;
#endregion
#region Constructors
public PMModuleBase(int slot)
{
_slot = slot;
}
#endregion
#region Properties
public abstract double ChamberPressure { get; }
public abstract bool IsIdle { get; }
public abstract bool IsProcessIdle { get; }
public abstract bool IsReady { get; }
public abstract bool IsError { get; }
public abstract bool IsInit { get; }
public abstract bool IsService { get; }
public bool IsBypassInterlock => SC.GetValue<bool>($"PM.{Module}.BypassInterlock");
public bool IsBypassEnableTable => SC.GetValue<bool>($"PM.{Module}.BypassEnableTable");
#endregion
#region Methods
public override bool Initialize()
{
WaferManager.Instance.SubscribeLocation(Module, _slot);
return base.Initialize();
}
/// <summary>
/// 检查是否Bypass了Interlock。
/// </summary>
/// <returns></returns>
protected void DoIfInterlockNotBypassed(Action action)
{
if (IsBypassInterlock)
EV.PostWarningLog(Module, $"Interlock is bypassed");
else if (IsBypassEnableTable)
EV.PostWarningLog(Module, $"Enable table is bypassed");
else
action.Invoke();
}
#endregion
#region Abstract Methods
public abstract bool CheckAcked(int entityTaskToken);
//Initialize
public abstract bool Home();
//Transfer
public abstract bool IsPrepareTransferReady(ModuleName robot, EnumTransferType pick, int slot);
public abstract int InvokePrepareTransfer(ModuleName robot, EnumTransferType type, int slot);
public abstract bool InvokeCheckHeaterDisable();
public abstract int InvokeSetHeatDisable();
public abstract bool Home(out string reason);
//ITransferTarget
public abstract bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason);
public abstract bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason);
public abstract bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason);
public abstract bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason);
public abstract void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType);
public abstract void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType);
//Process
public abstract int InvokeProcess(string recipeName, bool isCleanRecipe, bool withWafer);
public abstract int InvokeCleanProcess(string recipeName);
public abstract bool IsProcessed();
//Pump
public abstract bool PreparePump(out string reason);
public abstract bool CheckPreparePump();
public abstract bool SlowPump(int tvPosition, out string reason);
public abstract bool FastPump(int tvPosition, out string reason);
public abstract bool TurnOnPump(out string reason);
public abstract bool CheckPumpIsOn();
public abstract bool ShutDownPump(out string reason);
public abstract bool AbortPump();
//Vent
public abstract bool PrepareVent(out string reason);
public abstract bool CheckPrepareVent();
public abstract bool Vent(out string reason);
public abstract bool StopVent(out string reason);
public abstract bool CheckSlitValveClose();
//Lid
public abstract bool CheckLidClosed();
// PreProcess
public abstract bool CheckPreProcessCondition(Dictionary<string, string> recipeCommands, out string reason);
// 2704
public abstract bool CloseHeaterEnable(out string reason);
public abstract bool ClosePSUEnable(out string reason);
public abstract bool CloseSCREnable(out string reason);
public abstract bool EnableHeater(bool enable, out string reason);
public abstract bool CheckHeaterEnable();
public abstract bool CheckPickFromPMTemp();
public abstract bool CheckPlacetoPMTemp();
public abstract bool SetRotationEnable(bool enable, out string reason);
public abstract bool CheckRotationEnable();
#endregion
}
}