|
@@ -1,9 +1,12 @@
|
|
|
using Aitex.Core.Common;
|
|
|
+using Aitex.Core.RT.Device;
|
|
|
using Aitex.Core.RT.Log;
|
|
|
using Aitex.Core.RT.Routine;
|
|
|
using Aitex.Core.Util;
|
|
|
using CyberX8_Core;
|
|
|
+using CyberX8_RT.Devices.AXIS;
|
|
|
using CyberX8_RT.Devices.EFEM;
|
|
|
+using CyberX8_RT.Modules.LPs;
|
|
|
using CyberX8_RT.Modules.Rinse;
|
|
|
using MECF.Framework.Common.Equipment;
|
|
|
using MECF.Framework.Common.Routine;
|
|
@@ -15,6 +18,7 @@ using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using static Mono.Security.X509.X520;
|
|
|
|
|
|
namespace CyberX8_RT.Modules.EFEM
|
|
|
{
|
|
@@ -57,6 +61,10 @@ namespace CyberX8_RT.Modules.EFEM
|
|
|
{
|
|
|
_sequences.Add((ModuleName)Enum.Parse(typeof(ModuleName), item));
|
|
|
}
|
|
|
+ if(!CheckRobotCyclePreCondiction(_sequences))
|
|
|
+ {
|
|
|
+ return RState.Failed;
|
|
|
+ }
|
|
|
_cycleTimes=(int)objs[1];
|
|
|
_alignerAngle = (int)objs[2];
|
|
|
_actions = new List<EfemCycleAction>();
|
|
@@ -66,7 +74,6 @@ namespace CyberX8_RT.Modules.EFEM
|
|
|
LOG.Write(eEvent.ERR_EFEM_ROBOT, Module, $"Input Robot Cycle Times{_cycleTimes} error");
|
|
|
return RState.Failed;
|
|
|
}
|
|
|
-
|
|
|
return Runner.Start(Module, "Start CycleRobotCycleRoutine");
|
|
|
}
|
|
|
private void GenerateCycleAction()
|
|
@@ -194,6 +201,184 @@ namespace CyberX8_RT.Modules.EFEM
|
|
|
{
|
|
|
return _currentCycle;
|
|
|
}
|
|
|
+ private bool CheckRobotCyclePreCondiction(List<ModuleName> lists)
|
|
|
+ {
|
|
|
+ bool result = true;
|
|
|
+ //Robot
|
|
|
+ if (!CheckRobotStatus())
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //LP
|
|
|
+ if(lists.Contains(ModuleName.LP1))
|
|
|
+ {
|
|
|
+ if (!CheckLoadPortStatus(ModuleName.LP1))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if (lists.Contains(ModuleName.LP2))
|
|
|
+ {
|
|
|
+ if (!CheckLoadPortStatus(ModuleName.LP2))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (!CheckLoadPortStatus(ModuleName.LP2))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ //Dummy
|
|
|
+ if (lists.Contains(ModuleName.Dummy1))
|
|
|
+ {
|
|
|
+ if (!CheckDummyStatus(ModuleName.Dummy1))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if(lists.Contains(ModuleName.Dummy2))
|
|
|
+ {
|
|
|
+ if (!CheckDummyStatus(ModuleName.Dummy2))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ //Puf
|
|
|
+ if (lists.Contains(ModuleName.PUF1) && !CheckPufStatus(ModuleName.PUF1))
|
|
|
+ {
|
|
|
+ return false ;
|
|
|
+ }
|
|
|
+ //Srd
|
|
|
+ if (lists.Contains(ModuleName.SRD1))
|
|
|
+ {
|
|
|
+ if (!CheckSrdStatus(ModuleName.SRD1))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if(lists.Contains(ModuleName.SRD2))
|
|
|
+ {
|
|
|
+ if (!CheckSrdStatus(ModuleName.SRD2))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ //检查robot状态
|
|
|
+ private bool CheckRobotStatus()
|
|
|
+ {
|
|
|
+ bool result = true;
|
|
|
+ if (WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 0))
|
|
|
+ {
|
|
|
+ Stop($"Efem robot arm already has a wafer, cannot do the RobotCycle action");
|
|
|
+ result = false;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ //检查loadport状态
|
|
|
+ private bool CheckLoadPortStatus(ModuleName loadpoartName)
|
|
|
+ {
|
|
|
+ bool result = true;
|
|
|
+
|
|
|
+ if (ModuleHelper.IsInstalled(loadpoartName))
|
|
|
+ {
|
|
|
+ Loadport loadPort = GetLoadPort(loadpoartName);
|
|
|
+ if (loadPort == null)
|
|
|
+ {
|
|
|
+ Stop($"{loadpoartName} is null");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ WaferInfo[] waferInfos = WaferManager.Instance.GetWafers(loadpoartName);
|
|
|
+ if (waferInfos.Length < 1)
|
|
|
+ {
|
|
|
+ Stop($"there is no wafer in {loadpoartName}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Stop($"{loadpoartName} is not installed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ private Loadport GetLoadPort(ModuleName station)
|
|
|
+ {
|
|
|
+ LoadPortModule loadPortModule = Singleton<RouteManager>.Instance.EFEM.GetLoadportModule(station - ModuleName.LP1);
|
|
|
+ return loadPortModule.LPDevice;
|
|
|
+ }
|
|
|
+ //Dummy状态判断
|
|
|
+ private bool CheckDummyStatus(ModuleName dummyName)
|
|
|
+ {
|
|
|
+ bool result = true;
|
|
|
+ if (!ModuleHelper.IsInstalled(dummyName))
|
|
|
+ {
|
|
|
+ Stop($"{dummyName} is not installed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //若dummy存在wafer,需要人工处理
|
|
|
+ DummyDevice dummyDevice = Singleton<RouteManager>.Instance.EFEM.GetDummyDevice(dummyName - ModuleName.Dummy1);
|
|
|
+ if (dummyDevice != null)
|
|
|
+ {
|
|
|
+ if (!dummyDevice.HasCassette)
|
|
|
+ {
|
|
|
+ Stop($"{dummyName} dose not have cassette");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ WaferInfo[] waferInfos = WaferManager.Instance.GetWafers(dummyName);
|
|
|
+ if (waferInfos.Length > 0)
|
|
|
+ {
|
|
|
+ foreach (var item in waferInfos)
|
|
|
+ {
|
|
|
+ if (item != null && !item.IsEmpty)
|
|
|
+ {
|
|
|
+ Stop($"There are wafers inside the {dummyName},cannot do the RobotCycle action");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ //检查puf
|
|
|
+ private bool CheckPufStatus(ModuleName pufName)
|
|
|
+ {
|
|
|
+ bool result = true;
|
|
|
+ if (!ModuleHelper.IsInstalled(pufName))
|
|
|
+ {
|
|
|
+ Stop($"{pufName} is not install");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ JetAxisBase puf1RotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.PUF1}.Rotation");
|
|
|
+ if (puf1RotationAxis == null)
|
|
|
+ {
|
|
|
+ Stop("Puf1 Rotation Axis is null");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ double puf1RotationPosition = puf1RotationAxis.MotionData.MotorPosition;
|
|
|
+ if ( !puf1RotationAxis.CheckPositionIsInStation(puf1RotationPosition, "Robot"))
|
|
|
+ {
|
|
|
+ Stop($"PUF1 Rotation {puf1RotationPosition} is not in Robot");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ //检查srd
|
|
|
+ private bool CheckSrdStatus(ModuleName SrdName)
|
|
|
+ {
|
|
|
+ bool result = true;
|
|
|
+ if (!ModuleHelper.IsInstalled(SrdName))
|
|
|
+ {
|
|
|
+ Stop($"{SrdName} is not install");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|