public static bool InspectActuator() { //Local Var. bool isOk = true; bool isErr = false; //Inspect. for (int i = 0; i < (int)ci.MAX_ACTR; i++) { isErr = ML.CL_Err((ci)i); if (isErr) { ML.ER_SetErr(ei.ATR_TimeOut, ML.CL_GetName((ci)i)); isOk = false; } } //Ok. return(isOk); }
private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; bool bCmd = ML.CL_GetCmd(m_iActrId) == 0 ? true : false; bool bErr = ML.CL_Err(m_iActrId); bool bDone = ML.CL_Complete(m_iActrId); bool bDoneFwd = ML.CL_Complete(m_iActrId, fb.Fwd); bool bDoneBwd = ML.CL_Complete(m_iActrId, fb.Bwd); //if (bDone) //{ // lbFwd.BackColor = bCmd ? Color.ForestGreen : SystemColors.Control; // lbBwd.BackColor = bCmd ? SystemColors.Control : Color.ForestGreen ; //} if (bErr) { lbBwd.BackColor = Color.Red; lbFwd.BackColor = Color.Red; } if (bCmd != m_bPreCmd) { if ((int)ML.CL_GetCmd(m_iActrId) == 0) { lbFwd.BackColor = Color.ForestGreen; lbBwd.BackColor = SystemColors.Control; } else { lbBwd.BackColor = Color.ForestGreen; lbFwd.BackColor = SystemColors.Control; } } m_bPreCmd = bCmd; if (!this.Visible) { tmUpdate.Enabled = false; return; } tmUpdate.Enabled = true; }
private void tmUpdate_Tick(object sender, EventArgs e) { tmUpdate.Enabled = false; bool bCmd = ML.CL_GetCmd(m_iActrId) == 0 ? true : false; bool bErr = ML.CL_Err(m_iActrId); bool bDone = ML.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)ML.CL_GetCmd(m_iActrId) == 0) { btAction.ImageIndex = iFwd; btAction.Text = sFwd; } else { btAction.ImageIndex = iBwd; btAction.Text = sBwd; } } m_bPreCmd = bCmd; if (!this.Visible) { tmUpdate.Enabled = false; return; } tmUpdate.Enabled = true; }