AsterixDisplayAnalyser.CAT34.ItemIDToIndex C# (CSharp) Метод

ItemIDToIndex() публичный статический Метод

public static ItemIDToIndex ( string ID ) : int
ID string
Результат int
        public static int ItemIDToIndex(string ID)
        {
            int index = 0;

            switch (ID)
            {
                case "010":
                    index = 0;
                    break;
                case "000":
                    index = 1;
                    break;
                case "030":
                    index = 2;
                    break;
                case "020":
                    index = 3;
                    break;
                case "041":
                    index = 4;
                    break;
                case "050":
                    index = 5;
                    break;
                case "060":
                    index = 6;
                    break;
                case "070":
                    index = 7;
                    break;
                case "100":
                    index = 8;
                    break;
                case "110":
                    index = 9;
                    break;
                case "120":
                    index = 10;
                    break;
                case "090":
                    index = 11;
                    break;
                default:
                    break;
            }

            return index;
        }

Usage Example

Пример #1
0
        public static void DecodeCAT34I060(byte[] Data)
        {
            // At this time we do not care about the content of CAT034I060.
            // However it is necessary to determine how many subfields of 8 octets
            // is present so that data buffer can be updated accordingly on order to
            // decode the other fileds of interest
            // NOTE: We assume that only first 7 defined subfuled

            // I034/050     Radar Plot Characteristics                          1 + 1+
            int Number_Of_Octets_Present = 1; // at least two, but that will be determined below

            // Decode 020
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("060")].HasBeenPresent == true)
            {
                // Get an instance of bit ops
                Bit_Ops BO = new Bit_Ops();

                //Extract the first octet
                BO.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT34.CurrentDataBufferOctalIndex + 1];

                // Now check how many data octets is present.
                if (BO.DWord[CAT34I060Types.Subfiled_1] == true)
                {
                    Number_Of_Octets_Present++;
                }
                if (BO.DWord[CAT34I060Types.Subfiled_2] == true)
                {
                    Number_Of_Octets_Present++;
                }
                if (BO.DWord[CAT34I060Types.Subfiled_3] == true)
                {
                    Number_Of_Octets_Present++;
                }
                if (BO.DWord[CAT34I060Types.Subfiled_4] == true)
                {
                    Number_Of_Octets_Present++;
                }
                if (BO.DWord[CAT34I060Types.Subfiled_5] == true)
                {
                    Number_Of_Octets_Present++;
                }
                if (BO.DWord[CAT34I060Types.Subfiled_6] == true)
                {
                    Number_Of_Octets_Present++;
                }
                if (BO.DWord[CAT34I060Types.Subfiled_7] == true)
                {
                    Number_Of_Octets_Present++;
                }

                // Increase data buffer index so it ready for the next data item.
                CAT34.CurrentDataBufferOctalIndex = CAT34.CurrentDataBufferOctalIndex + Number_Of_Octets_Present;
            }
        }
All Usage Examples Of AsterixDisplayAnalyser.CAT34::ItemIDToIndex