private Workout BuildWorkout(GenericWorkout genericWorkout) { var workout = new Workout { Name = genericWorkout.WorkoutName, WorkoutSegments = genericWorkout.GenericWorkoutSegments.Select(BuildWorkoutSegment).ToList() }; return(workout); }
internal void StopWorkout() { workout = null; AntManagerState.Instance.WorkoutName = null; AntManagerState.Instance.TargetPower = 0; AntManagerState.Instance.NextTargetPower = 0; AntManagerState.Instance.RemainingIntervalTime = 0; AntManagerState.Instance.RemainingTotalTime = 0; AntManagerState.Instance.WorkoutElapsedTime = 0; AntManagerState.Instance.WorkoutMessage = null; AntManagerState.WriteToMemory(); FITRecorder.TerminateLap(); }
internal void StartWorkout(string filename) { try { if (bikeModel == BikeModel.FEC) { throw new Exception("Workouts not compatible with FEC bike model"); } AntManagerState.Instance.WorkoutName = filename; AntManagerState.Instance.WorkoutElapsedTime = 0; workout = GenericWorkout.Factory(AntManagerState.Instance.WorkoutName); FITRecorder.TerminateLap(); } catch (Exception e) { workout = null; AntManagerState.Instance.WorkoutName = null; Console.WriteLine("Did not load workout." + e.Message); } }