Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DcmStatus"/> class.
        /// </summary>
        /// <param name="code">The code.</param>
        /// <param name="status">The status.</param>
        /// <param name="desc">The desc.</param>
        public DcmStatus(string code, DcmState status, string desc)
        {
            Code = ushort.Parse(code.Replace('x', '0'), System.Globalization.NumberStyles.HexNumber);

            StringBuilder msb = new StringBuilder();

            msb.Append(code.ToLower());
            msb.Replace('0', 'F').Replace('1', 'F').Replace('2', 'F')
            .Replace('3', 'F').Replace('4', 'F').Replace('5', 'F')
            .Replace('6', 'F').Replace('7', 'F').Replace('8', 'F')
            .Replace('9', 'F').Replace('a', 'F').Replace('b', 'F')
            .Replace('c', 'F').Replace('d', 'F').Replace('e', 'F')
            .Replace('x', '0');
            Mask = ushort.Parse(msb.ToString(), System.Globalization.NumberStyles.HexNumber);

            State       = status;
            Description = desc;
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DcmStatus"/> class.
 /// </summary>
 /// <param name="code">The code.</param>
 /// <param name="status">The status.</param>
 /// <param name="desc">The desc.</param>
 /// <param name="comment">The comment.</param>
 public DcmStatus(string code, DcmState status, string desc, string comment) : this(code, status, desc)
 {
     ErrorComment = comment;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DcmStatus"/> class.
 /// </summary>
 /// <param name="code">The code.</param>
 /// <param name="status">The status.</param>
 /// <param name="desc">The desc.</param>
 /// <param name="comment">The comment.</param>
 public DcmStatus(string code, DcmState status, string desc, string comment)
     : this(code, status, desc)
 {
     ErrorComment = comment;
 }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DcmStatus"/> class.
        /// </summary>
        /// <param name="code">The code.</param>
        /// <param name="status">The status.</param>
        /// <param name="desc">The desc.</param>
        public DcmStatus(string code, DcmState status, string desc)
        {
            Code = ushort.Parse(code.Replace('x', '0'), System.Globalization.NumberStyles.HexNumber);

            StringBuilder msb = new StringBuilder();
            msb.Append(code.ToLower());
            msb.Replace('0', 'F').Replace('1', 'F').Replace('2', 'F')
                .Replace('3', 'F').Replace('4', 'F').Replace('5', 'F')
                .Replace('6', 'F').Replace('7', 'F').Replace('8', 'F')
                .Replace('9', 'F').Replace('a', 'F').Replace('b', 'F')
                .Replace('c', 'F').Replace('d', 'F').Replace('e', 'F')
                .Replace('x', '0');
            Mask = ushort.Parse(msb.ToString(), System.Globalization.NumberStyles.HexNumber);

            State = status;
            Description = desc;
        }