示例#1
0
        public static bool  InspectActuator()
        {
            //Local Var.
            bool isOk  = true;
            bool isErr = false;

            //Inspect.
            for (ci i = 0; i < ci.MAX_ACTR; i++)
            {
                isErr = SM.CL_Err(i);
                if (isErr)
                {
                    SM.ER_SetErr(ei.ATR_TimeOut, SM.CL_GetName(i)); isOk = false;
                }
            }

            //Ok.
            return(isOk);
        }
示例#2
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;
        }
示例#3
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;
        }