private void button_open_Click(object sender, EventArgs e) { try { tablaSingle.Clear(); OpenFileDialog ofd = new OpenFileDialog(); ofd.DefaultExt = "AST"; ofd.Filter = "Archivos AST|*.AST|All files(*.*)|*.*"; ofd.Title = "Abrir archivos"; ofd.ShowDialog(); fichero = new Fichero(ofd.FileName); fichero.leer(); listaCAT10 = fichero.getListCAT10(); listaCAT20 = fichero.getListCAT20(); listaCAT21 = fichero.getListCAT21(); listas = new ManageListas(listaCAT10, listaCAT20, listaCAT21); listas.resolvelistas(); listas.actualizarTabla(); listas.singleList(); listFLights = listas.getSingleList(); label_starttime.Text = TimeSpan.FromHours(22).ToString(@"hh\:mm\:ss"); starttime = TimeSpan.FromHours(22); i = 0; dataGridView_flights.DataSource = tablaSingle; MessageBox.Show("File decoded correctly"); trackBar_speedtime.Value = 1000; timer.Interval = 1000; } catch (Exception b) { MessageBox.Show(b.Message); } }
private void Main_Load(object sender, EventArgs e) { try { gMap_mapa.MapProvider = GMapProviders.GoogleMap; gMap_mapa.DragButton = MouseButtons.Left; gMap_mapa.Position = new PointLatLng(41.289182, 2.0746423); gMap_mapa.MinZoom = 1; gMap_mapa.MaxZoom = 20; gMap_mapa.Zoom = 7; gMap_mapa.ShowCenter = false; label_starttime.Text = starttime.ToString(@"hh\:mm\:ss"); timer.Interval = 1000; trackBar_speedtime.Value = 1000; listaCAT10 = listas.getListCAT10(); listaCAT20 = listas.getListCAT20(); listaCAT21 = listas.getListCAT21(); listFLights = listas.getSingleList(); tablaSingle.Columns.Add("#", typeof(int)); tablaSingle.Columns.Add("CAT", typeof(int)); tablaSingle.Columns.Add("ACID", typeof(string)); tablaSingle.Columns.Add("Time", typeof(TimeSpan)); tablaSingle.Columns.Add("Coordinates", typeof(string)); tablaSingle.Columns.Add("Real index", typeof(int)); dataGridView_flights.DataSource = tablaSingle; } catch (Exception a) { MessageBox.Show(a.Message); } }