示例#1
0
 //--------------------------------------------------------------------------
 public bool MoveCyl(int aNum, int Act)
 {
     //Run Actuator.
     if (aNum < 0 || aNum >= m_iNumOfACT)
     {
         return(false);
     }
     if (!SEQ.fn_CheckDstbActr(aNum, Act))
     {
         return(false);
     }
     return(Actuator[aNum].Run(Act));
 }
示例#2
0
        //--------------------------------------------------------------------------
        //Update.
        public void fn_Update()
        {
            bool isOk = true;

            for (int i = 0; i < m_iNumOfACT; i++)
            {
                Actuator[i].Update();

                //Check Actuator Status.
                if (Err(i) == 1)
                {
                    m_bRptActr[i] = false;
                }

                //Changing Timer.
                if (!m_bRptActrIng)
                {
                    continue;
                }
                if (m_bRptActr[i])
                {
                    if (!SEQ.fn_CheckDstbActr(i, m_iRptCmd))
                    {
                        m_bRptActrIng = false; continue;
                    }
                    MoveCyl(i, m_iRptCmd);
                    if (!Complete(i, m_iRptCmd))
                    {
                        isOk = false;
                    }
                }
            }

            m_ChngActrOnTimer.OnDelay(isOk, m_iChngActrDlay);
            if (m_ChngActrOnTimer.Out)
            {
                m_ChngActrOnTimer.Clear();
                if (m_iRptCmd == (int)EN_ACTR_CMD.Fwd)
                {
                    m_iRptCmd = (int)EN_ACTR_CMD.Bwd;
                }
                else
                {
                    m_iRptCmd = (int)EN_ACTR_CMD.Fwd;
                }
            }
        }