Ejemplo n.º 1
0
        private LineGraphModel BuildTestModel()
        {
            int lapCount      = 10;
            int maxFrameCount = 1000;

            var series = new List <LineGraphSeries>();

            var rpmSeries = new RpmLineGraphSeries()
            {
                YAxis = new RpmYAxis()
            };

            series.Add(rpmSeries);

            var steeringSeries = new SteeringLineGraphSeries()
            {
                YAxis = new SteeringYAxis()
            };

            series.Add(steeringSeries);

            var throttleSeries = new ThrottleLineGraphSeries()
            {
                YAxis = new ThrottleYAxis()
            };

            series.Add(throttleSeries);

            var brakeSeries = new BrakeLineGraphSeries()
            {
                YAxis = new BrakeYAxis()
            };

            series.Add(brakeSeries);

            var model = new LineGraphModel(lapCount, maxFrameCount, series.Count);

            model.AddSeries(rpmSeries);
            model.AddSeries(steeringSeries);
            model.AddSeries(throttleSeries);
            model.AddSeries(brakeSeries);

            PopulateSampleData(model, lapCount, maxFrameCount, rpmSeries, 100);
            PopulateSampleData(model, lapCount, maxFrameCount, steeringSeries, 3);
            PopulateSampleData(model, lapCount, maxFrameCount, throttleSeries, .1F);
            PopulateSampleData(model, lapCount, maxFrameCount, brakeSeries, .1F);

            return(model);
        }
        public static ILineGraphSeries GetSeries(string key)
        {
            ILineGraphSeries series = null;

            switch (key)
            {
            case ("Telemetry.RPM"):
            {
                series = new RpmLineGraphSeries();
                break;
            }

            case ("Telemetry.Throttle"):
            {
                series = new ThrottleLineGraphSeries();
                break;
            }

            case ("Telemetry.SteeringWheelAngle"):
            {
                series = new SteeringLineGraphSeries();
                break;
            }

            case ("Telemetry.Brake"):
            {
                series = new BrakeLineGraphSeries();
                break;
            }

            case ("Telemetry.Speed"):
            {
                series = new SpeedLineGraphSeries();
                break;
            }
            }

            return(series);
        }