Пример #1
0
        private void writeWeeklyReportData(StreamWriter sw, int curYear,
                                           string curMonth, int curWeek, DateTime curStartOfWeek,
                                           TimeSpan totalWalkingDuration, double totalWalkingDistance,
                                           TimeSpan totalCyclingDuration, double totalCyclingDistance,
                                           TimeSpan totalWorkoutDuration, double totalWorkoutDistance,
                                           TimeSpan totalOtherDuration, double totalOtherDistance,
                                           TimeSpan totalDuration, double totalDistance)
        {
            sw.Write(curYear + CSV_SEP);  // year
            sw.Write(curMonth + CSV_SEP); // month
            sw.Write(curWeek + CSV_SEP);  // week
            sw.Write($"{GpsData.formatTimeWeekday(curStartOfWeek)}" + CSV_SEP);

            sw.Write($"{GpsData.formatDuration(totalWalkingDuration)}" + CSV_SEP
                     + $"{GpsData.formatDurationMinutes(totalWalkingDuration)}" + CSV_SEP
                     + $"{GpsData.M2MI * totalWalkingDistance:f1}" + CSV_SEP);
            sw.Write($"{GpsData.formatDuration(totalCyclingDuration)}" + CSV_SEP
                     + $"{GpsData.formatDurationMinutes(totalCyclingDuration)}" + CSV_SEP
                     + $"{GpsData.M2MI * totalCyclingDistance:f1}" + CSV_SEP);
            sw.Write($"{GpsData.formatDuration(totalWorkoutDuration)}" + CSV_SEP
                     + $"{GpsData.formatDurationMinutes(totalWorkoutDuration)}" + CSV_SEP
                     + $"{GpsData.M2MI * totalWorkoutDistance:f1}" + CSV_SEP);
            sw.Write($"{GpsData.formatDuration(totalOtherDuration)}" + CSV_SEP
                     + $"{GpsData.formatDurationMinutes(totalOtherDuration)}" + CSV_SEP
                     + $"{GpsData.M2MI * totalOtherDistance:f1}" + CSV_SEP);
            sw.Write($"{GpsData.formatDuration(totalDuration)}" + CSV_SEP
                     + $"{GpsData.formatDurationMinutes(totalDuration)}" + CSV_SEP
                     + $"{GpsData.M2MI * totalDistance:f1}" + CSV_SEP);
            sw.Write(NL);
        }