public void movedronesegundo(int sec) { if (!inicioumapa) { gMapControl1.MapProvider = GMapProviders.GoogleSatelliteMap; gMapControl1.Position = new GMap.NET.PointLatLng(rawtelemetrydata[0].lat, rawtelemetrydata[0].log); gMapControl1.Zoom = 18; inicioumapa = true; } objtelemetria ob = rawtelemetrydata.FirstOrDefault(x => x.deltasegundos == sec); latitude = ob.lat; longitude = ob.log; dronerotacao = ob.rotacao; //posicionadrone(ob.lat, ob.log, 0, ob.rotacao); }
public Itemdetectado(detectado d, Formexiberesult f) { InitializeComponent(); ff = f; label1.Text = $"pessoas: {d.quantpessoas}"; int segundos = 0; int minutos = 0; framed = d.frame; if (d.frame > 60) { minutos = Convert.ToInt32(Math.Truncate(Convert.ToDouble(d.frame) / 60)); segundos = d.frame - (minutos * 60); } else { segundos = d.frame; } label2.Text = $"tempo: {minutos}:{segundos}"; o = Form1.rawtelemetrydata.FirstOrDefault(x => x.deltasegundos == framed); label3.Text = $"lat: {o.lat}"; label4.Text = $"lng: {o.log}"; }
private void Timer4_Tick_1(object sender, EventArgs e) { timer4.Enabled = false; DateTime tempoinicio = new DateTime(); bool first = true; string todotexto = ""; if (testando) { todotexto = File.ReadAllText($@"{pathprograma}\bin\Debug\telemetria\telemetria.csv"); } else { todotexto = File.ReadAllText($@"{pathprograma}\telemetria.csv"); } //Match m = Regex.Match(todotexto, $"({DateTime.Now.Year})\\/(\\d+)\\/(\\d+)\\s?(\\d+):(\\d+):([0-9\\.]+),[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-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\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,[\\-0-9\\/\\s:\\.a-zA-Z_]*,([\\-0-9\\/\\s:\\.a-zA-Z_]*)", RegexOptions.Multiline); string[] ls = todotexto.Split(Convert.ToChar("\r")); int atual = 1; do {//21 string[] ls2 = ls[atual].Split(','); if (ls2.Length > 3) { objtelemetria ov = new objtelemetria(); ov.lat = Convert.ToDouble(ls2[12].Replace('.', ',')); ov.log = Convert.ToDouble(ls2[13].Replace('.', ',')); ov.date = DateTime.Parse(ls2[0].Remove(0, 2)); if (first) { ov.deltasegundos = 0; tempoinicio = ov.date; first = false; } else { TimeSpan ts = ov.date - tempoinicio; ov.deltasegundos = Convert.ToInt32(Math.Truncate(ts.TotalSeconds)); } string tyaw = ls2[21]; double rot; try { rot = Convert.ToDouble(tyaw); } catch (Exception) { rot = 0; } rot = rot * -1; ov.rotacao = rot; rawtelemetrydata.Add(ov); //m = m.NextMatch(); } atual++; } while (atual < ls.Length); if (jaanalisado) { new Formexiberesult(this).Show(); } }