/// <summary> /// This is the constructor for the AngleGraphViewModel /// </summary> /// <param name="dataProvider">A DataProvider object to read the data from</param> public AngleGraphViewModel(DataProvider dataProvider) { _data = dataProvider; PlotManager manager = new PlotManager(); manager.AddLineSeries(_data.Roll, "Roll [°]", OxyColors.Blue); manager.AddLineSeries(_data.Pitch, "Pitch [°]", OxyColors.Chartreuse); manager.AddLineSeries(_data.Yaw, "Yaw [°]", OxyColors.Gold); data = manager.GetPlotModel("Angle").Result; blank = new PlotModel(); blank.Title = "Angle"; Plot = data; MainWindow.OnResizeStartEvent += MainWindow_OnResizeStartEvent; MainWindow.OnResizeEndEvent += MainWindow_OnResizeEndEvent; }
/// <summary> /// This is the constructor for the AccelerationGraphViewModel /// </summary> /// <param name="dataProvider">A DataProvider object to read the data from</param> public AccelerationGraphViewModel(DataProvider dataProvider) { _data = dataProvider; PlotManager manager = new PlotManager(); manager.AddLineSeries(_data.XAcceleration, "F/B [m/s^2]", OxyColors.Blue); manager.AddLineSeries(_data.YAcceleration, "L/R [m/s^2]", OxyColors.Chartreuse); manager.AddLineSeries(_data.ZAcceleration, "U/D [m/s^2]", OxyColors.Gold); data = manager.GetPlotModel("Acceleration").Result; blank = new PlotModel(); blank.Title = "Acceleration"; Plot = data; MainWindow.OnResizeStartEvent += MainWindow_OnResizeStartEvent; MainWindow.OnResizeEndEvent += MainWindow_OnResizeEndEvent; }
public void PlotManager_GetPlotModel_CreatesPlotModel() { PlotManager manager = new PlotManager(); List <float> TestList = new List <float>(); TestList.Add(1); TestList.Add(2); manager.AddLineSeries(TestList, "Test", OxyColors.Aqua, 2); PlotModel model = manager.GetPlotModel("Model").Result; Assert.AreEqual("Model", model.Title); Assert.AreEqual("Test", model.Series.ElementAt(0).Title); }
public void PlotManager_AddLineSeriesV2_AddsCorrectLineSeries() { PlotManager manager = new PlotManager(); List <float> TestList = new List <float>(); TestList.Add(1); TestList.Add(2); manager.AddLineSeries(TestList, "Test", 2); Assert.AreEqual("Test", manager.Series.ElementAt(0).Title); Assert.AreEqual(new DataPoint(0, 1), manager.Series.ElementAt(0).Points.ElementAt(0)); Assert.AreEqual(new DataPoint(2, 2), manager.Series.ElementAt(0).Points.ElementAt(1)); }
/// <summary> /// This is the constructor of the VelocityGraphViewModel /// </summary> /// <param name="dataProvider">A DataProvider object to read the data from</param> public VelocityGraphViewModel(DataProvider dataProvider) { _data = dataProvider; PlotManager manager = new PlotManager(); manager.AddLineSeries(_data.Velocity, "Vel [kt]", OxyColors.IndianRed); data = manager.GetPlotModel("Velocity").Result; blank = new PlotModel(); blank.Title = "Velocity"; Plot = data; MainWindow.OnResizeStartEvent += MainWindow_OnResizeStartEvent; MainWindow.OnResizeEndEvent += MainWindow_OnResizeEndEvent; }
/// <summary> /// This is the constructor for the HeightViewModel page /// </summary> /// <param name="dataProvider">A DataProvider object to read the data from</param> public HeightViewModel(DataProvider dataProvider) { _data = dataProvider; slMaximum = _data.Height.Count - 1; if (slMaximum < 1000) { slTickFrequency = 2; } if (slMaximum > 1000 && slMaximum < 10000) { slTickFrequency = 10; } if (slMaximum > 10000 && slMaximum < 1000000) { slTickFrequency = 500; } if (slMaximum > 1000000) { slTickFrequency = 2000; } if (_data.Height.Count != 0) { slValueChanged(0); HeightMaxL = HeightMaxR = _data.Height.Max() + 10; } else { HeightText = "Height"; HeightMaxR = HeightMaxL = 10; } PlotManager manager = new PlotManager(); manager.AddLineSeries(_data.Height, "Height [ft]", OxyColors.Coral); data = manager.GetPlotModel("Height").Result; blank = new PlotModel(); blank.Title = "Height"; Plot = data; MainWindow.OnResizeStartEvent += MainWindow_OnResizeStartEvent; MainWindow.OnResizeEndEvent += MainWindow_OnResizeEndEvent; }