Exemplo n.º 1
0
        public void DispLotInfo(ListView _lvLotInfo) //오퍼레이션 창용.
        {
            DateTime tDateTime;

            string sTemp;
            double dUPH;

            //LotId
            _lvLotInfo.Items[0].SubItems[0].Text = "LotNo";
            _lvLotInfo.Items[0].SubItems[1].Text = Data.LotNo;

            //WorkCnt
            _lvLotInfo.Items[1].SubItems[0].Text = "WorkCnt  ";
            _lvLotInfo.Items[1].SubItems[1].Text = Data.WorkCnt.ToString();

            //UPH
            sTemp = string.Format("{0:0.0}", OM.EqpStat.dTrayUPH);
            _lvLotInfo.Items[2].SubItems[0].Text = "Tray UPH ";
            _lvLotInfo.Items[2].SubItems[1].Text = sTemp;

            //SttTime
            _lvLotInfo.Items[3].SubItems[0].Text = "SttTime  ";
            tDateTime = DateTime.FromOADate(Data.StartedAt);
            _lvLotInfo.Items[3].SubItems[1].Text = tDateTime.ToString("HH:mm:ss");

            //TickTime
            sTemp = string.Format("{0:0.00}", OM.EqpStat.dTrayWorkTime);
            _lvLotInfo.Items[4].SubItems[0].Text = "Tray Work time ";
            _lvLotInfo.Items[4].SubItems[1].Text = sTemp;

            //Oper ID
            //sTemp = string.Format("{0:0.00}", OM.EqpStat.dTrayWorkTime);
            _lvLotInfo.Items[5].SubItems[0].Text = "OperID ";
            _lvLotInfo.Items[5].SubItems[1].Text = LOT.CrntLotData.sEmployeeID;   //20180125 SML.FrmLogOn.GetId();

            //Supply Count

            _lvLotInfo.Items[6].SubItems[0].Text = "Tray Supply Count ";
            _lvLotInfo.Items[6].SubItems[1].Text = OM.GetSupplyCnt().ToString();
        }
Exemplo n.º 2
0
        override public bool Autorun() //오토런닝시에 계속 타는 함수.
        {
            //Check Cycle Time Out.
            String sTemp;

            sTemp = String.Format("%s Step.iCycle={0:00}", "Autorun", Step.iCycle);
            if (Step.eSeq != PreStep.eSeq)
            {
                Log.Trace(m_sPartName, sTemp);
            }


            PreStep.eSeq = Step.eSeq;

            string sCycle = GetCrntCycleName();

            //Check Error & Decide Step.
            if (Step.eSeq == sc.Idle)
            {
                if (Stat.bReqStop)
                {
                    return(false);
                }

                //if( DM.ARAY[ri.SPLR].CheckAllStat(cs.None) && IO_GetX(xi.RAIL_TrayDtct1)) {ER_SetErr(ei.PKG_Unknwn , "Supplyer Unknwn PKG Error."   ); return false;}
                if (!OM.CmnOptn.bIdleRun && !DM.ARAY[ri.SPLR].CheckAllStat(cs.None) && !IO_GetX(xi.RAIL_TrayDtct1))
                {
                    ER_SetErr(ei.PKG_Dispr, "Supplyer Disappear PKG Error."); return(false);
                }

                //공급 부족 에러.
                if (!OM.CmnOptn.bIdleRun && !OM.CmnOptn.bGoldenTray)
                {
                    if ((!IO_GetX(xi.LODR_TrayDtct) && OM.GetSupplyCnt() < OM.DevInfo.iTRAY_StackingCnt) && LOT.LotOpened && !OM.EqpStat.bWrapingEnd)
                    {
                        ER_SetErr(ei.PRT_NeedTraySupply, "Supply Tray");
                    }
                }
                //int iFWorkCol = DM.ARAY[ri.IDXF].FindFrstCol(cs.Good);
                //int iRWorkCol = DM.ARAY[ri.IDXR].FindFrstCol(cs.Good);

                //작업열을 세팅하여 미리서플라이 가능하게 함.
                //bool bIdxFCanSply = (iFWorkCol!=-1) && DM.ARAY[ri.IDXF].GetMaxCol() - iFWorkCol >= OM.DevOptn.iIdxCanSplyCol ;
                //bool bIdxRCanSply = (iRWorkCol!=-1) && DM.ARAY[ri.IDXR].GetMaxCol() - iRWorkCol >= OM.DevOptn.iIdxCanSplyCol ;
                bool bIdxFSplyPos = !DM.ARAY[ri.IDXF].CheckAllStat(cs.None) && SM.MT_GetCmdPos(mi.IDXF_XFrnt) > OM.CmnOptn.dIdxFSplyPos;
                bool bIdxRSplyPos = !DM.ARAY[ri.IDXR].CheckAllStat(cs.None) && SM.MT_GetCmdPos(mi.IDXR_XRear) > OM.CmnOptn.dIdxRSplyPos;

                //인덱스 비어있음.
                bool bIdxFNone     = DM.ARAY[ri.IDXF].CheckAllStat(cs.None) && !IO_GetX(xi.RAIL_TrayDtct1);
                bool bIdxRNone     = DM.ARAY[ri.IDXR].CheckAllStat(cs.None) && !IO_GetX(xi.RAIL_TrayDtct1);
                bool bIdxFSplyStat = DM.ARAY[ri.IDXF].GetCntStat(cs.Empty) == DM.ARAY[ri.IDXF].GetMaxCol() * DM.ARAY[ri.IDXF].GetMaxRow() - DM.ARAY[ri.MASK].GetCntStat(cs.None) || DM.ARAY[ri.IDXF].GetCntStat(cs.Good) != 0;
                bool bIdxRSplyStat = DM.ARAY[ri.IDXR].GetCntStat(cs.Empty) == DM.ARAY[ri.IDXR].GetMaxCol() * DM.ARAY[ri.IDXR].GetMaxRow() - DM.ARAY[ri.MASK].GetCntStat(cs.None) || DM.ARAY[ri.IDXR].GetCntStat(cs.Good) != 0;

                //int  iTopCoverCnt  = 1 ;
                //int  iBtmCoverCnt  =
                bool isCycleSupply = DM.ARAY[ri.SPLR].CheckAllStat(cs.None) && !OM.CmnOptn.bLoadingStop && !OM.EqpStat.bWrapingEnd &&
                                     (IO_GetX(xi.LODR_TrayDtct) || OM.CmnOptn.bIdleRun) && //로더에 자제 확인 하여.
                                     ((OM.GetSupplyCnt() < OM.DevInfo.iTRAY_StackingCnt && !OM.CmnOptn.bGoldenTray) || OM.CmnOptn.bIdleRun || (OM.GetSupplyCnt() == 0 && OM.CmnOptn.bGoldenTray)) &&
                                     ((bIdxRNone && bIdxFSplyStat && bIdxFSplyPos) || (bIdxFNone && bIdxRSplyStat && bIdxRSplyPos) || (bIdxRNone && bIdxFNone));


                bool isCycleEnd = DM.ARAY[ri.SPLR].CheckAllStat(cs.None) && (OM.EqpStat.bWrapingEnd || OM.CmnOptn.bGoldenTray);   //;



                if (ER_IsErr())
                {
                    return(false);
                }
                //Normal Decide Step.
                if (isCycleSupply)
                {
                    Step.eSeq = sc.Supply;
                }
                else if (isCycleEnd)
                {
                    Stat.bWorkEnd = true; return(true);
                }
                Stat.bWorkEnd = false;

                if (Step.eSeq != sc.Idle)
                {
                    Log.Trace(m_sPartName, Step.eSeq.ToString() + " Start");
                    InitCycleStep();
                    m_CycleTime[(int)Step.eSeq].Start();
                }
            }

            //Cycle.
            Step.eLastSeq = Step.eSeq;
            switch (Step.eSeq)
            {
            default:                      Log.Trace(m_sPartName, "default End");                                    Step.eSeq = sc.Idle;   return(false);

            case (sc.Idle):                                                                                                                       return(false);

            case (sc.Supply): if (CycleSupply())
                {
                    Log.Trace(m_sPartName, sCycle + " End"); m_CycleTime[(int)Step.eSeq].End(); Step.eSeq = sc.Idle;
                }
                return(false);
            }
        }
Exemplo n.º 3
0
        //bool bNeedToBarcode = false ;
        public bool CycleBarcode()
        {
            String sTemp;

            if (m_tmCycle.OnDelay(Step.iCycle != 0 && Step.iCycle == PreStep.iCycle && CheckStop() && !OM.MstOptn.bDebugMode, 30000))
            {
                sTemp = string.Format("Cycle Step.iCycle={0:00}", Step.iCycle);
                sTemp = m_sPartName + "-" + GetCrntCycleName() + sTemp;
                ER_SetErr(ei.PRT_CycleTO, sTemp);
                Log.Trace(m_sPartName, sTemp);
                return(true);
            }

            if (Step.iCycle != PreStep.iCycle)
            {
                sTemp = string.Format("Cycle Step.iCycle={0:00}", Step.iCycle);
                sTemp = m_sPartName + "-" + GetCrntCycleName() + sTemp;
                Log.Trace(m_sPartName, sTemp);
            }

            if (IO_GetX(xi.IDXR_Overload))
            {
                MT_Stop(mi.IDXR_XRear);
                ER_SetErr(ei.PRT_OverLoad, "Rear Index is Overload Error");
                return(true);
            }

            PreStep.iCycle = Step.iCycle;

            if (Stat.bReqStop)
            {
                //return true ;
            }

            LOT.TLot Lot;



            switch (Step.iCycle)
            {
            default:
                sTemp = string.Format("Cycle Default Clear Step.iCycle={0:00}", Step.iCycle);
                //if(Step.iCycle != PreStep.iCycle)Trace(m_sPartName.c_str(), sTemp.c_str());
                return(true);

            case 10:                                                          //sometime when barcode works failed.!
                if (!OM.CmnOptn.bIdleRun && IO_GetX(xi.RAIL_TrayDtct2) && !MT_CmprPos(mi.IDXR_XRear, PM_GetValue(mi.IDXR_XRear, pv.IDXR_XRearBarcode)))
                {
                    //ER_SetErr(ei.PRT_Detect , IO_GetXName(xi.RAIL_TrayDtct2) +" is Something Detected!");
                    //return true ;
                }
                OM.EqpStat.sTraySttTime  = DateTime.Now.ToString("HH:mm:ss");
                OM.EqpStat.dTrayWorkTime = SEQ.bTrayWorkTimer ? SEQ.m_cyTrayWorktime.CheckTime_s() : 0;
                OM.EqpStat.dTrayUPH      = SEQ.bTrayWorkTimer ? 3600 / (OM.EqpStat.dTrayWorkTime / (DM.ARAY[ri.IDXF].GetMaxCol() * DM.ARAY[ri.IDXF].GetMaxRow() - DM.ARAY[ri.IDXF].GetCntStat(cs.None))) : 0;
                SEQ.m_cyTrayWorktime.Clear();
                SEQ.bTrayWorkTimer = true;

                if (OM.CmnOptn.bIdleRun)
                {
                    Step.iCycle = 100;
                    return(false);
                }

                //이조건이면 바코드 안찍는다.
                if (!OM.CmnOptn.bIdleRun)       //아이들 런이면 첫장부터 작업 한다.
                {
                    if (OM.GetSupplyCnt() == 1 || (OM.DevOptn.bUseBtmCover && OM.GetSupplyCnt() == OM.DevInfo.iTRAY_StackingCnt) || OM.CmnOptn.bGoldenTray)
                    {
                        Step.iCycle = 50;
                        return(false);
                    }
                }

                Step.iCycle++;
                return(false);

            case 11:

                if (!IO_GetX(xi.IDXR_TrayDtct) && !OM.CmnOptn.bIdleRun)
                {
                    ER_SetErr(ei.PKG_Dispr, "Rear Index tray detect sensor Not detected.");
                    return(true);
                }
                //Don need to barcode scan
                SEQ.BarcordLODR.SendScanOn();

                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearBarcode);
                Step.iCycle++;
                return(false);

            case 12:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearBarcode))
                {
                    return(false);
                }
                if (!OM.CmnOptn.bIdleRun && !IO_GetX(xi.RAIL_TrayDtct2))    //sensor zone is over when col 0
                {
                    ER_SetErr(ei.PRT_Missed, IO_GetXName(xi.RAIL_TrayDtct2) + " is Not Detected!");
                    return(true);
                }
                MoveCyl(ci.IDXR_ClampClOp, fb.Bwd);    //레일 초기 진입시에 크리퍼랑 레일이랑 찐따지는것 방지용. 한번 풀었다 잡는다.
                Step.iCycle++;
                return(false);

            case 13:
                if (!CL_Complete(ci.IDXR_ClampClOp, fb.Bwd))
                {
                    return(false);
                }
                m_tmDelay.Clear();
                Step.iCycle++;
                return(false);

            case 14:
                if (m_tmDelay.OnDelay(3000))     //바코드 못읽었을때 상황.
                {
                    if (SEQ.BarcordLODR.GetText() == "")
                    {
                        ER_SetErr(ei.PRT_Barcode, "Barcode Reading Failed");
                        return(true);
                    }
                }
                if (SEQ.BarcordLODR.GetText() == "")
                {
                    return(false);
                }

                //temp
                //SEQ.LODR.iLDRSplyCnt++;

                if (SPC.LOT.Data.TrayNo == "")
                {
                    SPC.LOT.Data.TrayNo = SEQ.BarcordLODR.GetText();
                }
                OM.EqpStat.sTrayLabel = SEQ.BarcordLODR.GetText();

                if (!OM.CmnOptn.bOracleNotUse)
                {
                    if (!SEQ.Oracle.ProcessTrayLabel(OM.EqpStat.sTrayLabel))
                    {
                        SM.ER_SetErr(ei.ETC_Oracle, SEQ.Oracle.GetLastMsg());
                        Log.Trace("Oracle Fail Message", SEQ.Oracle.GetLastMsg());
                        return(true);
                    }

                    //쓰레드로 돌린다 PanelID가 많을때 10만개 정도...
                    SEQ.Oracle.ThreadMakePanelIDList();
                }

                Step.iCycle++;
                return(false);

            case 15:
                if (!OM.CmnOptn.bOracleNotUse)
                {
                    //쓰레드로 돌린다 PanelID가 많을때 10만개 정도...
                    if (COracle.bMakingPanelList)
                    {
                        return(false);
                    }
                    if (!COracle.bMakePanelListRet)
                    {
                        ER_SetErr(ei.ETC_Oracle, SEQ.Oracle.GetLastMsg());
                        return(true);
                    }
                }
                MoveCyl(ci.IDXR_ClampClOp, fb.Fwd);
                Step.iCycle++;
                return(false);

            case 16:
                if (!CL_Complete(ci.IDXR_ClampClOp, fb.Fwd))
                {
                    return(false);
                }
                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1);
                Step.iCycle++;
                return(false);

            case 17:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1))
                {
                    return(false);
                }
                DM.ARAY[ri.IDXR].ChangeStat(cs.Unknown, cs.Vision);
                Step.iCycle = 0;
                return(true);



            //골든디바이스 및 빈트레이일때 위에서 씀.
            case 50:
                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1);
                Step.iCycle++;
                return(false);

            case 51:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1))
                {
                    return(false);
                }
                MoveCyl(ci.IDXR_ClampClOp, fb.Bwd);     //레일 초기 진입시에 크리퍼랑 레일이랑 찐따지는것 방지용. 한번 풀었다 잡는다.
                Step.iCycle++;
                return(false);

            case 52:
                if (!CL_Complete(ci.IDXR_ClampClOp, fb.Bwd))
                {
                    return(false);
                }
                MoveCyl(ci.IDXR_ClampClOp, fb.Fwd);
                Step.iCycle++;
                return(false);

            case 53:
                if (!CL_Complete(ci.IDXR_ClampClOp, fb.Fwd))
                {
                    return(false);
                }


                //골드트레이가 아니고서.
                if (!OM.CmnOptn.bGoldenTray)
                {
                    DM.ARAY[ri.IDXR].ChangeStat(cs.Unknown, cs.Empty);
                    if (OM.CmnOptn.iInspCrvrTray == (int)vi.One)
                    {
                        DM.ARAY[ri.IDXR].SetStat(OM.DevInfo.iTRAY_PcktCntX - 1, 0, cs.Vision);
                    }
                    else if (OM.CmnOptn.iInspCrvrTray == (int)vi.Col)
                    {
                        for (int i = 0; i < OM.DevInfo.iTRAY_PcktCntY; i++)
                        {
                            DM.ARAY[ri.IDXR].SetStat(OM.DevInfo.iTRAY_PcktCntX - 1, i, cs.Vision);
                        }
                    }
                    else if (OM.CmnOptn.iInspCrvrTray == (int)vi.All)
                    {
                        DM.ARAY[ri.IDXR].SetStat(cs.Vision);
                    }
                    else
                    {
                        DM.ARAY[ri.IDXR].SetStat(cs.Vision);
                    }
                }
                else
                {
                    DM.ARAY[ri.IDXR].ChangeStat(cs.Unknown, cs.Vision);
                }
                Step.iCycle = 0;
                return(true);


            //아이들 러닝용 위애서 씀.
            case 100:
                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearBarcode);
                Step.iCycle++;
                return(false);

            case 101:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearBarcode))
                {
                    return(false);
                }
                MoveMotr(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1);
                Step.iCycle++;
                return(false);

            case 102:
                if (!MT_GetStopPos(mi.IDXR_XRear, pv.IDXR_XRearVsnStt1))
                {
                    return(false);
                }
                DM.ARAY[ri.IDXR].ChangeStat(cs.Unknown, cs.Vision);
                Step.iCycle = 0;
                return(true);
            }
        }