Exemple #1
0
        public void resolver_dataitems()
        {
            CAT = Convert.ToInt32(stringbinary[0], 2);
            int count = 0;

            if (listboolean_fspec.Count == 8)
            {
                count = 1;
            }
            else if (listboolean_fspec.Count == 16)
            {
                count = 2;
            }
            else if (listboolean_fspec.Count == 24)
            {
                count = 3;
            }
            else if (listboolean_fspec.Count == 32)
            {
                count = 4;
            }
            else if (listboolean_fspec.Count == 40)
            {
                count = 5;
            }
            else if (listboolean_fspec.Count == 48)
            {
                count = 6;
            }

            for (int i = (3 + count); i < stringbinary.Length; i++)
            {
                if (DI_010 == true)//VERDADERO
                {
                    DI_010_buffer1 = stringbinary[i];
                    i++;
                    DI_010_buffer2 = stringbinary[i];
                    DI_010         = false;

                    SAC = Convert.ToInt32(DI_010_buffer1, 2);
                    SIC = Convert.ToInt32(DI_010_buffer2, 2);
                }
                else if (DI_040 == true)//VERDADERO
                {
                    DI_040_buffer1 = stringbinary[i];
                    i++;
                    DI_040_buffer2 = stringbinary[i];
                    DI_040         = false;

                    char[] buff1 = DI_040_buffer1.ToArray();
                    if (buff1[0] == '1')
                    {
                        TARGET_DCR = "Differential correction";
                    }
                    else
                    {
                        TARGET_DCR = "No differential correction";
                    }
                    if (buff1[1] == '1')
                    {
                        TARGET_GBS = "Ground Bit set";
                    }
                    else
                    {
                        TARGET_GBS = "Ground Bit not set";
                    }
                    if (buff1[2] == '1')
                    {
                        TARGET_SIM = "Simulated target report";
                    }
                    else
                    {
                        TARGET_SIM = "Actual target report";
                    }
                    if (buff1[3] == '1')
                    {
                        TARGET_TST = "Test target";
                    }
                    else
                    {
                        TARGET_TST = "Default";
                    }
                    if (buff1[4] == '1')
                    {
                        TARGET_RAB = "Report from field monitor";
                    }
                    else
                    {
                        TARGET_RAB = "Report from target transponder";
                    }
                    if (buff1[5] == '1')
                    {
                        TARGET_SAA = "Equipement capable to provide Selected Altitud";
                    }
                    else
                    {
                        TARGET_SAA = "Equipement not capable to provide Selected Altitude";
                    }
                    if (buff1[6] == '1')
                    {
                        TARGET_SPI = "Special Position Identification";
                    }
                    else
                    {
                        TARGET_SPI = "Absence of SPI";
                    }

                    string concat1 = String.Concat(DI_040_buffer2[0], DI_040_buffer2[1], DI_040_buffer2[2]);
                    string concat2 = String.Concat(DI_040_buffer2[3], DI_040_buffer2[4]);

                    int num1 = Convert.ToInt32(concat1, 2);
                    int num2 = Convert.ToInt32(concat2, 2);

                    if (num1 == 0)
                    {
                        TARGET_ATP = "Non unique addres";
                    }
                    else if (num1 == 1)
                    {
                        TARGET_ATP = "24-Bit ICAO address";
                    }
                    else if (num1 == 2)
                    {
                        TARGET_ATP = "Surface vehicle address";
                    }
                    else
                    {
                        TARGET_ATP = "Anonymous addres";
                    }

                    if (num2 == 0)
                    {
                        TARGET_ARC = "Uknown";
                    }
                    else if (num2 == 1)
                    {
                        TARGET_ARC = "25 ft";
                    }
                    else
                    {
                        TARGET_ARC = "100 ft";
                    }
                }
                else if (DI_030 == true)//VERDADERO
                {
                    DI_030_buffer1 = stringbinary[i];
                    i++;
                    DI_030_buffer2 = stringbinary[i];
                    i++;
                    DI_030_buffer3 = stringbinary[i];
                    DI_030         = false;


                    int    DI_030_bff = Convert.ToInt32(String.Concat(DI_030_buffer1, DI_030_buffer2, DI_030_buffer3), 2);
                    double seconds    = Math.Round(Convert.ToDouble(DI_030_bff) / 128, 3);
                    myTime = TimeSpan.FromSeconds(seconds);
                    //Time = time.ToString(@"hh\:mm\:ss\.fff");
                }
                else if (DI_130 == true)//VERDADERO
                {
                    DI_130_buffer1 = stringbinary[i];
                    i++;
                    DI_130_buffer2 = stringbinary[i];
                    i++;
                    DI_130_buffer3 = stringbinary[i];
                    i++;
                    DI_130_buffer4 = stringbinary[i];
                    i++;
                    DI_130_buffer5 = stringbinary[i];
                    i++;
                    DI_130_buffer6 = stringbinary[i];
                    DI_130         = false;

                    string lat = String.Concat(DI_130_buffer1, DI_130_buffer2, DI_130_buffer3);
                    string lon = String.Concat(DI_130_buffer4, DI_130_buffer5, DI_130_buffer6);

                    latitud  = CA2todec(lat) * (2.145767 * Math.Pow(10, -5));
                    longitud = CA2todec(lon) * (2.145767 * Math.Pow(10, -5));

                    punto = new PointLatLng(latitud, longitud);

                    string[] separados1lat;
                    string[] separados1lon;

                    separados1lat = Convert.ToString(latitud).Split(',');
                    separados1lon = Convert.ToString(longitud).Split(',');
                    string   gradoslat = separados1lat[0];
                    string   gradoslon = separados1lon[0];
                    string   uno = String.Concat("0,", separados1lat[1]);
                    string   dos = String.Concat("0,", separados1lon[1]);
                    double   mindeclat = Convert.ToDouble(uno) * 60;
                    double   mindeclon = Convert.ToDouble(dos) * 60;
                    string[] separados2lat = Convert.ToString(mindeclat).Split(',');
                    string[] separados2lon = Convert.ToString(mindeclon).Split(',');
                    string   minlat = separados2lat[0];
                    string   minlon = separados2lon[0];
                    double   segdeclat = Convert.ToDouble(String.Concat("0,", separados2lat[1])) * 60;
                    double   segdeclon = Convert.ToDouble(String.Concat("0,", separados2lon[1])) * 60;
                    string   seclat = (Math.Round(segdeclat, 3)).ToString(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
                    string   seclon = (Math.Round(segdeclon, 3)).ToString(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
                    string   latitudd, longitudd;
                    if (latitud > 0)
                    {
                        latitudd = String.Concat(gradoslat, "º", minlat, "'", seclat, '"', 'N');
                    }
                    else
                    {
                        latitudd = String.Concat(gradoslat, 'º', minlat, "'", seclat, '"', 'S');
                    }
                    if (longitud > 0)
                    {
                        longitudd = String.Concat(gradoslon, 'º', minlon, "'", seclon, '"', 'E');
                    }
                    else
                    {
                        longitudd = String.Concat(gradoslon, 'º', minlon, "'", seclon, '"', 'O');
                    }

                    coordinates = String.Concat(latitudd, longitudd);
                }
                else if (DI_080 == true)//VERDADERO
                {
                    DI_080_buffer1 = stringbinary[i];
                    i++;
                    DI_080_buffer2 = stringbinary[i];
                    i++;
                    DI_080_buffer3 = stringbinary[i];
                    DI_080         = false;
                    if (stringhex[i].Count() == 1)
                    {
                        stringhex[i] = String.Concat("0", stringhex[i]);
                    }
                    if (stringhex[i - 1].Count() == 1)
                    {
                        stringhex[i - 1] = String.Concat("0", stringhex[i]);
                    }
                    if (stringhex[i - 2].Count() == 1)
                    {
                        stringhex[i - 2] = String.Concat("0", stringhex[i]);
                    }
                    ADDRESS = String.Concat(stringhex[i - 2], stringhex[i - 1], stringhex[i]);
                }
                else if (DI_140 == true)
                {
                    DI_140_buffer1 = stringbinary[i];
                    i++;
                    DI_140_buffer2 = stringbinary[i];
                    DI_140         = false;
                }
                else if (DI_090 == true)//VERDADERO
                {
                    DI_090_buffer1 = stringbinary[i];
                    i++;
                    DI_090_buffer2 = stringbinary[i];
                    DI_090         = false;

                    char[] octet1 = DI_090_buffer1.ToArray();
                    char[] octet2 = DI_090_buffer2.ToArray();
                    int    AC     = Convert.ToInt32(String.Concat(Convert.ToString(octet1[0]), Convert.ToString(octet1[1])));
                    int    MN     = Convert.ToInt32(String.Concat(Convert.ToString(octet1[2]), Convert.ToString(octet1[3])));
                    int    DC     = Convert.ToInt32(String.Concat(Convert.ToString(octet1[4]), Convert.ToString(octet1[5])));
                    string PA     = String.Concat(octet2[4], octet2[5], octet2[6], octet2[7]);

                    if (AC == 00)
                    {
                        FOM_AC = "Uknown";
                    }
                    else if (AC == 01)
                    {
                        FOM_AC = "ACAS not operational";
                    }
                    else if (AC == 10)
                    {
                        FOM_AC = "ACAS operational";
                    }
                    else
                    {
                        FOM_AC = "invalid";
                    }

                    if (MN == 00)
                    {
                        FOM_MN = "Uknown";
                    }
                    else if (MN == 01)
                    {
                        FOM_MN = "Multiple navigational aids not operatingl";
                    }
                    else if (MN == 10)
                    {
                        FOM_MN = "Multiple navigational aids operating";
                    }
                    else
                    {
                        FOM_MN = "invalid";
                    }

                    if (DC == 00)
                    {
                        FOM_DC = "Uknown";
                    }
                    else if (DC == 01)
                    {
                        FOM_DC = "Differential correction";
                    }
                    else if (DC == 10)
                    {
                        FOM_DC = "No Differential correction";
                    }
                    else
                    {
                        FOM_DC = "invalid";
                    }
                    FOM_PA = Convert.ToString(Convert.ToInt32(PA, 2));
                }
                else if (DI_210 == true)//VERDADERO
                {
                    DI_210_buffer1 = stringbinary[i];
                    DI_210         = false;
                    char[] octet = DI_210_buffer1.ToArray();
                    if (octet[3] == '1')
                    {
                        LINK_DTI = " Aircraft equiped with CDTI";
                    }
                    else
                    {
                        LINK_DTI = "Uknown";
                    }
                    if (octet[4] == '1')
                    {
                        LINK_MDS = "Used";
                    }
                    else
                    {
                        LINK_MDS = "Not used";
                    }
                    if (octet[5] == '1')
                    {
                        LINK_UAT = "Used";
                    }
                    else
                    {
                        LINK_UAT = "Not used";
                    }
                    if (octet[6] == '1')
                    {
                        LINK_VDL = "Used";
                    }
                    else
                    {
                        LINK_VDL = "Not used";
                    }
                    if (octet[7] == '1')
                    {
                        LINK_OTR = "Used";
                    }
                    else
                    {
                        LINK_OTR = "Not used";
                    }
                }
                else if (DI_230 == true)
                {
                    DI_230_buffer1 = stringbinary[i];
                    i++;
                    DI_230_buffer2 = stringbinary[i];
                    DI_230         = false;
                }
                else if (DI_145 == true)//VERDADERO
                {
                    DI_145_buffer1 = stringbinary[i];
                    i++;
                    DI_145_buffer2 = stringbinary[i];
                    DI_145         = false;

                    string octetos = String.Concat(DI_145_buffer1, DI_145_buffer2);
                    //double FL = Convert.ToDouble(Convert.ToInt32(octetos, 2)/4);
                    double FL = Convert.ToDouble(CA2todec(octetos)) / 4;
                    LEVEL = String.Format("{0}", FL);
                }
                else if (DI_150 == true)
                {
                    DI_150_buffer1 = stringbinary[i];
                    i++;
                    DI_150_buffer2 = stringbinary[i];
                    DI_150         = false;
                }
                else if (DI_151 == true)
                {
                    DI_151_buffer1 = stringbinary[i];
                    i++;
                    DI_151_buffer2 = stringbinary[i];
                    DI_151         = false;
                }
                else if (DI_152 == true)
                {
                    DI_152_buffer1 = stringbinary[i];
                    i++;
                    DI_152_buffer2 = stringbinary[i];
                    DI_152         = false;
                }
                else if (DI_155 == true)
                {
                    DI_155_buffer1 = stringbinary[i];
                    i++;
                    DI_155_buffer2 = stringbinary[i];
                    DI_155         = false;
                }
                else if (DI_157 == true)//VERDADERO
                {
                    DI_157_buffer1 = stringbinary[i];
                    i++;
                    DI_157_buffer2 = stringbinary[i];
                    DI_157         = false;

                    string octets  = String.Concat(DI_157_buffer1, DI_157_buffer2);
                    int    VR_prov = Convert.ToInt32(octets, 2);
                    VR = String.Format("{0}", VR_prov * 6.25);
                }
                else if (DI_160 == true)//VERDADERO
                {
                    DI_160_buffer1 = stringbinary[i];
                    i++;
                    DI_160_buffer2 = stringbinary[i];
                    i++;
                    DI_160_buffer3 = stringbinary[i];
                    i++;
                    DI_160_buffer4 = stringbinary[i];
                    DI_160         = false;

                    string octet1 = String.Concat(DI_160_buffer1, DI_160_buffer2);
                    string octet2 = String.Concat(DI_160_buffer3, DI_160_buffer4);

                    int oc1 = Convert.ToInt32(octet1, 2);
                    int oc2 = Convert.ToInt32(octet2, 2);

                    SPD = String.Format("{0}", oc1 * 0.22);
                    AGL = String.Format("{0}", oc2 * 0.0055);
                }
                else if (DI_165 == true)
                {
                    DI_165_buffer1 = stringbinary[i];
                    char[] prov = DI_165_buffer1.ToArray();
                    if (prov[prov.Length - 1] == '1')
                    {
                        i++;
                        DI_165_buffer2 = stringbinary[i];
                    }
                    DI_165 = false;
                }
                else if (DI_170 == true)//VERDADERO
                {
                    DI_170_buffer1 = stringbinary[i];
                    i++;
                    DI_170_buffer2 = stringbinary[i];
                    i++;
                    DI_170_buffer3 = stringbinary[i];
                    i++;
                    DI_170_buffer4 = stringbinary[i];
                    i++;
                    DI_170_buffer5 = stringbinary[i];
                    i++;
                    DI_170_buffer6 = stringbinary[i];
                    DI_170         = false;

                    string fulloctet     = String.Concat(DI_170_buffer1, DI_170_buffer2, DI_170_buffer3, DI_170_buffer4, DI_170_buffer5, DI_170_buffer6);
                    char[] fulloctetchar = fulloctet.ToArray();
                    string oc1           = String.Concat(Convert.ToString(fulloctetchar[0]), Convert.ToString(fulloctetchar[1]), Convert.ToString(fulloctetchar[2]), Convert.ToString(fulloctetchar[3]), Convert.ToString(fulloctetchar[4]), Convert.ToString(fulloctetchar[5]));
                    string oc2           = String.Concat(Convert.ToString(fulloctetchar[6]), Convert.ToString(fulloctetchar[7]), Convert.ToString(fulloctetchar[8]), Convert.ToString(fulloctetchar[9]), Convert.ToString(fulloctetchar[10]), Convert.ToString(fulloctetchar[11]));
                    string oc3           = String.Concat(Convert.ToString(fulloctetchar[12]), Convert.ToString(fulloctetchar[13]), Convert.ToString(fulloctetchar[14]), Convert.ToString(fulloctetchar[15]), Convert.ToString(fulloctetchar[16]), Convert.ToString(fulloctetchar[17]));
                    string oc4           = String.Concat(Convert.ToString(fulloctetchar[18]), Convert.ToString(fulloctetchar[19]), Convert.ToString(fulloctetchar[20]), Convert.ToString(fulloctetchar[21]), Convert.ToString(fulloctetchar[22]), Convert.ToString(fulloctetchar[23]));
                    string oc5           = String.Concat(Convert.ToString(fulloctetchar[24]), Convert.ToString(fulloctetchar[25]), Convert.ToString(fulloctetchar[26]), Convert.ToString(fulloctetchar[27]), Convert.ToString(fulloctetchar[28]), Convert.ToString(fulloctetchar[29]));
                    string oc6           = String.Concat(Convert.ToString(fulloctetchar[30]), Convert.ToString(fulloctetchar[31]), Convert.ToString(fulloctetchar[32]), Convert.ToString(fulloctetchar[33]), Convert.ToString(fulloctetchar[34]), Convert.ToString(fulloctetchar[35]));
                    string oc7           = String.Concat(Convert.ToString(fulloctetchar[36]), Convert.ToString(fulloctetchar[37]), Convert.ToString(fulloctetchar[38]), Convert.ToString(fulloctetchar[39]), Convert.ToString(fulloctetchar[40]), Convert.ToString(fulloctetchar[41]));
                    string oc8           = String.Concat(Convert.ToString(fulloctetchar[42]), Convert.ToString(fulloctetchar[43]), Convert.ToString(fulloctetchar[44]), Convert.ToString(fulloctetchar[45]), Convert.ToString(fulloctetchar[46]), Convert.ToString(fulloctetchar[47]));
                    ACID_palabra = ACID(oc1, oc2, oc3, oc4, oc5, oc6, oc7, oc8);
                }
                else if (DI_095 == true) //VERDADERO???
                {
                    DI_095_buffer1 = stringbinary[i];
                    DI_095         = false;

                    VA = Convert.ToString(Convert.ToInt32(DI_095_buffer1, 2));
                }
                else if (DI_032 == true)//????????
                {
                    DI_032_buffer1 = stringbinary[i];
                    DI_032         = false;
                }
                else if (DI_200 == true)
                {
                    DI_200_buffer1 = stringbinary[i];
                    DI_200         = false;
                }
                else if (DI_020 == true)
                {
                    DI_020_buffer1 = stringbinary[i];
                    DI_020         = false;
                }
                else if (DI_220 == true)//VERDADERO
                {
                    DI_220_buffer1 = stringbinary[i];
                    char[] prov = DI_220_buffer1.ToArray();
                    if (prov[prov.Length - 1] == '1')
                    {
                        i++;
                        DI_220_buffer2 = stringbinary[i];
                    }
                    DI_220 = false;
                }
                else if (DI_146 == true)
                {
                    DI_146_buffer1 = stringbinary[i];
                    i++;
                    DI_146_buffer2 = stringbinary[i];
                    DI_146         = false;
                }
                else if (DI_148 == true)
                {
                    DI_148_buffer1 = stringbinary[i];
                    i++;
                    DI_148_buffer2 = stringbinary[i];
                    DI_148         = false;
                }
                else if (DI_110 == true)
                {
                }
            }
            //myTime = DateTime.ParseExact(Time, "HH:mm:ss.fff",null);
        }
Exemple #2
0
        public void resolver_dataitems()
        {
            CAT = Convert.ToInt32(stringbinary[0], 2);
            int count = 0;

            if (listboolean_fspec.Count == 8)
            {
                count = 1;
            }
            else if (listboolean_fspec.Count == 16)
            {
                count = 2;
            }
            else if (listboolean_fspec.Count == 24)
            {
                count = 3;
            }
            else if (listboolean_fspec.Count == 32)
            {
                count = 4;
            }
            else if (listboolean_fspec.Count == 40)
            {
                count = 5;
            }
            else if (listboolean_fspec.Count == 48)
            {
                count = 6;
            }

            for (int i = (3 + count); i < stringbinary.Length; i++)
            {
                if (DI_010 == true) //VERDADERO HECHO
                {
                    DI_010_buffer1 = stringbinary[i];
                    i++;
                    DI_010_buffer2 = stringbinary[i];
                    DI_010         = false;

                    SAC = Convert.ToInt32(DI_010_buffer1, 2);
                    SIC = Convert.ToInt32(DI_010_buffer2, 2);
                }
                else if (DI_020 == true)//VERDADERO HECHO
                {
                    DI_020_buffer1 = stringbinary[i];
                    char[] prov = DI_020_buffer1.ToArray();
                    if (Convert.ToInt32(prov[prov.Length - 1]) == '1')
                    {
                        i++;
                        DI_020_buffer2 = stringbinary[i];
                    }
                    DI_020 = false;
                    if (prov[0] == '1')
                    {
                        D020_SSR = "Non-Mode S 1090MHz multilateration";
                    }
                    else
                    {
                        D020_SSR = "no Non-Mode S 1090MHz multilateration";
                    }
                    if (prov[1] == '1')
                    {
                        D020_MS = "Mode-S 1090 MHz multilateration";
                    }
                    else
                    {
                        D020_MS = "no Mode-s 1090 MHz multilateration";
                    }
                    if (prov[2] == '1')
                    {
                        D020_HF = "HF multilateration";
                    }
                    else
                    {
                        D020_HF = "no HF multilateration";
                    }
                    if (prov[3] == '1')
                    {
                        D020_VDL4 = "VDL Mode 4 multilateration";
                    }
                    else
                    {
                        D020_VDL4 = "no VDL Mode 4 multilateration";
                    }
                    if (prov[4] == '1')
                    {
                        D020_UAT = "UAT multilateration";
                    }
                    else
                    {
                        D020_UAT = "no UAT multilateration";
                    }
                    if (prov[5] == '1')
                    {
                        D020_DME = "DME/TACAN multilateration";
                    }
                    else
                    {
                        D020_DME = "no DME/TACAN multilateration";
                    }
                    if (prov[6] == '1')
                    {
                        D020_OT = "Other Tecnology Multilateration";
                    }
                    else
                    {
                        D020_OT = "No Other Tecnology Multilateration";
                    }

                    if (DI_020_buffer2 != null)
                    {
                        char[] prov2 = DI_020_buffer2.ToArray();
                        if (prov2[0] == '1')
                        {
                            D020_RAB = "Report from field monitor";
                        }
                        else
                        {
                            D020_RAB = "Report from target transponder";
                        }
                        if (prov2[1] == '1')
                        {
                            D020_SPI = "Special Position Identification";
                        }
                        else
                        {
                            D020_SPI = "Absence of SPI ";
                        }
                        if (prov2[2] == '1')
                        {
                            D020_CHN = "Chain 2";
                        }
                        else
                        {
                            D020_CHN = "Chain 1";
                        }
                        if (prov2[3] == '1')
                        {
                            D020_GBS = "Transponder Ground bit set";
                        }
                        else
                        {
                            D020_GBS = "Transponder Ground bit not set";
                        }
                        if (prov2[4] == '1')
                        {
                            D020_CRT = "Corrupted replies in multilateration";
                        }
                        else
                        {
                            D020_CRT = "No Corrupted reply in multilateration";
                        }
                        if (prov2[5] == '1')
                        {
                            D020_SIM = "Simulated target report";
                        }
                        else
                        {
                            D020_SIM = "Actual target report ";
                        }
                        if (prov2[6] == '1')
                        {
                            D020_TST = "Test Target";
                        }
                        else
                        {
                            D020_TST = "Default";
                        }
                    }
                }
                else if (DI_140 == true)//VERDADERO HECHO
                {
                    DI_140_buffer1 = stringbinary[i];
                    i++;
                    DI_140_buffer2 = stringbinary[i];
                    i++;
                    DI_140_buffer3 = stringbinary[i];
                    DI_140         = false;
                    int    DI_140_bff = Convert.ToInt32(String.Concat(DI_140_buffer1, DI_140_buffer2, DI_140_buffer3), 2);
                    double seconds    = Math.Round(Convert.ToDouble(DI_140_bff) / 128, 3);
                    myTime = TimeSpan.FromSeconds(seconds);
                    //Time = time.ToString(@"hh\:mm\:ss\.fff");
                }
                else if (DI_041 == true)
                {
                    DI_041_buffer1 = stringbinary[i];
                    i++;
                    DI_041_buffer2 = stringbinary[i];
                    i++;
                    DI_041_buffer3 = stringbinary[i];
                    i++;
                    DI_041_buffer4 = stringbinary[i];
                    i++;
                    DI_041_buffer5 = stringbinary[i];
                    i++;
                    DI_041_buffer6 = stringbinary[i];
                    i++;
                    DI_041_buffer7 = stringbinary[i];
                    i++;
                    DI_041_buffer8 = stringbinary[i];
                    DI_041         = false;
                }
                else if (DI_042 == true)//VERDADERO COMPROBADO
                {
                    DI_042_buffer1 = stringbinary[i];
                    i++;
                    DI_042_buffer2 = stringbinary[i];
                    i++;
                    DI_042_buffer3 = stringbinary[i];
                    i++;
                    DI_042_buffer4 = stringbinary[i];
                    i++;
                    DI_042_buffer5 = stringbinary[i];
                    i++;
                    DI_042_buffer6 = stringbinary[i];
                    DI_042         = false;

                    string oc1 = String.Concat(DI_042_buffer1, DI_042_buffer2, DI_042_buffer3);
                    string oc2 = String.Concat(DI_042_buffer4, DI_042_buffer5, DI_042_buffer6);

                    X = CA2todec(oc1) * 0.5;
                    if (X < 0)
                    {
                        X = X + 0.5;
                    }
                    Y = CA2todec(oc2) * 0.5;
                    if (Y < 0)
                    {
                        Y = Y + 0.5;
                    }

                    double gradlat      = 41;
                    double gradlon      = 2;
                    double mintogradlat = (Convert.ToDouble(17) / 60);
                    double mintogradlon = (Convert.ToDouble(4) / 60);
                    double sectogradlat = Convert.ToDouble(49.426) / 3600;
                    double sectogradlon = Convert.ToDouble(42.410) / 3600;
                    double latitud      = (Convert.ToDouble(gradlat) + Convert.ToDouble(mintogradlat)) + Convert.ToDouble(sectogradlat);
                    double longitud     = (Convert.ToDouble(gradlon) + Convert.ToDouble(mintogradlon)) + Convert.ToDouble(sectogradlon);
                    double lat_original = latitud;
                    latitud  = latitud + (X / 6378000) * (180 / Math.PI);
                    longitud = longitud + (Y / 6378000) * (180 / Math.PI) / Math.Cos(lat_original * (Math.PI / 180));;

                    punto = new PointLatLng(latitud, longitud);

                    string[] separados1lat;
                    string[] separados1lon;

                    separados1lat = Convert.ToString(latitud).Split(',');
                    separados1lon = Convert.ToString(longitud).Split(',');
                    string   gradoslat = separados1lat[0];
                    string   gradoslon = separados1lon[0];
                    string   uno = String.Concat("0,", separados1lat[1]);
                    string   dos = String.Concat("0,", separados1lon[1]);
                    double   mindeclat = Convert.ToDouble(uno) * 60;
                    double   mindeclon = Convert.ToDouble(dos) * 60;
                    string[] separados2lat = Convert.ToString(mindeclat).Split(',');
                    string[] separados2lon = Convert.ToString(mindeclon).Split(',');
                    string   minlat = separados2lat[0];
                    string   minlon = separados2lon[0];
                    double   segdeclat = Convert.ToDouble(String.Concat("0,", separados2lat[1])) * 60;
                    double   segdeclon = Convert.ToDouble(String.Concat("0,", separados2lon[1])) * 60;
                    string   seclat = (Math.Round(segdeclat, 3)).ToString(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
                    string   seclon = (Math.Round(segdeclon, 3)).ToString(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
                    string   latitudd, longitudd;
                    if (latitud > 0)
                    {
                        latitudd = String.Concat(gradoslat, "º", minlat, "'", seclat, '"', 'N');
                    }
                    else
                    {
                        latitudd = String.Concat(gradoslat, 'º', minlat, "'", seclat, '"', 'S');
                    }
                    if (longitud > 0)
                    {
                        longitudd = String.Concat(gradoslon, 'º', minlon, "'", seclon, '"', 'E');
                    }
                    else
                    {
                        longitudd = String.Concat(gradoslon, 'º', minlon, "'", seclon, '"', 'O');
                    }

                    coordinates = String.Concat(latitudd, longitudd);
                }
                else if (DI_161 == true)//VERDADERO HECHO
                {
                    DI_161_buffer1 = stringbinary[i];
                    i++;
                    DI_161_buffer2 = stringbinary[i];
                    DI_161         = false;
                    char[] buf1 = DI_161_buffer1.ToArray();
                    string conc = String.Concat(buf1[4], buf1[5], buf1[6], buf1[7], DI_161_buffer2);
                    TRACK_NUM = Convert.ToString(Convert.ToInt32(conc, 2));
                }
                else if (DI_170 == true)//VERDADERO HECHO
                {
                    DI_170_buffer1 = stringbinary[i];
                    char[] prov = DI_170_buffer1.ToArray();
                    if (prov[prov.Length - 1] == '1')
                    {
                        i++;
                        DI_170_buffer2 = stringbinary[i];
                    }
                    DI_170 = false;

                    char[] oc1 = DI_170_buffer1.ToArray();

                    string oc34 = String.Concat(oc1[3], oc1[4]);
                    if (oc1[0] == '1')
                    {
                        TRACKSTATUS_CNF = "Initiation phase";
                    }
                    else
                    {
                        TRACKSTATUS_CNF = "Confirmed track";
                    }

                    if (oc1[1] == '1')
                    {
                        TRACKSTATUS_TRE = "Last report for a track ";
                    }
                    else
                    {
                        TRACKSTATUS_TRE = "Default";
                    }
                    if (oc1[2] == '1')
                    {
                        TRACKSTATUS_CST = "Extrapolated";
                    }
                    else
                    {
                        TRACKSTATUS_CST = "Not extrapolated";
                    }
                    if (String.Compare(oc34, "00") == 0)
                    {
                        TRACKSTATUS_CDM = "Maintaning";
                    }
                    else if (String.Compare(oc34, "01") == 0)
                    {
                        TRACKSTATUS_CDM = "Cruising";
                    }
                    else if (String.Compare(oc34, "10") == 0)
                    {
                        TRACKSTATUS_CDM = "Descending";
                    }
                    else
                    {
                        TRACKSTATUS_CDM = "Invalid";
                    }
                    if (oc1[5] == '1')
                    {
                        TRACKSTATUS_MAH = "Horizontal manouvre";
                    }
                    else
                    {
                        TRACKSTATUS_MAH = "Default";
                    }
                    if (oc1[6] == '1')
                    {
                        TRACKSTATUS_STH = "Smoothed position";
                    }
                    else
                    {
                        TRACKSTATUS_STH = "Mesured position";
                    }

                    if (DI_170_buffer2 != null)
                    {
                        char[] oc2 = DI_170_buffer2.ToArray();
                        if (oc2[0] == '1')
                        {
                            TRACKSTATUS_GHO = "Ghost track";
                        }
                        else
                        {
                            TRACKSTATUS_GHO = "Default";
                        }
                    }
                }
                else if (DI_070 == true)//VERDADERO HECHO
                {
                    DI_070_buffer1 = stringbinary[i];
                    i++;
                    DI_070_buffer2 = stringbinary[i];
                    DI_070         = false;

                    char[] oc1       = DI_070_buffer1.ToArray();
                    char[] oc2       = DI_070_buffer2.ToArray();
                    string bit4_6    = String.Concat(oc1[4], oc1[5], oc1[6]);
                    string bit7_9    = String.Concat(oc1[7], oc2[0], oc2[1]);
                    string bit10_12  = String.Concat(oc2[2], oc2[3], oc2[4]);
                    string bit13_15  = String.Concat(oc2[5], oc2[6], oc2[7]);
                    int    bbit4_6   = Convert.ToInt32(bit4_6, 2);
                    int    bbit7_9   = Convert.ToInt32(bit7_9, 2);
                    int    bbit10_12 = Convert.ToInt32(bit10_12, 2);
                    int    bbit13_15 = Convert.ToInt32(bit13_15, 2);
                    MODE_3A = String.Concat(bbit4_6, bbit7_9, bbit10_12, bbit13_15);
                }
                else if (DI_202 == true)//VERDADERO LA MAYORIA BIEN!
                {
                    DI_202_buffer1 = stringbinary[i];
                    i++;
                    DI_202_buffer2 = stringbinary[i];
                    i++;
                    DI_202_buffer3 = stringbinary[i];
                    i++;
                    DI_202_buffer4 = stringbinary[i];
                    DI_202         = false;

                    string oc1 = String.Concat(DI_202_buffer1, DI_202_buffer2);
                    string oc2 = String.Concat(DI_202_buffer3, DI_202_buffer4);

                    VX = CA2todec(oc1) * 0.25;
                    if (VX < 0)
                    {
                        VX = VX + 0.25;
                    }
                    VY = CA2todec(oc2) * 0.25;//PUEDE FALLAR ESTE POR EL ÚLTIMO VALOR DEL TERCER OCTETO!!!
                    if (VY < 0)
                    {
                        VY = VY + 0.25;
                    }
                }
                else if (DI_090 == true)//VERDADERO HECHO
                {
                    DI_090_buffer1 = stringbinary[i];
                    i++;
                    DI_090_buffer2 = stringbinary[i];
                    DI_090         = false;

                    char[] oc1     = DI_090_buffer1.ToArray();
                    string ocfinal = String.Concat(oc1[2], oc1[3], oc1[4], oc1[5], oc1[6], oc1[7], DI_090_buffer2);
                    MODE_C = Convert.ToDouble(Convert.ToInt32(ocfinal, 2)) * 0.25;
                }
                else if (DI_100 == true)
                {
                    DI_100_buffer1 = stringbinary[i];
                    i++;
                    DI_100_buffer2 = stringbinary[i];
                    i++;
                    DI_100_buffer3 = stringbinary[i];
                    i++;
                    DI_100_buffer4 = stringbinary[i];
                    DI_100         = false;
                }
                else if (DI_220 == true)//VERDADERO HECHO
                {
                    DI_220_buffer1 = stringbinary[i];
                    i++;
                    DI_220_buffer2 = stringbinary[i];
                    i++;
                    DI_220_buffer3 = stringbinary[i];
                    DI_220         = false;
                    if (stringhex[i].Count() == 1)
                    {
                        stringhex[i] = String.Concat("0", stringhex[i]);
                    }
                    if (stringhex[i - 1].Count() == 1)
                    {
                        stringhex[i - 1] = String.Concat("0", stringhex[i]);
                    }
                    if (stringhex[i - 2].Count() == 1)
                    {
                        stringhex[i - 2] = String.Concat("0", stringhex[i]);
                    }
                    ADDRESS = String.Concat(stringhex[i - 2], stringhex[i - 1], stringhex[i]);
                }
                else if (DI_245 == true)//VERDADERO HECHO
                {
                    DI_245_buffer1 = stringbinary[i];
                    i++;
                    DI_245_buffer2 = stringbinary[i];
                    i++;
                    DI_245_buffer3 = stringbinary[i];
                    i++;
                    DI_245_buffer4 = stringbinary[i];
                    i++;
                    DI_245_buffer5 = stringbinary[i];
                    i++;
                    DI_245_buffer6 = stringbinary[i];
                    i++;
                    DI_245_buffer7 = stringbinary[i];
                    DI_245         = false;

                    string fulloctet     = String.Concat(DI_245_buffer1, DI_245_buffer2, DI_245_buffer3, DI_245_buffer4, DI_245_buffer5, DI_245_buffer6, DI_245_buffer7);
                    char[] fulloctetchar = fulloctet.ToArray();
                    string oc1           = String.Concat(Convert.ToString(fulloctetchar[8]), Convert.ToString(fulloctetchar[9]), Convert.ToString(fulloctetchar[10]), Convert.ToString(fulloctetchar[11]), Convert.ToString(fulloctetchar[12]), Convert.ToString(fulloctetchar[13]));
                    string oc2           = String.Concat(Convert.ToString(fulloctetchar[14]), Convert.ToString(fulloctetchar[15]), Convert.ToString(fulloctetchar[16]), Convert.ToString(fulloctetchar[17]), Convert.ToString(fulloctetchar[18]), Convert.ToString(fulloctetchar[19]));
                    string oc3           = String.Concat(Convert.ToString(fulloctetchar[20]), Convert.ToString(fulloctetchar[21]), Convert.ToString(fulloctetchar[22]), Convert.ToString(fulloctetchar[23]), Convert.ToString(fulloctetchar[24]), Convert.ToString(fulloctetchar[25]));
                    string oc4           = String.Concat(Convert.ToString(fulloctetchar[26]), Convert.ToString(fulloctetchar[27]), Convert.ToString(fulloctetchar[28]), Convert.ToString(fulloctetchar[29]), Convert.ToString(fulloctetchar[30]), Convert.ToString(fulloctetchar[31]));
                    string oc5           = String.Concat(Convert.ToString(fulloctetchar[32]), Convert.ToString(fulloctetchar[33]), Convert.ToString(fulloctetchar[34]), Convert.ToString(fulloctetchar[35]), Convert.ToString(fulloctetchar[36]), Convert.ToString(fulloctetchar[37]));
                    string oc6           = String.Concat(Convert.ToString(fulloctetchar[38]), Convert.ToString(fulloctetchar[39]), Convert.ToString(fulloctetchar[40]), Convert.ToString(fulloctetchar[41]), Convert.ToString(fulloctetchar[42]), Convert.ToString(fulloctetchar[43]));
                    string oc7           = String.Concat(Convert.ToString(fulloctetchar[44]), Convert.ToString(fulloctetchar[45]), Convert.ToString(fulloctetchar[46]), Convert.ToString(fulloctetchar[47]), Convert.ToString(fulloctetchar[48]), Convert.ToString(fulloctetchar[49]));

                    ACID_palabra = ACID(oc1, oc2, oc3, oc4, oc5, oc6, oc7);
                }
                else if (DI_110 == true)
                {
                    DI_110_buffer1 = stringbinary[i];
                    i++;
                    DI_110_buffer2 = stringbinary[i];
                    DI_110         = false;
                }
                else if (DI_105 == true)
                {
                    DI_105_buffer1 = stringbinary[i];
                    i++;
                    DI_105_buffer2 = stringbinary[i];
                    DI_105         = false;
                }
                else if (DI_210 == true)
                {
                    DI_210_buffer1 = stringbinary[i];
                    i++;
                    DI_210_buffer2 = stringbinary[i];
                    DI_210         = false;
                }
                else if (DI_300 == true)
                {
                    DI_300_buffer1 = stringbinary[i];
                    DI_300         = false;
                }
                else if (DI_310 == true)
                {
                    DI_310_buffer1 = stringbinary[i];
                    DI_310         = false;
                }
                else if (DI_500 == true)//VERDADERO (NO SÉ SI ES NECESARIO)
                {
                    DI_500_buffer1 = stringbinary[i];
                    char[] buff1 = DI_500_buffer1.ToArray();
                    if (buff1[0] == '1')
                    {
                        i++;
                        DI_500_buffer2 = stringbinary[i];
                        i++;
                        DI_500_buffer3 = stringbinary[i];
                        i++;
                        DI_500_buffer4 = stringbinary[i];
                        i++;
                        DI_500_buffer5 = stringbinary[i];
                        i++;
                        DI_500_buffer6 = stringbinary[i];
                        i++;
                        DI_500_buffer7 = stringbinary[i];
                    }
                    if (buff1[1] == '1')
                    {
                        i++;
                        DI_500_buffer8 = stringbinary[i];
                        i++;
                        DI_500_buffer9 = stringbinary[i];
                        i++;
                        DI_500_buffer10 = stringbinary[i];
                        i++;
                        DI_500_buffer11 = stringbinary[i];
                        i++;
                        DI_500_buffer12 = stringbinary[i];
                        i++;
                        DI_500_buffer13 = stringbinary[i];
                    }
                    if (buff1[2] == '1')
                    {
                        i++;
                        DI_500_buffer14 = stringbinary[i];
                        i++;
                        DI_500_buffer15 = stringbinary[i];
                    }
                    DI_500 = false;
                }
                else if (DI_400 == true)//VERDADERO HECHO
                {
                    DI_400_buffer1 = stringbinary[i];
                    i++;
                    DI_400_buffer2 = stringbinary[i];
                    i++;
                    DI_400_buffer3 = stringbinary[i];
                    i++;
                    DI_400_buffer4 = stringbinary[i];
                    i++;
                    DI_400_buffer5 = stringbinary[i];
                    i++;
                    DI_400_buffer6 = stringbinary[i];
                    i++;
                    DI_400_buffer7 = stringbinary[i];
                    i++;
                    DI_400_buffer8 = stringbinary[i];
                    i++;
                    DI_400_buffer9 = stringbinary[i];
                    i++;
                    DI_400 = false;

                    char[] oc1  = DI_400_buffer1.ToArray();
                    char[] oc2  = DI_400_buffer2.ToArray();
                    char[] oc3  = DI_400_buffer3.ToArray();
                    char[] oc4  = DI_400_buffer4.ToArray();
                    char[] oc5  = DI_400_buffer5.ToArray();
                    char[] oc6  = DI_400_buffer6.ToArray();
                    char[] oc7  = DI_400_buffer7.ToArray();
                    char[] oc8  = DI_400_buffer8.ToArray();
                    char[] oc9  = DI_400_buffer9.ToArray();
                    int    suma = 0;
                    for (int d = 0; d < oc1.Length; d++)
                    {
                        if (oc1[d] == '1')
                        {
                            suma++;
                        }
                        if (oc2[d] == '1')
                        {
                            suma++;
                        }
                        if (oc3[d] == '1')
                        {
                            suma++;
                        }
                        if (oc4[d] == '1')
                        {
                            suma++;
                        }
                        if (oc5[d] == '1')
                        {
                            suma++;
                        }
                        if (oc6[d] == '1')
                        {
                            suma++;
                        }
                        if (oc7[d] == '1')
                        {
                            suma++;
                        }
                        if (oc8[d] == '1')
                        {
                            suma++;
                        }
                        if (oc9[d] == '1')
                        {
                            suma++;
                        }
                    }
                    RECEIVERS = suma - 1;
                }
                else if (DI_250 == true)
                {
                    DI_250_buffer1 = stringbinary[i];
                    DI_250         = false;
                }
                else if (DI_230 == true)
                {
                    DI_230_buffer1 = stringbinary[i];
                    i++;
                    DI_230_buffer2 = stringbinary[i];
                    DI_230         = false;
                }
                else if (DI_260 == true)
                {
                    DI_260_buffer1 = stringbinary[i];
                    i++;
                    DI_260_buffer2 = stringbinary[i];
                    i++;
                    DI_260_buffer3 = stringbinary[i];
                    i++;
                    DI_260_buffer4 = stringbinary[i];
                    i++;
                    DI_260_buffer5 = stringbinary[i];
                    i++;
                    DI_260_buffer6 = stringbinary[i];
                    i++;
                    DI_260_buffer7 = stringbinary[i];
                    DI_260         = false;
                }
                else if (DI_030 == true)
                {
                    DI_030_buffer1 = stringbinary[i];
                    char[] prov = DI_030_buffer1.ToArray();
                    if (prov[prov.Length - 1] == '1')
                    {
                        i++;
                        DI_030_buffer2 = stringbinary[i];
                    }
                    DI_030 = false;
                }
                else if (DI_055 == true)
                {
                    DI_055_buffer1 = stringbinary[i];
                    DI_055         = false;
                }
                else if (DI_050 == true)
                {
                    DI_050_buffer1 = stringbinary[i];
                    i++;
                    DI_050_buffer2 = stringbinary[i];
                    DI_050         = false;
                }
            }
            //myTime = DateTime.ParseExact(Time, "HH:mm:ss.fff", System.Globalization.CultureInfo.InvariantCulture);
        }