Ejemplo n.º 1
0
        private static void GetNewCoords(string courseName, double meters, double heading)
        {
            Console.WriteLine($"Moving {courseName} by {meters}m @ {heading} degrees.");
            KnownCourses courses = new KnownCourses();
            var          coords  = courses.GetNewCoordinates(courseName, meters, heading);

            Console.WriteLine($"Lat: {coords.Latitude}, Lon: {coords.Longitude}");
        }
Ejemplo n.º 2
0
        private Course GetCourseFromMetadata(Storage storage, string jsonUrl)
        {
            string         date     = ParseDate(jsonUrl);
            string         filename = GetMP4FromJsonUrl(jsonUrl);
            SkiVideoEntity entity   = storage.GetSkiVideoEntity(date, filename);

            // Should probably throw an exception here?
            if (entity == null)
            {
                Console.WriteLine($"Couldn't load video metadata for {jsonUrl}");
                return(null);
            }

            if (string.IsNullOrEmpty(entity.CourseName))
            {
                Console.WriteLine($"No course saved for {jsonUrl}");
                return(null);
            }

            KnownCourses courses = new KnownCourses();

            return(courses.ByName(entity.CourseName));
        }
Ejemplo n.º 3
0
        private static void PrintCourses(string[] args)
        {
            if (args.Length > 3)
            {
                string course  = args[1];
                double meters  = double.Parse(args[2]);
                double heading = double.Parse(args[3]);
                GetNewCoords(course, meters, heading);
            }

            KnownCourses knownCourses = new KnownCourses();

            // One time run only:
            // knownCourses.AddKnownCourses();
            Console.WriteLine("Courses available:");
            foreach (Course c in knownCourses.List)
            {
                Console.WriteLine("\tName:{0}, Entry(Lat/Lon):{1}\\{2}, Heading:{3}",
                                  c.Name,
                                  c.Course55EntryCL.Latitude,
                                  c.Course55EntryCL.Longitude,
                                  c.GetCourseHeadingDeg());
            }
        }