2022-02-17 20:07:53 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace EFBTracker.Tracking
|
|
|
|
{
|
|
|
|
public class SimPosition
|
|
|
|
{
|
|
|
|
public float Latitude { get; set; }
|
|
|
|
public float Longitude { get; set; }
|
|
|
|
public int Altitude { get; set; }
|
|
|
|
|
|
|
|
public SimPosition(Packet[] data){
|
|
|
|
if (data[0].Data != null)
|
|
|
|
{
|
2022-02-18 10:31:14 +00:00
|
|
|
//Use Linq to search through the packets for a given id and use that data
|
|
|
|
Latitude = (data.Where(x => x.Id == 22).Select(x => x.Data[0]).ToArray())[0];
|
|
|
|
Longitude = (data.Where(x => x.Id == 23).Select(x => x.Data[0]).ToArray())[0];
|
|
|
|
Altitude = Convert.ToInt32((data.Where(x => x.Id == 24).Select(x => x.Data[0]).ToArray())[0]);
|
|
|
|
|
2022-02-17 20:07:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|