コード例 #1
0
        public static PlotViewModel Clone(PlotViewModel plotToClone)
        {
            var output = new PlotViewModel(plotToClone._plotViewId + 1);

            plotToClone._plotViewId += 1;

            Commands.Plot_PlotValues.Executed -= output.Plot_Executed;

            output._Title                          = plotToClone._Title;
            output._PlotTitles                     = plotToClone._PlotTitles.ToList();
            output._PlotType                       = plotToClone._PlotType;
            output._HoldOn                         = plotToClone._HoldOn;
            output._PlotSeriesCollection           = new PlotPointCollection();
            output._Labels                         = plotToClone._Labels.ToList();
            output._CustomPlotLabel                = plotToClone._CustomPlotLabel;
            output.ShowInPlotView                  = false;
            output._HideKey                        = plotToClone.HideKey;
            output._ShowAxes                       = plotToClone._ShowAxes;
            output._MinYValue                      = plotToClone._MinYValue;
            output._MaxYValue                      = plotToClone._MaxYValue;
            output._MinXValue                      = plotToClone._MinXValue;
            output._MaxXValue                      = plotToClone._MaxXValue;
            output._AutoScaleX                     = plotToClone._AutoScaleX;
            output._AutoScaleY                     = plotToClone._AutoScaleY;
            output._IsComplexPlot                  = plotToClone._IsComplexPlot;
            output._CurrentIndependentVariableAxis = plotToClone._CurrentIndependentVariableAxis;

            output.RealLabels      = plotToClone.RealLabels;
            output.ImagLabels      = plotToClone.ImagLabels;
            output.PhaseLabels     = plotToClone.PhaseLabels;
            output.AmplitudeLabels = plotToClone.AmplitudeLabels;

            output._YAxisSpacingOptionVM.Options[output._YAxisSpacingOptionVM.SelectedValue].IsSelected = false;
            output._PlotNormalizationTypeOptionVM.Options[output._PlotNormalizationTypeOptionVM.SelectedValue].IsSelected = false;
            output._PlotToggleTypeOptionVM.Options[output._PlotToggleTypeOptionVM.SelectedValue].IsSelected  = false;
            output._XAxisSpacingOptionVM.Options[output._XAxisSpacingOptionVM.SelectedValue].IsSelected      = false;
            output._YAxisSpacingOptionVM.Options[plotToClone._YAxisSpacingOptionVM.SelectedValue].IsSelected = true;
            output._PlotNormalizationTypeOptionVM.Options[plotToClone._PlotNormalizationTypeOptionVM.SelectedValue].IsSelected = true;
            output._PlotToggleTypeOptionVM.Options[plotToClone._PlotToggleTypeOptionVM.SelectedValue].IsSelected = true;
            output._XAxisSpacingOptionVM.Options[plotToClone._XAxisSpacingOptionVM.SelectedValue].IsSelected     = true;

            output.DataSeriesCollection =
                plotToClone.DataSeriesCollection.Select(ds => new DataPointCollection {
                DataPoints = ds.DataPoints.Select(val => val).ToArray(), ColorTag = ds.ColorTag, Title = ds.Title
            }).ToList();
            //output.DataSeriesCollectionToggle =
            //    plotToClone.DataSeriesCollectionToggle.Select(ds => (IList<IDataPoint>)ds.Select(val => val).ToList()).ToList();

            return(output);
        }
コード例 #2
0
        public SolverDemoViewModel()
        {
            Current = this;

            ForwardSolverVM    = new ForwardSolverViewModel();
            InverseSolverVM    = new InverseSolverViewModel();
            FluenceSolverVM    = new FluenceSolverViewModel();
            MonteCarloSolverVM = new MonteCarloSolverViewModel();
            FemSolverVM        = new FemSolverViewModel();
            SpectralMappingVM  = new SpectralMappingViewModel();
            PlotVM             = new PlotViewModel();
            MapVM        = new MapViewModel();
            MeshVM       = new MeshViewModel();
            TextOutputVM = new TextOutputViewModel();
        }