Пример #1
0
        /// <summary>
        /// .inc 파일을 읽어 각 라인을 TopicPoint로 생성하고,
        /// track에 추가한다.
        /// </summary>
        /// <param name="track"></param>
        /// <param name="reader"></param>
        protected void LoadPoints(Track track, TextReader reader)
        {
            if (track == null)
                throw new ArgumentNullException("track");
            if (reader == null)
                throw new ArgumentNullException("reader");

            string line;
            while ((line = reader.ReadLine()) != null) {
                if (Regex.IsMatch(line, @"^\d{4}-\d{2}-\d{2}")) {
                    string[] items = line.Split2(',');
                    if (items.Length >= 7) {
                        TrackPoint p = new TrackPoint();
                        p.PointTime = DateTime.ParseExact(items[0], DATE_FORMAT, null);
                        p.Latitude = Convert.ToDouble(items[1]);
                        p.Longitude = Convert.ToDouble(items[2]);
                        p.Velocity = Convert.ToDouble(items[3]);
                        p.AccelerationX = Convert.ToDouble(items[4]);
                        p.AccelerationY = Convert.ToDouble(items[5]);
                        p.AccelerationZ = Convert.ToDouble(items[6]);

                        track.AddPoint(p);
                    }
                }
            }
        }
 private void AddPoint(TrackPoint point)
 {
     browser.InvokeScript("addPoint", point.Latitude, point.Longitude);
 }
Пример #3
0
 public void ResetPosition(TrackPoint point)
 {
     bar.Position = point;
 }
Пример #4
0
        public void AddPoint(TrackPoint p)
        {
            if (p != null && !m_points.Contains(p)) {
                m_points.Add(p);

                if (m_points.Count == 1) {
                    StartTime = EndTime = m_points[0].PointTime;
                } else {
                    EndTime = m_points[PointCount - 1].PointTime;
                }
            }
        }
Пример #5
0
 private void ResetPosition(int i)
 {
     TrackCollection tracks = timelineView.Tracks;
     Track track = tracks[i];
     TrackPoint point = new TrackPoint();
     point.PointTime = track.StartTime;
     timelineView.ResetPosition(point);
 }
        private void RefreshPoints(TrackPoint current)
        {
            chart.Clear();
            chart.Title = "";

            if (Track != null && Track.PointCount > 0 && Position != null) {
                foreach (TrackPoint p in Track.Points) {
                    chart.AddValue(p.PointTime, p.AccelerationX, p.AccelerationY, p.AccelerationZ);
                    if (p == current)
                        break;
                }

                chart.Title = Track.First.PointTime.ToString("yyyy-MM-dd hh:mm:ss") + " ~ " +
                    Track.Last.PointTime.ToString("yyyy-MM-dd hh:mm:ss");
            } else {
                chart.Title = "";
                chart.Clear();
            }
        }