示例#1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.TheGraph = ((ScottPlot.WpfPlot)(target));

            #line 10 "..\..\MainWindow.xaml"
                this.TheGraph.Loaded += new System.Windows.RoutedEventHandler(this.WpfPlot_Loaded);

            #line default
            #line hidden
                return;

            case 2:

            #line 11 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
示例#2
0
        private void FillDemoPlots()
        {
            Random rand = new Random();

            if (true)
            {
                var plt = new ScottPlot.Plot(600, 400);

                int      pointCount = 51;
                double[] xs         = DataGen.Consecutive(pointCount);
                double[] sin        = DataGen.Sin(pointCount);
                double[] cos        = DataGen.Cos(pointCount);

                plt.PlotScatter(xs, sin, label: "sin");
                plt.PlotScatter(xs, cos, label: "cos");
                plt.Legend();

                plt.Title("Scatter Plot Quickstart");
                plt.YLabel("Vertical Units");
                plt.XLabel("Horizontal Units");

                var pv1 = new ScottPlot.WpfPlot();
                pv1.Height = 200;

                plt.Title("Scatter Plot Quickstart");
                plt.YLabel("Vertical Units");
                plt.XLabel("Horizontal Units");

                StackPanelCharts.Children.Add(pv1);
            }

            if (true)
            {
                var pv1 = new ScottPlot.WpfPlot();
                pv1.Height = 200;
                pv1.plt.PlotSignal(DataGen.RandomWalk(rand, 100));

                var      plt        = pv1.plt;
                int      pointCount = 51;
                double[] xs         = DataGen.Consecutive(pointCount);
                double[] sin        = DataGen.Sin(pointCount);
                double[] cos        = DataGen.Cos(pointCount);

                plt.PlotScatter(xs, sin, label: "sin");
                plt.PlotScatter(xs, cos, label: "cos");
                plt.Legend();

                plt.Title("Scatter Plot Quickstart");
                plt.YLabel("Vertical Units");
                plt.XLabel("Horizontal Units");

                StackPanelCharts.Children.Add(pv1);
            }
        }
        public static void SetOverallPlotProperties(
            IWpfPlotViewControl pvc,
            ScottPlot.WpfPlot wpfPlot,
            PlotArguments args,
            double defPlotHeight)
        {
            if (wpfPlot != null)
            {
                var pal = args?.GetScottPalette();
                if (pal != null)
                {
                    wpfPlot.Plot.Palette = pal;
                }
                var stl = args?.GetScottStyle();
                if (stl != null)
                {
                    wpfPlot.Plot.Style(stl);
                }

                var legend = wpfPlot.Plot.Legend(location: Alignment.UpperRight);
                legend.FontSize = 9.0f;
            }

            var cc = pvc?.ContentControl;

            if (cc != null)
            {
                var height = defPlotHeight;
                if (true == args?.height.HasValue)
                {
                    height = args.height.Value;
                }
                cc.MinHeight = height;
                cc.MaxHeight = height;
            }
        }
示例#4
0
            public List <PlotItemGroup> RenderAllGroups(StackPanel panel, double plotHeight)
            {
                // first access
                var res = new List <PlotItemGroup>();

                if (panel == null)
                {
                    return(null);
                }
                panel.Children.Clear();

                // before applying arguments
                _autoScaleX = true;
                _autoScaleY = true;

                // go over all groups
                ScottPlot.WpfPlot lastPlot = null;
                foreach (var groupPI in GetItemsGrouped())
                {
                    // start new group
                    var pvc = new WpfPlotViewControlHorizontal();
                    pvc.Text = "Single value plot";
                    if (groupPI.Group >= 0 && groupPI.Group < 9999)
                    {
                        pvc.Text += $"; grp={groupPI.Group}";
                    }
                    var wpfPlot = pvc.WpfPlot;

                    // some basic attributes
                    lastPlot = wpfPlot;
                    wpfPlot.plt.AntiAlias(false, false, false);
                    wpfPlot.AxisChanged += (s, e) => WpfPlot_AxisChanged(wpfPlot, e);
                    groupPI.WpfPlot      = wpfPlot;
                    res.Add(groupPI);

                    // for all wpf / all signals
                    pvc.Height       = plotHeight;
                    pvc.ButtonClick += WpfPlot_ButtonClicked;

                    // for each signal
                    double?yMin = null, yMax = null;

                    foreach (var pi in groupPI)
                    {
                        // value
                        var val = pi.SME?.ValueAsDouble();

                        // integrate args
                        if (pi.Args != null)
                        {
                            if (pi.Args.ymin.HasValue)
                            {
                                yMin = Nullable.Compare(pi.Args.ymin, yMin) > 0 ? pi.Args.ymin : yMin;
                            }

                            if (pi.Args.ymax.HasValue)
                            {
                                yMax = Nullable.Compare(yMax, pi.Args.ymax) > 0 ? yMax : pi.Args.ymax;
                            }
                        }

                        // prepare data
                        var pb = new PlotBuffer();
                        pi.Buffer = pb;

                        // factory new Plottable
                        pb.Plottable = wpfPlot.plt.PlotSignal(pb.BufferData, label: "" + pi.DisplayPath);
                        pb.Push(val.HasValue ? val.Value : 0.0);
                    }

                    // apply some more args to the group
                    if (yMin.HasValue)
                    {
                        wpfPlot.plt.Axis(y1: yMin.Value);
                        _autoScaleY = false;
                    }

                    if (yMax.HasValue)
                    {
                        wpfPlot.plt.Axis(y2: yMax.Value);
                        _autoScaleY = false;
                    }

                    // render the plot into panel
                    wpfPlot.plt.Legend(fontSize: 9.0f);
                    panel.Children.Add(pvc);
                    wpfPlot.Render(skipIfCurrentlyRendering: true);
                }

                // for the last plot ..
                if (lastPlot != null)
                {
                    lastPlot.plt.XLabel("Samples");
                }

                // return groups for notice
                return(res);
            }
示例#5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\..\MainWindow.xaml"
                ((AppleTurnover.MainWindow)(target)).Drop += new System.Windows.DragEventHandler(this.Window_Drop);

            #line default
            #line hidden
                return;

            case 2:
                this.databaseFilesGroupBox = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 3:
                this.dataGridDatabaseFiles = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 4:
                this.AddDatabaseButton = ((System.Windows.Controls.Button)(target));

            #line 67 "..\..\..\MainWindow.xaml"
                this.AddDatabaseButton.Click += new System.Windows.RoutedEventHandler(this.AddDatabase_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.ClearDatabaseButton = ((System.Windows.Controls.Button)(target));

            #line 68 "..\..\..\MainWindow.xaml"
                this.ClearDatabaseButton.Click += new System.Windows.RoutedEventHandler(this.ClearDatabase_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.datafilesGroupBox = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 7:
                this.dataGridPeptideFiles = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 8:
                this.AddDataButton = ((System.Windows.Controls.Button)(target));

            #line 117 "..\..\..\MainWindow.xaml"
                this.AddDataButton.Click += new System.Windows.RoutedEventHandler(this.AddDataFile_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.ClearDataButton = ((System.Windows.Controls.Button)(target));

            #line 118 "..\..\..\MainWindow.xaml"
                this.ClearDataButton.Click += new System.Windows.RoutedEventHandler(this.ClearDataFiles_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.MinValidValuesTotalLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 11:
                this.MinValidValuesTotalTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 138 "..\..\..\MainWindow.xaml"
                this.MinValidValuesTotalTextBox.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.CheckIfNumber);

            #line default
            #line hidden
                return;

            case 12:
                this.MinValidValuesTimepointLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 13:
                this.MinValidValuesTimepointTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 148 "..\..\..\MainWindow.xaml"
                this.MinValidValuesTimepointTextBox.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.CheckIfNumber);

            #line default
            #line hidden
                return;

            case 14:
                this.UseBadRatiosCheckBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 15:
                this.RemoveBadPeptidesCheckBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 16:
                this.AnalyzeButton = ((System.Windows.Controls.Button)(target));

            #line 173 "..\..\..\MainWindow.xaml"
                this.AnalyzeButton.Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.StatusLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 18:
                this.AnalysisStatusTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 19:
                this.peptideRadioButton = ((System.Windows.Controls.RadioButton)(target));

            #line 189 "..\..\..\MainWindow.xaml"
                this.peptideRadioButton.Click += new System.Windows.RoutedEventHandler(this.GlobalVisualization_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.proteinRadioButton = ((System.Windows.Controls.RadioButton)(target));

            #line 190 "..\..\..\MainWindow.xaml"
                this.proteinRadioButton.Click += new System.Windows.RoutedEventHandler(this.GlobalVisualization_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.DisplayAnalyzedFilesDataGrid = ((System.Windows.Controls.DataGrid)(target));

            #line 195 "..\..\..\MainWindow.xaml"
                this.DisplayAnalyzedFilesDataGrid.SelectedCellsChanged += new System.Windows.Controls.SelectedCellsChangedEventHandler(this.AnalyzedFilesGrid_SelectedCellsChanged);

            #line default
            #line hidden
                return;

            case 22:
                this.KstTB = ((System.Windows.Controls.TextBox)(target));

            #line 204 "..\..\..\MainWindow.xaml"
                this.KstTB.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.ParamTextBox_TextChanged);

            #line default
            #line hidden
                return;

            case 23:
                this.KbtTB = ((System.Windows.Controls.TextBox)(target));

            #line 206 "..\..\..\MainWindow.xaml"
                this.KbtTB.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.ParamTextBox_TextChanged);

            #line default
            #line hidden
                return;

            case 24:
                this.KaoTB = ((System.Windows.Controls.TextBox)(target));

            #line 208 "..\..\..\MainWindow.xaml"
                this.KaoTB.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.ParamTextBox_TextChanged);

            #line default
            #line hidden
                return;

            case 25:
                this.MseTB = ((System.Windows.Controls.TextBox)(target));

            #line 212 "..\..\..\MainWindow.xaml"
                this.MseTB.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.ParamTextBox_TextChanged);

            #line default
            #line hidden
                return;

            case 26:
                this.assignParamsButton = ((System.Windows.Controls.Button)(target));

            #line 213 "..\..\..\MainWindow.xaml"
                this.assignParamsButton.Click += new System.Windows.RoutedEventHandler(this.ParamApply_Click);

            #line default
            #line hidden
                return;

            case 27:
                this.PrecisionPlot = ((ScottPlot.WpfPlot)(target));
                return;

            case 28:
                this.HalfLifeHistogramPlot = ((ScottPlot.WpfPlot)(target));
                return;

            case 29:
                this.SearchLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 30:
                this.ProteinSearchTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 235 "..\..\..\MainWindow.xaml"
                this.ProteinSearchTextBox.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.ProteinSearchTextBox_TextChanged);

            #line default
            #line hidden
                return;

            case 31:
                this.PeptideSearchLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 32:
                this.PeptidenSearchTextBox = ((System.Windows.Controls.TextBox)(target));

            #line 239 "..\..\..\MainWindow.xaml"
                this.PeptidenSearchTextBox.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.ProteinSearchTextBox_TextChanged);

            #line default
            #line hidden
                return;

            case 33:
                this.proteinSpecificRadioButton = ((System.Windows.Controls.RadioButton)(target));

            #line 244 "..\..\..\MainWindow.xaml"
                this.proteinSpecificRadioButton.Click += new System.Windows.RoutedEventHandler(this.SpecificVisualization_Click);

            #line default
            #line hidden
                return;

            case 34:
                this.proteoformSpecificRadioButton = ((System.Windows.Controls.RadioButton)(target));

            #line 245 "..\..\..\MainWindow.xaml"
                this.proteoformSpecificRadioButton.Click += new System.Windows.RoutedEventHandler(this.SpecificVisualization_Click);

            #line default
            #line hidden
                return;

            case 35:
                this.showFullSequenceCheckbox = ((System.Windows.Controls.CheckBox)(target));

            #line 247 "..\..\..\MainWindow.xaml"
                this.showFullSequenceCheckbox.Click += new System.Windows.RoutedEventHandler(this.SpecificVisualization_Click);

            #line default
            #line hidden
                return;

            case 36:
                this.DisplayPeptidesDataGrid = ((System.Windows.Controls.DataGrid)(target));

            #line 252 "..\..\..\MainWindow.xaml"
                this.DisplayPeptidesDataGrid.SelectedCellsChanged += new System.Windows.Controls.SelectedCellsChangedEventHandler(this.PeptideDataGrid_SelectedCellsChanged);

            #line default
            #line hidden
                return;

            case 37:
                this.HiddenSamplesDataGrid = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 38:
                this.ChangeSamplesDisplayed = ((System.Windows.Controls.Button)(target));

            #line 280 "..\..\..\MainWindow.xaml"
                this.ChangeSamplesDisplayed.Click += new System.Windows.RoutedEventHandler(this.ChangeFilesToPlotSpecificData_Click);

            #line default
            #line hidden
                return;

            case 39:
                this.DisplayedSamplesDataGrid = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 40:
                this.PlotBestFitCheckBox = ((System.Windows.Controls.CheckBox)(target));

            #line 297 "..\..\..\MainWindow.xaml"
                this.PlotBestFitCheckBox.Click += new System.Windows.RoutedEventHandler(this.ChangeFilesToPlotSpecificData_Click);

            #line default
            #line hidden
                return;

            case 41:
                this.PlotCICheckBox = ((System.Windows.Controls.CheckBox)(target));

            #line 298 "..\..\..\MainWindow.xaml"
                this.PlotCICheckBox.Click += new System.Windows.RoutedEventHandler(this.ChangeFilesToPlotSpecificData_Click);

            #line default
            #line hidden
                return;

            case 42:
                this.PlotAminoAcidPoolCheckBox = ((System.Windows.Controls.CheckBox)(target));

            #line 301 "..\..\..\MainWindow.xaml"
                this.PlotAminoAcidPoolCheckBox.Click += new System.Windows.RoutedEventHandler(this.ChangeFilesToPlotSpecificData_Click);

            #line default
            #line hidden
                return;

            case 43:
                this.DisplayLegendCheckBox = ((System.Windows.Controls.CheckBox)(target));

            #line 302 "..\..\..\MainWindow.xaml"
                this.DisplayLegendCheckBox.Click += new System.Windows.RoutedEventHandler(this.AddRemoveLegends_Click);

            #line default
            #line hidden
                return;

            case 44:
                this.ComparisonLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 45:
                this.RatioComparisonPlot = ((ScottPlot.WpfPlot)(target));
                return;

            case 46:
                this.HalfLifeComparisonPlot = ((ScottPlot.WpfPlot)(target));
                return;

            case 47:
                this.OutputFigures = ((System.Windows.Controls.Button)(target));

            #line 312 "..\..\..\MainWindow.xaml"
                this.OutputFigures.Click += new System.Windows.RoutedEventHandler(this.ExportFiguresButton_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.portsbox = ((System.Windows.Controls.ComboBox)(target));

            #line 23 "..\..\..\MainWindow.xaml"
                this.portsbox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.Portsbox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.connect = ((System.Windows.Controls.Button)(target));

            #line 34 "..\..\..\MainWindow.xaml"
                this.connect.Click += new System.Windows.RoutedEventHandler(this.Connect_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.disconnect = ((System.Windows.Controls.Button)(target));

            #line 35 "..\..\..\MainWindow.xaml"
                this.disconnect.Click += new System.Windows.RoutedEventHandler(this.Disconnect_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.status = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.start_measurement = ((System.Windows.Controls.Button)(target));

            #line 49 "..\..\..\MainWindow.xaml"
                this.start_measurement.Click += new System.Windows.RoutedEventHandler(this.start_measurement_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.stop_measurement = ((System.Windows.Controls.Button)(target));

            #line 50 "..\..\..\MainWindow.xaml"
                this.stop_measurement.Click += new System.Windows.RoutedEventHandler(this.stop_measurement_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.single_measurement = ((System.Windows.Controls.Button)(target));

            #line 51 "..\..\..\MainWindow.xaml"
                this.single_measurement.Click += new System.Windows.RoutedEventHandler(this.single_measurement_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.measurement_status = ((System.Windows.Controls.TextBox)(target));
                return;

            case 9:
                this.voltage = ((System.Windows.Controls.TextBox)(target));
                return;

            case 10:
                this.current = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.saveDirectoryText = ((System.Windows.Controls.TextBox)(target));
                return;

            case 12:
                this.saveDirectory = ((System.Windows.Controls.Button)(target));

            #line 91 "..\..\..\MainWindow.xaml"
                this.saveDirectory.Click += new System.Windows.RoutedEventHandler(this.SaveDirectory_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.export = ((System.Windows.Controls.Button)(target));

            #line 94 "..\..\..\MainWindow.xaml"
                this.export.Click += new System.Windows.RoutedEventHandler(this.export_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.clear = ((System.Windows.Controls.Button)(target));

            #line 95 "..\..\..\MainWindow.xaml"
                this.clear.Click += new System.Windows.RoutedEventHandler(this.clear_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.wpfPlot1 = ((ScottPlot.WpfPlot)(target));
                return;

            case 16:
                this.wpfPlot2 = ((ScottPlot.WpfPlot)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.portsbox = ((System.Windows.Controls.ComboBox)(target));

            #line 28 "..\..\..\MainWindow.xaml"
                this.portsbox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.Portsbox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.connect = ((System.Windows.Controls.Button)(target));

            #line 37 "..\..\..\MainWindow.xaml"
                this.connect.Click += new System.Windows.RoutedEventHandler(this.Connect_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.disconnect = ((System.Windows.Controls.Button)(target));

            #line 38 "..\..\..\MainWindow.xaml"
                this.disconnect.Click += new System.Windows.RoutedEventHandler(this.Disconnect_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.status = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.ampEn = ((System.Windows.Controls.Button)(target));

            #line 42 "..\..\..\MainWindow.xaml"
                this.ampEn.Click += new System.Windows.RoutedEventHandler(this.ampEn_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.ampDis = ((System.Windows.Controls.Button)(target));

            #line 43 "..\..\..\MainWindow.xaml"
                this.ampDis.Click += new System.Windows.RoutedEventHandler(this.ampDis_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.setVoltageTextBox = ((Xceed.Wpf.Toolkit.DecimalUpDown)(target));

            #line 45 "..\..\..\MainWindow.xaml"
                this.setVoltageTextBox.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.voltageBox_ValueChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.currentLimitTextBox = ((Xceed.Wpf.Toolkit.DecimalUpDown)(target));

            #line 48 "..\..\..\MainWindow.xaml"
                this.currentLimitTextBox.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.currentLimitTextBox_ValueChanged);

            #line default
            #line hidden
                return;

            case 9:
                this.osrSlider = ((System.Windows.Controls.Slider)(target));

            #line 58 "..\..\..\MainWindow.xaml"
                this.osrSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.osrSlider_ValueChanged);

            #line default
            #line hidden
                return;

            case 10:
                this.osrSliderText = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.clearGraphButton = ((System.Windows.Controls.Button)(target));

            #line 62 "..\..\..\MainWindow.xaml"
                this.clearGraphButton.Click += new System.Windows.RoutedEventHandler(this.clearGraphButton_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.exportDataButton = ((System.Windows.Controls.Button)(target));

            #line 63 "..\..\..\MainWindow.xaml"
                this.exportDataButton.Click += new System.Windows.RoutedEventHandler(this.export_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.currentTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 14:
                this.voltageTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 15:
                this.iPlot = ((ScottPlot.WpfPlot)(target));
                return;

            case 16:
                this.vPlot = ((ScottPlot.WpfPlot)(target));
                return;
            }
            this._contentLoaded = true;
        }