コード例 #1
0
        public string onMainAlarm(string mAlarmCode, params object[] args)
        {
            MainAlarm mainAlarm = mainAlarmDao.getMainAlarmByCode(mAlarmCode);
            bool      isAlarm   = false;
            string    msg       = string.Empty;

            try
            {
                if (mainAlarm != null)
                {
                    isAlarm = mainAlarm.CODE.StartsWith("A");
                    msg     = string.Format(mainAlarm.DESCRIPTION, args);
                    if (isAlarm)
                    {
                        msg = string.Format("[{0}]{2}", mainAlarm.CODE, Environment.NewLine, msg);
                        BCFApplication.onErrorMsg(msg);
                    }
                    else
                    {
                        msg = string.Format("[{0}]{2}", mainAlarm.CODE, Environment.NewLine, msg);
                        BCFApplication.onWarningMsg(msg);
                    }
                }
                else
                {
                    logger.Warn(string.Format("LFC alarm/warm happen, but no defin remark code:[{0}] !!!", mAlarmCode));
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception:");
            }
            return(msg);
        }
コード例 #2
0
 /// <summary>
 /// MPLCs the handshake timeout.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="ErrorEventArgs"/> instance containing the event data.</param>
 private void mplcHandshakeTimeout(object sender, ErrorEventArgs e)
 {
     BCFApplication.onErrorMsg(String.Format("MPLC Handshake Timeout: {0}", e.ErrorMsg));
 }