public static void DecodeCAT62I060(byte[] Data)
        {
            // A new instance of the CAT48I070 data
            CAT62I060Types.CAT62060Mode3UserData MyCAT62I060 = new CAT62I060Types.CAT62060Mode3UserData();

            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]  = Data[CAT62.CurrentDataBufferOctalIndex + 1];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            //////////////////////////////////////////////////////////////////////////////////
            // Has code has changed
            MyCAT62I060.Mode_3A_Has_Changed = (BO.DWord[Bit_Ops.Bit13] == true);

            //////////////////////////////////////////////////////////////////////////////////
            // Decode Code value
            int A = DetermineOctalFromTheeBoolean(BO.DWord[Bit_Ops.Bit9], BO.DWord[Bit_Ops.Bit10], BO.DWord[Bit_Ops.Bit11]);
            int B = DetermineOctalFromTheeBoolean(BO.DWord[Bit_Ops.Bit6], BO.DWord[Bit_Ops.Bit7], BO.DWord[Bit_Ops.Bit8]);
            int C = DetermineOctalFromTheeBoolean(BO.DWord[Bit_Ops.Bit3], BO.DWord[Bit_Ops.Bit4], BO.DWord[Bit_Ops.Bit5]);
            int D = DetermineOctalFromTheeBoolean(BO.DWord[Bit_Ops.Bit0], BO.DWord[Bit_Ops.Bit1], BO.DWord[Bit_Ops.Bit2]);

            MyCAT62I060.Mode3A_Code = A.ToString() + B.ToString() + C.ToString() + D.ToString();

            //////////////////////////////////////////////////////////////////////////////////
            // Now assign it to the generic list
            CAT62.I062DataItems[CAT62.ItemIDToIndex("060")].value = MyCAT62I060;
            //////////////////////////////////////////////////////////////////////////////////

            // Increase data buffer index so it ready for the next data item.
            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
        }
Exemple #2
0
        /////////////////////////////////////////////////////////////////////////
        // This method returns the fifth FSPEC octet
        // as a BitVector32. User then can evaluate the individual bits
        // and interpret their meaining depending on the ASTERIX CAT
        public static BitVector32 GetFifthFSPECOctet(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            // Move each octet into the DWORD
            BO.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[FifthFSPECS_Byte_Index];

            return(BO.DWord);
        }
Exemple #3
0
        /////////////////////////////////////////////////////////////////////////
        // This method returns the first four FSPEC octets
        // as a BitVector32. User then can evaluate the individual bits
        // and interpret their meaining depending on the ASTERIX CAT
        //
        // NOTE: It returns the four possible FSPEC, but user is first to
        // determine the length of the FSPEC and according to that to use it.
        public static BitVector32 GetFourFSPECOctets(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            // Move each octet into the DWORD
            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]   = Data[FirstFSPECS_Byte_Index];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord]  = Data[SecondFSPECS_Byte_Index];
            BO.DWord[Bit_Ops.Bits16_23_Of_DWord] = Data[ThirdFSPECS_Byte_Index];
            BO.DWord[Bit_Ops.Bits24_31_Of_DWord] = Data[FourthFSPECS_Byte_Index];

            return(BO.DWord);
        }
Exemple #4
0
        public static void DecodeCAT62IREF(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops WORD0 = new Bit_Ops();

            //Extract the first octet
            WORD0.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            int NumOfOctets = (int)WORD0.DWord[Bit_Ops.Bits0_7_Of_DWord];

            // Increase data buffer index so it ready for the next data item.
            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + NumOfOctets;
        }
Exemple #5
0
        ///////////////////////////////////////////////////////////////////////////
        // This one extracts the next 16 bits, which is
        // lenght of the data block
        public static int ExtractLengthOfDataBlockInBytes_Int(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            // Extract first 16 bits
            // 15..........................0
            // 00000000             00000000
            // First_LEN_Octet   Second_LEN_Octet

            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]  = Data[Second_LEN_Octet];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord] = Data[First_LEN_Octet];

            int Result = BO.DWord[Bit_Ops.Bits0_15_Of_DWord];

            return(Result);
        }
        public static void DecodeCAT62I136(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]  = Data[CAT62.CurrentDataBufferOctalIndex + 1];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            double MeasuredFlightLevel = DecodeFlightLevel(BO);

            //////////////////////////////////////////////////////////////////////////////////
            // Now assign it to the generic list
            CAT62.I062DataItems[CAT62.ItemIDToIndex("136")].value = MeasuredFlightLevel;
            //////////////////////////////////////////////////////////////////////////////////

            // Increase data buffer index so it ready for the next data item.
            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
        }
        public static void DecodeCAT62I040(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            BO.DWord[Bit_Ops.Bits8_15_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];
            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]  = Data[CAT62.CurrentDataBufferOctalIndex + 1];

            int Track_Number = BO.DWord[Bit_Ops.Bits0_15_Of_DWord];

            //////////////////////////////////////////////////////////////////////////////////
            // Now assign it to the generic list
            CAT62.I062DataItems[CAT62.ItemIDToIndex("040")].value = Track_Number;
            //////////////////////////////////////////////////////////////////////////////////

            // Increase data buffer index so it ready for the next data item.
            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
        }
        public static void DecodeCAT62I340(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops WORD0 = new Bit_Ops();

            //Extract the first octet
            WORD0.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;

            // 2 SIC/SAC
            if (WORD0.DWord[CAT62I340Types.Sensor_Identification] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            if (WORD0.DWord[CAT62I340Types.Measured_Position] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 4;
            }

            if (WORD0.DWord[CAT62I340Types.Measured_3_D_Height] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
            }

            if (WORD0.DWord[CAT62I340Types.Last_Measured_Mode_C_Code] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
            }

            if (WORD0.DWord[CAT62I340Types.Last_Measured_Mode_3_A_Code] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
            }

            if (WORD0.DWord[CAT62I340Types.Report_Type] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
        }
Exemple #9
0
        // This method returns the lenght of FSPEC in bytes (8bits).
        // The minumum value is 1, and if it is bigger than one byte then
        // bit 8 is set to true to indicate that next byte is also used
        // as FSPEC field. After the last FSPEC field ASTERIX data items begin.
        public static int DetermineLenghtOfFSPEC(byte[] Data)
        {
            // Assume it is 1
            int LenghtOfFSPEC = 1;

            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            // Move each octet into the DWORD
            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]   = Data[FirstFSPECS_Byte_Index];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord]  = Data[SecondFSPECS_Byte_Index];
            BO.DWord[Bit_Ops.Bits16_23_Of_DWord] = Data[ThirdFSPECS_Byte_Index];
            BO.DWord[Bit_Ops.Bits24_31_Of_DWord] = Data[FourthFSPECS_Byte_Index];

            ////////////////////////////////////////////////////////////////////////
            // Now check for the 8th bit of each FSPEC field. If it is set
            // to true then the next octet is also FSPEC.
            if (BO.DWord[Bit_Ops.Bit0] == true)
            {
                LenghtOfFSPEC++;
                if (BO.DWord[Bit_Ops.Bit8] == true)
                {
                    LenghtOfFSPEC++;
                    if (BO.DWord[Bit_Ops.Bit16] == true)
                    {
                        LenghtOfFSPEC++;
                        if (BO.DWord[Bit_Ops.Bit24] == true)
                        {
                            LenghtOfFSPEC++;
                        }
                    }
                }
            }

            return(LenghtOfFSPEC);
        }
        public static void DecodeCAT62I220(byte[] Data)
        {
            // Define a global record for all data, then down there depending on the avalability of each field
            // populate specific items. Each item has validity flag that needs to be set for each available data
            // item for this message
            CAT62I220Types.CalculatedRateOfClimbDescent CAT62I220DataRecord = new CAT62I220Types.CalculatedRateOfClimbDescent();

            ///////////////////////////////////////////////////////////////
            // Track_Angle and Magnetic Heading DECODE CONSTANTS
            double RCD_1  = 6.25; // LSB Feet/MIN
            double RCD_2  = RCD_1 * 2.0;
            double RCD_3  = RCD_2 * 2.0;
            double RCD_4  = RCD_3 * 2.0;
            double RCD_5  = RCD_4 * 2.0;
            double RCD_6  = RCD_5 * 2.0;
            double RCD_7  = RCD_6 * 2.0;
            double RCD_8  = RCD_7 * 2.0;
            double RCD_9  = RCD_8 * 2.0;
            double RCD_10 = RCD_9 * 2.0;
            double RCD_11 = RCD_10 * 2.0;
            double RCD_12 = RCD_11 * 2.0;
            double RCD_13 = RCD_12 * 2.0;
            double RCD_14 = RCD_13 * 2.0;
            double RCD_15 = RCD_14 * 2.0;
            double RCD_16 = RCD_15 * 2.0; // MSB
            ///////////////////////////////////////////////////////////////////

            Bit_Ops BO = new Bit_Ops();

            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]  = Data[CAT62.CurrentDataBufferOctalIndex + 1];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            double Value = 0.0;

            if (BO.DWord[Bit_Ops.Bit15])
            {
                BO.DWord[Bit_Ops.Bit0]              = !BO.DWord[Bit_Ops.Bit0];
                BO.DWord[Bit_Ops.Bit1]              = !BO.DWord[Bit_Ops.Bit1];
                BO.DWord[Bit_Ops.Bit2]              = !BO.DWord[Bit_Ops.Bit2];
                BO.DWord[Bit_Ops.Bit3]              = !BO.DWord[Bit_Ops.Bit3];
                BO.DWord[Bit_Ops.Bit4]              = !BO.DWord[Bit_Ops.Bit4];
                BO.DWord[Bit_Ops.Bit5]              = !BO.DWord[Bit_Ops.Bit5];
                BO.DWord[Bit_Ops.Bit6]              = !BO.DWord[Bit_Ops.Bit6];
                BO.DWord[Bit_Ops.Bit7]              = !BO.DWord[Bit_Ops.Bit7];
                BO.DWord[Bit_Ops.Bit8]              = !BO.DWord[Bit_Ops.Bit8];
                BO.DWord[Bit_Ops.Bit9]              = !BO.DWord[Bit_Ops.Bit9];
                BO.DWord[Bit_Ops.Bit10]             = !BO.DWord[Bit_Ops.Bit10];
                BO.DWord[Bit_Ops.Bit11]             = !BO.DWord[Bit_Ops.Bit11];
                BO.DWord[Bit_Ops.Bit12]             = !BO.DWord[Bit_Ops.Bit12];
                BO.DWord[Bit_Ops.Bit13]             = !BO.DWord[Bit_Ops.Bit13];
                BO.DWord[Bit_Ops.Bit14]             = !BO.DWord[Bit_Ops.Bit14];
                BO.DWord[Bit_Ops.Bit15]             = !BO.DWord[Bit_Ops.Bit15];
                BO.DWord[Bit_Ops.Bits0_15_Of_DWord] = BO.DWord[Bit_Ops.Bits0_15_Of_DWord] + 1;

                if (BO.DWord[Bit_Ops.Bit0])
                {
                    Value = RCD_1;
                }
                if (BO.DWord[Bit_Ops.Bit1])
                {
                    Value = Value + RCD_2;
                }
                if (BO.DWord[Bit_Ops.Bit2])
                {
                    Value = Value + RCD_3;
                }
                if (BO.DWord[Bit_Ops.Bit3])
                {
                    Value = Value + RCD_4;
                }
                if (BO.DWord[Bit_Ops.Bit4])
                {
                    Value = Value + RCD_5;
                }
                if (BO.DWord[Bit_Ops.Bit5])
                {
                    Value = Value + RCD_6;
                }
                if (BO.DWord[Bit_Ops.Bit6])
                {
                    Value = Value + RCD_7;
                }
                if (BO.DWord[Bit_Ops.Bit7])
                {
                    Value = Value + RCD_8;
                }
                if (BO.DWord[Bit_Ops.Bit8])
                {
                    Value = Value + RCD_9;
                }
                if (BO.DWord[Bit_Ops.Bit9])
                {
                    Value = Value + RCD_10;
                }
                if (BO.DWord[Bit_Ops.Bit10])
                {
                    Value = Value + RCD_11;
                }
                if (BO.DWord[Bit_Ops.Bit11])
                {
                    Value = Value + RCD_12;
                }
                if (BO.DWord[Bit_Ops.Bit12])
                {
                    Value = Value + RCD_13;
                }
                if (BO.DWord[Bit_Ops.Bit13])
                {
                    Value = Value + RCD_14;
                }
                if (BO.DWord[Bit_Ops.Bit14])
                {
                    Value = Value + RCD_15;
                }
                if (BO.DWord[Bit_Ops.Bit15])
                {
                    Value = Value + RCD_16;
                }

                Value = -Value;
            }
            else
            {
                if (BO.DWord[Bit_Ops.Bit0])
                {
                    Value = RCD_1;
                }
                if (BO.DWord[Bit_Ops.Bit1])
                {
                    Value = Value + RCD_2;
                }
                if (BO.DWord[Bit_Ops.Bit2])
                {
                    Value = Value + RCD_3;
                }
                if (BO.DWord[Bit_Ops.Bit3])
                {
                    Value = Value + RCD_4;
                }
                if (BO.DWord[Bit_Ops.Bit4])
                {
                    Value = Value + RCD_5;
                }
                if (BO.DWord[Bit_Ops.Bit5])
                {
                    Value = Value + RCD_6;
                }
                if (BO.DWord[Bit_Ops.Bit6])
                {
                    Value = Value + RCD_7;
                }
                if (BO.DWord[Bit_Ops.Bit7])
                {
                    Value = Value + RCD_8;
                }
                if (BO.DWord[Bit_Ops.Bit8])
                {
                    Value = Value + RCD_9;
                }
                if (BO.DWord[Bit_Ops.Bit9])
                {
                    Value = Value + RCD_10;
                }
                if (BO.DWord[Bit_Ops.Bit10])
                {
                    Value = Value + RCD_11;
                }
                if (BO.DWord[Bit_Ops.Bit11])
                {
                    Value = Value + RCD_12;
                }
                if (BO.DWord[Bit_Ops.Bit12])
                {
                    Value = Value + RCD_13;
                }
                if (BO.DWord[Bit_Ops.Bit13])
                {
                    Value = Value + RCD_14;
                }
                if (BO.DWord[Bit_Ops.Bit14])
                {
                    Value = Value + RCD_15;
                }
            }

            CAT62I220DataRecord.Is_Valid = true;
            CAT62I220DataRecord.Value    = Value;

            //////////////////////////////////////////////////////////////////////////////////
            // Now assign it to the generic list
            CAT62.I062DataItems[CAT62.ItemIDToIndex("220")].value = CAT62I220DataRecord;
            //////////////////////////////////////////////////////////////////////////////////

            // Increase data buffer index so it ready for the next data item.
            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
        }
Exemple #11
0
        public static void DecodeCAT62I390(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops WORD0 = new Bit_Ops();
            Bit_Ops WORD1 = new Bit_Ops();
            Bit_Ops WORD2 = new Bit_Ops();

            //Extract the first octet
            WORD0.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            if (WORD0.DWord[CAT62I390Types.WORD0_FX_Extension_Indicator] == true)
            {
                CAT62.CurrentDataBufferOctalIndex     = CAT62.CurrentDataBufferOctalIndex + 1;
                WORD1.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

                if (WORD1.DWord[CAT62I390Types.WORD1_FX_Extension_Indicator] == true)
                {
                    CAT62.CurrentDataBufferOctalIndex     = CAT62.CurrentDataBufferOctalIndex + 1;
                    WORD2.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

                    if (WORD2.DWord[CAT62I390Types.WORD2_FX_Extension_Indicator] == true)
                    {
                        CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
                    }
                }
            }

            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;

            // 2 SIC/SAC
            if (WORD0.DWord[CAT62I390Types.FPPS_Identification_Tag] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
            }

            // 7 (7 Char Callsign)
            if (WORD0.DWord[CAT62I390Types.Callsign] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 7;
            }

            // 4
            if (WORD0.DWord[CAT62I390Types.IFPS_FLIGHT_ID] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 4;
            }

            // 1
            if (WORD0.DWord[CAT62I390Types.Flight_Category] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 4
            if (WORD0.DWord[CAT62I390Types.Type_of_Aircraft] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 4;
            }

            // 1
            if (WORD0.DWord[CAT62I390Types.Wake_Turbulence_Category] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 4
            if (WORD0.DWord[CAT62I390Types.Departure_Airport] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 4;
            }

            // 4
            if (WORD1.DWord[CAT62I390Types.Destination_Airport] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 4;
            }

            // 3
            if (WORD1.DWord[CAT62I390Types.Runway_Designation] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 3;
            }

            // 2
            if (WORD1.DWord[CAT62I390Types.Current_Cleared_Flight_Level] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
            }

            // 2
            if (WORD1.DWord[CAT62I390Types.Current_Control_Position] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
            }

            // 5
            if (WORD1.DWord[CAT62I390Types.Time_of_Departure_Arrival] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 5;
            }

            // 6
            if (WORD1.DWord[CAT62I390Types.Aircraft_Stand] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 6;
            }

            // 1
            if (WORD1.DWord[CAT62I390Types.Stand_Status] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 7
            if (WORD2.DWord[CAT62I390Types.Standard_Instrument_Departure] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 7;
            }

            // 7
            if (WORD2.DWord[CAT62I390Types.Standard_Instrument_Arrival] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 7;
            }

            // 2
            if (WORD2.DWord[CAT62I390Types.Pre_emergency_Mode_3_A_Code] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 2;
            }

            // 7
            if (WORD2.DWord[CAT62I390Types.Pre_emergency_Callsign] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 7;
            }

            ////bits-4/2 Spare bits set to zero
        }
        static double DecodeFlightLevel(Bit_Ops BO_In)
        {
            double Result = 0.0;

            // First check if this is a negative altitude.
            // and then handle it properly
            if (BO_In.DWord[Bit_Ops.Bit15] == true)
            {
                // Do not worry about negative values for now.
                Result = -1.0;
            }
            else
            { // A positive value
                if (BO_In.DWord[Bit_Ops.Bit0] == true)
                {
                    Result = Result + 0.25;
                }
                if (BO_In.DWord[Bit_Ops.Bit1] == true)
                {
                    Result = Result + 0.50;
                }
                if (BO_In.DWord[Bit_Ops.Bit2] == true)
                {
                    Result = Result + 1.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit3] == true)
                {
                    Result = Result + 2.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit4] == true)
                {
                    Result = Result + 4.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit5] == true)
                {
                    Result = Result + 8.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit6] == true)
                {
                    Result = Result + 16.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit7] == true)
                {
                    Result = Result + 32.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit8] == true)
                {
                    Result = Result + 64.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit9] == true)
                {
                    Result = Result + 128.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit10] == true)
                {
                    Result = Result + 256.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit11] == true)
                {
                    Result = Result + 512.00;
                }
                if (BO_In.DWord[Bit_Ops.Bit12] == true)
                {
                    Result = Result + 1024.00;
                }
            }

            return(Result);
        }
Exemple #13
0
        public static void DecodeCAT62I295(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops WORD0 = new Bit_Ops();
            Bit_Ops WORD1 = new Bit_Ops();
            Bit_Ops WORD2 = new Bit_Ops();
            Bit_Ops WORD3 = new Bit_Ops();
            Bit_Ops WORD4 = new Bit_Ops();

            //Extract the first octet
            WORD0.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            if (WORD0.DWord[CAT62I295Types.WORD0_FX_Extension_Indicator] == true)
            {
                CAT62.CurrentDataBufferOctalIndex     = CAT62.CurrentDataBufferOctalIndex + 1;
                WORD1.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

                if (WORD1.DWord[CAT62I295Types.WORD1_FX_Extension_Indicator] == true)
                {
                    CAT62.CurrentDataBufferOctalIndex     = CAT62.CurrentDataBufferOctalIndex + 1;
                    WORD2.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

                    if (WORD2.DWord[CAT62I295Types.WORD2_FX_Extension_Indicator] == true)
                    {
                        CAT62.CurrentDataBufferOctalIndex     = CAT62.CurrentDataBufferOctalIndex + 1;
                        WORD3.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

                        if (WORD3.DWord[CAT62I295Types.WORD3_FX_Extension_Indicator] == true)
                        {
                            CAT62.CurrentDataBufferOctalIndex     = CAT62.CurrentDataBufferOctalIndex + 1;
                            WORD4.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

                            if (WORD4.DWord[CAT62I295Types.WORD4_FX_Extension_Indicator] == true)
                            {
                                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
                            }
                        }
                    }
                }
            }

            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;

            // WORD0
            if (WORD0.DWord[CAT62I295Types.Measured_Flight_Level_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD0.DWord[CAT62I295Types.Mode_1_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD0.DWord[CAT62I295Types.Mode_2_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD0.DWord[CAT62I295Types.Mode_3_A_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD0.DWord[CAT62I295Types.Mode_4_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD0.DWord[CAT62I295Types.Mode_5_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD0.DWord[CAT62I295Types.Magnetic_Heading_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            //WORD1
            if (WORD1.DWord[CAT62I295Types.Indicated_Airspeed_Mach_Nb_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD1.DWord[CAT62I295Types.True_Airspeed_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD1.DWord[CAT62I295Types.Selected_Altitude_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD1.DWord[CAT62I295Types.Final_State_Selected_Altitude_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD1.DWord[CAT62I295Types.Trajectory_Intent_Data_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD1.DWord[CAT62I295Types.COM_ACAS_Capability_and_Flight_Status_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD1.DWord[CAT62I295Types.Status_Reported_by_ADS_B_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            //WORD2
            if (WORD2.DWord[CAT62I295Types.ACAS_Resolution_Advisory_Report_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD2.DWord[CAT62I295Types.Barometric_Vertical_Rate_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD2.DWord[CAT62I295Types.Geometric_Vertical_Rate_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD2.DWord[CAT62I295Types.Roll_Angle_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD2.DWord[CAT62I295Types.Track_Angle_Rate_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD2.DWord[CAT62I295Types.Track_Angle_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD2.DWord[CAT62I295Types.Ground_Speed_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            //WORD3
            if (WORD3.DWord[CAT62I295Types.Velocity_Uncertainty_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD3.DWord[CAT62I295Types.Meteorological_Data_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD3.DWord[CAT62I295Types.Emitter_Category_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD3.DWord[CAT62I295Types.Position_Data_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD3.DWord[CAT62I295Types.Geometric_Altitude_Data_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD3.DWord[CAT62I295Types.Position_Uncertainty_Data_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD3.DWord[CAT62I295Types.Mode_S_MB_Data_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            //WORD4
            if (WORD4.DWord[CAT62I295Types.Indicated_Airspeed_Data_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD4.DWord[CAT62I295Types.Mach_NumberAData_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
            if (WORD4.DWord[CAT62I295Types.Barometric_Pressure_Setting_Data_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
        }
Exemple #14
0
        public static void DecodeCAT62I185(byte[] Data)
        {
            CAT62I185Types.CalculatedGSPandHDG_Type CalculatedGSPDandHDG = new CAT62I185Types.CalculatedGSPandHDG_Type();

            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]   = Data[CAT62.CurrentDataBufferOctalIndex + 3];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord]  = Data[CAT62.CurrentDataBufferOctalIndex + 2];
            BO.DWord[Bit_Ops.Bits16_23_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex + 1];
            BO.DWord[Bit_Ops.Bits24_31_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            double Vx = 0.0;
            double Vy = 0.0;

            ///////////////////////////////////////////////////////////////////////////////////////
            // Decode Vx
            ///////////////////////////////////////////////////////////////////////////////////////
            if (BO.DWord[Bit_Ops.Bit31] == true)
            {
                Bit_Ops BO1_Temp = new Bit_Ops();

                BO1_Temp.DWord[Bit_Ops.Bit0]  = !BO.DWord[Bit_Ops.Bit16];
                BO1_Temp.DWord[Bit_Ops.Bit1]  = !BO.DWord[Bit_Ops.Bit17];
                BO1_Temp.DWord[Bit_Ops.Bit2]  = !BO.DWord[Bit_Ops.Bit18];
                BO1_Temp.DWord[Bit_Ops.Bit3]  = !BO.DWord[Bit_Ops.Bit19];
                BO1_Temp.DWord[Bit_Ops.Bit4]  = !BO.DWord[Bit_Ops.Bit20];
                BO1_Temp.DWord[Bit_Ops.Bit5]  = !BO.DWord[Bit_Ops.Bit21];
                BO1_Temp.DWord[Bit_Ops.Bit6]  = !BO.DWord[Bit_Ops.Bit22];
                BO1_Temp.DWord[Bit_Ops.Bit7]  = !BO.DWord[Bit_Ops.Bit23];
                BO1_Temp.DWord[Bit_Ops.Bit8]  = !BO.DWord[Bit_Ops.Bit24];
                BO1_Temp.DWord[Bit_Ops.Bit9]  = !BO.DWord[Bit_Ops.Bit25];
                BO1_Temp.DWord[Bit_Ops.Bit10] = !BO.DWord[Bit_Ops.Bit26];
                BO1_Temp.DWord[Bit_Ops.Bit11] = !BO.DWord[Bit_Ops.Bit27];
                BO1_Temp.DWord[Bit_Ops.Bit12] = !BO.DWord[Bit_Ops.Bit28];
                BO1_Temp.DWord[Bit_Ops.Bit13] = !BO.DWord[Bit_Ops.Bit29];
                BO1_Temp.DWord[Bit_Ops.Bit14] = !BO.DWord[Bit_Ops.Bit30];
                BO1_Temp.DWord[Bit_Ops.Bit15] = !BO.DWord[Bit_Ops.Bit31];

                BO1_Temp.DWord[Bit_Ops.Bit16] = false;
                BO1_Temp.DWord[Bit_Ops.Bit17] = false;
                BO1_Temp.DWord[Bit_Ops.Bit18] = false;
                BO1_Temp.DWord[Bit_Ops.Bit19] = false;
                BO1_Temp.DWord[Bit_Ops.Bit20] = false;
                BO1_Temp.DWord[Bit_Ops.Bit21] = false;
                BO1_Temp.DWord[Bit_Ops.Bit22] = false;
                BO1_Temp.DWord[Bit_Ops.Bit23] = false;
                BO1_Temp.DWord[Bit_Ops.Bit24] = false;
                BO1_Temp.DWord[Bit_Ops.Bit25] = false;
                BO1_Temp.DWord[Bit_Ops.Bit26] = false;
                BO1_Temp.DWord[Bit_Ops.Bit27] = false;
                BO1_Temp.DWord[Bit_Ops.Bit28] = false;
                BO1_Temp.DWord[Bit_Ops.Bit29] = false;
                BO1_Temp.DWord[Bit_Ops.Bit30] = false;
                BO1_Temp.DWord[Bit_Ops.Bit31] = false;

                BO1_Temp.DWord[Bit_Ops.Bits0_15_Of_DWord] = BO1_Temp.DWord[Bit_Ops.Bits0_15_Of_DWord] + 1;

                if (BO1_Temp.DWord[Bit_Ops.Bit0] == true)
                {
                    Vx = V_1;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit1] == true)
                {
                    Vx = Vx + V_2;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit2] == true)
                {
                    Vx = Vx + V_3;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit3] == true)
                {
                    Vx = Vx + V_4;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit4] == true)
                {
                    Vx = Vx + V_5;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit5] == true)
                {
                    Vx = Vx + V_6;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit6] == true)
                {
                    Vx = Vx + V_7;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit7] == true)
                {
                    Vx = Vx + V_8;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit8] == true)
                {
                    Vx = Vx + V_9;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit9] == true)
                {
                    Vx = Vx + V_10;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit10] == true)
                {
                    Vx = Vx + V_11;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit11] == true)
                {
                    Vx = Vx + V_12;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit12] == true)
                {
                    Vx = Vx + V_13;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit13] == true)
                {
                    Vx = Vx + V_14;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit14] == true)
                {
                    Vx = Vx + V_15;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit15] == true)
                {
                    Vx = Vx + V_16;
                }

                Vx = -Vx;
            }
            else
            {
                if (BO.DWord[Bit_Ops.Bit16] == true)
                {
                    Vx = V_1;
                }
                if (BO.DWord[Bit_Ops.Bit17] == true)
                {
                    Vx = Vx + V_2;
                }
                if (BO.DWord[Bit_Ops.Bit18] == true)
                {
                    Vx = Vx + V_3;
                }
                if (BO.DWord[Bit_Ops.Bit19] == true)
                {
                    Vx = Vx + V_4;
                }
                if (BO.DWord[Bit_Ops.Bit20] == true)
                {
                    Vx = Vx + V_5;
                }
                if (BO.DWord[Bit_Ops.Bit21] == true)
                {
                    Vx = Vx + V_6;
                }
                if (BO.DWord[Bit_Ops.Bit22] == true)
                {
                    Vx = Vx + V_7;
                }
                if (BO.DWord[Bit_Ops.Bit23] == true)
                {
                    Vx = Vx + V_8;
                }
                if (BO.DWord[Bit_Ops.Bit24] == true)
                {
                    Vx = Vx + V_9;
                }
                if (BO.DWord[Bit_Ops.Bit25] == true)
                {
                    Vx = Vx + V_10;
                }
                if (BO.DWord[Bit_Ops.Bit26] == true)
                {
                    Vx = Vx + V_11;
                }
                if (BO.DWord[Bit_Ops.Bit27] == true)
                {
                    Vx = Vx + V_12;
                }
                if (BO.DWord[Bit_Ops.Bit28] == true)
                {
                    Vx = Vx + V_13;
                }
                if (BO.DWord[Bit_Ops.Bit29] == true)
                {
                    Vx = Vx + V_14;
                }
                if (BO.DWord[Bit_Ops.Bit30] == true)
                {
                    Vx = Vx + V_15;
                }
                if (BO.DWord[Bit_Ops.Bit31] == true)
                {
                    Vx = Vx + V_16;
                }
            }

            ///////////////////////////////////////////////////////////////////////////////////////
            // Decode Vy
            ///////////////////////////////////////////////////////////////////////////////////////
            if (BO.DWord[Bit_Ops.Bit15] == true)
            {
                Bit_Ops BO1_Temp = new Bit_Ops();

                BO1_Temp.DWord[Bit_Ops.Bit0]  = !BO.DWord[Bit_Ops.Bit0];
                BO1_Temp.DWord[Bit_Ops.Bit1]  = !BO.DWord[Bit_Ops.Bit1];
                BO1_Temp.DWord[Bit_Ops.Bit2]  = !BO.DWord[Bit_Ops.Bit2];
                BO1_Temp.DWord[Bit_Ops.Bit3]  = !BO.DWord[Bit_Ops.Bit3];
                BO1_Temp.DWord[Bit_Ops.Bit4]  = !BO.DWord[Bit_Ops.Bit4];
                BO1_Temp.DWord[Bit_Ops.Bit5]  = !BO.DWord[Bit_Ops.Bit5];
                BO1_Temp.DWord[Bit_Ops.Bit6]  = !BO.DWord[Bit_Ops.Bit6];
                BO1_Temp.DWord[Bit_Ops.Bit7]  = !BO.DWord[Bit_Ops.Bit7];
                BO1_Temp.DWord[Bit_Ops.Bit8]  = !BO.DWord[Bit_Ops.Bit8];
                BO1_Temp.DWord[Bit_Ops.Bit9]  = !BO.DWord[Bit_Ops.Bit9];
                BO1_Temp.DWord[Bit_Ops.Bit10] = !BO.DWord[Bit_Ops.Bit10];
                BO1_Temp.DWord[Bit_Ops.Bit11] = !BO.DWord[Bit_Ops.Bit11];
                BO1_Temp.DWord[Bit_Ops.Bit12] = !BO.DWord[Bit_Ops.Bit12];
                BO1_Temp.DWord[Bit_Ops.Bit13] = !BO.DWord[Bit_Ops.Bit13];
                BO1_Temp.DWord[Bit_Ops.Bit14] = !BO.DWord[Bit_Ops.Bit14];
                BO1_Temp.DWord[Bit_Ops.Bit15] = !BO.DWord[Bit_Ops.Bit15];

                BO1_Temp.DWord[Bit_Ops.Bit16] = false;
                BO1_Temp.DWord[Bit_Ops.Bit17] = false;
                BO1_Temp.DWord[Bit_Ops.Bit18] = false;
                BO1_Temp.DWord[Bit_Ops.Bit19] = false;
                BO1_Temp.DWord[Bit_Ops.Bit20] = false;
                BO1_Temp.DWord[Bit_Ops.Bit21] = false;
                BO1_Temp.DWord[Bit_Ops.Bit22] = false;
                BO1_Temp.DWord[Bit_Ops.Bit23] = false;
                BO1_Temp.DWord[Bit_Ops.Bit24] = false;
                BO1_Temp.DWord[Bit_Ops.Bit25] = false;
                BO1_Temp.DWord[Bit_Ops.Bit26] = false;
                BO1_Temp.DWord[Bit_Ops.Bit27] = false;
                BO1_Temp.DWord[Bit_Ops.Bit28] = false;
                BO1_Temp.DWord[Bit_Ops.Bit29] = false;
                BO1_Temp.DWord[Bit_Ops.Bit30] = false;
                BO1_Temp.DWord[Bit_Ops.Bit31] = false;

                BO1_Temp.DWord[Bit_Ops.Bits0_15_Of_DWord] = BO1_Temp.DWord[Bit_Ops.Bits0_15_Of_DWord] + 1;

                if (BO1_Temp.DWord[Bit_Ops.Bit0] == true)
                {
                    Vy = V_1;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit1] == true)
                {
                    Vy = Vy + V_2;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit2] == true)
                {
                    Vy = Vy + V_3;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit3] == true)
                {
                    Vy = Vy + V_4;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit4] == true)
                {
                    Vy = Vy + V_5;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit5] == true)
                {
                    Vy = Vy + V_6;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit6] == true)
                {
                    Vy = Vy + V_7;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit7] == true)
                {
                    Vy = Vy + V_8;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit8] == true)
                {
                    Vy = Vy + V_9;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit9] == true)
                {
                    Vy = Vy + V_10;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit10] == true)
                {
                    Vy = Vy + V_11;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit11] == true)
                {
                    Vy = Vy + V_12;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit12] == true)
                {
                    Vy = Vy + V_13;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit13] == true)
                {
                    Vy = Vy + V_14;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit14] == true)
                {
                    Vy = Vy + V_15;
                }
                if (BO1_Temp.DWord[Bit_Ops.Bit15] == true)
                {
                    Vy = Vy + V_16;
                }

                Vy = -Vy;
            }
            else
            {
                if (BO.DWord[Bit_Ops.Bit0] == true)
                {
                    Vy = V_1;
                }
                if (BO.DWord[Bit_Ops.Bit1] == true)
                {
                    Vy = Vy + V_2;
                }
                if (BO.DWord[Bit_Ops.Bit2] == true)
                {
                    Vy = Vy + V_3;
                }
                if (BO.DWord[Bit_Ops.Bit3] == true)
                {
                    Vy = Vy + V_4;
                }
                if (BO.DWord[Bit_Ops.Bit4] == true)
                {
                    Vy = Vy + V_5;
                }
                if (BO.DWord[Bit_Ops.Bit5] == true)
                {
                    Vy = Vy + V_6;
                }
                if (BO.DWord[Bit_Ops.Bit6] == true)
                {
                    Vy = Vy + V_7;
                }
                if (BO.DWord[Bit_Ops.Bit7] == true)
                {
                    Vy = Vy + V_8;
                }
                if (BO.DWord[Bit_Ops.Bit8] == true)
                {
                    Vy = Vy + V_9;
                }
                if (BO.DWord[Bit_Ops.Bit9] == true)
                {
                    Vy = Vy + V_10;
                }
                if (BO.DWord[Bit_Ops.Bit10] == true)
                {
                    Vy = Vy + V_11;
                }
                if (BO.DWord[Bit_Ops.Bit11] == true)
                {
                    Vy = Vy + V_12;
                }
                if (BO.DWord[Bit_Ops.Bit12] == true)
                {
                    Vy = Vy + V_13;
                }
                if (BO.DWord[Bit_Ops.Bit13] == true)
                {
                    Vy = Vy + V_14;
                }
                if (BO.DWord[Bit_Ops.Bit14] == true)
                {
                    Vy = Vy + V_15;
                }
                if (BO.DWord[Bit_Ops.Bit15] == true)
                {
                    Vy = Vy + V_16;
                }
            }

            CalculatedGSPDandHDG = ToPolarFromCarteisan(Vx, Vy);

            //////////////////////////////////////////////////////////////////////////////////
            // Now assign it to the generic list
            CAT62.I062DataItems[CAT62.ItemIDToIndex("185")].value = CalculatedGSPDandHDG;
            //////////////////////////////////////////////////////////////////////////////////

            // Increase data buffer index so it ready for the next data item.
            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 4;
        }
Exemple #15
0
        public static void DecodeCAT62I105(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]   = Data[CAT62.CurrentDataBufferOctalIndex + 3];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord]  = Data[CAT62.CurrentDataBufferOctalIndex + 2];
            BO.DWord[Bit_Ops.Bits16_23_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex + 1];
            BO.DWord[Bit_Ops.Bits24_31_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            double Result    = 0.0;
            double Latitude  = 0.0;
            double Longitude = 0.0;

            // Check for negative values
            if (BO.DWord[Bit_Ops.Bit31] == true)
            {
                BO.DWord[Bit_Ops.Bit0]  = !BO.DWord[Bit_Ops.Bit0];
                BO.DWord[Bit_Ops.Bit1]  = !BO.DWord[Bit_Ops.Bit1];
                BO.DWord[Bit_Ops.Bit2]  = !BO.DWord[Bit_Ops.Bit2];
                BO.DWord[Bit_Ops.Bit3]  = !BO.DWord[Bit_Ops.Bit3];
                BO.DWord[Bit_Ops.Bit4]  = !BO.DWord[Bit_Ops.Bit4];
                BO.DWord[Bit_Ops.Bit5]  = !BO.DWord[Bit_Ops.Bit5];
                BO.DWord[Bit_Ops.Bit6]  = !BO.DWord[Bit_Ops.Bit6];
                BO.DWord[Bit_Ops.Bit7]  = !BO.DWord[Bit_Ops.Bit7];
                BO.DWord[Bit_Ops.Bit8]  = !BO.DWord[Bit_Ops.Bit8];
                BO.DWord[Bit_Ops.Bit9]  = !BO.DWord[Bit_Ops.Bit9];
                BO.DWord[Bit_Ops.Bit10] = !BO.DWord[Bit_Ops.Bit10];
                BO.DWord[Bit_Ops.Bit11] = !BO.DWord[Bit_Ops.Bit11];
                BO.DWord[Bit_Ops.Bit12] = !BO.DWord[Bit_Ops.Bit12];
                BO.DWord[Bit_Ops.Bit13] = !BO.DWord[Bit_Ops.Bit13];
                BO.DWord[Bit_Ops.Bit14] = !BO.DWord[Bit_Ops.Bit14];
                BO.DWord[Bit_Ops.Bit15] = !BO.DWord[Bit_Ops.Bit15];
                BO.DWord[Bit_Ops.Bit16] = !BO.DWord[Bit_Ops.Bit16];
                BO.DWord[Bit_Ops.Bit17] = !BO.DWord[Bit_Ops.Bit17];
                BO.DWord[Bit_Ops.Bit18] = !BO.DWord[Bit_Ops.Bit18];
                BO.DWord[Bit_Ops.Bit19] = !BO.DWord[Bit_Ops.Bit19];
                BO.DWord[Bit_Ops.Bit20] = !BO.DWord[Bit_Ops.Bit20];
                BO.DWord[Bit_Ops.Bit21] = !BO.DWord[Bit_Ops.Bit21];
                BO.DWord[Bit_Ops.Bit22] = !BO.DWord[Bit_Ops.Bit22];
                BO.DWord[Bit_Ops.Bit23] = !BO.DWord[Bit_Ops.Bit23];
                BO.DWord[Bit_Ops.Bit24] = !BO.DWord[Bit_Ops.Bit24];
                BO.DWord[Bit_Ops.Bit25] = !BO.DWord[Bit_Ops.Bit25];
                BO.DWord[Bit_Ops.Bit26] = !BO.DWord[Bit_Ops.Bit26];
                BO.DWord[Bit_Ops.Bit27] = !BO.DWord[Bit_Ops.Bit27];
                BO.DWord[Bit_Ops.Bit28] = !BO.DWord[Bit_Ops.Bit28];
                BO.DWord[Bit_Ops.Bit29] = !BO.DWord[Bit_Ops.Bit29];
                BO.DWord[Bit_Ops.Bit30] = !BO.DWord[Bit_Ops.Bit30];
                BO.DWord[Bit_Ops.Bit31] = !BO.DWord[Bit_Ops.Bit31];
                BO.DWord[Bit_Ops.Bits16_31_Of_DWord] = BO.DWord[Bit_Ops.Bits16_31_Of_DWord] + 1;

                if (BO.DWord[Bit_Ops.Bit0] == true)
                {
                    Result = POS_FIX_1;
                }
                if (BO.DWord[Bit_Ops.Bit1] == true)
                {
                    Result = Result + POS_FIX_2;
                }
                if (BO.DWord[Bit_Ops.Bit2] == true)
                {
                    Result = Result + POS_FIX_3;
                }
                if (BO.DWord[Bit_Ops.Bit3] == true)
                {
                    Result = Result + POS_FIX_4;
                }
                if (BO.DWord[Bit_Ops.Bit4] == true)
                {
                    Result = Result + POS_FIX_5;
                }
                if (BO.DWord[Bit_Ops.Bit5] == true)
                {
                    Result = Result + POS_FIX_6;
                }
                if (BO.DWord[Bit_Ops.Bit6] == true)
                {
                    Result = Result + POS_FIX_7;
                }
                if (BO.DWord[Bit_Ops.Bit7] == true)
                {
                    Result = Result + POS_FIX_8;
                }
                if (BO.DWord[Bit_Ops.Bit8] == true)
                {
                    Result = Result + POS_FIX_9;
                }
                if (BO.DWord[Bit_Ops.Bit9] == true)
                {
                    Result = Result + POS_FIX_10;
                }
                if (BO.DWord[Bit_Ops.Bit10] == true)
                {
                    Result = Result + POS_FIX_11;
                }
                if (BO.DWord[Bit_Ops.Bit11] == true)
                {
                    Result = Result + POS_FIX_12;
                }
                if (BO.DWord[Bit_Ops.Bit12] == true)
                {
                    Result = Result + POS_FIX_13;
                }
                if (BO.DWord[Bit_Ops.Bit13] == true)
                {
                    Result = Result + POS_FIX_14;
                }
                if (BO.DWord[Bit_Ops.Bit14] == true)
                {
                    Result = Result + POS_FIX_15;
                }
                if (BO.DWord[Bit_Ops.Bit15] == true)
                {
                    Result = Result + POS_FIX_16;
                }
                if (BO.DWord[Bit_Ops.Bit16] == true)
                {
                    Result = Result + POS_FIX_17;
                }
                if (BO.DWord[Bit_Ops.Bit17] == true)
                {
                    Result = Result + POS_FIX_18;
                }
                if (BO.DWord[Bit_Ops.Bit18] == true)
                {
                    Result = Result + POS_FIX_19;
                }
                if (BO.DWord[Bit_Ops.Bit19] == true)
                {
                    Result = Result + POS_FIX_20;
                }
                if (BO.DWord[Bit_Ops.Bit20] == true)
                {
                    Result = Result + POS_FIX_21;
                }
                if (BO.DWord[Bit_Ops.Bit21] == true)
                {
                    Result = Result + POS_FIX_22;
                }
                if (BO.DWord[Bit_Ops.Bit22] == true)
                {
                    Result = Result + POS_FIX_23;
                }
                if (BO.DWord[Bit_Ops.Bit23] == true)
                {
                    Result = Result + POS_FIX_24;
                }
                if (BO.DWord[Bit_Ops.Bit24] == true)
                {
                    Result = Result + POS_FIX_25;
                }
                if (BO.DWord[Bit_Ops.Bit25] == true)
                {
                    Result = Result + POS_FIX_26;
                }
                if (BO.DWord[Bit_Ops.Bit26] == true)
                {
                    Result = Result + POS_FIX_27;
                }
                if (BO.DWord[Bit_Ops.Bit27] == true)
                {
                    Result = Result + POS_FIX_28;
                }

                Latitude = -Result;
            }
            else
            {
                ///////////////////////////////////////////////////////////////////////////////////////
                if (BO.DWord[Bit_Ops.Bit0] == true)
                {
                    Result = POS_FIX_1;
                }
                if (BO.DWord[Bit_Ops.Bit1] == true)
                {
                    Result = Result + POS_FIX_2;
                }
                if (BO.DWord[Bit_Ops.Bit2] == true)
                {
                    Result = Result + POS_FIX_3;
                }
                if (BO.DWord[Bit_Ops.Bit3] == true)
                {
                    Result = Result + POS_FIX_4;
                }
                if (BO.DWord[Bit_Ops.Bit4] == true)
                {
                    Result = Result + POS_FIX_5;
                }
                if (BO.DWord[Bit_Ops.Bit5] == true)
                {
                    Result = Result + POS_FIX_6;
                }
                if (BO.DWord[Bit_Ops.Bit6] == true)
                {
                    Result = Result + POS_FIX_7;
                }
                if (BO.DWord[Bit_Ops.Bit7] == true)
                {
                    Result = Result + POS_FIX_8;
                }
                if (BO.DWord[Bit_Ops.Bit8] == true)
                {
                    Result = Result + POS_FIX_9;
                }
                if (BO.DWord[Bit_Ops.Bit9] == true)
                {
                    Result = Result + POS_FIX_10;
                }
                if (BO.DWord[Bit_Ops.Bit10] == true)
                {
                    Result = Result + POS_FIX_11;
                }
                if (BO.DWord[Bit_Ops.Bit11] == true)
                {
                    Result = Result + POS_FIX_12;
                }
                if (BO.DWord[Bit_Ops.Bit12] == true)
                {
                    Result = Result + POS_FIX_13;
                }
                if (BO.DWord[Bit_Ops.Bit13] == true)
                {
                    Result = Result + POS_FIX_14;
                }
                if (BO.DWord[Bit_Ops.Bit14] == true)
                {
                    Result = Result + POS_FIX_15;
                }
                if (BO.DWord[Bit_Ops.Bit15] == true)
                {
                    Result = Result + POS_FIX_16;
                }
                if (BO.DWord[Bit_Ops.Bit16] == true)
                {
                    Result = Result + POS_FIX_17;
                }
                if (BO.DWord[Bit_Ops.Bit17] == true)
                {
                    Result = Result + POS_FIX_18;
                }
                if (BO.DWord[Bit_Ops.Bit18] == true)
                {
                    Result = Result + POS_FIX_19;
                }
                if (BO.DWord[Bit_Ops.Bit19] == true)
                {
                    Result = Result + POS_FIX_20;
                }
                if (BO.DWord[Bit_Ops.Bit20] == true)
                {
                    Result = Result + POS_FIX_21;
                }
                if (BO.DWord[Bit_Ops.Bit21] == true)
                {
                    Result = Result + POS_FIX_22;
                }
                if (BO.DWord[Bit_Ops.Bit22] == true)
                {
                    Result = Result + POS_FIX_23;
                }
                if (BO.DWord[Bit_Ops.Bit23] == true)
                {
                    Result = Result + POS_FIX_24;
                }
                if (BO.DWord[Bit_Ops.Bit24] == true)
                {
                    Result = Result + POS_FIX_25;
                }
                if (BO.DWord[Bit_Ops.Bit25] == true)
                {
                    Result = Result + POS_FIX_26;
                }
                if (BO.DWord[Bit_Ops.Bit26] == true)
                {
                    Result = Result + POS_FIX_27;
                }
                if (BO.DWord[Bit_Ops.Bit27] == true)
                {
                    Result = Result + POS_FIX_28;
                }

                Latitude = Result;
            }

            Result = 0.0;

            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]   = Data[CAT62.CurrentDataBufferOctalIndex + 7];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord]  = Data[CAT62.CurrentDataBufferOctalIndex + 6];
            BO.DWord[Bit_Ops.Bits16_23_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex + 5];
            BO.DWord[Bit_Ops.Bits24_31_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex + 4];

            // Check for negative values
            if (BO.DWord[Bit_Ops.Bit31] == true)
            {
                BO.DWord[Bit_Ops.Bit0]  = !BO.DWord[Bit_Ops.Bit0];
                BO.DWord[Bit_Ops.Bit1]  = !BO.DWord[Bit_Ops.Bit1];
                BO.DWord[Bit_Ops.Bit2]  = !BO.DWord[Bit_Ops.Bit2];
                BO.DWord[Bit_Ops.Bit3]  = !BO.DWord[Bit_Ops.Bit3];
                BO.DWord[Bit_Ops.Bit4]  = !BO.DWord[Bit_Ops.Bit4];
                BO.DWord[Bit_Ops.Bit5]  = !BO.DWord[Bit_Ops.Bit5];
                BO.DWord[Bit_Ops.Bit6]  = !BO.DWord[Bit_Ops.Bit6];
                BO.DWord[Bit_Ops.Bit7]  = !BO.DWord[Bit_Ops.Bit7];
                BO.DWord[Bit_Ops.Bit8]  = !BO.DWord[Bit_Ops.Bit8];
                BO.DWord[Bit_Ops.Bit9]  = !BO.DWord[Bit_Ops.Bit9];
                BO.DWord[Bit_Ops.Bit10] = !BO.DWord[Bit_Ops.Bit10];
                BO.DWord[Bit_Ops.Bit11] = !BO.DWord[Bit_Ops.Bit11];
                BO.DWord[Bit_Ops.Bit12] = !BO.DWord[Bit_Ops.Bit12];
                BO.DWord[Bit_Ops.Bit13] = !BO.DWord[Bit_Ops.Bit13];
                BO.DWord[Bit_Ops.Bit14] = !BO.DWord[Bit_Ops.Bit14];
                BO.DWord[Bit_Ops.Bit15] = !BO.DWord[Bit_Ops.Bit15];
                BO.DWord[Bit_Ops.Bit16] = !BO.DWord[Bit_Ops.Bit16];
                BO.DWord[Bit_Ops.Bit17] = !BO.DWord[Bit_Ops.Bit17];
                BO.DWord[Bit_Ops.Bit18] = !BO.DWord[Bit_Ops.Bit18];
                BO.DWord[Bit_Ops.Bit19] = !BO.DWord[Bit_Ops.Bit19];
                BO.DWord[Bit_Ops.Bit20] = !BO.DWord[Bit_Ops.Bit20];
                BO.DWord[Bit_Ops.Bit21] = !BO.DWord[Bit_Ops.Bit21];
                BO.DWord[Bit_Ops.Bit22] = !BO.DWord[Bit_Ops.Bit22];
                BO.DWord[Bit_Ops.Bit23] = !BO.DWord[Bit_Ops.Bit23];
                BO.DWord[Bit_Ops.Bit24] = !BO.DWord[Bit_Ops.Bit24];
                BO.DWord[Bit_Ops.Bit25] = !BO.DWord[Bit_Ops.Bit25];
                BO.DWord[Bit_Ops.Bit26] = !BO.DWord[Bit_Ops.Bit26];
                BO.DWord[Bit_Ops.Bit27] = !BO.DWord[Bit_Ops.Bit27];
                BO.DWord[Bit_Ops.Bit28] = !BO.DWord[Bit_Ops.Bit28];
                BO.DWord[Bit_Ops.Bit29] = !BO.DWord[Bit_Ops.Bit29];
                BO.DWord[Bit_Ops.Bit30] = !BO.DWord[Bit_Ops.Bit30];
                BO.DWord[Bit_Ops.Bit31] = !BO.DWord[Bit_Ops.Bit31];
                BO.DWord[Bit_Ops.Bits16_31_Of_DWord] = BO.DWord[Bit_Ops.Bits16_31_Of_DWord] + 1;

                if (BO.DWord[Bit_Ops.Bit0] == true)
                {
                    Result = POS_FIX_1;
                }
                if (BO.DWord[Bit_Ops.Bit1] == true)
                {
                    Result = Result + POS_FIX_2;
                }
                if (BO.DWord[Bit_Ops.Bit2] == true)
                {
                    Result = Result + POS_FIX_3;
                }
                if (BO.DWord[Bit_Ops.Bit3] == true)
                {
                    Result = Result + POS_FIX_4;
                }
                if (BO.DWord[Bit_Ops.Bit4] == true)
                {
                    Result = Result + POS_FIX_5;
                }
                if (BO.DWord[Bit_Ops.Bit5] == true)
                {
                    Result = Result + POS_FIX_6;
                }
                if (BO.DWord[Bit_Ops.Bit6] == true)
                {
                    Result = Result + POS_FIX_7;
                }
                if (BO.DWord[Bit_Ops.Bit7] == true)
                {
                    Result = Result + POS_FIX_8;
                }
                if (BO.DWord[Bit_Ops.Bit8] == true)
                {
                    Result = Result + POS_FIX_9;
                }
                if (BO.DWord[Bit_Ops.Bit9] == true)
                {
                    Result = Result + POS_FIX_10;
                }
                if (BO.DWord[Bit_Ops.Bit10] == true)
                {
                    Result = Result + POS_FIX_11;
                }
                if (BO.DWord[Bit_Ops.Bit11] == true)
                {
                    Result = Result + POS_FIX_12;
                }
                if (BO.DWord[Bit_Ops.Bit12] == true)
                {
                    Result = Result + POS_FIX_13;
                }
                if (BO.DWord[Bit_Ops.Bit13] == true)
                {
                    Result = Result + POS_FIX_14;
                }
                if (BO.DWord[Bit_Ops.Bit14] == true)
                {
                    Result = Result + POS_FIX_15;
                }
                if (BO.DWord[Bit_Ops.Bit15] == true)
                {
                    Result = Result + POS_FIX_16;
                }
                if (BO.DWord[Bit_Ops.Bit16] == true)
                {
                    Result = Result + POS_FIX_17;
                }
                if (BO.DWord[Bit_Ops.Bit17] == true)
                {
                    Result = Result + POS_FIX_18;
                }
                if (BO.DWord[Bit_Ops.Bit18] == true)
                {
                    Result = Result + POS_FIX_19;
                }
                if (BO.DWord[Bit_Ops.Bit19] == true)
                {
                    Result = Result + POS_FIX_20;
                }
                if (BO.DWord[Bit_Ops.Bit20] == true)
                {
                    Result = Result + POS_FIX_21;
                }
                if (BO.DWord[Bit_Ops.Bit21] == true)
                {
                    Result = Result + POS_FIX_22;
                }
                if (BO.DWord[Bit_Ops.Bit22] == true)
                {
                    Result = Result + POS_FIX_23;
                }
                if (BO.DWord[Bit_Ops.Bit23] == true)
                {
                    Result = Result + POS_FIX_24;
                }
                if (BO.DWord[Bit_Ops.Bit24] == true)
                {
                    Result = Result + POS_FIX_25;
                }
                if (BO.DWord[Bit_Ops.Bit25] == true)
                {
                    Result = Result + POS_FIX_26;
                }
                if (BO.DWord[Bit_Ops.Bit26] == true)
                {
                    Result = Result + POS_FIX_27;
                }
                if (BO.DWord[Bit_Ops.Bit27] == true)
                {
                    Result = Result + POS_FIX_28;
                }

                Longitude = -Result;
            }
            else
            {
                if (BO.DWord[Bit_Ops.Bit0] == true)
                {
                    Result = POS_FIX_1;
                }
                if (BO.DWord[Bit_Ops.Bit1] == true)
                {
                    Result = Result + POS_FIX_2;
                }
                if (BO.DWord[Bit_Ops.Bit2] == true)
                {
                    Result = Result + POS_FIX_3;
                }
                if (BO.DWord[Bit_Ops.Bit3] == true)
                {
                    Result = Result + POS_FIX_4;
                }
                if (BO.DWord[Bit_Ops.Bit4] == true)
                {
                    Result = Result + POS_FIX_5;
                }
                if (BO.DWord[Bit_Ops.Bit5] == true)
                {
                    Result = Result + POS_FIX_6;
                }
                if (BO.DWord[Bit_Ops.Bit6] == true)
                {
                    Result = Result + POS_FIX_7;
                }
                if (BO.DWord[Bit_Ops.Bit7] == true)
                {
                    Result = Result + POS_FIX_8;
                }
                if (BO.DWord[Bit_Ops.Bit8] == true)
                {
                    Result = Result + POS_FIX_9;
                }
                if (BO.DWord[Bit_Ops.Bit9] == true)
                {
                    Result = Result + POS_FIX_10;
                }
                if (BO.DWord[Bit_Ops.Bit10] == true)
                {
                    Result = Result + POS_FIX_11;
                }
                if (BO.DWord[Bit_Ops.Bit11] == true)
                {
                    Result = Result + POS_FIX_12;
                }
                if (BO.DWord[Bit_Ops.Bit12] == true)
                {
                    Result = Result + POS_FIX_13;
                }
                if (BO.DWord[Bit_Ops.Bit13] == true)
                {
                    Result = Result + POS_FIX_14;
                }
                if (BO.DWord[Bit_Ops.Bit14] == true)
                {
                    Result = Result + POS_FIX_15;
                }
                if (BO.DWord[Bit_Ops.Bit15] == true)
                {
                    Result = Result + POS_FIX_16;
                }
                if (BO.DWord[Bit_Ops.Bit16] == true)
                {
                    Result = Result + POS_FIX_17;
                }
                if (BO.DWord[Bit_Ops.Bit17] == true)
                {
                    Result = Result + POS_FIX_18;
                }
                if (BO.DWord[Bit_Ops.Bit18] == true)
                {
                    Result = Result + POS_FIX_19;
                }
                if (BO.DWord[Bit_Ops.Bit19] == true)
                {
                    Result = Result + POS_FIX_20;
                }
                if (BO.DWord[Bit_Ops.Bit20] == true)
                {
                    Result = Result + POS_FIX_21;
                }
                if (BO.DWord[Bit_Ops.Bit21] == true)
                {
                    Result = Result + POS_FIX_22;
                }
                if (BO.DWord[Bit_Ops.Bit22] == true)
                {
                    Result = Result + POS_FIX_23;
                }
                if (BO.DWord[Bit_Ops.Bit23] == true)
                {
                    Result = Result + POS_FIX_24;
                }
                if (BO.DWord[Bit_Ops.Bit24] == true)
                {
                    Result = Result + POS_FIX_25;
                }
                if (BO.DWord[Bit_Ops.Bit25] == true)
                {
                    Result = Result + POS_FIX_26;
                }
                if (BO.DWord[Bit_Ops.Bit26] == true)
                {
                    Result = Result + POS_FIX_27;
                }

                Longitude = Result;
            }

            GeoCordSystemDegMinSecUtilities.LatLongClass LatLong = new GeoCordSystemDegMinSecUtilities.LatLongClass(Latitude, Longitude);


            //////////////////////////////////////////////////////////////////////////////////
            // Now assign it to the generic list
            CAT62.I062DataItems[CAT62.ItemIDToIndex("105")].value = LatLong;
            //////////////////////////////////////////////////////////////////////////////////

            // Increase data buffer index so it ready for the next data item.
            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 8;
        }
        public static void DecodeCAT62I070(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops BO = new Bit_Ops();

            BO.DWord[Bit_Ops.Bits0_7_Of_DWord]   = Data[CAT62.CurrentDataBufferOctalIndex + 2];
            BO.DWord[Bit_Ops.Bits8_15_Of_DWord]  = Data[CAT62.CurrentDataBufferOctalIndex + 1];
            BO.DWord[Bit_Ops.Bits16_23_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            CAT62I070Types.CAT62070ElapsedTimeSinceMidnight Result = new CAT62I070Types.CAT62070ElapsedTimeSinceMidnight();

            if (BO.DWord[Bit_Ops.Bit0] == true)
            {
                Result.ElapsedTimeSinceMidnight = FIX_POINT_1;
            }
            if (BO.DWord[Bit_Ops.Bit1] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_2;
            }
            if (BO.DWord[Bit_Ops.Bit2] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_3;
            }
            if (BO.DWord[Bit_Ops.Bit3] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_4;
            }
            if (BO.DWord[Bit_Ops.Bit4] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_5;
            }
            if (BO.DWord[Bit_Ops.Bit5] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_6;
            }
            if (BO.DWord[Bit_Ops.Bit6] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_7;
            }
            if (BO.DWord[Bit_Ops.Bit7] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_8;
            }
            if (BO.DWord[Bit_Ops.Bit8] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_9;
            }
            if (BO.DWord[Bit_Ops.Bit9] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_10;
            }
            if (BO.DWord[Bit_Ops.Bit10] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_11;
            }
            if (BO.DWord[Bit_Ops.Bit11] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_12;
            }
            if (BO.DWord[Bit_Ops.Bit12] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_13;
            }
            if (BO.DWord[Bit_Ops.Bit13] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_14;
            }
            if (BO.DWord[Bit_Ops.Bit14] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_15;
            }
            if (BO.DWord[Bit_Ops.Bit15] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_16;
            }
            if (BO.DWord[Bit_Ops.Bit16] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_17;
            }
            if (BO.DWord[Bit_Ops.Bit17] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_18;
            }
            if (BO.DWord[Bit_Ops.Bit18] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_19;
            }
            if (BO.DWord[Bit_Ops.Bit19] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_20;
            }
            if (BO.DWord[Bit_Ops.Bit20] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_21;
            }
            if (BO.DWord[Bit_Ops.Bit21] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_22;
            }
            if (BO.DWord[Bit_Ops.Bit22] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_23;
            }
            if (BO.DWord[Bit_Ops.Bit23] == true)
            {
                Result.ElapsedTimeSinceMidnight = Result.ElapsedTimeSinceMidnight + FIX_POINT_24;
            }

            //////////////////////////////////////////////////////////////////////////////////
            // Now assign it to the generic list
            CAT62.I062DataItems[CAT62.ItemIDToIndex("070")].value = Result;
            //////////////////////////////////////////////////////////////////////////////////

            // Increase data buffer index so it ready for the next data item.
            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 3;
        }
Exemple #17
0
        public static void DecodeCAT62I290(byte[] Data)
        {
            // Get an instance of bit ops
            Bit_Ops WORD0 = new Bit_Ops();
            Bit_Ops WORD1 = new Bit_Ops();

            //Extract the first octet
            WORD0.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];

            if (WORD0.DWord[CAT62I290Types.WORD0_FX_Extension_Indicator] == true)
            {
                CAT62.CurrentDataBufferOctalIndex     = CAT62.CurrentDataBufferOctalIndex + 1;
                WORD1.DWord[Bit_Ops.Bits0_7_Of_DWord] = Data[CAT62.CurrentDataBufferOctalIndex];
            }

            CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;

            // 2 SIC/SAC
            if (WORD0.DWord[CAT62I290Types.Track_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 7 (7 Char Callsign)
            if (WORD0.DWord[CAT62I290Types.PSR_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 4
            if (WORD0.DWord[CAT62I290Types.SSR_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 1
            if (WORD0.DWord[CAT62I290Types.Mode_S_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 4
            if (WORD0.DWord[CAT62I290Types.ADS_C_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 1
            if (WORD0.DWord[CAT62I290Types.ADS_B_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 4
            if (WORD0.DWord[CAT62I290Types.ADS_B_VDL_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 4
            if (WORD1.DWord[CAT62I290Types.ADS_B_UAT_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 3
            if (WORD1.DWord[CAT62I290Types.Loop_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }

            // 2
            if (WORD1.DWord[CAT62I290Types.Multilateration_Age] == true)
            {
                CAT62.CurrentDataBufferOctalIndex = CAT62.CurrentDataBufferOctalIndex + 1;
            }
        }