Exemple #1
0
 private void InitChartData()
 {
     this.pathData = new PathChartData(this.routeData);
     chartWindow.SetCanvasData("height", new HeightChart(this.pathData));
     chartWindow.SetCanvasData("grade", new GradeChart(this.pathData));
     chartWindow.SetCanvasData("curvature", new CurvatureChart(this.pathData));
     chartWindow.SetCanvasData("distance", new DistanceChart(this.pathData));
     chartWindow.SetCanvasData("milemarkers", new MileMarkersChart(this.pathData));
     chartWindow.SetCanvasData("speedmarkers", new SpeedlimitsChart(this.pathData));
 }
Exemple #2
0
        /// <summary>
        /// Set the route and path-specifics.
        /// </summary>
        /// <param name="routeData">The route information from which we need the track database and the tsectiondat</param>
        /// <param name="pathEditor"></param>
        public void SetPathEditor(ORTS.TrackViewer.Drawing.RouteData routeData, PathEditor pathEditor)
        {
            this.routeData               = routeData;
            this.pathEditor              = pathEditor;
            this.pathEditor.ChangedPath += new ChangedPathHandler(OnPathChanged);

            if (pathEditor == null || pathEditor.CurrentTrainPath == null || pathEditor.CurrentTrainPath.FirstNode == null)
            {
                pathData = null;
                return;
            }

            if (ChartWindowIsOpen)
            {
                InitChartData();
                OnPathChanged(); // To make sure we have an initial update
            }
            else
            {
                pathData = null;
            }
        }
Exemple #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pathChartData">The data for which we will be creating charts</param>
 public SpeedlimitsChart(PathChartData pathChartData) : base(pathChartData)
 {
 }
Exemple #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pathChartData">The data for which we will be creating charts</param>
 public DistanceChart(PathChartData pathChartData) : base(pathChartData)
 {
 }
Exemple #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pathChartData">The data for which we will be creating charts</param>
 public CurvatureChart(PathChartData pathChartData) : base(pathChartData)
 {
 }
Exemple #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pathChartData">The data for which we will be creating charts</param>
 public GradeChart(PathChartData pathChartData) : base(pathChartData)
 {
 }
Exemple #7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pathChartData">The data for which we will be creating charts</param>
 public HeightChart(PathChartData pathChartData) : base(pathChartData)
 {
 }
Exemple #8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="chartData">The data for which we will be creating charts</param>
 protected SubChart(PathChartData chartData)
 {
     this.pathData = chartData;
 }
Exemple #9
0
 /// <summary>
 /// Close (Hide) the window with the charts and remove memory used for storing the path chart data
 /// </summary>
 public void Close()
 {
     chartWindow.Hide();
     pathData = null; // release memory, and do not do further update processing
 }
Exemple #10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pathChartData">The data for which we will be creating charts</param>
 public MileMarkersChart(PathChartData pathChartData) : base(pathChartData)
 {
 }