|
@@ -46,114 +46,114 @@ namespace CyberX8_RT.Devices.Loader
|
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
|
public bool CheckGotoPosition(string station)
|
|
|
{
|
|
|
- if (!_axis.IsHomed)
|
|
|
- {
|
|
|
- LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Name} is not home, Cannot execute GotoSavedPosition");
|
|
|
- return false;
|
|
|
- }
|
|
|
+ //if (!_axis.IsHomed)
|
|
|
+ //{
|
|
|
+ // LOG.WriteLog(eEvent.ERR_LOADER, Module, $"{Name} is not home, Cannot execute GotoSavedPosition");
|
|
|
+ // return false;
|
|
|
+ //}
|
|
|
|
|
|
- //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;
|
|
|
+ ////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.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 (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;
|
|
|
+ //}
|
|
|
return true;
|
|
|
}
|
|
|
|