private void dispatcherTimer_TickCAT21(object sender, EventArgs e)
        {
            checkActual();
            Boolean t = true;

            while (t == true)
            {
                CAT21 cat21 = CAT21s[this.contador];
                this.tiempo = cat21.TOD.Split(':');
                if (Convert.ToInt32(tiempo[2]) == secact)
                {
                    addMarkerADSB(cat21.LatitudeWGS, cat21.LongitudeWGS, cat21.TargetID);
                    this.contador++;
                    if (mapView.Markers.Count >= 200)
                    {
                        mapView.Markers[mapView.Markers.Count - 200].Clear();
                    }
                }
                else
                {
                    t = false;
                    secact++;
                }

                clockUpdate(this.tiempo);
            }
            flightdata.Rows.Clear();
            fillGridFlightsCAT21();
        }
        public int ReadFile(string path)
        {
            if (File.Exists(path))
            {
                try
                {
                    this.fileReader = new BinaryReader(File.Open(path, FileMode.Open));

                    while (fileReader.BaseStream.Position != fileReader.BaseStream.Length)
                    {
                        int category = fileReader.ReadByte();

                        byte[] lengthBytes = fileReader.ReadBytes(2);
                        if (BitConverter.IsLittleEndian)
                        {
                            Array.Reverse(lengthBytes);
                        }
                        int length = BitConverter.ToInt16(lengthBytes, 0);
                        if (Convert.ToInt16(category) == 10)
                        {
                            CAT10       dataBlock = new CAT10(length);
                            List <byte> data      = fileReader.ReadBytes(length - 3).ToList <byte>();
                            dataBlock.SetMessage(data);
                            dataBlock.GetFSPEC(data);
                            //dataBlock.FullDecode();
                            this.dataBlocks.Add(dataBlock);
                        }
                        else if (Convert.ToInt16(category) == 21)
                        {
                            CAT21       dataBlock = new CAT21(length);
                            List <byte> data      = fileReader.ReadBytes(length - 3).ToList <byte>();
                            dataBlock.SetMessage(data);
                            dataBlock.GetFSPEC(data);
                            //dataBlock.FullDecode();
                            this.dataBlocks.Add(dataBlock);
                        }
                        else
                        {
                            List <byte> data = fileReader.ReadBytes(length - 3).ToList <byte>();
                        }
                    }
                    Parallel.ForEach(dataBlocks, DataBlock =>
                    {
                        DataBlock.FullDecode();
                    });
                    DecodeFlights();
                    return(0);
                }
                catch (Exception e)
                {
                    return(-1);
                }
            }
            else
            {
                return(-2);
            }
        }
示例#3
0
        public double Horizontal_Accuracy_Pos(CAT21 list)
        {
            string NACp = list.Quality_Indicators[2];

            if (NACp == "0")
            {
                return(18520.0);
            }
            if (NACp == "1")
            {
                return(18520.0);
            }
            if (NACp == "2")
            {
                return(7408.0);
            }
            if (NACp == "3")
            {
                return(3704.0);
            }
            if (NACp == "4")
            {
                return(1852.0);
            }
            if (NACp == "5")
            {
                return(926.0);
            }
            if (NACp == "6")
            {
                return(555.6);
            }
            if (NACp == "7")
            {
                return(185.2);
            }
            if (NACp == "8")
            {
                return(92.6);
            }
            if (NACp == "9")
            {
                return(30.0);
            }
            if (NACp == "10")
            {
                return(10.0);
            }
            if (NACp == "11")
            {
                return(3.0);
            }
            else
            {
                return(double.NaN);
            }
        }
示例#4
0
        public double checkdistanceADSB(CAT21 C21)
        {
            // comparamos los módulos de dos segmentos : el que une el ARP con 10 MN y el que une el ARP con el avión
            double lat = C21.Lat_WGS_84;
            double lon = C21.Lon_WGS_84;

            // conversion de WGS a Cart
            double[] cart = M.WGStoCartesian(lat, lon);

            return(Math.Sqrt(Math.Pow(cart[0], 2) + Math.Pow(cart[1], 2)) / 1851.85185185185);
        }
示例#5
0
 public void updateFlight(CAT21 listcat21, int i)
 {
     if (this.callsign == null && listcat21.TargetID != null)
     {
         this.callsign = listcat21.TargetID;
     }
     packages.Add(i);
     lats.Add(listcat21.LatitudeWGS);
     lngs.Add(listcat21.LongitudeWGS);
     fls.Add(listcat21.FlightLevel);
     TODs.Add(listcat21.TOD);
 }
示例#6
0
        public Flight(CAT21 listcat21, int i)
        {
            this.callsign    = listcat21.TargetID;
            this.CAT         = 20;
            this.tracknumber = Convert.ToString(listcat21.TrackNumber);
            this.messagetype = "ADS-B";
            this.SIC         = Convert.ToInt32(listcat21.SIC);
            this.SAC         = Convert.ToInt32(listcat21.SAC);

            packages.Add(i);
            lats.Add(listcat21.LatitudeWGS);
            lngs.Add(listcat21.LongitudeWGS);
            fls.Add(listcat21.FlightLevel);
            TODs.Add(listcat21.TOD);
        }
示例#7
0
        public double Compute_GVA(CAT21 C21)
        {
            string GVA = C21.Quality_Indicators[5];

            if (GVA == "1")
            {
                return(150.0);
            }
            if (GVA == "2")
            {
                return(45.0);
            }
            else
            {
                return(double.NaN);
            }
        }
示例#8
0
        public void leer()
        {
            byte[]        fileBytes = File.ReadAllBytes(path);
            List <byte[]> listabyte = new List <byte[]>();
            int           i         = 0;
            int           contador  = fileBytes[2];

            while (i < fileBytes.Length)
            {
                byte[] array = new byte[contador];
                for (int j = 0; j < array.Length; j++)
                {
                    array[j] = fileBytes[i];
                    i++;
                }
                listabyte.Add(array);
                if (i + 2 < fileBytes.Length)
                {
                    contador = fileBytes[i + 2];
                }
            }


            List <string[]> listahex = new List <string[]>();

            for (int x = 0; x < listabyte.Count; x++)
            {
                byte[]   buffer   = listabyte[x];
                string[] arrayhex = new string[buffer.Length];
                for (int y = 0; y < buffer.Length; y++)
                {
                    arrayhex[y] = buffer[y].ToString("X");
                    if (arrayhex[y].Length != 2)
                    {
                        arrayhex[y] = String.Concat("0", arrayhex[y]);
                    }
                }
                listahex.Add(arrayhex);
            }

            for (int q = 0; q < listahex.Count; q++)
            {
                string[] arraystring = listahex[q];
                int      CAT         = int.Parse(arraystring[0], System.Globalization.NumberStyles.HexNumber);

                if (CAT == 10)
                {
                    //try
                    //{
                    CAT10 newcat10 = new CAT10(arraystring);
                    newcat10.Calculate_FSPEC(newcat10.paquete);
                    listaCAT10.Add(newcat10);

                    //}
                    //catch
                    //{
                    //    Console.WriteLine(q);
                    //    Console.ReadKey();
                    //}
                }


                if (CAT == 21)
                {
                    string FSPEC = "";

                    int  j     = 3;
                    bool found = false;

                    while (found == false)
                    {
                        FSPEC = Convert.ToString(Convert.ToInt32(arraystring[j], 16), 2);// Convertir de hex a binario paquete [3]
                        FSPEC = AddZeros(FSPEC);

                        if (Char.ToString(FSPEC[FSPEC.Length - 1]) == "1")
                        {
                            while (Char.ToString(FSPEC[FSPEC.Length - 1]) != "0")
                            {
                                j = j + 1;
                                string parte2 = Convert.ToString(Convert.ToInt32(arraystring[j], 16), 2);
                                parte2 = AddZeros(parte2);

                                FSPEC = String.Concat(FSPEC, parte2);
                            }

                            found = true;
                        }

                        found = true;
                    }

                    int data_position = 1 + 2 + ((FSPEC.Length) / 8);

                    string string1 = Convert.ToString(arraystring[data_position]);
                    string1 = Convert.ToString(Convert.ToInt32(string1, 16), 2);
                    string1 = AddZeros(string1);

                    string string2 = Convert.ToString(arraystring[data_position + 1]);
                    string2 = Convert.ToString(Convert.ToInt32(string2, 16), 2);
                    string2 = AddZeros(string2);

                    data_position = data_position + 2;

                    string DataSourceIdentification = String.Concat(string1, string2);

                    Calculate_DataSourceIdentification(DataSourceIdentification);

                    // ahora que sabemos que version es cada paquete los metemos en su lista correspondiente.

                    if (SAC == 20 && SIC == 219)
                    {
                        CAT21 newcat21 = new CAT21(arraystring);
                        newcat21.Calculate_FSPEC(newcat21.paquete);
                        listaCAT21.Add(newcat21);
                    }

                    if (SAC == 0 && SIC == 107)
                    {
                        CAT21v23 newcat21v23 = new CAT21v23(arraystring);
                        newcat21v23.Calculate_FSPEC(newcat21v23.paquete);
                        listaCAT21v23.Add(newcat21v23);
                    }
                }
            }
        }
示例#9
0
 public CAT21_TARGET(CAT21 cat21)
 {
     InitializeComponent();
     this.cat21 = cat21;
 }
 public MoreInfoOfPacketCAT21(CAT21 packet)
 {
     InitializeComponent();
     this.selectedPacket = packet;
 }
        private void searchbut_Click(object sender, RoutedEventArgs e) // botón SEARCH
        {
            if (combobox.SelectedIndex == 0)                           // buscar por número de paquete
            {
                try
                {
                    int package = Convert.ToInt32(searchbox.Text) - 1;

                    if (this.cat == 10)
                    {
                        CAT10 cat10search = f.getCAT10(package);

                        dataCATsearch = f.getTablaCAT10Indv(cat10search, package);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();

                        filldataexpandedCAT10(package);
                    }
                    if (this.cat == 20)
                    {
                        CAT20 cat20search = f.getCAT20(package);

                        dataCATsearch = f.getTablaCAT20Indv(cat20search, package);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();

                        filldataexpandedCAT20(package);
                    }
                    if (this.cat == 21)
                    {
                        CAT21 cat21search = f.getCAT21(package);

                        dataCATsearch = f.getTablaCAT21Indv(cat21search, package);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();

                        filldataexpandedCAT21(package);
                    }
                }
                catch
                {
                    MessageBox.Show("Package not available, check the number");
                }
            }
            if (combobox.SelectedIndex == 1) // buscar por callsign
            {
                try
                {
                    if (this.cat == 10)
                    {
                        dataCATsearch = f.SearchCallsignCAT10(searchbox.Text);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();
                    }
                    if (this.cat == 20)
                    {
                        dataCATsearch = f.SearchCallsignCAT20(searchbox.Text);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();
                    }
                    if (this.cat == 21)
                    {
                        dataCATsearch = f.SearchCallsignCAT21(searchbox.Text);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();
                    }
                }
                catch
                {
                    MessageBox.Show("Package not available, check the callsign");
                }
            }
            if (combobox.SelectedIndex == 2) // buscar por track number
            {
                try
                {
                    if (this.cat == 10)
                    {
                        dataCATsearch = f.SearchTrackNumberCAT10(searchbox.Text);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();
                    }
                    if (this.cat == 20)
                    {
                        dataCATsearch = f.SearchTrackNumberCAT20(searchbox.Text);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();
                    }
                    if (this.cat == 21)
                    {
                        dataCATsearch = f.SearchTrackNumberCAT21(searchbox.Text);

                        gridCAT.ItemsSource = dataCATsearch.DefaultView;
                        gridCAT.Items.Refresh();
                    }
                }
                catch
                {
                    MessageBox.Show("Package not available, check the track number");
                }
            }
        }
        private void filldataexpandedCAT21(int index) //crea la tabla pequeña de CAT21 (solo con los items que existan)
        {
            DataTable expanded = new DataTable();
            CAT21     cat21exp = f.getCAT21(index);

            expanded.Columns.Add(new DataColumn());
            expanded.Columns.Add(new DataColumn());

            expanded.Rows.Add("Package #", index + 1);
            if (cat21exp.DataSourceID != null)
            {
                expanded.Rows.Add("Data Source", cat21exp.DataSourceID);
            }
            if (cat21exp.TargetID != null)
            {
                expanded.Rows.Add("Target ID", cat21exp.TargetID);
            }
            if (cat21exp.TrackNumber != null)
            {
                expanded.Rows.Add("Track Number", cat21exp.TrackNumber);
            }
            if (cat21exp.TOD != null)
            {
                expanded.Rows.Add("Time of Day", cat21exp.TOD);
            }
            if (cat21exp.TimeOfAsterixReportTransmission_ != null)
            {
                expanded.Rows.Add("Time of ASTERIX Report Transmission", cat21exp.TimeOfAsterixReportTransmission_);
            }
            if (cat21exp.positionWGS != null)
            {
                expanded.Rows.Add("Position WGS-84 coordinates\n[Latitude, Longitude]", cat21exp.positionWGS);
            }
            if (cat21exp.AirborneGroundVector != null)
            {
                expanded.Rows.Add("Airborne Ground vector\n[Ground Speed, Track Angle]", cat21exp.AirborneGroundVector);
            }
            if (cat21exp.TrackAngleRate != null)
            {
                expanded.Rows.Add("Track Angle Rate", cat21exp.TrackAngleRate);
            }
            if (cat21exp.FlightLevel != null)
            {
                expanded.Rows.Add("Flight Level", cat21exp.FlightLevel);
            }
            if (cat21exp.TargetAddress != null)
            {
                expanded.Rows.Add("Target Address", cat21exp.TargetAddress);
            }
            if (cat21exp.TargetReport != null)
            {
                expanded.Rows.Add("Target Report", cat21exp.TargetReport);
            }
            if (cat21exp.OperationalStatus != null)
            {
                expanded.Rows.Add("Operational Status", cat21exp.OperationalStatus);
            }
            if (cat21exp.HRpositionWGS != null)
            {
                expanded.Rows.Add("High Resolution position WGS-84\n[Latitude, Longitude]", cat21exp.HRpositionWGS);
            }
            if (cat21exp.AirSpeed != null)
            {
                expanded.Rows.Add("Air Speed", cat21exp.AirSpeed);
            }
            if (cat21exp.TrueAirspeed != null)
            {
                expanded.Rows.Add("True Air Speed", cat21exp.TrueAirspeed);
            }
            if (cat21exp.GeometricHeight != null)
            {
                expanded.Rows.Add("Geometric Height", cat21exp.GeometricHeight);
            }
            if (cat21exp.SelectedAltitude_IS != null)
            {
                expanded.Rows.Add("Selected Altitude\nIntermediate State", cat21exp.SelectedAltitude_IS);
            }
            if (cat21exp.SelectedAltitude_FS != null)
            {
                expanded.Rows.Add("Selected Altitude\nFinal State", cat21exp.SelectedAltitude_FS);
            }
            if (cat21exp.MOPS != null)
            {
                expanded.Rows.Add("MOPS version", cat21exp.MOPS);
            }
            if (cat21exp.MagneticHeading != null)
            {
                expanded.Rows.Add("Magnetic Heading", cat21exp.MagneticHeading);
            }
            if (cat21exp.BarometricVerticalRate != null)
            {
                expanded.Rows.Add("Barometric Vertical rate", cat21exp.BarometricVerticalRate);
            }
            if (cat21exp.GeometricVerticalRate != null)
            {
                expanded.Rows.Add("Geometric Vertical rate", cat21exp.GeometricVerticalRate);
            }
            if (cat21exp.Mode3ACode != null)
            {
                expanded.Rows.Add("Mode 3A Code", cat21exp.Mode3ACode);
            }
            if (cat21exp.MetReport != null)
            {
                expanded.Rows.Add("Met Report", cat21exp.MetReport);
            }
            if (cat21exp.ECAT != null)
            {
                expanded.Rows.Add("Emitter category", cat21exp.ECAT);
            }
            if (cat21exp.TargetStatus != null)
            {
                expanded.Rows.Add("Target Status", cat21exp.TargetStatus);
            }
            if (cat21exp.TrackAngleRate != null)
            {
                expanded.Rows.Add("Track Angle Rate", cat21exp.TrackAngleRate);
            }
            if (cat21exp.RateOfTurn != null)
            {
                expanded.Rows.Add("Rate of Turn", cat21exp.RateOfTurn);
            }
            if (cat21exp.RollAngle != null)
            {
                expanded.Rows.Add("Roll Angle", cat21exp.RollAngle);
            }
            if (cat21exp.serviceID != null)
            {
                expanded.Rows.Add("Service Identification", cat21exp.serviceID);
            }
            if (cat21exp.QualityIndicators != null)
            {
                expanded.Rows.Add("Quality Indicators", cat21exp.QualityIndicators);
            }
            if (cat21exp.ModeS != null)
            {
                expanded.Rows.Add("Mode S", cat21exp.ModeS);
            }
            if (cat21exp.LinkTech != null)
            {
                expanded.Rows.Add("Link Technology", cat21exp.LinkTech);
            }
            if (cat21exp.RP != null)
            {
                expanded.Rows.Add("Report period", cat21exp.RP);
            }
            if (cat21exp.MSGampl != null)
            {
                expanded.Rows.Add("Message amplitude", cat21exp.MSGampl);
            }
            if (cat21exp.TrackAngleRate != null)
            {
                expanded.Rows.Add("Track Angle rate", cat21exp.TrackAngleRate);
            }
            if (cat21exp.RID != null)
            {
                expanded.Rows.Add("Receiver ID", cat21exp.RID);
            }
            if (cat21exp.TimeOfApplicabilityForPosition_ != null)
            {
                expanded.Rows.Add("Time of Applicability\nfor position", cat21exp.TimeOfApplicabilityForPosition_);
            }
            if (cat21exp.TimeOfApplicabilityForVelocity_ != null)
            {
                expanded.Rows.Add("Time of Applicability\nfor velocity", cat21exp.TimeOfApplicabilityForVelocity_);
            }
            if (cat21exp.TimeOfMessageReceptionForPosition_ != null)
            {
                expanded.Rows.Add("Time of Message Reception\nfor position", cat21exp.TimeOfMessageReceptionForPosition_);
            }
            if (cat21exp.TimeOfMessageReceptionForVelocity_ != null)
            {
                expanded.Rows.Add("Time of Message Reception\nfor velocity", cat21exp.TimeOfMessageReceptionForVelocity_);
            }
            if (cat21exp.TimeOfMessageReceptionForPosition_HighPrecision_ != null)
            {
                expanded.Rows.Add("Time of Message Reception\nfor position - High Resolution", cat21exp.TimeOfMessageReceptionForPosition_HighPrecision_);
            }
            if (cat21exp.TimeOfMessageReceptionForVelocity_HighPrecision_ != null)
            {
                expanded.Rows.Add("Time of Message Reception\nfor velocity - High Resolution", cat21exp.TimeOfMessageReceptionForVelocity_HighPrecision_);
            }
            if (cat21exp.TrajectoryIntentData != null)
            {
                expanded.Rows.Add("Trajectory Intent Data", cat21exp.TrajectoryIntentData);
            }
            if (cat21exp.posAccuracy != null)
            {
                expanded.Rows.Add("Position accuracy", cat21exp.posAccuracy);
            }
            if (cat21exp.velAccuracy != null)
            {
                expanded.Rows.Add("Velocity accuracy", cat21exp.velAccuracy);
            }
            if (cat21exp.TODaccuracy != null)
            {
                expanded.Rows.Add("Time of Day accuracy", cat21exp.TODaccuracy);
            }
            if (cat21exp.FigureOfMerit != null)
            {
                expanded.Rows.Add("Figure of merit", cat21exp.FigureOfMerit);
            }
            if (cat21exp.ages != null)
            {
                expanded.Rows.Add("Data Ages", cat21exp.ages);
            }
            if (cat21exp.RP != null)
            {
                expanded.Rows.Add("Service Management", cat21exp.RP);
            }

            dataexpanded.ItemsSource = expanded.DefaultView;
            dataexpanded.Items.Refresh();
        }
示例#13
0
 public CAT21_INFOFLIGHT(CAT21 cat21, List <PointLatLng> listaCoordenadas)
 {
     InitializeComponent();
     this.cat21            = cat21;
     this.listaCoordenadas = listaCoordenadas;
 }
示例#14
0
        public void leer()
        {
            //StreamReader fichero = new StreamReader(path);
            //string linea = fichero.ReadLine();
            byte[] fileBytes = File.ReadAllBytes(path);
            filename = path;

            List <string[]> listahex = M.File_to_HexaList(fileBytes, path);

            int contadorGeneral = 0;
            int contadorCAT10   = 0;
            int contadorCAT21   = 0;

            bool multicat = M.IsAMulticatFile(listahex);

            for (int q = 0; q < listahex.Count; q++)
            {
                string[] arraystring = listahex[q];
                CAT = int.Parse(arraystring[0], System.Globalization.NumberStyles.HexNumber);
                contadorGeneral++;

                if (CAT == 10)
                {
                    if (multicat == false)
                    {
                        CAT10 C10 = new CAT10();
                        CAT_list.Add(CAT); // Adds the pack category into this list
                        contadorCAT10++;
                        C10.Decode10(arraystring);
                        listaCAT10.Add(C10);

                        // CAT10 reduced table for maptrack
                        tablacat10reducida.Rows.Add(contadorCAT10, C10.Target_ID, M.convert_to_hms(Math.Floor(C10.Time_Day)), C10.FL[2], C10.Data_Source_ID[0], C10.Data_Source_ID[1],
                                                    Math.Round(M.cartesiantolatmlat(C10.Pos_Cartesian[0], C10.Pos_Cartesian[1]), 2), Math.Round(M.cartesiantolonmlat(C10.Pos_Cartesian[0], C10.Pos_Cartesian[1]), 2),
                                                    C10.Target_Add, C10.Track_Num);

                        // Complete CAT10 table
                        tablaCAT10.Rows.Add(contadorCAT10, CAT, C10.Data_Source_ID[0], C10.Data_Source_ID[1], C10.Target_ID, C10.Track_Num, "Click to View Data",
                                            C10.Message_Type, M.convert_to_hms(Math.Floor(C10.Time_Day)), "(" + C10.Pos_WGS84[0] + ", " + C10.Pos_WGS84[1] + ")", "(" + C10.Pos_PolarCoord[0] + ", " + C10.Pos_PolarCoord[1] + ")",
                                            "(" + C10.Pos_Cartesian[0] + ", " + C10.Pos_Cartesian[1] + ")", "(" + C10.Track_Vel_Polar[0] + ", " + C10.Track_Vel_Polar[1] + ")", "(" + C10.Track_Vel_Cartesian[0] +
                                            ", " + C10.Track_Vel_Cartesian[1] + ")", "Click to View Data", "Click to View Data", C10.Target_Add, "Click to View Data", C10.Fleet_ID, C10.FL[2], C10.Height,
                                            "(" + C10.Target_Size_Heading[0] + ", " + C10.Target_Size_Heading[2] + ")", C10.Target_Size_Heading[1], "Click to View Data", "Click to View Data",
                                            "(" + C10.StndrdDev_Position[0] + ", " + C10.StndrdDev_Position[1] + ")", C10.StndrdDev_Position[2], "Click to View Data", C10.Amplitude, "(" + C10.Acceleration[0] +
                                            ", " + C10.Acceleration[1] + ")");
                    }
                    if (multicat == true)
                    {
                        CAT10 C10 = new CAT10();
                        CAT_list.Add(CAT); // Adds the pack category into this list
                        contadorCAT10++;
                        C10.Decode10(arraystring);
                        listaCAT10.Add(C10);

                        // Multiple CAT reduced table for maptrack
                        multiplecattablereducida.Rows.Add(contadorGeneral, C10.Target_ID, M.convert_to_hms(Math.Floor(C10.Time_Day)), C10.FL[2], C10.Data_Source_ID[0], C10.Data_Source_ID[1],
                                                          Math.Round(M.cartesiantolatmlat(C10.Pos_Cartesian[0], C10.Pos_Cartesian[1]), 2), Math.Round(M.cartesiantolonmlat(C10.Pos_Cartesian[0], C10.Pos_Cartesian[1]), 2),
                                                          C10.Target_Add, C10.Track_Num);

                        // Complete Multiple CAT table
                        tablaMultipleCAT.Rows.Add(contadorGeneral, CAT, C10.Data_Source_ID[0], C10.Data_Source_ID[1], C10.Target_ID, C10.Track_Num, M.convert_to_hms(Math.Floor(C10.Time_Day)),
                                                  "Click to View Data", "(" + C10.Pos_WGS84[0] + ", " + C10.Pos_WGS84[1] + ")", "Click to View Data", "Click to View Data", C10.FL[2], C10.Height,
                                                  C10.Target_Add, C10.Amplitude,

                                                  "(" + C10.Target_Size_Heading[0] + ", " + C10.Target_Size_Heading[2] + ")", C10.Target_Size_Heading[1], C10.Message_Type, "(" + C10.Pos_PolarCoord[0] +
                                                  ", " + C10.Pos_PolarCoord[1] + ")", "(" + C10.Pos_Cartesian[0] + ", " + C10.Pos_Cartesian[1] + ")", "(" + C10.Track_Vel_Polar[0] + ", " + C10.Track_Vel_Polar[1] +
                                                  ")", "(" + C10.Track_Vel_Cartesian[0] + ", " + C10.Track_Vel_Cartesian[1] + ")", "Click To View Data", C10.Fleet_ID, "Click to View Data", "Click to View Data",
                                                  "(" + C10.StndrdDev_Position[0] + ", " + C10.StndrdDev_Position[1] + ")", C10.StndrdDev_Position[2], "Click to View Data", "(" + C10.Acceleration[0] +
                                                  ", " + C10.Acceleration[1] + ")", "", "", "", "",
                                                  "", "", "", "", "", "", "", "", "", "", "",
                                                  "", "", "", "", "", "", "", "", "", "", "", "");
                    }
                }
                if (CAT == 21)
                {
                    SICSAC = M.getSIC_SAC(arraystring);
                    contadorCAT21++;
                    // Check if its version 23
                    if (multicat == false && SICSAC[0] == 107 && SICSAC[1] == 0)
                    {
                        CAT21_v23 C21_v23 = new CAT21_v23();
                        CAT_list.Add(CAT + 0.23); // Adds the pack category into this list
                        C21_v23.Decode21_23(arraystring);
                        listaCAT21_v23.Add(C21_v23);

                        // CAT21 reduced table for maptrack
                        tablacat21reducida.Rows.Add(contadorCAT21, C21_v23.Target_ID, M.convert_to_hms(Math.Floor((C21_v23.Time_of_Day))), C21_v23.FL, C21_v23.Data_Source_ID_SIC, C21_v23.Data_Source_ID_SAC,
                                                    Math.Round(C21_v23.Lat_WGS_84, 3), Math.Round(C21_v23.Lon_WGS_84, 3), C21_v23.Target_Address, "Null");

                        // Complete CAT21 table
                        tablaCAT21.Rows.Add(contadorCAT21, CAT + 0.23, C21_v23.Data_Source_ID_SIC, C21_v23.Data_Source_ID_SAC, C21_v23.Target_ID, " ", "Click to View Data",
                                            M.convert_to_hms(Math.Floor((C21_v23.Time_of_Day))), "(" + Math.Round(C21_v23.Lat_WGS_84, 3) + ", " + Math.Round(C21_v23.Lon_WGS_84, 3) + ")", "(" + Math.Round(C21_v23.Lat_WGS_84, 3) + ", " + Math.Round(C21_v23.Lon_WGS_84, 3) + ")", C21_v23.FL, C21_v23.GA,
                                            "", "(" + C21_v23.Air_Speed[0] + ", " + C21_v23.Air_Speed[1] + ")", C21_v23.True_Airspeed, "(" + C21_v23.GS + ", " + C21_v23.TA + ")", "", "", "",
                                            C21_v23.MH, C21_v23.BVR, C21_v23.GVR, "", "Click to View Data", C21_v23.ECAT, C21_v23.Target_Address, "Click to View Data", C21_v23.Roll, "",
                                            "", "", "", "", "", "", "", "", "", "", "", "Click To View Data", "", "");
                    }
                    if (multicat == true)
                    {
                        CAT21_v23 C21_v23 = new CAT21_v23();
                        CAT_list.Add(CAT + 0.23); // Adds the pack category into this list
                        C21_v23.Decode21_23(arraystring);
                        listaCAT21_v23.Add(C21_v23);

                        // Multiple CAT reduced table for maptrack
                        multiplecattablereducida.Rows.Add(contadorGeneral, C21_v23.Target_ID, M.convert_to_hms(Math.Floor((C21_v23.Time_of_Day))), C21_v23.FL, C21_v23.Data_Source_ID_SIC, C21_v23.Data_Source_ID_SAC,
                                                          Math.Round(C21_v23.Lat_WGS_84, 3), Math.Round(C21_v23.Lon_WGS_84, 3), C21_v23.Target_Address, "Null");

                        // Complete Multiple CAT table
                        tablaMultipleCAT.Rows.Add(contadorGeneral, CAT + 0.23, C21_v23.Data_Source_ID_SIC, C21_v23.Data_Source_ID_SAC, C21_v23.Target_ID, "", M.convert_to_hms(Math.Floor((C21_v23.Time_of_Day))),
                                                  "Click to View Data", "(" + Math.Round(C21_v23.Lat_WGS_84, 3) + ", " + Math.Round(C21_v23.Lon_WGS_84, 3) + ")", "", "", C21_v23.FL, C21_v23.GA, C21_v23.Target_Address, "",

                                                  "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
                                                  "(" + Math.Round(C21_v23.Lat_WGS_84, 3) + ", " + Math.Round(C21_v23.Lon_WGS_84, 3) + ")", "", "(" + C21_v23.Air_Speed[0] + ", " + C21_v23.Air_Speed[1] + ")",
                                                  C21_v23.True_Airspeed, "(" + C21_v23.GS + ", " + C21_v23.TA + ")", "", "", "", C21_v23.MH, C21_v23.BVR, C21_v23.GVR, "Click to View Data", C21_v23.ECAT, "", C21_v23.Roll, "",
                                                  "", "", "", "", "", "", "", "", "", "Click to View Data", "", "");
                    }
                    // Check if its version 21
                    if (SICSAC[0] != 107 || SICSAC[1] != 0)
                    {
                        CAT21 C21 = new CAT21();
                        CAT_list.Add(CAT); // Adds the pack category into this list
                        C21.Decode21(arraystring);
                        listaCAT21.Add(C21);

                        // CAT21 reduced table for maptrack
                        tablacat21reducida.Rows.Add(contadorCAT21, C21.Target_ID, M.convert_to_hms(Math.Floor(C21.Time_Rep_Transm)), C21.FL, C21.Data_Source_ID_SIC, C21.Data_Source_ID_SAC,
                                                    Math.Round(C21.High_Res_Lat_WGS_84, 3), Math.Round(C21.High_Res_Lon_WGS_84, 3), C21.Target_Address, C21.Track_Num);

                        // Complete CAT21 table
                        tablaCAT21.Rows.Add(contadorCAT21, CAT, C21.Data_Source_ID_SIC, C21.Data_Source_ID_SAC, C21.Target_ID, C21.Track_Num, "Click to View Data",
                                            M.convert_to_hms(Math.Floor(C21.Time_Rep_Transm)), "(" + C21.Lat_WGS_84 + ", " + C21.Lon_WGS_84 + ")", "(" + Math.Round(C21.High_Res_Lat_WGS_84, 3) + ", " + Math.Round(C21.High_Res_Lon_WGS_84, 3) + ")", C21.FL, C21.GH,
                                            "Click to View Data", "(" + C21.Air_Speed[0] + ", " + C21.Air_Speed[1] + ")", C21.True_Airspeed, "(" + C21.GS + ", " + C21.TA + ")", C21.TAR, C21.SA, "Click to View Data",
                                            C21.MH, C21.BVR, C21.GVR, C21.M3AC, "Click to View Data", C21.ECAT, C21.Target_Address, "Click to View Data", C21.Roll, C21.Service_ID,
                                            "Click to View Data", "Click to View Data", C21.MAM, C21.RID, C21.ToA_Position, C21.ToA_Velocity, C21.TMRP, C21.TMRV, C21.TMRP_HP, C21.TMRV_HP, C21.Time_Rep_Transm, "Click to View Data", "Click to View Data", C21.RP);
                    }
                }
            }
        }
示例#15
0
 public CAT21_LINK(CAT21 cat21)
 {
     InitializeComponent();
     this.cat21 = cat21;
 }
        void ClikDataGrid(object sender, RoutedEventArgs e) //al clicar en una celda de la tabla
        {
            //cogemos la celda
            DataGridCell cell = (DataGridCell)sender;
            int          c    = cell.Column.DisplayIndex; //número de columna
            DataGridRow  r2   = DataGridRow.GetRowContainingElement(cell);
            int          fil  = r2.GetIndex();            //número de fila

            if (this.cat == 10)
            {
                //cojo el paquete
                CAT10 paquete = f.getCAT10(fil);

                //expandimos información:
                if (c == 7 && paquete.DataCharacteristics != null) // Target Report - Data Characteristics
                {
                    MessageBox.Show(paquete.DataCharacteristics, "Data Characteristics");
                }
                if (c == 14 && paquete.TrackStatus != null) // Track Status
                {
                    MessageBox.Show(paquete.TrackStatus, "Track Status");
                }
                if (c == 27 && paquete.Presence != null) // Presence
                {
                    MessageBox.Show(paquete.Presence, "Presence");
                }
                if (c == 17 && paquete.ModeS != null) // Mode S MB Data
                {
                    MessageBox.Show(paquete.ModeS, "Mode S MB Data");
                }
                if (c == 23 && paquete.SystemStatus != null) // System Status
                {
                    MessageBox.Show(paquete.SystemStatus, "System Status");
                }

                //mostramos las características de ese paquete a parte:
                filldataexpandedCAT10(fil);
            }
            if (this.cat == 20)
            {
                CAT20 paquete = f.getCAT20(fil);

                //expandimos información:
                if (c == 6 && paquete.getTargetReportDescriptortoString() != null)
                {
                    MessageBox.Show(paquete.getTargetReportDescriptortoString(), "Target Report Descriptor");
                }
                if (c == 10 && paquete.getTrackStatusToString() != null) //Track status
                {
                    MessageBox.Show(paquete.getTrackStatusToString(), "Track Status");
                }
                if (c == 21 && paquete.getPositionAccuracyToString() != null) //Pos Accuracy
                {
                    MessageBox.Show(paquete.getPositionAccuracyToString(), "Position Accuracy");
                }

                //mostramos las características de ese paquete a parte:
                filldataexpandedCAT20(fil);
            }
            if (this.cat == 21)
            {
                CAT21 paquete = f.getCAT21(fil);

                //expandimos información:
                if (c == 5 && paquete.TargetReport != null) //Target Report Descriptor
                {
                    MessageBox.Show(paquete.TargetReport, "Target Report Descriptor");
                }
                if (c == 11 && paquete.OperationalStatus != null) //Operational Status
                {
                    MessageBox.Show(paquete.OperationalStatus, "Operational Status");
                }
                if (c == 48 && paquete.FigureOfMerit != null) //Figure Of Merit
                {
                    MessageBox.Show(paquete.FigureOfMerit, "Figure of Merit");
                }
                if (c == 49 && paquete.ages != null) //Data ages
                {
                    MessageBox.Show(paquete.ages, "Data Ages");
                }
                if (c == 41 && paquete.TrajectoryIntentData != null) //Trajectory Intent Data
                {
                    MessageBox.Show(paquete.TrajectoryIntentData, "Trajectory Intent Data");
                }
                if (c == 32 && paquete.LinkTech != null) //Link Technology
                {
                    MessageBox.Show(paquete.LinkTech, "Link Technology");
                }
                if (c == 26 && paquete.TargetStatus != null) //Target Status
                {
                    MessageBox.Show(paquete.TargetStatus, "Target Status");
                }
                if (c == 21 && paquete.MetReport != null) //Met Report
                {
                    MessageBox.Show(paquete.MetReport, "Met Report");
                }
                if (c == 30 && paquete.QualityIndicators != null) //Quality Indicators
                {
                    MessageBox.Show(paquete.QualityIndicators, "Quality Indicators");
                }
                if (c == 28 && paquete.ModeS != null) //Mode S
                {
                    MessageBox.Show(paquete.ModeS, "Mode S");
                }
                if (c == 18 && paquete.MOPS != null) //MOPS version
                {
                    MessageBox.Show(paquete.MOPS, "MOPS Version");
                }

                //mostramos las características de ese paquete a parte:
                filldataexpandedCAT21(fil);
            }
        }
示例#17
0
 public AircraftInformation(CAT21 cat21)
 {
     InitializeComponent();
     this.cat21 = cat21;
 }