Example #1
0
        public void TestFindCourse()
        {
            CoursePassFactory  factory      = new CoursePassFactory();
            CoursePass         pass         = factory.FromFile("./Video/GOPR0565.json");
            List <Measurement> measurements = pass.Measurements;

            Assert.IsNotNull(pass.Course);
        }
Example #2
0
        public void GetBestFitTest()
        {
            CoursePassFactory factory = new CoursePassFactory();

            factory.RopeLengthOff = 22;
            CoursePass pass      = factory.FromFile("./Video/GOPR0565.json");
            CoursePass best      = factory.FitPass(pass.Measurements);
            double     precision = best.GetGatePrecision();

            //Assert.IsTrue(precision == 1.0F);
        }
Example #3
0
        public void TestDraw()
        {
            CoursePassFactory factory = new CoursePassFactory();

            factory.RopeLengthOff          = 32;
            factory.CenterLineDegreeOffset = 19;
            CoursePass      pass   = factory.FromFile("./Video/GOPR0565.json");
            CoursePassImage image  = new CoursePassImage(pass);
            Bitmap          bitmap = image.Draw();

            bitmap.Save("pass.png", ImageFormat.Png);
        }
Example #4
0
        public void CoursePositionFromGeoTest()
        {
            // Grab a boatposition and verify where in the X,Y course plane it should fit.
            // 7.45, 42.289983, -71.358973, 13.68, 0.11289 <-- before the course
            // 21.63, 42.288066, -71.359257, 14.87, 0.50935 <-- just prior to ball 1, after gate crossing
            // 40.71, 42.285529, -71.359519, 14.27, 0.59728 <-- between exit gates and the 55's
            // 45.32, 42.285165, -71.359369, 5.60, -0.10074 <-- way past the course, looping around

            // 15.02, 42.288937, -71.359136, 14.33, 0.77112 <-- boat is passing through the 55s.

            //42.2867806,"Longitude":-71.3594418 == Chet @ 15 seconds into the GOPR0565.mp4
            // .\slalom\SlalomTracker\Video\MetadataExtractor\GOPR0565.json
            CoursePassFactory factory  = new CoursePassFactory();
            CoursePass        pass     = factory.FromFile("./Video/GOPR0565.json");
            CoursePosition    position = pass.CoursePositionFromGeo(42.2867806, -71.3594418);

            Assert.IsTrue((int)position.X == 0, "Incorrect course X position.");
            Assert.IsTrue((int)position.Y == 61, "Incorrect course Y position.");
        }
Example #5
0
        /// <summary>
        /// Dummy course for testing.
        /// </summary>
        /// <returns></returns>
        public static CoursePass CreateTestCoursePass()
        {
            CoursePassFactory factory = new CoursePassFactory();

            return(factory.FromFile("./Video/GOPR0194.json"));
        }