Exemple #1
0
        public PlotViewModel(PICPlot plot)
        {
            this.PICPlot = plot;
            this.PlotModel = new PlotModel { };
            var backgroundBrush = (Brush)ThemeManager.DetectAppStyle(Application.Current).Item1.Resources["WindowBackgroundBrush"];
            PlotModel.Background = backgroundBrush.ToOxyColor();

            switch (plot.PlotType)
            {
                case PlotType.Heatmap:
                    PlotModel.Axes.Add(new LinearColorAxis
                    {
                        HighColor = OxyColors.Gray,
                        LowColor = OxyColors.Black,
                        Position = AxisPosition.Right
                    });
                    PlotModel.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
                    PlotModel.Axes.Add(new LinearAxis());
                    HeatMapSeries = new HeatMapSeries
                    {
                        X1 = 0.1,
                        Y0 = 0,
                        Y1 = 0.1,
                        Interpolate = true
                    };
                    PlotModel.Series.Add(HeatMapSeries);
                    break;
                case PlotType.Line:

                    PlotModel.InvalidatePlot(true);
                    OnPropertyChanged("PlotModel");
                    break;
                case PlotType.Trajectories:
                    PlotModel.InvalidatePlot(true);
                    OnPropertyChanged("PlotModel");
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
Exemple #2
0
 public void AddPlot(PICPlot plot)
 {
     string header;
     switch (plot.PlotType)
     {
         case PlotType.Line:
             header = $"{plot.PlotSource.Description()} {plot.PlotType.Description()}";
             break;
         case PlotType.Trajectories:
             header = plot.PlotType.Description();
             break;
         default:
             header = plot.PlotSource.Description();
             break;
     }
     var workspace = new PlotViewModel(plot) { Header = header };
     Workspaces.Add(workspace);
     SelectedIndex = Workspaces.IndexOf(workspace);
 }