コード例 #1
0
        protected void TrackChanged(object sender, EventArgs e)
        {
            if (GPX == null)
                return;
            if (String.IsNullOrEmpty(ddlTracks.SelectedValue))
            {
                pnlAnalysis.Visible = false;
                pnlActivity.Visible = false;
                ActivityPanelsVisible = false;
                return;
            }

            List<wptType> trackPoints = GPX.GetTrackFirstSegmentPoints(ddlTracks.SelectedValue);

            lblTrackPointCount.Text = String.Format(" ({0})", trackPoints.Count());

            Analyzer = new DataAnalyzer(trackPoints);

            gvTrackPoints.DataSource = Analyzer.TrackPoints;
            gvTrackPoints.DataBind();

            lblSegmentCount.Text = String.Format(" ({0})", Analyzer.Segments.Count());

            gvSegments.DataSource = Analyzer.Segments;
            gvSegments.DataBind();

            lblTotalDistance.Text = FormatDistance(Analyzer.TotalDistance());
            lblTotalVerticalDistance.Text = FormatDistance(Analyzer.TotalVerticalDistance());
            lblTotalFlatEarthDistance.Text = FormatDistance(Analyzer.TotalFlatEarthDistance());

            lblTotalTime.Text = FormatTime(Analyzer.TotalTime());

            lblAverageDistance.Text = FormatDistance(Analyzer.AverageDistance());
            lblAverageVerticalDistance.Text = FormatDistance(Analyzer.AverageVerticalDistance());
            lblAverageFlatEarthDistance.Text = FormatDistance(Analyzer.AverageFlatEarthDistance());

            lblAverageTime.Text = FormatTime(Analyzer.AverageTime());
            lblAverageCourse.Text = FormatCourse(Analyzer.AverageCourse());

            lblAverageVelocity.Text = FormatVelocity(Analyzer.AverageVelocity());
            lblAverageVerticalVelocity.Text = FormatVelocity(Analyzer.AverageVerticalVelocity());
            lblAverageFlatEarthVelocity.Text = FormatVelocity(Analyzer.AverageFlatEarthVelocity());

            pnlAnalysis.Visible = true;

            pnlActivity.Visible = true;
            ActivityChanged(ddlActivity, EventArgs.Empty);
        }