Beispiel #1
0
        private void Save()
        {
            var div = "\t";

            var sb = new StringBuilder();

            sb.Append("時刻")
            .Append(div)
            .Append("ロット数")
            .AppendLine();

            Laps.ForEach(x =>
            {
                sb.Append(x.TimeStamp.ToString("yyyy/MM/dd HH:mm:ss.fff"))
                .Append(div)
                .Append(x.Rot)
                .AppendLine();
            });

            sb.AppendLine();

            sb.Append("悟飯の出番").Append(div).Append(LapCount.ToString()).AppendLine();
            sb.Append("合計ロット数").Append(div).Append(TotalRot.ToString()).AppendLine();
            sb.Append("最大ロット数").Append(div).Append(MaxRot.ToString()).AppendLine();
            sb.Append("平均ロット数").Append(div).Append(AverageRot.ToString("f2")).AppendLine();

            try
            {
                Clipboard.SetText(sb.ToString());
            }
            catch (Exception)
            {
                MessageBox.Show(
                    "クリップボードにコピーできませんでした。",
                    "エラー",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error);

                return;
            }

            MessageBox.Show(
                "カカログをクリップボードにコピーしました。",
                "完了",
                MessageBoxButton.OK,
                MessageBoxImage.Information);
        }
Beispiel #2
0
        /// <summary>
        /// Convert the list of points to a list of common coordinates
        /// </summary>
        /// <returns></returns>
        public List <GeoCoordinateExtended> ToCoords()
        {
            List <GeoCoordinateExtended> merged = new List <GeoCoordinateExtended>();

            Laps.ForEach(lap => merged.AddRange(lap.Track.ToCoords()));

            // Infilling is done for each track but there could be bad coordinates left over at the start or end of tracks that
            // might still need dealing with so check first rather than always doing it.
            if (merged.Where(pt => pt.BadCoordinate).Count() > 0)
            {
                return(merged.InfillPositions()); // Infill the positions that might still exist in boundaries between tracks before returning
            }
            else
            {
                return(merged); // No need for infilling as no bad coordinates
            }
        }