Ejemplo n.º 1
0
        public override string ToString()
        {
            string address;

            if (_is_logical)
            {
                if (_group_type == GROUP_LEVEL_FORMAT.GROUP_2_LEVEL_FORMAT)
                {
                    address  = MainGroup.ToString();
                    address += "/";
                    address += SubGroup11.ToString();
                }
                else
                {
                    address  = MainGroup.ToString();
                    address += "/";
                    address += MiddleGroup.ToString();
                    address += "/";
                    address += SubGroup8.ToString();
                }
                return(address);
            }
            address  = Zone.ToString();
            address += ".";
            address += Line.ToString();
            address += ".";
            address += Device.ToString();
            return(address);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fills the bit array with the corresponding values.
        /// </summary>
        /// <param name="bitArray">The bit array.</param>
        protected override void FillBitArray(BitArray bitArray)
        {
            bitArray[0] = false; // reserved for special addressing methods

            int currentIdx = 1;

            // add MAIN group (always 4-bit)
            foreach (bool bit in Group.ConvertToBits(4))
            {
                bitArray[currentIdx] = bit;
                currentIdx++;
            }

            // add MIDDLE group (3-bit, but it's not mandatory)
            if (MiddleGroup != null)
            {
                foreach (bool bit in MiddleGroup.ConvertToBits(3))
                {
                    bitArray[currentIdx] = bit;
                    currentIdx++;
                }
            }

            var length = (byte)((MiddleGroup != null) ? 8 : 11);

            foreach (bool bit in ((int)SubGroup).ConvertToBits(length))
            {
                bitArray[currentIdx] = bit;
                currentIdx++;
            }
        }
Ejemplo n.º 3
0
 public override string ToString()
 {
     return(MainGroup.ToString() + "/" + MiddleGroup.ToString() + "/" + SubGroup.ToString());
 }