AsterixDisplayAnalyser.CAT02I041UserData.DecodeCAT02I041 C# (CSharp) Method

DecodeCAT02I041() public static method

public static DecodeCAT02I041 ( byte Data ) : void
Data byte
return void
        public static void DecodeCAT02I041(byte[] Data)
        {
            // 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[CAT02.CurrentDataBufferOctalIndex + 2];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord] = Data[CAT02.CurrentDataBufferOctalIndex + 1];

             double Result = 0.0;

            if (BO.DWord[Bit_Ops.Bit0] == true)
                Result = LSB_1;
            if (BO.DWord[Bit_Ops.Bit1] == true)
                Result = Result + LSB_2;
            if (BO.DWord[Bit_Ops.Bit2] == true)
                Result = Result + LSB_3;
            if (BO.DWord[Bit_Ops.Bit3] == true)
                Result = Result + LSB_4;
            if (BO.DWord[Bit_Ops.Bit4] == true)
                Result = Result + LSB_5;
            if (BO.DWord[Bit_Ops.Bit5] == true)
                Result = Result + LSB_6;
            if (BO.DWord[Bit_Ops.Bit6] == true)
                Result = Result + LSB_7;
            if (BO.DWord[Bit_Ops.Bit7] == true)
                Result = Result + LSB_8;
            if (BO.DWord[Bit_Ops.Bit8] == true)
                Result = Result + LSB_9;
            if (BO.DWord[Bit_Ops.Bit9] == true)
                Result = Result + LSB_10;
            if (BO.DWord[Bit_Ops.Bit10] == true)
                Result = Result + LSB_11;
            if (BO.DWord[Bit_Ops.Bit11] == true)
                Result = Result + LSB_12;
            if (BO.DWord[Bit_Ops.Bit12] == true)
                Result = Result + LSB_13;
            if (BO.DWord[Bit_Ops.Bit13] == true)
                Result = Result + LSB_14;
            if (BO.DWord[Bit_Ops.Bit14] == true)
                Result = Result + LSB_15;
            if (BO.DWord[Bit_Ops.Bit15] == true)
                Result = Result + LSB_16;

             //////////////////////////////////////////////////////////////////////////////////
            // Now assign it to the generic list
            CAT02.I002DataItems[CAT02.ItemIDToIndex("041")].value = Result;
            //////////////////////////////////////////////////////////////////////////////////

            // Leave it at the current index for the next decode
            CAT02.CurrentDataBufferOctalIndex = CAT02.CurrentDataBufferOctalIndex + 2;
        }

Usage Example

Example #1
0
        // This method will accept a buffer of data with the assumption that
        // category has been determined. It will then decode the data and save
        // it in the shared buffer. Every time a message is passed in the data
        // will be appended to the buffer. This means that each line will contain
        // data for one message. For data items which are not in the message,
        // indicated by the FSPEC field, N/A will be inserted instead. The shared
        // buffer is loacted in the SharedData and will not be saved. It is responsibility
        // of the user to save the data in a file it desired.
        public static void Do(byte[] Data)
        {
            // BitExtractor BE = new BitExtractor();

            // I002/000, Message Type                        1
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("000")].CurrentlyPresent == true)
            {
                CAT02I000UserData.DecodeCAT02I000(Data);
            }

            //  I002/020 Sector Number                       1
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("020")].CurrentlyPresent == true)
            {
                CAT02I020UserData.DecodeCAT02I020(Data);
            }

            //  I002/030 Time of Day                         3
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("030")].CurrentlyPresent == true)
            {
                CAT02I030UserData.DecodeCAT02I030(Data);
            }

            //  I002/041 Antenna Rotation Period             2
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("041")].CurrentlyPresent == true)
            {
                CAT02I041UserData.DecodeCAT02I041(Data);
            }
            //  I002/050 Station Configuration Status        1+
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("050")].CurrentlyPresent == true)
            {
                CAT02I050UserData.DecodeCAT02I050(Data);
            }

            //  I002/060 Station Processing Mode             1+
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("060")].CurrentlyPresent == true)
            {
                CAT02I060UserData.DecodeCAT02I060(Data);
            }

            //  FX Field Extension Indicator

            //  I002/070 Plot Count Values                   (1 + 2 X N)
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("070")].CurrentlyPresent == true)
            {
                CAT02I070UserData.DecodeCAT02I070(Data);
            }

            //  I002/100 Dynamic Window - Type 1             8
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("100")].CurrentlyPresent == true)
            {
                CAT02I100UserData.DecodeCAT02I100(Data);
            }

            //  I002/090 Collimation Error 2
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("090")].CurrentlyPresent == true)
            {
                CAT02I090UserData.DecodeCAT02I090(Data);
            }

            //  I002/080 Warning/Error Conditions            1+
            if (CAT02.I002DataItems[CAT02.ItemIDToIndex("080")].CurrentlyPresent == true)
            {
                CAT02I080UserData.DecodeCAT02I080(Data);
            }

            ////////////////////////////////////////////////////////////////////////////////////
            // All CAT02 data has been decoded, so lets save off the message data to the global
            // storage for latter usage
            MainASTERIXDataStorage.CAT02Data CAT02MessageData = new MainASTERIXDataStorage.CAT02Data();
            foreach (CAT02.CAT02DataItem Item in CAT02.I002DataItems)
            {
                CAT02.CAT02DataItem MyItem = new CAT02.CAT02DataItem();
                MyItem.CurrentlyPresent = Item.CurrentlyPresent;
                MyItem.Description      = Item.Description;
                MyItem.HasBeenPresent   = Item.HasBeenPresent;
                MyItem.ID    = Item.ID;
                MyItem.value = Item.value;
                CAT02MessageData.CAT02DataItems.Add(MyItem);
            }
            MainASTERIXDataStorage.CAT02Message.Add(CAT02MessageData);
            CAT02.Intitialize(false);
        }
CAT02I041UserData