コード例 #1
0
        private void btAction_Click(object sender, EventArgs e)
        {
            fb sCylderPos = 0;

            if (SM.CL_GetCmd(m_iActrId) == 0)
            {
                sCylderPos = fb.Fwd;
            }
            else
            {
                sCylderPos = fb.Bwd;
            }

            SM.CL_Move(m_iActrId, sCylderPos);

            string sMsg = "FrameCyl Form_Cylinder Move Button Click" + SM.CL_GetName(m_iActrId).ToString();

            sMsg += SM.CL_GetCmd(m_iActrId) == 0 ? "(Fwd)" : "(Bwd)";

            Log.Trace("Operator", sMsg);
        }
コード例 #2
0
ファイル: ManualMan.cs プロジェクト: zoro-008/Works
        //Manual Processing.
        public static bool SetManCycle(mc _iNo)
        {
            m_iCrntManNo = m_iManNo;

            if (_iNo < 0)
            {
                Log.ShowMessage("ERROR", "Wrong Manual No"); return(false);
            }
            if (_iNo >= mc.MAX_MANUAL_CYCLE)
            {
                Log.ShowMessage("ERROR", "Wrong Manual No"); return(false);
            }
            if (m_iManNo != mc.NoneCycle)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle"); return(false);
            }
            if (SEQ._bRun)
            {
                Log.ShowMessage("ERROR", "Autorunning"); return(false);
            }
            if (_iNo != mc.AllHome && !SEQ.InspectHomeDone())
            {
                return(false);
            }

            //Check Alarm.
            //if (SM.ER.IsErr()) { Init(); return false; } //아 밑에 처리 하는 애 때문에 잠시 이렇게 함.          //test

            //    if(!IO_GetX(xETC_MainPower) ) {FM_MsgOk("ERR","Power On Plz");      return false ;} //test
            //if (!SM.IO.GetX((int)EN_INPUT_ID.xETC_MainAirChk)) { MessageBox.Show("Check Main Air!", "ERROR"); return false; } //test
            m_bStdCalPick = false; //   mcLDR_FHome
            //   mcLDR_RHome
            m_bManSetting = true;  //SetManCycle함수는 화면 쓰레드. 업데이트 함수에서 다른쓰레드로 들어와서 갱신하기에 플레그 걸어 막아둠.    //   mcIDX_Home
            m_iManNo      = _iNo;

            //   mcLTL_Home
            //   mcRTL_Home

            //SM.ER.SetDisp(true);

            bool bRet = true;                                                                                                                //   mcSTG_Home

            //   mcULD_Home
            /********************/
            /* 프리프로세서     */
            /********************/
            if (m_iManNo == mc.NoneCycle)
            {
                bRet = false;
            }
            else if (m_iManNo == mc.AllHome)
            {
            }
            else if (m_iManNo == mc.IDX_Home)
            {
            }


            else if (m_iManNo == mc.IDX_CycleWork)
            {
            }
            else if (m_iManNo == mc.IDX_CycleOut)
            {
            }
            //else if (m_iManNo == mc.IDX_CycleSupply    ) { }
            else if (m_iManNo == mc.IDX_CycleManSttWait)
            {
            }

            else if (m_iManNo == mc.IDX_HolderFwd)
            {
            }
            else if (m_iManNo == mc.IDX_HolderBwd)
            {
            }
            else if (m_iManNo == mc.IDX_CutterFwd)
            {
            }
            else if (m_iManNo == mc.IDX_CutterBwd)
            {
            }

            if (!bRet)
            {
                Init();
            }

            /********************/
            /* 처리..           */
            /********************/

            if (m_iManNo == mc.NoneCycle)
            {
            }
            else if (m_iManNo == mc.AllHome)
            {
                SM.MT_SetServoAll(true);
                SEQ.IDX.InitHomeStep();
                //SEQ.PCK.InitHomeStep();
                //LTL.InitHomeStep();
                //RTL.InitHomeStep();
                //STG.InitHomeStep();
                //ULD.InitHomeStep();
            }
            else if (m_iManNo == mc.IDX_CycleWork)
            {
                SEQ.IDX.InitCycleStep();
            }
            else if (m_iManNo == mc.IDX_CycleOut)
            {
                SEQ.IDX.InitCycleStep();
            }
            else if (m_iManNo == mc.IDX_CycleManSttWait)
            {
                SEQ.IDX.InitCycleStep();
            }

            else if (m_iManNo == mc.IDX_HolderFwd)
            {
                SM.CL_Move(ci.IDX_Hold1UpDn, fb.Fwd);
                SM.CL_Move(ci.IDX_Hold2UpDn, fb.Fwd);
                SM.CL_Move(ci.IDX_TwstLtDnUp, fb.Fwd);
                SM.CL_Move(ci.IDX_TwstRtDnUp, fb.Fwd);
            }
            else if (m_iManNo == mc.IDX_HolderBwd)
            {
                SM.CL_Move(ci.IDX_Hold1UpDn, fb.Bwd);
                SM.CL_Move(ci.IDX_Hold2UpDn, fb.Bwd);
                SM.CL_Move(ci.IDX_TwstLtDnUp, fb.Bwd);
                SM.CL_Move(ci.IDX_TwstRtDnUp, fb.Bwd);
            }
            else if (m_iManNo == mc.IDX_CutterFwd)
            {
                SM.CL_Move(ci.IDX_CutLtFwBw, fb.Fwd);
                SM.CL_Move(ci.IDX_CutRtFwBw, fb.Fwd);
                SM.CL_Move(ci.IDX_CutterDnUp, fb.Fwd);
                SM.CL_Move(ci.IDX_CutBaseUpDn, fb.Fwd);
            }
            else if (m_iManNo == mc.IDX_CutterBwd)
            {
                SM.CL_Move(ci.IDX_CutLtFwBw, fb.Bwd);
                SM.CL_Move(ci.IDX_CutRtFwBw, fb.Bwd);
                SM.CL_Move(ci.IDX_CutterDnUp, fb.Bwd);
                SM.CL_Move(ci.IDX_CutBaseUpDn, fb.Bwd);
            }

            m_bManSetting = false; //m_bManSetting 중요함 리턴전에 꼭 펄스 시켜야함. 쓰레드가 달라서. ::Update에서 m_iManNo=0이 되므로 주의.
            return(true);
        }