diff --git a/LaiPuLaser/LaiPuLaser/CommonFlowMgr.cpp b/LaiPuLaser/LaiPuLaser/CommonFlowMgr.cpp index be352a9..4ab8d98 100644 --- a/LaiPuLaser/LaiPuLaser/CommonFlowMgr.cpp +++ b/LaiPuLaser/LaiPuLaser/CommonFlowMgr.cpp @@ -3582,705 +3582,484 @@ void CCommonFlowMgr::CreatAnnealPrepareCmd(CWorkCmdInvoker &CmdInvoker,CWafer * //创建subrcp 退火开始前的准备指令 void CCommonFlowMgr::CreatSubRecipeAnnealPrepareCmd(CWorkCmdInvoker &CmdInvoker,CWafer *pWafer,int SubRecipeIdx) { - Dbxy LaserPt = gPlatSpecialPosMgr->GetSpecialPosXY(_ESpecialPosType_LaserCenter);//加工中心点 - Dbxy WaferCenterPt = gPlatSpecialPosMgr->GetSpecialPosXY(_ESpecialPosType_WaferCenter); - CMotor &MotorZ = *(CMotor::GetMotor(MOTOR_Z)); - - CLogInfo LogInfo; - LogInfo.m_ClassName = "CCommonFlowMgr"; - LogInfo.m_FuncName = "CreatSubRecipeAnnealPrepareCmd"; - - //这里Recipe 改变SubRecipeIdx 只是为了下面的指令获取参数 - CRecipe Recipe = pWafer->m_WaferRecipe; - Recipe.SetCurSubRecipeIdx(SubRecipeIdx); - CRecipeParameter RecipePar; - //计算wafer 使用的扫描移动间隔Y - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_OVERLAP_RATIO_Y); - double OverlapY = RecipePar.m_ParDoubleVal; - pWafer->m_ScanLineGapY = gLaser->GetScanIntervals(OverlapY,true); - } - //当前pJob recipe edi 相关参数是否变化(会记录当前值) - bool bPluseWidthChanged1 = false; - bool bPluseWidthChanged2 = false; - bool bLaser1RecipeEdiChange = gAnnealMonitoringMgr->CheckEdiRecipeChange(_LaserDeviceType_MainLaser1,Recipe); - bool bLaser2RecipeEdiChange = gAnnealMonitoringMgr->CheckEdiRecipeChange(_LaserDeviceType_MainLaser2,Recipe); - //功率密度复检参数是否发生变化(LD1或者LD2) - bool bRcpEdiParChange = (bLaser1RecipeEdiChange||bLaser2RecipeEdiChange); - CString Log; - Log.Format("->SubRecipeIdx = %d",SubRecipeIdx); - LogInfo.m_LogMsg = Recipe.m_RecipeName+Log; - gLogMgr->WriteLogInfo(LogInfo); + Dbxy LaserPt = gPlatSpecialPosMgr->GetSpecialPosXY(_ESpecialPosType_LaserCenter);//加工中心点 + Dbxy WaferCenterPt = gPlatSpecialPosMgr->GetSpecialPosXY(_ESpecialPosType_WaferCenter); + CMotor &MotorZ = *(CMotor::GetMotor(MOTOR_Z)); - m_bSubRecipeEdiEqualZero = false;//当前SubRcp 的Edi是否设置为0(用来控制退火时是否出激光) - bool bLaser1EdiZero = false;//Laser1的功率密度是否为0 - bool bLaser2EdiZero = false;//Laser2的功率密度是否为0 - bool bLaser1CurrZero = false;//Laser1的电流是否为0 - bool bLaser2CurrZero = false;//Laser2的电流是否为0 - double lfLaser1PluseWidthOffset = 0; - double lfLaser2PluseWidthOffset = 0; - double lfPluseWidth = 0; + CLogInfo LogInfo; + LogInfo.m_ClassName = "CCommonFlowMgr"; + LogInfo.m_FuncName = "CreatSubRecipeAnnealPrepareCmd"; - { - double Laser1Edi,Laser2Edi,Laser1Curr,Laser2Curr; - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_EDI_1); - Laser1Edi = RecipePar.m_ParDoubleVal; - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_EDI_2); - Laser2Edi = RecipePar.m_ParDoubleVal; - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_CURR_1); - Laser1Curr = RecipePar.m_ParDoubleVal; - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_CURR_2); - Laser2Curr = RecipePar.m_ParDoubleVal; - RecipePar = Recipe.GetRecipePar(RECIPE_OFFSET_PAR_LASER1_PLUSEWIDTH); - lfLaser1PluseWidthOffset = RecipePar.m_ParDoubleVal; - RecipePar = Recipe.GetRecipePar(RECIPE_OFFSET_PAR_LASER2_PLUSEWIDTH); - lfLaser2PluseWidthOffset = RecipePar.m_ParDoubleVal; - - bLaser1EdiZero = IsDbEqualZero(Laser1Edi); - bLaser2EdiZero = IsDbEqualZero(Laser2Edi); - bLaser1CurrZero = IsDbEqualZero(Laser1Curr); - bLaser2CurrZero = IsDbEqualZero(Laser2Curr); - //edi都为0 表示SubRecipeEdiEqualZero - if(bLaser1EdiZero&&bLaser2EdiZero) - { - LogInfo.m_LogMsg = "Sub Recipe Edi Equal Zero"; - gLogMgr->WriteLogInfo(LogInfo); - m_bSubRecipeEdiEqualZero = true; - gAnnealMonitoringMgr->SetLight1BasePow(0); - gAnnealMonitoringMgr->SetLight2BasePow(0); - gAnnealMonitoringMgr->SetLight3BasePow(0); - } - } - //功率密度为0 的时候要重置FDC 的stage 功率 - CFDCKeepPar &FDCKeepPar = gSemiSecsCommMgr->GetFDCKeepPar(); - if(bLaser1EdiZero) - { - LogInfo.m_LogMsg = "StageLaser1Powermeter-->Zero"; - gLogMgr->WriteLogInfo(LogInfo); - FDCKeepPar.m_StageLaser1Powermeter = 0; - FDCKeepPar.m_StageLaser1Edi = 0; - } - if(bLaser2EdiZero) - { - LogInfo.m_LogMsg = "StageLaser2Powermeter-->Zero"; - gLogMgr->WriteLogInfo(LogInfo); - FDCKeepPar.m_StageLaser2Powermeter = 0; - FDCKeepPar.m_StageLaser2Edi = 0; - } - - //检查是否有Warning 报警 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_CheckWarningMsg); - CmdInvoker.AddCmd(pCmd); - } - //检查LDD 状态 - if(gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDeviceCtrl)) - { - if(!bLaser1EdiZero)//Edi 不为0 时才检查LDD 是否打开 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_FlowCheck; - ActionPar.AddFlowCheck(_FlowCheck_Laser1LDD); - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - if(!bLaser2EdiZero) - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_FlowCheck; - ActionPar.AddFlowCheck(_FlowCheck_Laser2LDD); - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - } - //设置后续动作的平台速度为空移速度 - { - CWorkCmdSetAsixSpeed *pCmd = new CWorkCmdSetAsixSpeed(); - pCmd->SetAsixSpeedType(_AsixSpeedType_EmptyMoveXY); - CmdInvoker.AddCmd(pCmd); - } - //设置SubRecipeIdx 的多点运动数据 - //这里运行时将WaferRecipe设置为当前的SubRecipeIdx - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_SetAnneaSubRcprMultiMoveData); - pCmd->BindingPar(pWafer);//绑定当前生产的wafer - pCmd->SetIntParVal(SubRecipeIdx); - CmdInvoker.AddCmd(pCmd); - } - - bool bCreatRecipeEdiCheckCmd = false;//是否创建功率密度检测cmd - if(gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDeviceCtrl)//屏蔽激光 - && (!m_bSubRecipeEdiEqualZero)//rcp Edi1和 Edi2都设置为0 的时候不要检测 - && gAnnealMonitoringMgr->IsbRecipeEdiCheckOnJobStart()//可以选择不检测 - && gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserPowerMeter_Surface,false))//屏蔽功率计 - { - bCreatRecipeEdiCheckCmd = true; - } - //log - { - LogInfo.m_LogMsg = "bCreatRecipeEdiCheckCmd = "; - LogInfo.m_LogMsg += Bool2CStringYesNo(bCreatRecipeEdiCheckCmd); - gLogMgr->WriteLogInfo(LogInfo); - } - { - if (bCreatRecipeEdiCheckCmd)//创建cmd 不一定会执行 - { - //Edi 复检开始工作(检查是否需要复检) - { - //功率密度复检参数是否发生变化 - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_EdiCheckStart); - pCmd->SetBoolParVal(bRcpEdiParChange); - pCmd->SetBoolParVal2(pWafer->m_bNeedEdiCheck);//是否需要复检 - CmdInvoker.AddCmd(pCmd); - } - //抓取光斑数据(Laser1和Laser2合并抓取一次) - //需要复检的时候才抓取光斑参数 - if (!m_bIsManusal_Anneal_Test - &&gAnnealMonitoringMgr->IsbBeamCheckOnJobStart() - && gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserBeamMeter)) - { - //发送eap 事件 - { - CSecsEventInfo EventInfo; - EventInfo.m_EventType = _SecsEvent_Beam_Check_Start; - EventInfo.m_Wafer = pWafer; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_SendSecsEvent); - pCmd->SetSecsEventInfo(EventInfo); - CmdInvoker.AddCmd(pCmd); - } - CreatLaserBeamFlowCmd(CmdInvoker, pWafer, true); - //发送eap 事件 - { - CSecsEventInfo EventInfo; - EventInfo.m_EventType = _SecsEvent_Beam_Check_End; - EventInfo.m_Wafer = pWafer; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_SendSecsEvent); - pCmd->SetSecsEventInfo(EventInfo); - CmdInvoker.AddCmd(pCmd); - } - } - } - //设置SubRecipe 的激光参数(频率电流和延时) - //Rcp 电流是0的时候也需要把电流设置为0 - //参数不变的时候这个步骤不会消耗时间 - if(gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDeviceCtrl)) - { - CSetMainLaserPar SetLaserPar; - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_FRE); - SetLaserPar.m_Laser1_PRF = RecipePar.m_ParDoubleVal; - } - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER2_FRE); - SetLaserPar.m_Laser2_PRF = RecipePar.m_ParDoubleVal; - } - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_CURR_1); - SetLaserPar.m_Current = RecipePar.m_ParDoubleVal; - } - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_CURR_2); - SetLaserPar.m_Current2 = RecipePar.m_ParDoubleVal; - } - //加上补偿表的电流 - { - double OffsetTabCurrent = Recipe.GetOffsetParVal(RECIPE_OFFSET_PAR_LASER1_CURR); - SetLaserPar.m_Current += OffsetTabCurrent; - } - { - double OffsetTabCurrent = Recipe.GetOffsetParVal(RECIPE_OFFSET_PAR_LASER2_CURR); - SetLaserPar.m_Current2 += OffsetTabCurrent; - } - //要检测功率密度,并且两个laser 都要检测的时候 - //在改变激光电流后等待指定的延时m_WaitCurrChangeDelay - SetLaserPar.m_bWaitCurrChangeDelay = true; - //双脉冲延时 - if(gLaserDevice->IsbTwoLaserLddMode()) - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_PRF2_DELAY); - SetLaserPar.m_PRF2Delay = RecipePar.m_ParDoubleVal;//双脉冲延时 - } - - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_SetMainLaserPar; - ActionPar.m_SetMainLaserPar = SetLaserPar; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - //调整SubRecipe 对应的衰减器角度 - //不复检的时候也要调整 - if(!m_bSubRecipeEdiEqualZero && bLaser1EdiZero)//22-12-15 - { - //Edi 为0 的但是电流不为0的情况要旋转到45度,避免影响另外一路复检 - if(!bLaser1CurrZero) - { - double RotatoDimmer1Ang = POW_ZERO_DIMMER_ANG_45; - //log - { - Log.Format("->RotatoDimmer1Ang = %lf",RotatoDimmer1Ang); - LogInfo.m_LogMsg = Log; - gLogMgr->WriteLogInfo(LogInfo); - } - { - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; - ActionPar.m_DoubleParVal = RotatoDimmer1Ang; - ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser1; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - } - } - else - { - double RotatoDimmer1Ang = -1;//表示使用之前的角度 - //功率密度参数有变化的时候 - //或者不复检的时候 - //使用rcp 的计算角度 - if(bLaser1RecipeEdiChange||!bCreatRecipeEdiCheckCmd) - { - //转到recipe 设置角度(这个角度是用点检结果功率和EDI计算出来的) - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_ROTATO_DIMMER_ANG); - RotatoDimmer1Ang = RecipePar.m_ParDoubleVal; - } - //log - { - Log.Format("->RotatoDimmer1Ang = %lf",RotatoDimmer1Ang); - LogInfo.m_LogMsg = Log; - gLogMgr->WriteLogInfo(LogInfo); - } - //if(RotatoDimmer1Ang>=0) - { - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; - ActionPar.m_DoubleParVal = RotatoDimmer1Ang; - ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser1; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - } - //不复检的时候不用转动衰减器(使用之前复检的角度) - if(!m_bSubRecipeEdiEqualZero && bLaser2EdiZero) - { - //Edi 为0 的但是电流不为0的情况要旋转到45度,避免影响另外一路复检 - if(!bLaser2CurrZero) - { - double RotatoDimmer2Ang = POW_ZERO_DIMMER_ANG_45; - //log - { - Log.Format("->RotatoDimmer2Ang = %lf",RotatoDimmer2Ang); - LogInfo.m_LogMsg = Log; - gLogMgr->WriteLogInfo(LogInfo); - } - { - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; - ActionPar.m_DoubleParVal = RotatoDimmer2Ang; - ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser2; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - } - } - else - { - double RotatoDimmer2Ang = -1;//表示使用之前的角度 - //参数变化时转到recipe 设置角度 - //bLaser2RecipeEdiChange没变就是之前的角度-1(不用旋转) - //(!bCreatRecipeEdiCheckCmd)表示不EDI复检,就需要转到rcp 的角度上 - if(bLaser2RecipeEdiChange||!bCreatRecipeEdiCheckCmd) - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_ROTATO_DIMMER_ANG2); - RotatoDimmer2Ang = RecipePar.m_ParDoubleVal; - } - //log - { - Log.Format("->RotatoDimmer2Ang = %lf",RotatoDimmer2Ang); - LogInfo.m_LogMsg = Log; - gLogMgr->WriteLogInfo(LogInfo); - } - { - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; - ActionPar.m_DoubleParVal = RotatoDimmer2Ang; - ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser2; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - } - //SubRecipe功率密度复检 - //这个时候的激光参数已经设置为recipe 的参数 - if(bCreatRecipeEdiCheckCmd)//创建cmd 不一定会执行 - { - //XY移动到功率计位置 - { - CWorkCmdAsixXYMove *pCmd = new CWorkCmdAsixXYMove(); - Dbxy MovePt = gPlatSpecialPosMgr->GetSpecialPosXY(_ESpecialPosType_SufacePower); - pCmd->MoveToTargetPt(MovePt,LaserPt); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - //调整Z 轴位置到功率测量坐标 - { - double TargetCoord = gPlatSpecialPosMgr->GetSpecialPosZ(_ESpecialPosType_SufacePower);//目标焦距位置 - CWorkCmdMoveMotor *pCmd = new CWorkCmdMoveMotor(MotorZ,TargetCoord); - pCmd->SetMoveFlg(false);//移动到坐标 - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - //关闭气缸衰减器 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_IO_AirDimmerCtrl); - pCmd->SetBoolParVal(bCLOSE); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - //打开光闸 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_IO_Write); - pCmd->SetIntParVal(_IO_W_Machine_Gate); - pCmd->SetBoolParVal(bOPEN); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - //电流改变后 示波器自适应一下 - //检查LDD和示波器状态 - if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDeviceCtrl) && - gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_TekOscilloscope)) - { - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_AdjustOsiiMaxAmplitude; - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - } -#if 0 - if(!bLaser1EdiZero) - { - //电流和角度设置之后示波器自适应 - if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_TekOscilloscope)) - { - { - CExcuteActionPar ActionPar; - ActionPar.m_BoolParVal = true;// wafer2wafer流程才需要等待 设置true - ActionPar.m_IntParVal = 20;//20秒超时 - ActionPar.m_ExcuteAction = _ExcuteAction_AdjustOsiiMaxAmplitudeCheckExcEnd; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - { - //rawata采集 - CExcuteActionPar ActionPar; - ActionPar.m_BoolParVal = true;//是在工艺中,用于结束条件判断 - ActionPar.m_ExcuteAction = _ExcuteAction_OsiiRawDataCollect; - ActionPar.m_pBindingPar = pWafer; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - /*复检时波形 rawdata采集可以同步进行 - { - //rawata采集 - CExcuteActionPar ActionPar; - ActionPar.m_BoolParVal = true;//是在工艺中,用于结束条件判断 - ActionPar.m_ExcuteAction = _ExcuteAction_OsiiRawDataCollectCheckExcEnd; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - */ - } - //这个时候laser2 Pow 是0 (LD12一起用的时候衰减角度2是45度) - //检测Laser1 功率密度(不满足rcp 条件时自动调整衰减角度) - //调整后的角度保存在m_Laser1RotatoDimmerAng - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_CheckRecipeEdiOnAnnealStart); - pCmd->BindingPar(pWafer);//绑定当前生产的wafer - pCmd->SetIntParVal((int)_LaserDeviceType_MainLaser1); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - } - if(!bLaser2EdiZero)//LD2 Edi 不为0 - { - if(!bLaser1EdiZero)//LD1 Edi 不为0 - { - //先把laser1 的角度转到45 角度 - //没复检不会执行这里 - { - double RotatoDimmer1Ang = POW_ZERO_DIMMER_ANG_45; - { - Log.Format("->RotatoDimmer1Ang = %lf",RotatoDimmer1Ang); - LogInfo.m_LogMsg = Log; - gLogMgr->WriteLogInfo(LogInfo); - } - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; - ActionPar.m_DoubleParVal = RotatoDimmer1Ang; - ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser1; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - //把laser2 的衰减角度转到测量角度 - { - double RotatoDimmer2Ang; - if(bLaser2RecipeEdiChange)//变化的时候使用Recipe 的角度 - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_ROTATO_DIMMER_ANG2); - RotatoDimmer2Ang = RecipePar.m_ParDoubleVal; - //log - { - Log.Format("->RotatoDimmer2Ang = %lf",RotatoDimmer2Ang); - LogInfo.m_LogMsg = Log; - gLogMgr->WriteLogInfo(LogInfo); - } - } - else//没有变化的时候使用上一次复检调整的角度 - { - RotatoDimmer2Ang = -2; - { - LogInfo.m_LogMsg = "->RotatoDimmer2Ang = AdjustAng"; - gLogMgr->WriteLogInfo(LogInfo); - } - } - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; - ActionPar.m_DoubleParVal = RotatoDimmer2Ang; - ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser2; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - } - //电流和角度设置之后示波器自适应 - if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_TekOscilloscope)) - { - { - CExcuteActionPar ActionPar; - ActionPar.m_BoolParVal = true;// wafer2wafer流程才需要等待 设置true - ActionPar.m_IntParVal = 20;//20秒超时 - ActionPar.m_ExcuteAction = _ExcuteAction_AdjustOsiiMaxAmplitudeCheckExcEnd; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - { - //rawata采集 - CExcuteActionPar ActionPar; - ActionPar.m_BoolParVal = true;//是在工艺中,用于结束条件判断 - ActionPar.m_ExcuteAction = _ExcuteAction_OsiiRawDataCollect; - ActionPar.m_pBindingPar = pWafer; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - /*复检时波形 rawdata采集可以同步进行 - { - //rawata采集 - CExcuteActionPar ActionPar; - ActionPar.m_BoolParVal = true;//是在工艺中,用于结束条件判断 - ActionPar.m_ExcuteAction = _ExcuteAction_OsiiRawDataCollectCheckExcEnd; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - pCmd->SetExcuteActionPar(ActionPar); - CmdInvoker.AddCmd(pCmd); - } - */ - } - //检测Laser2 功率密度(不满足rcp 条件时自动调整) - //调整后的角度保存在m_Laser2RotatoDimmerAng - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_CheckRecipeEdiOnAnnealStart); - pCmd->BindingPar(pWafer);//绑定当前生产的wafer - pCmd->SetIntParVal((int)_LaserDeviceType_MainLaser2); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - //Laser2 检测好了再把laser1 衰减角度转到之前laser 复合后的角度值 - //保存在LastCheckPar中 - if(!bLaser1EdiZero) - { - //(Val<0的情况设置为m_LaserRotatoDimmerAng) - double RotatoDimmer1Ang = -2; - { - LogInfo.m_LogMsg = "->RotatoDimmer1Ang = AdjustAng"; - gLogMgr->WriteLogInfo(LogInfo); - } - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; - ActionPar.m_DoubleParVal = RotatoDimmer1Ang; - ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser1; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - } -#endif - //执行edi 复检 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_CheckRecipeEdiOnAnnealStart); - pCmd->BindingPar(pWafer);//绑定当前生产的wafer - pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd - CmdInvoker.AddCmd(pCmd); - } - //关闭光闸 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_IO_Write); - pCmd->SetIntParVal(_IO_W_Machine_Gate); - pCmd->SetBoolParVal(bCLOSE); - pCmd->CanNotCancel();//不能取消 - CmdInvoker.AddCmd(pCmd); - } - //Edi 复检结束工作 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_EdiCheckEnd); - CmdInvoker.AddCmd(pCmd); - } - } - //测距仪测量焦距(m_bPJobFirstWafer决定当前wafer 是否需要调整焦距) - if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDisMeter) && (pWafer->m_bNeedFoucsAdjust)) - { - //发送eap 事件 - { - CSecsEventInfo EventInfo; - EventInfo.m_EventType = _SecsEvent_Wafer_FoucsAdjust_Start; - EventInfo.m_Wafer = pWafer; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_SendSecsEvent); - pCmd->SetSecsEventInfo(EventInfo); - CmdInvoker.AddCmd(pCmd); - } - //创建自动校准的指令流程(完成后不回到焦距位置)(如果使用安全坐标,回到安全坐标) - CreatAutoFindFocusInvokerCmd(CmdInvoker, false); - //发送eap 事件 - { - CSecsEventInfo EventInfo; - EventInfo.m_EventType = _SecsEvent_Wafer_FoucsAdjust_End; - EventInfo.m_Wafer = pWafer; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_SendSecsEvent); - pCmd->SetSecsEventInfo(EventInfo); - CmdInvoker.AddCmd(pCmd); - } - } - //Z 轴到激光焦点位置(加上sub recipe 的焦距调整值) - //cmd执行时再去获取当前的激光焦距坐标 - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_FOCUS_ADJUST_VAL); - double FoucsZAdjustVal = RecipePar.m_ParDoubleVal; - CMotor &MotorZ = *(CMotor::GetMotor(MOTOR_Z)); - CWorkCmdMoveMotor *pCmd = new CWorkCmdMoveMotor(MotorZ,0); - pCmd->SetMoveFlg(false);//移动到坐标 - pCmd->SetbMoveToLaserFoucsZ(true,FoucsZAdjustVal); - CmdInvoker.AddCmd(pCmd); - } - //打开气帘 - if (m_bAirCurtain) - { - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_IO_Write); - pCmd->SetIntParVal(_IO_W_Anneal_AirCurtain); - pCmd->SetBoolParVal(bOPEN); - CmdInvoker.AddCmd(pCmd); - } - } - //自动控制N2 - { - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_N2_STATE); - bool bN2Open = RecipePar.m_ParBoolVal; - if (!bN2Open) - { - //停止使用MFC检测 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_MFCUseSignal); - pCmd->SetIntParVal(0); - pCmd->SetBoolParVal(bCLOSE); - pCmd->CanNotCancel(); - CmdInvoker.AddCmd(pCmd); - } - } - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_IO_Write); - pCmd->SetIntParVal(_IO_W_Anneal_N2); - pCmd->SetBoolParVal(bN2Open); - CmdInvoker.AddCmd(pCmd); - } - if (bN2Open) - { - if (gAnnealMonitoringMgr->IsUseN2Flowmeter()) - { - double CurVal = 0.0; - RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_USE_CUR_N2VAL); - if (RecipePar.m_ParBoolVal) - { - CRecipeParameter RecipePar2 = Recipe.GetRecipePar(RECIPE_PAR_NAME_N2_VAL); - CurVal = RecipePar2.m_ParDoubleVal; - } - else - { - CurVal = gAnnealMonitoringMgr->GetCurMFCVal(); - } - //设置N2流量 - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_SetN2Val); - pCmd->SetDoubleParVal(CurVal); - CmdInvoker.AddCmd(pCmd); - } - } - } - } - //加工前立即检测一次光路功率 - if (!m_bSubRecipeEdiEqualZero) - { - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteAction(_ExcuteAction_CheckLaserPathPow); - CmdInvoker.AddCmd(pCmd); - } - //工艺之前最后的确认指令 - { - CExcuteActionPar ActionPar; - ActionPar.m_ExcuteAction = _ExcuteAction_ConfirmBeforeProcess; - CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); - pCmd->SetExcuteActionPar(ActionPar); - pCmd->BindingPar(pWafer);//绑定当前生产的wafer - CmdInvoker.AddCmd(pCmd); - } - } + //这里Recipe 改变SubRecipeIdx 只是为了下面的指令获取参数 + CRecipe Recipe = pWafer->m_WaferRecipe; + Recipe.SetCurSubRecipeIdx(SubRecipeIdx); + CRecipeParameter RecipePar; + //计算wafer 使用的扫描移动间隔Y + { + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_OVERLAP_RATIO_Y); + double OverlapY = RecipePar.m_ParDoubleVal; + pWafer->m_ScanLineGapY = gLaser->GetScanIntervals(OverlapY, true); + } + //当前pJob recipe edi 相关参数是否变化(会记录当前值) + bool bPluseWidthChanged1 = false; + bool bPluseWidthChanged2 = false; + bool bLaser1RecipeEdiChange = gAnnealMonitoringMgr->CheckEdiRecipeChange(_LaserDeviceType_MainLaser1, Recipe); + bool bLaser2RecipeEdiChange = gAnnealMonitoringMgr->CheckEdiRecipeChange(_LaserDeviceType_MainLaser2, Recipe); + //功率密度复检参数是否发生变化(LD1或者LD2) + bool bRcpEdiParChange = (bLaser1RecipeEdiChange || bLaser2RecipeEdiChange); + CString Log; + Log.Format("->SubRecipeIdx = %d", SubRecipeIdx); + LogInfo.m_LogMsg = Recipe.m_RecipeName + Log; + gLogMgr->WriteLogInfo(LogInfo); + + m_bSubRecipeEdiEqualZero = false;//当前SubRcp 的Edi是否设置为0(用来控制退火时是否出激光) + bool bLaser1EdiZero = false;//Laser1的功率密度是否为0 + bool bLaser2EdiZero = false;//Laser2的功率密度是否为0 + bool bLaser1CurrZero = false;//Laser1的电流是否为0 + bool bLaser2CurrZero = false;//Laser2的电流是否为0 + double lfLaser1PluseWidthOffset = 0; + double lfLaser2PluseWidthOffset = 0; + double lfPluseWidth = 0; + + { + double Laser1Edi, Laser2Edi, Laser1Curr, Laser2Curr; + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_EDI_1); + Laser1Edi = RecipePar.m_ParDoubleVal; + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_EDI_2); + Laser2Edi = RecipePar.m_ParDoubleVal; + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_CURR_1); + Laser1Curr = RecipePar.m_ParDoubleVal; + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_CURR_2); + Laser2Curr = RecipePar.m_ParDoubleVal; + RecipePar = Recipe.GetRecipePar(RECIPE_OFFSET_PAR_LASER1_PLUSEWIDTH); + lfLaser1PluseWidthOffset = RecipePar.m_ParDoubleVal; + RecipePar = Recipe.GetRecipePar(RECIPE_OFFSET_PAR_LASER2_PLUSEWIDTH); + lfLaser2PluseWidthOffset = RecipePar.m_ParDoubleVal; + + bLaser1EdiZero = IsDbEqualZero(Laser1Edi); + bLaser2EdiZero = IsDbEqualZero(Laser2Edi); + bLaser1CurrZero = IsDbEqualZero(Laser1Curr); + bLaser2CurrZero = IsDbEqualZero(Laser2Curr); + //edi都为0 表示SubRecipeEdiEqualZero + if (bLaser1EdiZero&&bLaser2EdiZero) + { + LogInfo.m_LogMsg = "Sub Recipe Edi Equal Zero"; + gLogMgr->WriteLogInfo(LogInfo); + m_bSubRecipeEdiEqualZero = true; + gAnnealMonitoringMgr->SetLight1BasePow(0); + gAnnealMonitoringMgr->SetLight2BasePow(0); + gAnnealMonitoringMgr->SetLight3BasePow(0); + } + } + //功率密度为0 的时候要重置FDC 的stage 功率 + CFDCKeepPar &FDCKeepPar = gSemiSecsCommMgr->GetFDCKeepPar(); + if (bLaser1EdiZero) + { + LogInfo.m_LogMsg = "StageLaser1Powermeter-->Zero"; + gLogMgr->WriteLogInfo(LogInfo); + FDCKeepPar.m_StageLaser1Powermeter = 0; + FDCKeepPar.m_StageLaser1Edi = 0; + } + if (bLaser2EdiZero) + { + LogInfo.m_LogMsg = "StageLaser2Powermeter-->Zero"; + gLogMgr->WriteLogInfo(LogInfo); + FDCKeepPar.m_StageLaser2Powermeter = 0; + FDCKeepPar.m_StageLaser2Edi = 0; + } + + //检查是否有Warning 报警 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_CheckWarningMsg); + CmdInvoker.AddCmd(pCmd); + } + //检查LDD 状态 + if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDeviceCtrl)) + { + if (!bLaser1EdiZero)//Edi 不为0 时才检查LDD 是否打开 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + CExcuteActionPar ActionPar; + ActionPar.m_ExcuteAction = _ExcuteAction_FlowCheck; + ActionPar.AddFlowCheck(_FlowCheck_Laser1LDD); + pCmd->SetExcuteActionPar(ActionPar); + CmdInvoker.AddCmd(pCmd); + } + if (!bLaser2EdiZero) + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + CExcuteActionPar ActionPar; + ActionPar.m_ExcuteAction = _ExcuteAction_FlowCheck; + ActionPar.AddFlowCheck(_FlowCheck_Laser2LDD); + pCmd->SetExcuteActionPar(ActionPar); + CmdInvoker.AddCmd(pCmd); + } + } + //设置后续动作的平台速度为空移速度 + { + CWorkCmdSetAsixSpeed *pCmd = new CWorkCmdSetAsixSpeed(); + pCmd->SetAsixSpeedType(_AsixSpeedType_EmptyMoveXY); + CmdInvoker.AddCmd(pCmd); + } + //设置SubRecipeIdx 的多点运动数据 + //这里运行时将WaferRecipe设置为当前的SubRecipeIdx + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_SetAnneaSubRcprMultiMoveData); + pCmd->BindingPar(pWafer);//绑定当前生产的wafer + pCmd->SetIntParVal(SubRecipeIdx); + CmdInvoker.AddCmd(pCmd); + } + + bool bCreatRecipeEdiCheckCmd = false;//是否创建功率密度检测cmd + if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDeviceCtrl)//屏蔽激光 + && (!m_bSubRecipeEdiEqualZero)//rcp Edi1和 Edi2都设置为0 的时候不要检测 + && gAnnealMonitoringMgr->IsbRecipeEdiCheckOnJobStart()//可以选择不检测 + && gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserPowerMeter_Surface, false))//屏蔽功率计 + { + bCreatRecipeEdiCheckCmd = true; + } + //log + { + LogInfo.m_LogMsg = "bCreatRecipeEdiCheckCmd = "; + LogInfo.m_LogMsg += Bool2CStringYesNo(bCreatRecipeEdiCheckCmd); + gLogMgr->WriteLogInfo(LogInfo); + } + { + if (bCreatRecipeEdiCheckCmd)//创建cmd 不一定会执行 + { + //Edi 复检开始工作(检查是否需要复检) + { + //功率密度复检参数是否发生变化 + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_EdiCheckStart); + pCmd->SetBoolParVal(bRcpEdiParChange); + pCmd->SetBoolParVal2(pWafer->m_bNeedEdiCheck);//是否需要复检 + CmdInvoker.AddCmd(pCmd); + } + //抓取光斑数据(Laser1和Laser2合并抓取一次) + //需要复检的时候才抓取光斑参数 + if (!m_bIsManusal_Anneal_Test + &&gAnnealMonitoringMgr->IsbBeamCheckOnJobStart() + && gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserBeamMeter)) + { + //发送eap 事件 + { + CSecsEventInfo EventInfo; + EventInfo.m_EventType = _SecsEvent_Beam_Check_Start; + EventInfo.m_Wafer = pWafer; + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_SendSecsEvent); + pCmd->SetSecsEventInfo(EventInfo); + CmdInvoker.AddCmd(pCmd); + } + CreatLaserBeamFlowCmd(CmdInvoker, pWafer, true); + //发送eap 事件 + { + CSecsEventInfo EventInfo; + EventInfo.m_EventType = _SecsEvent_Beam_Check_End; + EventInfo.m_Wafer = pWafer; + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_SendSecsEvent); + pCmd->SetSecsEventInfo(EventInfo); + CmdInvoker.AddCmd(pCmd); + } + } + } + //设置SubRecipe 的激光参数(频率电流和延时) + //Rcp 电流是0的时候也需要把电流设置为0 + //参数不变的时候这个步骤不会消耗时间 + if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDeviceCtrl)) + { + CSetMainLaserPar SetLaserPar; + { + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_FRE); + SetLaserPar.m_Laser1_PRF = RecipePar.m_ParDoubleVal; + } + { + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER2_FRE); + SetLaserPar.m_Laser2_PRF = RecipePar.m_ParDoubleVal; + } + { + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_CURR_1); + SetLaserPar.m_Current = RecipePar.m_ParDoubleVal; + } + { + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_LASER_CURR_2); + SetLaserPar.m_Current2 = RecipePar.m_ParDoubleVal; + } + //加上补偿表的电流 + { + double OffsetTabCurrent = Recipe.GetOffsetParVal(RECIPE_OFFSET_PAR_LASER1_CURR); + SetLaserPar.m_Current += OffsetTabCurrent; + } + { + double OffsetTabCurrent = Recipe.GetOffsetParVal(RECIPE_OFFSET_PAR_LASER2_CURR); + SetLaserPar.m_Current2 += OffsetTabCurrent; + } + //要检测功率密度,并且两个laser 都要检测的时候 + //在改变激光电流后等待指定的延时m_WaitCurrChangeDelay + SetLaserPar.m_bWaitCurrChangeDelay = true; + //双脉冲延时 + if (gLaserDevice->IsbTwoLaserLddMode()) + { + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_PRF2_DELAY); + SetLaserPar.m_PRF2Delay = RecipePar.m_ParDoubleVal;//双脉冲延时 + } + + CExcuteActionPar ActionPar; + ActionPar.m_ExcuteAction = _ExcuteAction_SetMainLaserPar; + ActionPar.m_SetMainLaserPar = SetLaserPar; + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteActionPar(ActionPar); + CmdInvoker.AddCmd(pCmd); + } + //调整SubRecipe 对应的衰减器角度 + //不复检的时候也要调整 + if (!bLaser1CurrZero || !bLaser1EdiZero)//电流或Edi不为0的情况要旋转相应一路衰减器 + { + double RotatoDimmer1Ang = -1;//表示使用之前的角度 + //功率密度参数有变化的时候 + //或者不复检的时候 + //使用rcp 的计算角度 + if (bLaser1RecipeEdiChange || !bCreatRecipeEdiCheckCmd) + { + //转到recipe 设置角度(这个角度是用点检结果功率和EDI计算出来的) + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_ROTATO_DIMMER_ANG); + RotatoDimmer1Ang = RecipePar.m_ParDoubleVal; + } + //log + { + Log.Format("->RotatoDimmer1Ang = %lf", RotatoDimmer1Ang); + LogInfo.m_LogMsg = Log; + gLogMgr->WriteLogInfo(LogInfo); + } + { + CExcuteActionPar ActionPar; + ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; + ActionPar.m_DoubleParVal = RotatoDimmer1Ang; + ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser1; + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteActionPar(ActionPar); + CmdInvoker.AddCmd(pCmd); + } + } + if (!bLaser2CurrZero || !bLaser2EdiZero)//电流或Edi不为0的情况要旋转相应一路衰减器 + { + double RotatoDimmer2Ang = -1;//表示使用之前的角度 + //功率密度参数有变化的时候 + //或者不复检的时候 + //使用rcp 的计算角度 + if (bLaser2RecipeEdiChange || !bCreatRecipeEdiCheckCmd) + { + //转到recipe 设置角度(这个角度是用点检结果功率和EDI计算出来的) + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_ROTATO_DIMMER_ANG2); + RotatoDimmer2Ang = RecipePar.m_ParDoubleVal; + } + //log + { + Log.Format("->RotatoDimmer2Ang = %lf", RotatoDimmer2Ang); + LogInfo.m_LogMsg = Log; + gLogMgr->WriteLogInfo(LogInfo); + } + { + CExcuteActionPar ActionPar; + ActionPar.m_ExcuteAction = _ExcuteAction_RotatoDimmer_ToAngle; + ActionPar.m_DoubleParVal = RotatoDimmer2Ang; + ActionPar.m_IntParVal = (int)_LaserDeviceType_MainLaser2; + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteActionPar(ActionPar); + CmdInvoker.AddCmd(pCmd); + } + } + //SubRecipe功率密度复检 + //这个时候的激光参数已经设置为recipe 的参数 + if (bCreatRecipeEdiCheckCmd)//创建cmd 不一定会执行 + { + //XY移动到功率计位置 + { + CWorkCmdAsixXYMove *pCmd = new CWorkCmdAsixXYMove(); + Dbxy MovePt = gPlatSpecialPosMgr->GetSpecialPosXY(_ESpecialPosType_SufacePower); + pCmd->MoveToTargetPt(MovePt, LaserPt); + pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd + CmdInvoker.AddCmd(pCmd); + } + //调整Z 轴位置到功率测量坐标 + { + double TargetCoord = gPlatSpecialPosMgr->GetSpecialPosZ(_ESpecialPosType_SufacePower);//目标焦距位置 + CWorkCmdMoveMotor *pCmd = new CWorkCmdMoveMotor(MotorZ, TargetCoord); + pCmd->SetMoveFlg(false);//移动到坐标 + pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd + CmdInvoker.AddCmd(pCmd); + } + //关闭气缸衰减器 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_IO_AirDimmerCtrl); + pCmd->SetBoolParVal(bCLOSE); + pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd + CmdInvoker.AddCmd(pCmd); + } + //打开光闸 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_IO_Write); + pCmd->SetIntParVal(_IO_W_Machine_Gate); + pCmd->SetBoolParVal(bOPEN); + pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd + CmdInvoker.AddCmd(pCmd); + } + //电流改变后 示波器自适应一下 + //检查LDD和示波器状态 + if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDeviceCtrl) && + gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_TekOscilloscope)) + { + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + CExcuteActionPar ActionPar; + ActionPar.m_ExcuteAction = _ExcuteAction_AdjustOsiiMaxAmplitude; + pCmd->SetExcuteActionPar(ActionPar); + CmdInvoker.AddCmd(pCmd); + } + } + //执行edi 复检 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_CheckRecipeEdiOnAnnealStart); + pCmd->BindingPar(pWafer);//绑定当前生产的wafer + pCmd->SetbEdiCheckCmd(true);//标记为edi check cmd + CmdInvoker.AddCmd(pCmd); + } + //关闭光闸 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_IO_Write); + pCmd->SetIntParVal(_IO_W_Machine_Gate); + pCmd->SetBoolParVal(bCLOSE); + pCmd->CanNotCancel();//不能取消 + CmdInvoker.AddCmd(pCmd); + } + //Edi 复检结束工作 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_EdiCheckEnd); + CmdInvoker.AddCmd(pCmd); + } + } + //测距仪测量焦距(m_bPJobFirstWafer决定当前wafer 是否需要调整焦距) + if (gDeviceStateMgr->QueryUsedFunc(_EUsedFunc_LaserDisMeter) && (pWafer->m_bNeedFoucsAdjust)) + { + //发送eap 事件 + { + CSecsEventInfo EventInfo; + EventInfo.m_EventType = _SecsEvent_Wafer_FoucsAdjust_Start; + EventInfo.m_Wafer = pWafer; + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_SendSecsEvent); + pCmd->SetSecsEventInfo(EventInfo); + CmdInvoker.AddCmd(pCmd); + } + //创建自动校准的指令流程(完成后不回到焦距位置)(如果使用安全坐标,回到安全坐标) + CreatAutoFindFocusInvokerCmd(CmdInvoker, false); + //发送eap 事件 + { + CSecsEventInfo EventInfo; + EventInfo.m_EventType = _SecsEvent_Wafer_FoucsAdjust_End; + EventInfo.m_Wafer = pWafer; + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_SendSecsEvent); + pCmd->SetSecsEventInfo(EventInfo); + CmdInvoker.AddCmd(pCmd); + } + } + //Z 轴到激光焦点位置(加上sub recipe 的焦距调整值) + //cmd执行时再去获取当前的激光焦距坐标 + { + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_FOCUS_ADJUST_VAL); + double FoucsZAdjustVal = RecipePar.m_ParDoubleVal; + CMotor &MotorZ = *(CMotor::GetMotor(MOTOR_Z)); + CWorkCmdMoveMotor *pCmd = new CWorkCmdMoveMotor(MotorZ, 0); + pCmd->SetMoveFlg(false);//移动到坐标 + pCmd->SetbMoveToLaserFoucsZ(true, FoucsZAdjustVal); + CmdInvoker.AddCmd(pCmd); + } + //打开气帘 + if (m_bAirCurtain) + { + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_IO_Write); + pCmd->SetIntParVal(_IO_W_Anneal_AirCurtain); + pCmd->SetBoolParVal(bOPEN); + CmdInvoker.AddCmd(pCmd); + } + } + //自动控制N2 + { + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_N2_STATE); + bool bN2Open = RecipePar.m_ParBoolVal; + if (!bN2Open) + { + //停止使用MFC检测 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_MFCUseSignal); + pCmd->SetIntParVal(0); + pCmd->SetBoolParVal(bCLOSE); + pCmd->CanNotCancel(); + CmdInvoker.AddCmd(pCmd); + } + } + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_IO_Write); + pCmd->SetIntParVal(_IO_W_Anneal_N2); + pCmd->SetBoolParVal(bN2Open); + CmdInvoker.AddCmd(pCmd); + } + if (bN2Open) + { + if (gAnnealMonitoringMgr->IsUseN2Flowmeter()) + { + double CurVal = 0.0; + RecipePar = Recipe.GetRecipePar(RECIPE_PAR_NAME_USE_CUR_N2VAL); + if (RecipePar.m_ParBoolVal) + { + CRecipeParameter RecipePar2 = Recipe.GetRecipePar(RECIPE_PAR_NAME_N2_VAL); + CurVal = RecipePar2.m_ParDoubleVal; + } + else + { + CurVal = gAnnealMonitoringMgr->GetCurMFCVal(); + } + //设置N2流量 + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_SetN2Val); + pCmd->SetDoubleParVal(CurVal); + CmdInvoker.AddCmd(pCmd); + } + } + } + } + //加工前立即检测一次光路功率 + if (!m_bSubRecipeEdiEqualZero) + { + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteAction(_ExcuteAction_CheckLaserPathPow); + CmdInvoker.AddCmd(pCmd); + } + //工艺之前最后的确认指令 + { + CExcuteActionPar ActionPar; + ActionPar.m_ExcuteAction = _ExcuteAction_ConfirmBeforeProcess; + CWorkCmdExcuteAction *pCmd = new CWorkCmdExcuteAction(); + pCmd->SetExcuteActionPar(ActionPar); + pCmd->BindingPar(pWafer);//绑定当前生产的wafer + CmdInvoker.AddCmd(pCmd); + } + } } //创建SubRecipe 退火过程指令