|
@@ -11,6 +11,8 @@ using Aitex.Core.Util;
|
|
|
using Venus_RT.Modules.PMs;
|
|
|
using MECF.Framework.Common.Schedulers;
|
|
|
using System.Collections.Generic;
|
|
|
+using System;
|
|
|
+using MECF.Framework.Common.DBCore;
|
|
|
|
|
|
namespace Venus_RT.Modules.TM
|
|
|
{
|
|
@@ -21,9 +23,11 @@ namespace Venus_RT.Modules.TM
|
|
|
WaitPMReady,
|
|
|
PMPrepare,
|
|
|
ArmExtend,
|
|
|
+ QueryAWC,
|
|
|
DropDownWafer,
|
|
|
PickDelay,
|
|
|
ArmRetract,
|
|
|
+ SavePickeData,
|
|
|
NotifyDone,
|
|
|
}
|
|
|
|
|
@@ -37,14 +41,23 @@ namespace Venus_RT.Modules.TM
|
|
|
private int _targetSlot;
|
|
|
private Hand _hand;
|
|
|
|
|
|
+ private DateTime _starttime;
|
|
|
+ private bool _queryAwc;
|
|
|
+
|
|
|
public MFPMPickRoutine(JetTM tm, ITransferRobot robot) : base(ModuleName.TMRobot)
|
|
|
{
|
|
|
_JetTM = tm;
|
|
|
_robot = robot;
|
|
|
Name = "Pick from PM";
|
|
|
+
|
|
|
+ if (SC.GetValue<int>($"TM.QueryAWCOption") == 1 || SC.GetValue<int>($"TM.QueryAWCOption") == 3)
|
|
|
+ _queryAwc = true;
|
|
|
+ else
|
|
|
+ _queryAwc = false;
|
|
|
}
|
|
|
public RState Start(params object[] objs)
|
|
|
{
|
|
|
+ _starttime = DateTime.Now;
|
|
|
if (!_robot.IsHomed)
|
|
|
{
|
|
|
LOG.Write(eEvent.ERR_TM, Module, $"TM Robot is not homed, please home it first");
|
|
@@ -93,9 +106,11 @@ namespace Venus_RT.Modules.TM
|
|
|
Runner.Wait((int)PickStep.WaitPMReady, () => _pmModule.IsIdle, _delay_60s)
|
|
|
.Run((int)PickStep.PMPrepare, ModulePrepare, IsModulePrepareReady)
|
|
|
.Run((int)PickStep.ArmExtend, ArmExtend, WaitRobotExtendDone)
|
|
|
+ .Run((int)PickStep.QueryAWC, QueryAWC, WaitRobotQueryDone, _delay_1s)
|
|
|
.Run((int)PickStep.DropDownWafer, NotifyPMPickWafer, WaitPMWaferDropDown)
|
|
|
.Delay((int)PickStep.PickDelay, _pickDelayTime)
|
|
|
.Run((int)PickStep.ArmRetract, ArmRetract, WaitRobotRetractDone)
|
|
|
+ .Run((int)PickStep.SavePickeData, RecordAWCData, NullFun)
|
|
|
.End((int)PickStep.NotifyDone, NotifyPMDone, _delay_50ms);
|
|
|
|
|
|
return Runner.Status;
|
|
@@ -139,6 +154,54 @@ namespace Venus_RT.Modules.TM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private bool QueryAWC()
|
|
|
+ {
|
|
|
+ if (!_queryAwc)
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return _robot.QueryAwc(); ;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool WaitRobotQueryDone()
|
|
|
+ {
|
|
|
+ if (!_queryAwc)
|
|
|
+ return true;
|
|
|
+
|
|
|
+ if (_robot.Status == RState.Running)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ else if (_robot.Status == RState.End)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Runner.Stop($"TM Robot Query Awc failed, {_robot.Status}");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool RecordAWCData()
|
|
|
+ {
|
|
|
+ if (!_queryAwc)
|
|
|
+ return true;
|
|
|
+
|
|
|
+ //已经move后的数据
|
|
|
+ string _origin_module = $"LP{WaferManager.Instance.GetWafer(_targetModule, _targetSlot).OriginStation}";
|
|
|
+ int _origin_slot = WaferManager.Instance.GetWafer(_targetModule, _targetSlot).OriginSlot;
|
|
|
+ //查询完毕 插入数据
|
|
|
+ OffsetDataRecorder.RecordOffsetData(
|
|
|
+ Guid.NewGuid().ToString(),
|
|
|
+ _targetModule, _targetSlot,
|
|
|
+ ModuleName.TMRobot, 0,
|
|
|
+ _origin_module, _origin_slot,
|
|
|
+ _hand, RobotArmPan.None,
|
|
|
+ _robot.Offset_X, _robot.Offset_Y, _robot.Offset_D,
|
|
|
+ _starttime, DateTime.Now);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
private bool NotifyPMPickWafer()
|
|
|
{
|
|
|
_pmModule.PostMsg(PMEntity.MSG.DropDownWafer);
|