Exemple #1
0
        private void SortRoute(string routeDirection)
        {
            SimulatedData_HwyDataPoints point = m_route[0];

            if (point.Direction == NORTH_SOUTH)
            {
                if (routeDirection == FORWARD)
                {
                    m_route = m_route.OrderBy(x => x.Latitude).ToList();
                }
                else  //GO BACK
                {
                    m_route = m_route.OrderByDescending(x => x.Latitude).ToList();
                }
            }
            else //EAST_WEST
            if (routeDirection == FORWARD)
            {
                m_route = m_route.OrderBy(x => x.Longitude).ToList();
            }
            else    //GO BACK
            {
                m_route = m_route.OrderByDescending(x => x.Longitude).ToList();
            }
        }
Exemple #2
0
        private void AddDataPoint(SimulatedData_HwyDataPoints point)
        {
            VehicleLocationTimeHistory loc = new VehicleLocationTimeHistory
            {
                dateTime  = DateTimeOffset.UtcNow,
                driverId  = m_driver.Id,
                vehicleId = m_vehicle.Id,
                latitude  = point.Latitude,
                longitude = point.Longitude,
            };

            m_context.VehicleLocationTimeHistory.Add(loc);
            m_context.SaveChanges();
        }