Ejemplo n.º 1
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            bool bCmd     = SM.CL_GetCmd(m_iActrId) == fb.Bwd ? true : false;
            bool bErr     = SM.CL_Err(m_iActrId);
            bool bDone    = SM.CL_Complete(m_iActrId);
            bool bDoneFwd = SM.CL_Complete(m_iActrId, fb.Fwd);
            bool bDoneBwd = SM.CL_Complete(m_iActrId, fb.Bwd);

            //if (bDone)
            //{
            //    lbFwd.BackColor = bCmd ? Color.ForestGreen    : SystemColors.Control;
            //    lbBwd.BackColor = bCmd ? SystemColors.Control : Color.ForestGreen   ;
            //}
            if (bErr)
            {
                lbFwd.BackColor = Color.Red;
                lbBwd.BackColor = Color.Red;
            }


            if (bCmd != m_bPreCmd)
            {
                if (SM.CL_GetCmd(m_iActrId) == fb.Bwd)
                {
                    lbBwd.BackColor = Color.ForestGreen; lbFwd.BackColor = SystemColors.Control;
                }
                else
                {
                    lbFwd.BackColor = Color.ForestGreen; lbBwd.BackColor = SystemColors.Control;
                }
            }

            m_bPreCmd        = bCmd;
            tmUpdate.Enabled = true;
        }
Ejemplo n.º 2
0
        private void tmUpdate_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            bool bCmd  = SM.CL_GetCmd(m_iActrId) == 0 ? true : false;
            bool bErr  = SM.CL_Err(m_iActrId);
            bool bDone = SM.CL_Complete(m_iActrId);

            if (bDone)
            {
                btAction.ForeColor = Color.Lime;
            }
            else if (bErr)
            {
                btAction.ForeColor = Color.Red;
            }
            else
            {
                btAction.ForeColor = Color.Black;
            }

            if (bCmd != m_bPreCmd)
            {
                if ((int)SM.CL_GetCmd(m_iActrId) == 0)
                {
                    btAction.ImageIndex = iFwd; btAction.Text = sFwd;
                }
                else
                {
                    btAction.ImageIndex = iBwd; btAction.Text = sBwd;
                }
            }

            m_bPreCmd        = bCmd;
            tmUpdate.Enabled = true;
        }
Ejemplo n.º 3
0
        private void tmRot_Tick(object sender, EventArgs e)
        {
            if (iActionID != 0 && iActionID != iPreActionID)
            {
                iActionStep = 10;
                m_tmCycle.Clear();
            }
            iPreActionID = iActionID;

            if (iActionID == 0)
            {
                return;
            }

            string sTemp = "";

            if (m_tmCycle.OnDelay(iActionStep != 0 && iActionStep == iActionPreStep, 4000))
            {
                sTemp = string.Format("iActionStep={0:00}", iActionStep);
                Log.Trace("OperAction TimeOver", sTemp);
                iActionID = 0;
            }

            iActionPreStep = iActionStep;
            switch (iActionStep)
            {
            default:
                sTemp = string.Format("Cycle Default iActionStep={0:00}", iActionStep);
                if (iActionPreStep == iActionStep)
                {
                    Log.Trace("OperAction", sTemp);
                }
                iActionID = 0;
                return;

            case 10:
                if (iActionID == 1)
                {
                    iActionStep = 100;
                }
                if (iActionID == 2)
                {
                    iActionStep = 200;
                }
                if (iActionID == 3)
                {
                    iActionStep = 300;
                }
                if (iActionID == 4)
                {
                    iActionStep = 400;
                }
                return;

            //Unclamp IDXF
            case 100:
                SEQ.IDXF.MoveCyl(ci.IDXF_ClampClOp, fb.Bwd);
                iActionStep++;
                return;

            case 101:
                if (!SM.CL_Complete(ci.IDXF_ClampClOp, fb.Bwd))
                {
                    return;
                }
                SEQ.IDXF.MoveCyl(ci.IDXF_ClampUpDn, fb.Bwd);
                iActionStep++;
                return;

            case 102:
                if (!SM.CL_Complete(ci.IDXF_ClampUpDn, fb.Bwd))
                {
                    return;
                }
                iActionID = 0;
                return;

            //Unclamp IDXR
            case 200:
                SEQ.IDXR.MoveCyl(ci.IDXR_ClampClOp, fb.Bwd);
                iActionStep++;
                return;

            case 201:
                if (!SM.CL_Complete(ci.IDXR_ClampClOp, fb.Bwd))
                {
                    return;
                }
                SEQ.IDXR.MoveCyl(ci.IDXR_ClampUpDn, fb.Bwd);
                iActionStep++;
                return;

            case 202:
                if (!SM.CL_Complete(ci.IDXR_ClampUpDn, fb.Bwd))
                {
                    return;
                }
                iActionID = 0;
                return;

            //clamp IDXF
            case 300:
                SEQ.IDXF.MoveCyl(ci.IDXF_ClampUpDn, fb.Fwd);
                iActionStep++;
                return;

            case 301:
                if (!SM.CL_Complete(ci.IDXF_ClampUpDn, fb.Fwd))
                {
                    return;
                }
                SEQ.IDXF.MoveCyl(ci.IDXF_ClampClOp, fb.Fwd);
                iActionStep++;
                return;

            case 302:
                if (!SM.CL_Complete(ci.IDXF_ClampClOp, fb.Fwd))
                {
                    return;
                }
                iActionID = 0;
                return;


            //clamp IDXR
            case 400:
                SEQ.IDXR.MoveCyl(ci.IDXR_ClampUpDn, fb.Fwd);
                iActionStep++;
                return;

            case 401:
                if (!SM.CL_Complete(ci.IDXR_ClampUpDn, fb.Fwd))
                {
                    return;
                }
                SEQ.IDXR.MoveCyl(ci.IDXR_ClampClOp, fb.Fwd);
                iActionStep++;
                return;

            case 402:
                if (!SM.CL_Complete(ci.IDXR_ClampClOp, fb.Fwd))
                {
                    return;
                }
                iActionID = 0;
                return;
            }
        }
Ejemplo n.º 4
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            tmUpdate.Enabled = false;

            //로그인/로그아웃 방식
            if (SML.FrmLogOn.GetLevel() == (int)EN_LEVEL.LogOff)
            {
                btOperator.Text   = "LOG IN";
                pnDataMap.Enabled = false;
                //pnDayInfo .Enabled = false;
                pnLotInfo.Enabled = false;
                pnError.Enabled   = false;
                pnOperMan.Enabled = false;
                //pnWorkInfo.Enabled = false;
                pnLotOpen.Enabled = false;
                //btStart   .Enabled = LOT.LotList.Count == 0 || !LOT.LotOpened;
                btStart.Enabled      = false;
                btStop.Enabled       = false;
                btReset.Enabled      = false;
                btLightOnOff.Enabled = false;
                btOperator.Enabled   = true;
            }
            else
            {
                btOperator.Text   = SML.FrmLogOn.GetLevel().ToString();
                pnDataMap.Enabled = true;
                //pnDayInfo .Enabled = true;
                pnLotInfo.Enabled = true;
                pnError.Enabled   = true;
                pnOperMan.Enabled = true;
                //pnWorkInfo.Enabled = true;
                pnLotOpen.Enabled = true;
                //btStart   .Enabled = LOT.LotList.Count != 0 || LOT.LotOpened;
                btStart.Enabled      = true;
                btStop.Enabled       = true;
                btReset.Enabled      = true;
                btLightOnOff.Enabled = true;
            }



            btLotOpen.Enabled = !LOT.GetLotOpen();


            lbDate.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            TimeSpan Span;

            try{
                Span = TimeSpan.FromMilliseconds(SPC.LOT.Data.RunTime);
            }
            catch (Exception ex) {
                Span = TimeSpan.FromMilliseconds(0);
            }
            //label11.Text = OM.EqpStat.iLDRSplyCnt.ToString() ;

            string Str;
            int    iPreErrCnt  = 0;
            int    iCrntErrCnt = 0;

            for (int i = 0; i < SML.ER._iMaxErrCnt; i++)
            {
                if (SML.ER.GetErr(i))
                {
                    iCrntErrCnt++;
                }
            }
            if (iPreErrCnt != iCrntErrCnt)
            {
                lbErr.Items.Clear();
                int iErrNo = SM.ER_GetLastErr();
                for (int i = 0; i < SML.ER._iMaxErrCnt; i++)
                {
                    if (SML.ER.GetErr(i))
                    {
                        Str  = string.Format("[ERR{0:000}]", i);
                        Str += SML.ER.GetErrName(i) + " " + SML.ER.GetErrSubMsg(i);
                        lbErr.Items.Add(Str);
                    }
                }
            }
            if (SEQ._iSeqStat != EN_SEQ_STAT.Error)
            {
                lbErr.Items.Clear();
            }
            iPreErrCnt = iCrntErrCnt;


            if (!SM.MT_GetHomeDoneAll())
            {
                btAllHome.ForeColor = SEQ._bFlick ? Color.Black : Color.Red;
            }
            else
            {
                btAllHome.ForeColor = Color.Black;
            }

            SPC.LOT.DispLotInfo(lvLotInfo);

            btInputTrayF.Enabled   = !SEQ._bRun;
            btInputTrayG.Enabled   = !SEQ._bRun;
            btAllEmptyTray.Enabled = !SEQ._bRun;
            btBarCodeReTry.Enabled = !SEQ._bRun;

            if (SM.IO_GetX(xi.BARZ_PckrVac))
            {
                lbBarVac.BackColor = Color.Lime;
            }
            else
            {
                lbBarVac.BackColor = Color.Red;
            }

            //JS
            //Manual Button Text.
            if (SM.CL_GetCmd(ci.LODR_ClampClOp) == fb.Bwd)
            {
                btCylinder1.Text = "Loader Clamp OPEN";
            }
            else
            {
                btCylinder1.Text = "Loader Clamp CLOSE";
            }
            btCylinder1.ForeColor = SM.CL_Complete(ci.LODR_ClampClOp) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.LODR_SperatorUpDn) == fb.Bwd)
            {
                btCylinder2.Text = "Loader Sperator DOWN";
            }
            else
            {
                btCylinder2.Text = "Loader Sperator Up";
            }
            btCylinder2.ForeColor = SM.CL_Complete(ci.LODR_SperatorUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.IDXR_ClampClOp) == fb.Bwd)
            {
                btCylinder4.Text = "Index Rear Clamp OPEN";
            }
            else
            {
                btCylinder4.Text = "Index Rear Clamp CLOSE";
            }
            btCylinder4.ForeColor = SM.CL_Complete(ci.IDXR_ClampClOp) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.IDXR_ClampUpDn) == fb.Bwd)
            {
                btCylinder5.Text = "Index Rear Clamp DOWN";
            }
            else
            {
                btCylinder5.Text = "Index Rear Clamp UP";
            }
            btCylinder5.ForeColor = SM.CL_Complete(ci.IDXR_ClampUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.IDXF_ClampClOp) == fb.Bwd)
            {
                btCylinder6.Text = "Index Front Clamp OPEN";
            }
            else
            {
                btCylinder6.Text = "Index Front Clamp CLOSE";
            }
            btCylinder6.ForeColor = SM.CL_Complete(ci.IDXF_ClampClOp) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.IDXF_ClampUpDn) == fb.Bwd)
            {
                btCylinder3.Text = "Index Front Clamp DOWN";
            }
            else
            {
                btCylinder3.Text = "Index Front Clamp UP";
            }
            btCylinder3.ForeColor = SM.CL_Complete(ci.IDXF_ClampUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.STCK_RailClOp) == fb.Bwd)
            {
                btCylinder7.Text = "Tray Rail      OPEN";
            }
            else
            {
                btCylinder7.Text = "Tray Rail      CLOSE";
            }
            btCylinder7.ForeColor = SM.CL_Complete(ci.STCK_RailClOp) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.STCK_RailTrayUpDn) == fb.Bwd)
            {
                btCylinder8.Text = "Stacker Rail Tray DOWN";
            }
            else
            {
                btCylinder8.Text = "Stacker Rail Tray UP";
            }
            btCylinder8.ForeColor = SM.CL_Complete(ci.STCK_RailTrayUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.STCK_StackStprUpDn) == fb.Bwd)
            {
                btCylinder9.Text = "Stacker Stopper DOWN";
            }
            else
            {
                btCylinder9.Text = "Stacker Stopper UP";
            }
            btCylinder9.ForeColor = SM.CL_Complete(ci.STCK_StackStprUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.STCK_StackOpCl) == fb.Bwd)
            {
                btCylinder10.Text = "Stacker Rail     CLOSE";
            }
            else
            {
                btCylinder10.Text = "Stacker Rail     OPEN";
            }
            btCylinder10.ForeColor = SM.CL_Complete(ci.STCK_StackOpCl) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.BARZ_BrcdStprUpDn) == fb.Bwd)
            {
                btCylinder11.Text = "Barcode Stopper DOWN";
            }
            else
            {
                btCylinder11.Text = "Barcode Stopper UP";
            }
            btCylinder11.ForeColor = SM.CL_Complete(ci.BARZ_BrcdStprUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.BARZ_BrcdTrayUpDn) == fb.Bwd)
            {
                btCylinder12.Text = "Barcode Tray DOWN";
            }
            else
            {
                btCylinder12.Text = "Barcode Tray UP";
            }
            btCylinder12.ForeColor = SM.CL_Complete(ci.BARZ_BrcdTrayUpDn) ? Color.Black : Color.Lime;

            if (SM.CL_GetCmd(ci.BARZ_YPckrFwBw) == fb.Bwd)
            {
                btCylinder13.Text = "Barcode Picker BWD";
            }
            else
            {
                btCylinder13.Text = "Barcode Picker FWD";
            }
            btCylinder13.ForeColor = SM.CL_Complete(ci.BARZ_YPckrFwBw)    ? Color.Black : Color.Lime;

            btManual1.ForeColor = (MM.GetManNo() == mc.LODR_Home) ? Color.Lime : Color.Black;
            btManual2.ForeColor = (MM.GetManNo() == mc.TOOL_Home) ? Color.Lime : Color.Black;
            btManual3.ForeColor = (MM.GetManNo() == mc.BARZ_Home) ? Color.Lime : Color.Black;
            btManual4.ForeColor = (MM.GetManNo() == mc.IDXR_Home) ? Color.Lime : Color.Black;
            btManual5.ForeColor = (MM.GetManNo() == mc.IDXF_Home) ? Color.Lime : Color.Black;
            btManual6.ForeColor = (MM.GetManNo() == mc.STCK_Home) ? Color.Lime : Color.Black;

            Refresh();
            tmUpdate.Enabled = true;
        }