Exemple #1
0
        private void btPos_MouseDown(object sender, MouseEventArgs e)
        {
            string sTemp;
            bool   bRet    = true;
            int    iBtnTag = Convert.ToInt32(((Button)sender).Tag);
            uint   uPstnNo = (uint)iBtnTag;

            //if (!CheckSafe(m_iMotrNo)) return;
            //if (m_iId == (int)mi.IDX_X) bRet = SEQ.IDX.CheckSafe((mi)m_iId, uPstnNo);
            //if (m_iId == (int)mi.PCK_Y) bRet = SEQ.PCK.CheckSafe((mi)m_iId, uPstnNo);
            //if (m_iId == (int)mi.PCK_Z) bRet = SEQ.PCK.CheckSafe((mi)m_iId, uPstnNo);

            if (!bRet)
            {
                return;
            }
            SM.MT_Stop(m_eId);

            sTemp = m_eId.ToString();


            if (SEQ._iSeqStat == EN_SEQ_STAT.Manual)
            {
                Log.ShowMessage("ERROR", "Doing Manual Cycle");
                return;
            }
            else
            {
                Log.Trace("Operator", ("FrameMotr Form_" + sTemp + "Motor Pos Move Button Click"));

                if (!cbSlow.Checked)
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        SM.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        SM.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        SM.MT_GoIncMan(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    if (Para.iUnitType == (int)EN_UNIT_TYPE.utJog)
                    {
                        SM.MT_JogP(m_eId);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utMove)
                    {
                        SM.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else if (Para.iUnitType == (int)EN_UNIT_TYPE.utPitch)
                    {
                        SM.MT_GoIncSlow(m_eId, Para.dUnit);
                    }
                    else
                    {
                        return;
                    }
                }
            }
        }