#include "JELManager.h" JELManager::JELManager() { } JELManager::~JELManager() { } bool JELManager::InitJEL() { return m_JELObj.InitJEL(); } bool JELManager::InitAlign() { return m_JELObj.InitAlign(); } bool JELManager::TakeOutWafer(int cassIndex, int waferIndex) { if (CheckFinderExistWafer()) { return false; } CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Cassette; RobotCmd.m_ToPos = _WaferPos_Arm1; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::ToAlign(int cassIndex, int waferIndex) { //到准直 m_JELObj.InitAlign(); CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Arm1; RobotCmd.m_ToPos = _WaferPos_Aligner; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::DOAlign(int cassIndex, int waferIndex) { //执行准直 CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_AlignerExt; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Aligner; RobotCmd.m_ToPos = _WaferPos_Aligner; bool isSuccess = m_JELObj.SendRobotCmd(RobotCmd); if (!isSuccess) { m_JELObj.InitAlign(); } return isSuccess; } bool JELManager::AlignmentWafer(int cassIndex, int waferIndex) { bool isFlag = false; { //到准直 CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Arm1; RobotCmd.m_ToPos = _WaferPos_Aligner; isFlag = m_JELObj.SendRobotCmd(RobotCmd); if (!isFlag) { return false; } } { //执行准直 CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_AlignerExt; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Aligner; RobotCmd.m_ToPos = _WaferPos_Aligner; return m_JELObj.SendRobotCmd(RobotCmd); } } bool JELManager::AlignToArm(int cassIndex, int waferIndex) { //从准直器取料到手臂2 CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Aligner; RobotCmd.m_ToPos = _WaferPos_Arm2; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::ArmToWorkPlat(int cassIndex, int waferIndex) { //手臂2放料到平台 CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Arm2; RobotCmd.m_ToPos = _WaferPos_HotPlate; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::PutWaferOnWorkbench(int cassIndex, int waferIndex) { bool isFlag = false; { //从准直器取料到手臂2 CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Aligner; RobotCmd.m_ToPos = _WaferPos_Arm2; isFlag = m_JELObj.SendRobotCmd(RobotCmd); if (!isFlag) { return false; } } { //手臂2放料到平台 CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Arm2; RobotCmd.m_ToPos = _WaferPos_HotPlate; return m_JELObj.SendRobotCmd(RobotCmd); } } bool JELManager::PlatformToTwoArm2(int cassIndex, int waferIndex) { CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_HotPlate; RobotCmd.m_ToPos = _WaferPos_Arm2; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::TwoArm2ToAlign(int cassIndex, int waferIndex) { m_JELObj.InitAlign(); CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Arm2; RobotCmd.m_ToPos = _WaferPos_Aligner; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::AlignToArm1(int cassIndex, int waferIndex) { CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Aligner; RobotCmd.m_ToPos = _WaferPos_Arm1; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::Arm1ToCass(int cassIndex, int waferIndex) { CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_TransferWafer; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos = _WaferPos_Arm1; RobotCmd.m_ToPos = _WaferPos_Cassette; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::RotateToWaferIdPos(int cassIndex, int waferIndex) { CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RObotCmd_RotateToWaferIdPos; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.m_cassIndex = cassIndex; RobotCmd.m_Slot = waferIndex; RobotCmd.m_FromPos; RobotCmd.m_ToPos; return m_JELObj.SendRobotCmd(RobotCmd); } void JELManager::switchBank(int layerNum) { int bankIndex = 0; layerNum == 25 ? bankIndex = 0 : bankIndex = 1; CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RObotCmd_Switch_bank; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_SendOnly; RobotCmd.m_Slot = bankIndex; m_JELObj.SendRobotCmd(RobotCmd); Sleep(1500); } bool JELManager::CheckFinderExistWafer() { return false; } bool JELManager::JudgeJelArmIsExistWafer(int armType) { CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_Check_ARM_EXIST_WAFER; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_ImmediateReadFeedback; armType == 1 ? RobotCmd.m_armPos = "up" : RobotCmd.m_armPos = "down"; m_JELObj.SendRobotCmd(RobotCmd); return m_JELObj.m_armIsExistWafer; } void JELManager::CommonSwitchBank(int bak) { CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RObotCmd_Switch_bank; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_SendOnly; RobotCmd.m_Slot = bak; m_JELObj.SendRobotCmd(RobotCmd); Sleep(1500); } bool JELManager::RunToMappingCassPoint(int loadPortId) { CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_RunToCassMappingPoint; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.LoadportId = loadPortId; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::JELMapping(int loadPortId, int bakNum) { CommonSwitchBank(bakNum); bool isOk = RunToMappingCassPoint(loadPortId); if (!isOk) { return false; } CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_Mapping; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_WaitCmdEnd; RobotCmd.LoadportId = loadPortId; return m_JELObj.SendRobotCmd(RobotCmd); } bool JELManager::JELReadMappingData(std::vector& MappingData) { CRobotCmdInfo RobotCmd; RobotCmd.m_RobotCmdType = _RobotCmd_ReadMappingData; RobotCmd.m_RobotCmdSendType = _RobotCmdSendType_ImmediateReadFeedback; bool isSuccess = m_JELObj.SendRobotCmd(RobotCmd); std::string recvMappingData = RobotCmd.m_RevStr; //TODO:解析返回数据 return isSuccess; }