예제 #1
0
        /// <summary>
        /// gibt Infos für eine GPX-Datei aus
        /// </summary>
        /// <param name="info"></param>
        static void ShowInfoOnStdOut(GpxInfos info)
        {
            Console.WriteLine("Datei '{0}'", info.Filename);

            Console.WriteLine("{0} Waypoint/s", info.WaypointCount);
            for (int i = 0; i < info.WaypointCount; i++)
            {
                Console.WriteLine("   Waypoint {0}: {1}", i + 1, info.Waypointname[i]);
            }

            Console.WriteLine("{0} Route/n", info.RouteCount);
            for (int i = 0; i < info.RouteCount; i++)
            {
                Console.WriteLine("   Waypoint {0}: {1}", i + 1, info.Routename[i]);
            }

            Console.WriteLine("{0} Track/s", info.TrackCount);
            for (int t = 0; t < info.TrackCount; t++)
            {
                GpxInfos.TrackInfo ti = info.Tracks[t];
                Console.WriteLine("   Track {0}: {1}", t + 1, ti.Trackname);

                for (int s = 0; s < info.Tracks[t].SegmentCount; s++)
                {
                    GpxInfos.TrackInfo.SegmentInfo si = ti.Segment[s];

                    Console.Write("      Segment {0}: {1} Punkte, {2:N3}km",
                                  s + 1,
                                  si.PointCount,
                                  si.Length / 1000);
                    if (si.Minheight != double.MaxValue)
                    {
                        Console.Write(", Höhe {0:F0} .. {1:F0}m, Anstieg {2:F0}, Abstieg {3:F0}",
                                      si.Minheight,
                                      si.Maxheight,
                                      si.Descent,
                                      si.Ascent);
                    }
                    if (si.AverageSpeed > 0)
                    {
                        Console.Write(", Durchschnittsgeschw. {0:F1}km/h", si.AverageSpeed * 3.6);
                    }
                    Console.WriteLine();
                }
            }
        }
예제 #2
0
 static int TaskWorker4TrackInfo(GpxFile gpx, GpxInfos.TrackInfo[] trackinfos, int idx, int gesamt, CancellationTokenSource cancel, IProgress <string> progress)
 {
     TaskProgress4TrackInfo(string.Format("ermittle Infos zu Track {0} von {1} ...", idx + 1, gesamt));
     trackinfos[idx] = new GpxInfos.TrackInfo(gpx, idx);
     return(0);
 }