|
@@ -51,109 +51,97 @@ namespace CyberX8_RT.Devices.Loader
|
|
|
LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Name} is not home, Cannot execute GotoSavedPosition");
|
|
|
return false;
|
|
|
}
|
|
|
+ if (!_axis.IsSwitchOn)
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Name} is switch off, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (_axis.IsRun)
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Name} is running, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //判断puf的rotation是否在home/flip/robot位置上
|
|
|
+ if (ModuleHelper.IsInstalled(ModuleName.PUF1))
|
|
|
+ {
|
|
|
+ JetAxisBase puf1RotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.PUF1}.Rotation");
|
|
|
+ if (puf1RotationAxis != null)
|
|
|
+ {
|
|
|
|
|
|
- ////Puf vertical is park
|
|
|
- //if (ModuleHelper.IsInstalled(ModuleName.PUF1))
|
|
|
- //{
|
|
|
- // JetAxisBase puf1VerticalAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.PUF1}.Vertical");
|
|
|
- // if (puf1VerticalAxis != null)
|
|
|
- // {
|
|
|
- // double puf1VerticalPosition = puf1VerticalAxis.MotionData.MotorPosition;
|
|
|
- // if (!puf1VerticalAxis.CheckPositionIsInStation(puf1VerticalPosition, "Park"))
|
|
|
- // {
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{ModuleName.PUF1} {puf1VerticalPosition} is not in Park, Cannot execute GotoSavedPosition");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
- //if (ModuleHelper.IsInstalled(ModuleName.PUF2))
|
|
|
- //{
|
|
|
- // JetAxisBase puf2VerticalAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.PUF2}.Vertical");
|
|
|
- // if (puf2VerticalAxis != null)
|
|
|
- // {
|
|
|
- // double puf2VerticalPosition = puf2VerticalAxis.MotionData.MotorPosition;
|
|
|
- // if (!puf2VerticalAxis.CheckPositionIsInStation(puf2VerticalPosition, "Park"))
|
|
|
- // {
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{ModuleName.PUF2} {puf2VerticalPosition} is not in Park, Cannot execute GotoSavedPosition");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
- //JetAxisBase swingAxis = null;
|
|
|
- //double swingPosition = 0;
|
|
|
- //if (Name == "TiltA")
|
|
|
- //{
|
|
|
- // swingAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.SwingA");
|
|
|
- // swingPosition=swingAxis.MotionData.MotorPosition;
|
|
|
- // if (!swingAxis.IsSwitchOn)
|
|
|
- // {
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"SwingA is switch off");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // if (swingAxis.IsRun)
|
|
|
- // {
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"SwingA is running,Cannot execute GotoSavedPosition");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- //}
|
|
|
- //else
|
|
|
- //{
|
|
|
- // swingAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.SwingB");
|
|
|
- // swingPosition=swingAxis.MotionData.MotorPosition;
|
|
|
-
|
|
|
- // if (!swingAxis.IsSwitchOn)
|
|
|
- // {
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"SwingB is switch off");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
-
|
|
|
- // if (swingAxis.IsRun)
|
|
|
- // {
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"SwingB is running,Cannot execute GotoSavedPosition");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- //}
|
|
|
- //JetAxisBase rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Rotation");
|
|
|
- //if (!rotationAxis.IsSwitchOn)
|
|
|
- //{
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"rotation is switch off");
|
|
|
- // return false;
|
|
|
- //}
|
|
|
- //if (rotationAxis.IsRun)
|
|
|
- //{
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"rotation is running,Cannot execute GotoSavedPosition");
|
|
|
- // return false;
|
|
|
- //}
|
|
|
- //if(swingAxis.CheckPositionIsEmpty(swingPosition))
|
|
|
- //{
|
|
|
- // return true;
|
|
|
- //}
|
|
|
- ////Swing在CLOSED,不可以去某一Station
|
|
|
- //if (swingAxis.CheckPositionIsInStation(swingPosition, "CLOSED"))
|
|
|
- //{
|
|
|
- // //LOG.WriteLog(eEvent.ERR_LOADER, Module, "Swing is CLOSED, Cannot execute GotoSavedPosition");
|
|
|
- // //return false;
|
|
|
- // return true;
|
|
|
- //}
|
|
|
- ////Swing在OPEN/OPENB,除了FLIP外其他位置都可以去
|
|
|
- //if (swingAxis.CheckPositionIsInStation(swingPosition, "OPEN")||
|
|
|
- // swingAxis.CheckPositionIsInStation(swingPosition,"OPENB"))
|
|
|
- //{
|
|
|
- // if(station.EndsWith("FLIP"))
|
|
|
- // {
|
|
|
- // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"Swing {swingPosition} is OPEN/OPENB, Cannot Goto Flip");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // return true;
|
|
|
- // }
|
|
|
- //}
|
|
|
- ////Swing在Clean
|
|
|
- //if(swingAxis.CheckPositionIsInStation(swingPosition,"CLEAN"))
|
|
|
- //{
|
|
|
- // return true;
|
|
|
- //}
|
|
|
+ if (puf1RotationAxis.IsRun) //puf rotation正在运动返回false
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{ModuleName.PUF1} is running, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ double puf1RotationPosition = puf1RotationAxis.MotionData.MotorPosition;
|
|
|
+ if (puf1RotationAxis.CheckPositionIsInStation(puf1RotationPosition, "Home")
|
|
|
+ || puf1RotationAxis.CheckPositionIsInStation(puf1RotationPosition, "Flip")
|
|
|
+ || puf1RotationAxis.CheckPositionIsInStation(puf1RotationPosition, "Robot"))
|
|
|
+ {
|
|
|
+ //校验通过,不执行操作
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{ModuleName.PUF1} {puf1RotationPosition} is not in Home/flip/Robot station, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } //puf rotation为空返回false
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{ModuleName.PUF1} is null, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断shuttle是否在out位上
|
|
|
+ JetAxisBase shuttleAxis = null;
|
|
|
+ double shuttleAxisPosition = 0;
|
|
|
+ if (Name == "TiltA")
|
|
|
+ {
|
|
|
+ shuttleAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.ShuttleA");
|
|
|
+ if (shuttleAxis != null)
|
|
|
+ {
|
|
|
+ if (shuttleAxis.IsRun) //shuttle正在运动返回false
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.ShuttleA is running, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ shuttleAxisPosition = shuttleAxis.MotionData.MotorPosition;
|
|
|
+ if (!shuttleAxis.CheckPositionIsInStation(shuttleAxisPosition, $"OUT{shuttleAxis.WaferSize.ToString()}"))
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.ShuttleA is not in out station, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else //shuttle为空返回false
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.ShuttleA is null, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ shuttleAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.ShuttleB");
|
|
|
+ if (shuttleAxis != null)
|
|
|
+ {
|
|
|
+ if (shuttleAxis.IsRun) //shuttle正在运动返回false
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.ShuttleB is running, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ shuttleAxisPosition = shuttleAxis.MotionData.MotorPosition;
|
|
|
+ if (!shuttleAxis.CheckPositionIsInStation(shuttleAxisPosition, $"OUT{shuttleAxis.WaferSize.ToString()}"))
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.ShuttleB is not in out station, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else //shuttle为空返回false
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Module}.ShuttleB is null, Cannot execute GotoSavedPosition");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|