public IList <SprocketComboInfo> GetSprocketComboInfo(RangeInfoCacheWrapper range, ITimeDataSeries <SprocketCombo> sprocketTrack) { IList <SprocketComboInfo> result; if (range.ContainsStoredInfo(m_SprocketStoredInfoId) && range.RetrieveStoredInfo(m_SprocketStoredInfoId) != null) { result = range.RetrieveStoredInfo(m_SprocketStoredInfoId) as IList <SprocketComboInfo>; } else { result = Common.Data.Calculate(range.Activity, sprocketTrack); // Remove totals row result.RemoveAt(result.Count - 1); range.SaveStoredInfo(m_SprocketStoredInfoId, result); } return(result); }
public ITimeDataSeries <SprocketCombo> GetRangeSprocketsTrack(RangeInfoCacheWrapper range) { ITimeDataSeries <SprocketCombo> result = null; if (range.ContainsStoredInfo(m_SprocketTrackStoredInfoId) && range.RetrieveStoredInfo(m_SprocketTrackStoredInfoId) != null) { result = range.RetrieveStoredInfo(m_SprocketTrackStoredInfoId) as ITimeDataSeries <SprocketCombo>; } else { INumericTimeDataSeries gears = ActivityGearTrackCache.Instance.CalculateGearTrack(range.Activity); gears = Utils.Utils.RemovePausedTimesInTrack(gears, range.Activity); NumericTimeDataSeries tempResult = new NumericTimeDataSeries(); Utils.Utils.ExtractRangeFromDataTrack(gears, range.PauselessRange, tempResult); result = GearChart.UI.GearUtils.GuessSprockets(tempResult, Common.Data.GetSprocketCombos(range.Activity)); range.SaveStoredInfo(m_SprocketTrackStoredInfoId, result); } return(result); }