/[cits3200i]/trunk/UWAPlugins/PlaybackPlugin/Source/PlaybackControl.cs


UCC Code Repository

Diff of /trunk/UWAPlugins/PlaybackPlugin/Source/PlaybackControl.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 29 by rvvs89, Fri Sep 17 03:10:09 2010 UTC revision 30 by rvvs89, Fri Sep 17 04:31:03 2010 UTC
# Line 11  using ZoneFiveSoftware.Common.Data; Line 11  using ZoneFiveSoftware.Common.Data;
11  using ZoneFiveSoftware.Common.Data.Fitness;  using ZoneFiveSoftware.Common.Data.Fitness;
12  using ZoneFiveSoftware.Common.Visuals.Mapping;  using ZoneFiveSoftware.Common.Visuals.Mapping;
13  using ZoneFiveSoftware.Common.Visuals.Util;  using ZoneFiveSoftware.Common.Visuals.Util;
14    using ZoneFiveSoftware.Common.Data.GPS;
15    
16  namespace PlaybackPlugin.Source  namespace PlaybackPlugin.Source
17  {  {
# Line 111  namespace PlaybackPlugin.Source Line 112  namespace PlaybackPlugin.Source
112              // TODO              // TODO
113          }          }
114    
115            private static int RouteIndexFromDistance(IEnumerator<ITimeValueEntry<IGPSPoint>> route, double distance)
116            {
117                int index = 0;
118                double count = 0.0;
119                IGPSPoint prev = route.Current.Value;
120                while(route.MoveNext())
121                {
122                    IGPSPoint cur = route.Current.Value;
123                    count += prev.DistanceMetersToPoint(cur);
124                    if(count < distance)
125                    {
126                        index++;
127                                            prev = cur;
128                    } else {
129                        return index;
130                                    }
131                }
132                return -1;
133            }
134    
135          private void PlaybackTick(object source, ElapsedEventArgs args)          private void PlaybackTick(object source, ElapsedEventArgs args)
136          {          {
137              //IRouteControlSelection selection = CollectionUtils.GetSingleItemOfType<IRouteControlSelection>(PlaybackAnimationRouteControlLayer.Instance.Control.SelectedItems);              //IRouteControlSelection selection = CollectionUtils.GetSingleItemOfType<IRouteControlSelection>(PlaybackAnimationRouteControlLayer.Instance.Control.SelectedItems);
# Line 122  namespace PlaybackPlugin.Source Line 143  namespace PlaybackPlugin.Source
143              else              else
144              {              {
145                  IList<IValueRange<DateTime>> ranges = selection.TimeRanges;                  IList<IValueRange<DateTime>> ranges = selection.TimeRanges;
146                    IGPSRoute item = selection.Item.Item.GPSRoute;
147                  IList<IValueRange<double>> distanceRanges = selection.DistanceMetersRanges;                  IList<IValueRange<double>> distanceRanges = selection.DistanceMetersRanges;
148                  /*DateTime upper = range.Upper;                  /*DateTime upper = range.Upper;
149                  DateTime lower = range.Lower;*/                  DateTime lower = range.Lower;*/

Legend:
Removed from v.29  
changed lines
  Added in v.30

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26