|
@@ -27,6 +27,8 @@ using Aitex.Core.RT.Log;
|
|
|
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.BufferStations;
|
|
|
using EFEM.RT.Devices.Flipper;
|
|
|
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Flipper.FlipperBase;
|
|
|
+using EFEM.RT.Modules;
|
|
|
+using static EFEM.RT.Devices.FlipperEntity;
|
|
|
|
|
|
namespace EFEM.RT.Routines
|
|
|
{
|
|
@@ -51,6 +53,8 @@ namespace EFEM.RT.Routines
|
|
|
protected IoCoolingBuffer buffer1 = null;
|
|
|
protected IoCoolingBuffer buffer2 = null;
|
|
|
|
|
|
+ protected JetFlipper flipper = null;
|
|
|
+
|
|
|
protected IoCoolingBuffer aligner1 = null;
|
|
|
protected IoCoolingBuffer aligner2 = null;
|
|
|
protected LoadLockDevice ll1 = null;
|
|
@@ -129,6 +133,7 @@ namespace EFEM.RT.Routines
|
|
|
buffer1 = DEVICE.GetDevice<IoCoolingBuffer>(DeviceName.CoolingBuffer1);
|
|
|
buffer2 = DEVICE.GetDevice<IoCoolingBuffer>(DeviceName.CoolingBuffer2);
|
|
|
|
|
|
+ flipper = DEVICE.GetDevice<JetFlipper>(DeviceName.Flipper);
|
|
|
aligner1 = DEVICE.GetDevice<IoCoolingBuffer>(DeviceName.Aligner1);
|
|
|
aligner2 = DEVICE.GetDevice<IoCoolingBuffer>(DeviceName.Aligner2);
|
|
|
ll1 = DEVICE.GetDevice<LoadLockDevice>(DeviceName.LL1);
|
|
@@ -1370,6 +1375,10 @@ namespace EFEM.RT.Routines
|
|
|
return _ioCoolBuffer;
|
|
|
}
|
|
|
|
|
|
+ public JetFlipper GetFlipper()
|
|
|
+ {
|
|
|
+ return flipper;
|
|
|
+ }
|
|
|
public void QueryLoadportState(int id, string deviceName, int time)
|
|
|
{
|
|
|
|
|
@@ -2127,5 +2136,152 @@ namespace EFEM.RT.Routines
|
|
|
throw (new RoutineBreakException());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void FlipperPrepare(int id, FlipperBase device, string name, int time, Action<string> notify, Action<string> error)
|
|
|
+ {
|
|
|
+ Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
|
|
+ {
|
|
|
+ if(device == null)
|
|
|
+ {
|
|
|
+ LOG.Error($"{device.Name} device is null, prepare transfer failed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ notify(String.Format("{0} Prepare Transfer", device.Name));
|
|
|
+ if (Singleton<RouteManager>.Instance.FLPEntity.CheckToPostMsg(FlipperEntity.FlipperMSG.PrepareTransfer))
|
|
|
+ {
|
|
|
+ LOG.Info($"{device.Name} start prepare transfer");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LOG.Error($"{device.Name} prepare transfer failed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }, () =>
|
|
|
+ {
|
|
|
+ if (Singleton<RouteManager>.Instance.FLPEntity.IsTransfer)
|
|
|
+ {
|
|
|
+ LOG.Info($"{device.Name} end prepare transfer");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }, time * 1000);
|
|
|
+
|
|
|
+ if (ret.Item1)
|
|
|
+ {
|
|
|
+ if (ret.Item2 == Result.FAIL)
|
|
|
+ {
|
|
|
+ throw (new RoutineFaildException());
|
|
|
+ }
|
|
|
+ else if (ret.Item2 == Result.TIMEOUT) //timeout
|
|
|
+ {
|
|
|
+ error(String.Format("{0} timeout, than {1} seconds", name, time));
|
|
|
+ throw (new RoutineFaildException());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ throw (new RoutineBreakException());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void FlipperComplete(int id, FlipperBase device, string name, int time, Action<string> notify, Action<string> error)
|
|
|
+ {
|
|
|
+ Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
|
|
+ {
|
|
|
+ if (device == null)
|
|
|
+ {
|
|
|
+ LOG.Error($"{device.Name} device is null, prepare transfer failed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ notify(String.Format("{0} Complete Transfer", device.Name));
|
|
|
+ if (Singleton<RouteManager>.Instance.FLPEntity.CheckToPostMsg(FlipperEntity.FlipperMSG.EndTransfer))
|
|
|
+ {
|
|
|
+ LOG.Info($"{device.Name} start complete transfer");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LOG.Error($"{device.Name} complete transfer failed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }, () =>
|
|
|
+ {
|
|
|
+ if (Singleton<RouteManager>.Instance.FLPEntity.IsIdle)
|
|
|
+ {
|
|
|
+ LOG.Info($"{device.Name} end complete transfer");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }, time * 1000);
|
|
|
+
|
|
|
+ if (ret.Item1)
|
|
|
+ {
|
|
|
+ if (ret.Item2 == Result.FAIL)
|
|
|
+ {
|
|
|
+ throw (new RoutineFaildException());
|
|
|
+ }
|
|
|
+ else if (ret.Item2 == Result.TIMEOUT) //timeout
|
|
|
+ {
|
|
|
+ error(String.Format("{0} timeout, than {1} seconds", name, time));
|
|
|
+ throw (new RoutineFaildException());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ throw (new RoutineBreakException());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void FlipperHome(int id, FlipperBase device, string name, int time, Action<string> notify, Action<string> error)
|
|
|
+ {
|
|
|
+ Tuple<bool, Result> ret = ExecuteAndWait(id, () =>
|
|
|
+ {
|
|
|
+ if (device == null)
|
|
|
+ {
|
|
|
+ LOG.Error($"{device.Name} device is null, fliper home failed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ notify(String.Format("{0} Home", device.Name));
|
|
|
+ if (Singleton<RouteManager>.Instance.FLPEntity.CheckToPostMsg(FlipperMSG.Home))
|
|
|
+ {
|
|
|
+ LOG.Info($"{device.Name} start home");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LOG.Error($"{device.Name} home failed");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }, () =>
|
|
|
+ {
|
|
|
+ if (Singleton<RouteManager>.Instance.FLPEntity.IsIdle)
|
|
|
+ {
|
|
|
+ LOG.Info($"{device.Name} end home");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }, time * 1000);
|
|
|
+
|
|
|
+ if (ret.Item1)
|
|
|
+ {
|
|
|
+ if (ret.Item2 == Result.FAIL)
|
|
|
+ {
|
|
|
+ throw (new RoutineFaildException());
|
|
|
+ }
|
|
|
+ else if (ret.Item2 == Result.TIMEOUT) //timeout
|
|
|
+ {
|
|
|
+ error(String.Format("{0} timeout, than {1} seconds", name, time));
|
|
|
+ throw (new RoutineFaildException());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ throw (new RoutineBreakException());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|