Esempio n. 1
0
 public MinMaxAve(StreamType streamType)
 {
     StreamType = streamType;
     HasStream  = false;
     Suffix     = StreamTypeHelper.Units(streamType);
     Name       = StreamTypeHelper.Name(streamType);
     Priority   = StreamTypeHelper.Priority(streamType);
 }
        /// <summary>
        /// Which streams are valid and available on the activity
        /// </summary>
        /// <returns></returns>
        public List <MinMaxAve> GetStreamSummary()
        {
            List <MinMaxAve> streamInfo = new List <MinMaxAve>();

            StreamType activityTypeStreams = StreamTypeHelper.SportStreams(Activity.ActivityType);

            foreach (StreamType t in Enum.GetValues(typeof(StreamType)))
            {
                if (!activityTypeStreams.HasFlag(t))
                {
                    continue;
                }

                MinMaxAve mma = GetMinMaxAve(t);

                if (mma.HasStream)
                {
                    streamInfo.Add(mma);
                }
            }

            return(streamInfo.OrderBy(s => s.Priority).ToList());
        }
Esempio n. 3
0
 public string GetAverage()
 {
     return(StreamTypeHelper.ConvertToUserUnits(StreamType, Ave));
 }
Esempio n. 4
0
 public string GetMaximum()
 {
     return(StreamTypeHelper.ConvertToUserUnits(StreamType, Max));
 }