Ejemplo n.º 1
0
        /// <summary>
        /// 获取主站系统命令信息
        /// </summary>
        /// <param name="id">类型ID</param>
        /// <param name="dataArray">原始字节数组</param>
        public void GetMasterComand(TypeIdentification id, byte[] dataArray)
        {
            try
            {
                var cmd = new MasterCommand(dataArray);
                switch (id)
                {
                //主站系统命令
                case TypeIdentification.C_IC_NA_1:      //总召唤/组召唤
                {
                    MasterInterrogationArrived(this, new MasterCommmadEventArgs(cmd));

                    break;
                }

                case TypeIdentification.C_RP_NA_1:       //复位进程命令
                {
                    MasterResetArrived(this, new MasterCommmadEventArgs(cmd));
                    break;
                }

                case TypeIdentification.M_EI_NA_1:      //初始化结束
                {
                    MasterInitializeArrived(this, new MasterCommmadEventArgs(cmd));
                    break;
                }

                case TypeIdentification.C_CS_NA_1:     //时钟同步
                {
                    MasterTimeArrived(this, new MasterCommmadEventArgs(cmd));
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 主站系统命令
 /// </summary>
 /// <param name="cmd">系统命令</param>
 public MasterCommmadEventArgs(MasterCommand cmd)
 {
     MasterCMD = cmd;
 }