/// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.plot = new OxyPlot.WindowsForms.PlotView();
     this.SuspendLayout();
     //
     // plot
     //
     this.plot.Dock                 = System.Windows.Forms.DockStyle.Fill;
     this.plot.Location             = new System.Drawing.Point(0, 0);
     this.plot.Name                 = "plot";
     this.plot.PanCursor            = System.Windows.Forms.Cursors.Hand;
     this.plot.Size                 = new System.Drawing.Size(484, 461);
     this.plot.TabIndex             = 0;
     this.plot.Text                 = "plot";
     this.plot.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
     this.plot.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
     this.plot.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
     //
     // VisualizationForm
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(484, 461);
     this.Controls.Add(this.plot);
     this.Name  = "VisualizationForm";
     this.Text  = "VisualizationForm";
     this.Load += new System.EventHandler(this.AssignPlot);
     this.ResumeLayout(false);
 }
Example #2
0
        private void initialPlots()
        {
            this.plotFlights = new OxyPlot.WindowsForms.PlotView();
            this.plotPeak    = new OxyPlot.WindowsForms.PlotView();
            this.SuspendLayout();

            //
            // plotFlights
            //
            this.plotFlights.Location             = new System.Drawing.Point(0, 50);
            this.plotFlights.Name                 = "Aircrafts";
            this.plotFlights.PanCursor            = System.Windows.Forms.Cursors.Hand;
            this.plotFlights.Size                 = new System.Drawing.Size(1200, 500);
            this.plotFlights.TabIndex             = 0;
            this.plotFlights.Text                 = "Aircrafts";
            this.plotFlights.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
            this.plotFlights.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
            this.plotFlights.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
            //
            // plotPeak
            //
            //this.plotPeak.Dock = System.Windows.Forms.DockStyle.Fill;
            this.plotPeak.Location             = new System.Drawing.Point(0, 550);
            this.plotPeak.Name                 = "Peak Time";
            this.plotPeak.PanCursor            = System.Windows.Forms.Cursors.Hand;
            this.plotPeak.Size                 = new System.Drawing.Size(1200, 300);
            this.plotPeak.TabIndex             = 1;
            this.plotPeak.Text                 = "Peak Time";
            this.plotPeak.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
            this.plotPeak.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
            this.plotPeak.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;

            tblPlot.Controls.Add(this.plotFlights, 0, 0);
            tblPlot.Controls.Add(this.plotPeak, 0, 1);
        }
Example #3
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.pv = new OxyPlot.WindowsForms.PlotView();
     this.SuspendLayout();
     //
     // pv
     //
     this.pv.Location             = new System.Drawing.Point(0, 0);
     this.pv.Name                 = "pv";
     this.pv.PanCursor            = System.Windows.Forms.Cursors.Hand;
     this.pv.Size                 = new System.Drawing.Size(1000, 600);
     this.pv.TabIndex             = 0;
     this.pv.Text                 = "Graph";
     this.pv.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
     this.pv.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
     this.pv.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
     //
     // Form2
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.AutoSize            = true;
     this.BackColor           = System.Drawing.Color.White;
     this.ClientSize          = new System.Drawing.Size(910, 510);
     this.Name  = "Form2";
     this.Text  = "Error Graph";
     this.Load += new System.EventHandler(this.Form2_Load);
     this.ResumeLayout(false);
 }
Example #4
0
        private static Task showPlot(PlotModel model)
        {
            Task task = Task.Run(() =>
            {
                var plot1 = new OxyPlot.WindowsForms.PlotView();
                //
                // plot1
                //
                plot1.Dock      = System.Windows.Forms.DockStyle.Fill;
                plot1.Location  = new System.Drawing.Point(0, 0);
                plot1.Name      = "plot1";
                plot1.PanCursor = System.Windows.Forms.Cursors.Hand;
                //plot1.Size = new System.Drawing.Size(1219, 688);
                plot1.TabIndex             = 1;
                plot1.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
                plot1.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
                plot1.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
                plot1.Model = model;
                //plot1.Show();
                //
                var frm           = new Form();
                frm.Size          = new System.Drawing.Size(800, 600);
                frm.WindowState   = FormWindowState.Normal;
                frm.StartPosition = FormStartPosition.CenterScreen;
                frm.Controls.Add(plot1);
                frm.ShowDialog();
            });

            return(task);
        }
Example #5
0
        public Plot_SplitContainer()
        {
            Options_Table = new TableLayoutPanel();
            Plot_View     = new OxyPlot.WindowsForms.PlotView();

            //
            this.Options_Table.SuspendLayout();
            this.Panel1.SuspendLayout();
            this.Panel2.SuspendLayout();
            this.SuspendLayout();
            //
            //
            this.BorderStyle      = BorderStyle.FixedSingle;
            this.FixedPanel       = FixedPanel.Panel1;
            this.IsSplitterFixed  = true;
            this.SplitterDistance = 100;
            //
            // Panel1
            //
            this.Panel1.Controls.Add(Options_Table);
            this.Panel1MinSize   = 100;
            this.Panel1Collapsed = true;
            //
            // Panel2
            //
            this.Panel2.Controls.Add(Plot_View);
            //
            // Options Table
            //
            Options_Table.ColumnCount = 1;
            Options_Table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            Options_Table.Dock     = DockStyle.Fill;
            Options_Table.Location = new Point(0, 0);
            Options_Table.RowCount = 2;
            Options_Table.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
            Options_Table.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            //
            // Plot View
            //
            Plot_View.Dock                 = DockStyle.Fill;
            Plot_View.Location             = new Point(0, 0);
            Plot_View.PanCursor            = Cursors.Hand;
            Plot_View.ZoomHorizontalCursor = Cursors.SizeWE;
            Plot_View.ZoomRectangleCursor  = Cursors.SizeNWSE;
            Plot_View.ZoomVerticalCursor   = Cursors.SizeNS;
            //
            // ToolStrip
            //
            this.Options_Table.ResumeLayout(true);
            this.Panel1.ResumeLayout(false);
            this.Panel2.ResumeLayout(false);
            this.ResumeLayout(false);
            //
        }
Example #6
0
        private void Form1_Load(object sender, EventArgs eargs)
        {
            var model = new PlotModel {
                Title = "Continuous Histograms", Subtitle = "Distribution of cos(x) values"
            };

            model.Axes.Add(new LinearAxis {
                Position = AxisPosition.Left, MajorGridlineStyle = LineStyle.Solid, Key = "VBottom", StartPosition = 0, EndPosition = 0.48, AbsoluteMinimum = 0, AbsoluteMaximum = 5, Maximum = 5, Title = "Frequency"
            });
            model.Axes.Add(new LinearAxis {
                Position = AxisPosition.Left, MajorGridlineStyle = LineStyle.Solid, Key = "VTop", StartPosition = 0.52, EndPosition = 1.0, AbsoluteMinimum = 0, AbsoluteMaximum = 5, Maximum = 5, Title = "Frequency"
            });
            model.Axes.Add(new LinearAxis {
                Position = AxisPosition.Bottom, Title = "(1 + cos(x)) / 2", Key = "H", StartPosition = 1, EndPosition = 0
            });

            model.IsLegendVisible = true;
            model.LegendPlacement = LegendPlacement.Outside;
            model.LegendPosition  = LegendPosition.RightTop;

            var chs1 = new ContinuousHistogramSeries()
            {
                YAxisKey = "VBottom", Title = "Regular Bins"
            };

            chs1.ItemsSource     = HistogramHelpers.Collect(RandomSource(10000), 0, 1, 10, true);
            chs1.StrokeThickness = 1;
            chs1.RenderInLegend  = true;
            model.Series.Add(chs1);

            var chs2 = new ContinuousHistogramSeries()
            {
                YAxisKey = "VTop", Title = "Custom Bins"
            };

            chs2.ItemsSource     = HistogramHelpers.Collect(RandomSource(10000), new[] { 0, 0.02, 0.05, 0.1, 0.2, 0.4, 0.6, 0.8, 0.9, 0.95, 0.98, 1.0 }, true);
            chs2.StrokeThickness = 1;
            chs2.RenderInLegend  = true;
            model.Series.Add(chs2);

            OxyPlot.WindowsForms.PlotView plotView = new OxyPlot.WindowsForms.PlotView();

            plotView.Model = model;

            this.Controls.Add(plotView);

            model.InvalidatePlot(true);
            plotView.Invalidate();

            plotView.Dock = DockStyle.Fill;

            this.Refresh();
        }
        public SvmGui(double [] weights, double bias, int model, IEnumerable<Tuple<double, double>> setA, IEnumerable<Tuple<double, double>> setB, IEnumerable<Tuple<double, double>> hyperplane = null)
        {
            InitializeComponent();

            _plot = new MainViewModel(weights, bias, model, setA, setB, hyperplane);
            var view = new OxyPlot.WindowsForms.PlotView
                           {
                               Width = Width,
                               Height = Height,
                               Parent = this,
                               BackColor = Color.WhiteSmoke,
                               Model = _plot.Model
                           };
        }
Example #8
0
        private void InitializeOxyPlot()
        {
            this.plot = new OxyPlot.WindowsForms.PlotView();

            this.plot.Dock      = System.Windows.Forms.DockStyle.Fill;
            this.plot.Location  = new System.Drawing.Point(0, 0);
            this.plot.Margin    = new System.Windows.Forms.Padding(0);
            this.plot.Name      = "plot";
            this.plot.BackColor = Color.White;
            this.plot.Size      = new System.Drawing.Size(500, 250);
            this.plot.TabIndex  = 0;

            this.splitContainer.Panel2.Controls.Add(this.plot);
        }
Example #9
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Plot       = new OxyPlot.WindowsForms.PlotView();
            Plot.Model = new PlotModel();
            Plot.Dock  = DockStyle.Fill;
            this.panel1.Controls.Add(Plot);

            Plot.Model.PlotType   = PlotType.XY;
            Plot.Model.Background = OxyColor.FromRgb(255, 255, 255);
            Plot.Model.TextColor  = OxyColor.FromRgb(0, 0, 0);

            // add Series and Axis to plot model
            Plot.Model.Series.Add(lineSeries);
            Plot.Model.Axes.Add(new LinearAxis());
        }
Example #10
0
        public OxyPlot.WindowsForms.PlotView createGraph(string filePath, string graphType, TrackBar trackBar)
        {
            xAxis = new OxyPlot.Axes.LinearAxis();
            yAxis = new OxyPlot.Axes.LinearAxis();
            pm    = new PlotModel();
            pv    = new OxyPlot.WindowsForms.PlotView();


            pv.Controller = new OxyPlot.PlotController();
            pv.Controller.UnbindKeyDown(OxyKey.Right);
            pv.Controller.UnbindKeyDown(OxyKey.Left);
            pv.Controller.UnbindMouseDown(OxyMouseButton.Right);
            pv.Controller.UnbindAll();

            pm.TextColor = OxyColor.FromRgb(0, 0, 0);
            pm.Padding   = new OxyThickness(0, 10, 25, 15);
            pv.BackColor = Color.White;

            if (graphType.Equals("Accelerometer"))
            {
                pv.Location = new Point(520, 50);
                pv.Size     = new Size(900, 205);
                xAxis       = setXAxis(49);
                yAxis       = setYAxis(" m/" + "s\u00B2 ");
            }
            else if (graphType.Equals("Gyroscope"))
            {
                pv.Location = new Point(520, 260);
                pv.Size     = new Size(900, 205);
                xAxis       = setXAxis(49);
                yAxis       = setYAxis(" rad/s ");
            }
            else if (graphType.Equals("AudioLevel"))
            {
                pv.Location = new Point(520, 470);
                pv.Size     = new Size(900, 205);

                xAxis = setXAxis(49);
                yAxis = setYAxis(" Audio Level % ");
            }


            pm.Axes.Add(xAxis);
            pm.Axes.Add(yAxis);
            pv.Model = pm;

            return(pv);
        }
Example #11
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.plot1 = new OxyPlot.WindowsForms.PlotView();
     this.plot2 = new OxyPlot.WindowsForms.PlotView();
     this.SuspendLayout();
     //
     // plot1
     //
     this.plot1.Dock                 = System.Windows.Forms.DockStyle.Left;
     this.plot1.Location             = new System.Drawing.Point(0, 0);
     this.plot1.Name                 = "plot1";
     this.plot1.PanCursor            = System.Windows.Forms.Cursors.Hand;
     this.plot1.Size                 = new System.Drawing.Size(547, 856);
     this.plot1.TabIndex             = 0;
     this.plot1.Text                 = "plot1";
     this.plot1.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
     this.plot1.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
     this.plot1.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
     //
     // plot2
     //
     this.plot2.Dock                 = System.Windows.Forms.DockStyle.Right;
     this.plot2.Location             = new System.Drawing.Point(581, 0);
     this.plot2.Name                 = "plot2";
     this.plot2.PanCursor            = System.Windows.Forms.Cursors.Hand;
     this.plot2.Size                 = new System.Drawing.Size(529, 856);
     this.plot2.TabIndex             = 0;
     this.plot2.Text                 = "plot2";
     this.plot2.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
     this.plot2.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
     this.plot2.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
     //
     // Form2
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(1110, 856);
     this.Controls.Add(this.plot2);
     this.Controls.Add(this.plot1);
     this.Name = "Form2";
     this.Text = "Form2";
     this.ResumeLayout(false);
 }
Example #12
0
 /// <summary>
 /// Metoda wymagana do obsługi projektanta — nie należy modyfikować
 /// jej zawartości w edytorze kodu.
 /// </summary>
 private void InitializeComponent()
 {
     this.pv  = new OxyPlot.WindowsForms.PlotView();
     this.pv2 = new OxyPlot.WindowsForms.PlotView();
     this.SuspendLayout();
     //
     // pv
     //
     this.pv.Location             = new System.Drawing.Point(0, 0);
     this.pv.Name                 = "pv";
     this.pv.PanCursor            = System.Windows.Forms.Cursors.Hand;
     this.pv.Size                 = new System.Drawing.Size(900, 500);
     this.pv.TabIndex             = 0;
     this.pv.Text                 = "plot1";
     this.pv.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
     this.pv.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
     this.pv.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
     //
     // pv2
     //
     this.pv2.Location             = new System.Drawing.Point(0, 500);
     this.pv2.Name                 = "pv2";
     this.pv2.PanCursor            = System.Windows.Forms.Cursors.Hand;
     this.pv2.Size                 = new System.Drawing.Size(900, 500);
     this.pv2.TabIndex             = 0;
     this.pv2.Text                 = "plot2";
     this.pv2.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
     this.pv2.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
     this.pv2.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(1014, 1042);
     this.Name  = "Form1";
     this.Text  = "Form1";
     this.Load += new System.EventHandler(this.Form1_Load);
     this.ResumeLayout(false);
 }
Example #13
0
        private void Plotter_Load(object sender, EventArgs e)
        {
            PlotForm = new OxyPlot.WindowsForms.PlotView();
            SuspendLayout();

            PlotForm.Dock = System.Windows.Forms.DockStyle.Bottom;
            PlotForm.Location = new System.Drawing.Point(0, 0);
            PlotForm.Name = "plot1";
            PlotForm.PanCursor = System.Windows.Forms.Cursors.Hand;
            PlotForm.Size = new System.Drawing.Size(500, 500);
            PlotForm.TabIndex = 0;
            PlotForm.Text = "plot1";
            PlotForm.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
            PlotForm.ZoomRectangleCursor = System.Windows.Forms.Cursors.SizeNWSE;
            PlotForm.ZoomVerticalCursor = System.Windows.Forms.Cursors.SizeNS;
            Controls.Add(this.PlotForm);

            PlotForm.Model = new PlotModel { Title = Title };
            foreach (var s in Series)
            {
                PlotForm.Model.Series.Add(s);
            }
        }
Example #14
0
 public void setAccelerometerPlot(OxyPlot.WindowsForms.PlotView accelerometerPlot)
 {
     this.accelerometerPlot = accelerometerPlot;
 }
Example #15
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Plot = new OxyPlot.WindowsForms.PlotView();
            Plot.Model = new PlotModel();
            Plot.Dock = DockStyle.Fill;
            this.panel1.Controls.Add(Plot);

            Plot.Model.PlotType = PlotType.XY;
            Plot.Model.Background = OxyColor.FromRgb(255, 255, 255);
            Plot.Model.TextColor = OxyColor.FromRgb(0, 0, 0);

            // add Series and Axis to plot model
            Plot.Model.Series.Add(lineSeries);
            Plot.Model.Axes.Add(new LinearAxis());
        }
Example #16
0
        public void InitializePlot()
        {
            this.plotView = new OxyPlot.WindowsForms.PlotView();
            //
            // plotView
            //
            this.plotView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.plotView.Location = new System.Drawing.Point(0, 0);
            this.plotView.Name = "plotView";
            this.plotView.PanCursor = System.Windows.Forms.Cursors.Hand;
            this.plotView.Size = new System.Drawing.Size(434, 315);
            this.plotView.TabIndex = 0;
            this.plotView.Text = "plotView";
            this.plotView.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
            this.plotView.ZoomRectangleCursor = System.Windows.Forms.Cursors.SizeNWSE;
            this.plotView.ZoomVerticalCursor = System.Windows.Forms.Cursors.SizeNS;
            //
            // PlotForm
            //
            this.Controls.Add(this.plotView);

            var greyColor = OxyColor.FromRgb(0, 0, 0);
            var top = PlatformHeight / 2;
            var bottom = -top;
            var right = PlatformWidth / 2;
            var left = -right;

            var myModel = new PlotModel();
            myModel.PlotType = PlotType.Cartesian;
            //myModel.Series.Add(new FunctionSeries(d => PlatformHeight * Math.Cos(d) / 2, left, right, 0.1, "cos(x)"));

            var leftFootPlatformSeries = new LineSeries();
            leftFootPlatformSeries.Points.Add(new DataPoint(left, bottom));
            leftFootPlatformSeries.Points.Add(new DataPoint(left, top));
            leftFootPlatformSeries.Points.Add(new DataPoint(right, top));
            leftFootPlatformSeries.Points.Add(new DataPoint(right, bottom));
            leftFootPlatformSeries.Points.Add(new DataPoint(left, bottom));
            leftFootPlatformSeries.LineJoin = LineJoin.Round;
            leftFootPlatformSeries.Color = greyColor;

            leftFootPlatformSeries.XAxisKey = "x1";
            leftFootPlatformSeries.YAxisKey = "y1";
            myModel.Series.Add(leftFootPlatformSeries);

            var rightFootPlatformSeries = new LineSeries();
            rightFootPlatformSeries.Points.Add(new DataPoint(left, bottom));
            rightFootPlatformSeries.Points.Add(new DataPoint(left, top));
            rightFootPlatformSeries.Points.Add(new DataPoint(right, top));
            rightFootPlatformSeries.Points.Add(new DataPoint(right, bottom));
            rightFootPlatformSeries.Points.Add(new DataPoint(left, bottom));
            rightFootPlatformSeries.Color = greyColor;

            rightFootPlatformSeries.XAxisKey = "x2";
            rightFootPlatformSeries.YAxisKey = "y2";
            myModel.Series.Add(rightFootPlatformSeries);

            var axisY = new LinearAxis();
            axisY.Key = "y1";
            //axisY.Maximum = top+ 10;
            //axisY.Minimum = bottom - 10;
            //axisY.AbsoluteMaximum = top + 10;
            //axisY.AbsoluteMinimum = bottom - 10;
            axisY.MinimumPadding = 0.1;
            //axisY.PositionAtZeroCrossing = true;
            axisY.Position = AxisPosition.Left;
            //axisY.TickStyle = OxyPlot.Axes.TickStyle.Crossing;
            //axisY.AbsoluteMinimum = bottom -1;
            //axisY.AbsoluteMaximum = top + 1;
            axisY.MajorGridlineStyle = LineStyle.Solid;
            axisY.MinorGridlineStyle = LineStyle.Dot;
            myModel.Axes.Add(axisY);

            var leftX = new LinearAxis();
            leftX.EndPosition = 0.5;
            leftX.Key = "x1";
            //leftX.Maximum = right;
            //leftX.Minimum = left;
            leftX.AbsoluteMaximum = right;
            //leftX.AbsoluteMinimum = left - 1;
            leftX.Position = AxisPosition.Bottom;
            leftX.MinimumPadding = 0.1;
            //leftX.PositionAtZeroCrossing = true;
            //leftX.TickStyle = OxyPlot.Axes.TickStyle.Crossing;
            leftX.MajorGridlineStyle = LineStyle.Solid;
            leftX.MinorGridlineStyle = LineStyle.Dot;

            myModel.Axes.Add(leftX);

            var rightX = new LinearAxis();
            rightX.Key = "x2";
            //rightX.Maximum = right;
            //rightX.Minimum = left;
            //rightX.AbsoluteMaximum = right + 1;
            rightX.AbsoluteMinimum = left;
            rightX.Position = AxisPosition.Bottom;
            rightX.MinimumPadding = 0.1;
            //rightX.PositionAtZeroCrossing = true;
            //rightX.TickStyle = OxyPlot.Axes.TickStyle.Crossing;
            rightX.StartPosition = 0.5;
            rightX.MajorGridlineStyle = LineStyle.Solid;
            rightX.MinorGridlineStyle = LineStyle.Dot;

            myModel.Axes.Add(rightX);

            var topX = new LinearAxis();
            topX.Key = "x";
            topX.Maximum = right;
            topX.Minimum = left;
            //rightX.AbsoluteMaximum = 2* right + 10;
            //rightX.AbsoluteMinimum = 2* left - 10;
            topX.Position = AxisPosition.Top;
            topX.MinimumPadding = 0.1;
            //rightX.PositionAtZeroCrossing = true;
            //rightX.TickStyle = OxyPlot.Axes.TickStyle.Crossing;
            //rightX.StartPosition = 0.5;
            topX.MajorGridlineStyle = LineStyle.Solid;
            topX.MinorGridlineStyle = LineStyle.Dot;

            myModel.Axes.Add(topX);

            var axisY2 = new LinearAxis();
            axisY2.Key = "y2";
            //axisY2.Maximum = top;
            //axisY2.Minimum = bottom;
            axisY2.Position = AxisPosition.Right;
            axisY2.MinimumPadding = 0.1;
            //axisY2.PositionAtZeroCrossing = true;
            //axisY2.TickStyle = OxyPlot.Axes.TickStyle.Crossing;
            //axisY2.AbsoluteMinimum = bottom - 10;
            //axisY2.AbsoluteMaximum = top + 10;
            axisY2.MajorGridlineStyle = LineStyle.Solid;
            axisY2.MinorGridlineStyle = LineStyle.Dot;

            myModel.Axes.Add(axisY2);

            //var secondSeries = new FunctionSeries(d => PlatformHeight * Math.Sin(d) / 2, left, right, 0.1, "sin(x)");
            //secondSeries.XAxisKey = "x2";
            //secondSeries.YAxisKey = "y2";
            //myModel.Series.Add(secondSeries);

            var leftSeries = new LineSeries();
            leftSeries.XAxisKey = "x1";
            leftSeries.YAxisKey = "y1";
            leftSeries.Color = OxyColor.FromRgb(255, 0, 0);
            leftSeries.MarkerFill = OxyColors.Red;
            //            leftSeries.MarkerSize = 1;
            //            leftSeries.MarkerStroke = OxyColors.Red;
            //            leftSeries.MarkerType = MarkerType.Circle;
            leftSeries.Smooth = true;
            myModel.Series.Add(leftSeries);
            _leftSeries = leftSeries;

            var rightSeries = new LineSeries();
            rightSeries.XAxisKey = "x2";
            rightSeries.YAxisKey = "y2";
            rightSeries.Color = OxyColor.FromRgb(255, 0, 0);
            rightSeries.MarkerFill = OxyColors.Red;
            //            rightSeries.MarkerSize = 1;
            //            rightSeries.MarkerStroke = OxyColors.Red;
            //            rightSeries.MarkerType = MarkerType.Circle;
            rightSeries.Smooth = true;
            myModel.Series.Add(rightSeries);
            _rightSeries = rightSeries;
            //plotView.Enabled = false;

            this.plotView.Model = myModel;
        }
Example #17
0
        Control Overview(TimeInterval m)
        {
            var model = new OxyPlot.PlotModel()
            {
                Title           = "Overview",
                Background      = OxyColors.White,
                DefaultFont     = "Arial",
                DefaultFontSize = 10.0
            };

            model.Axes.Add(new DateTimeAxis
            {
                Position           = AxisPosition.Left,
                MajorGridlineStyle = LineStyle.Solid,
                MajorStep          = 1,
                MinorStep          = 1.0 / 4.0,
                Minimum            = DateTimeAxis.ToDouble(m.Begin.AddDays(-1)),
                Maximum            = DateTimeAxis.ToDouble(m.End),
                StringFormat       = "ddd dd.MM.",
            });

            model.Axes.Add(new TimeSpanAxis
            {
                Position           = AxisPosition.Bottom,
                MajorGridlineStyle = LineStyle.Solid,
                MinorGridlineStyle = LineStyle.Dot,
                Minimum            = TimeSpan.Zero.TotalSeconds,
                Maximum            = TimeSpan.FromDays(1).TotalSeconds,
                StringFormat       = "h:mm",
            });

            var bars = Summarize(input.Range(m));

            var activity = new OxyPlot.Series.RectangleBarSeries()
            {
                TrackerFormatString = "{2} - {3}",
                StrokeThickness     = 0
            };

            foreach (var i in bars)
            {
                foreach (var t in i.TimeInterval.SplitToDays())
                {
                    var refDay = t.Begin.Date;
                    var y0     = DateTimeAxis.ToDouble(refDay);
                    var x0     = (t.Begin - refDay).TotalSeconds;
                    var x1     = (t.End - refDay).TotalSeconds;
                    activity.Items.Add(new OxyPlot.Series.RectangleBarItem(x0, y0 - daySep, x1, y0 + daySep)
                    {
                        Color = OxyPlot.OxyColor.FromUInt32((uint)(i.IsActive ? activeColor : idleColor).ToArgb())
                    });
                }
            }

            model.Series.Add(activity);

            /*
             * var keys = new OxyPlot.Series.ScatterSeries()
             * {
             *  MarkerType = MarkerType.Circle,
             *
             * };
             *
             * foreach (var i in input.Range(m))
             * {
             *  if (i.KeyDown > 0)
             *  {
             *      keys.Points.Add(new OxyPlot.Series.ScatterPoint(
             *          i.TimeInterval.Begin.ToLocalTime().TimeOfDay.TotalSeconds,
             *          i.TimeInterval.Begin.ToLocalTime().Date.ToOADate()));
             *  }
             * }
             *
             * model.Series.Add(keys);
             */

            var plotView = new OxyPlot.WindowsForms.PlotView
            {
                Model = model
            };

            return(plotView);
        }
Example #18
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components        = new System.ComponentModel.Container();
     this.plot1             = new OxyPlot.WindowsForms.PlotView();
     this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.bottomPanel       = new System.Windows.Forms.Panel();
     this.closeButton       = new System.Windows.Forms.Button();
     this.captionLabel      = new System.Windows.Forms.Label();
     this.panel1            = new System.Windows.Forms.Panel();
     this.splitter          = new System.Windows.Forms.Splitter();
     this.bottomPanel.SuspendLayout();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // plot1
     //
     this.plot1.ContextMenuStrip     = this.contextMenuStrip1;
     this.plot1.Dock                 = System.Windows.Forms.DockStyle.Fill;
     this.plot1.Location             = new System.Drawing.Point(0, 0);
     this.plot1.Margin               = new System.Windows.Forms.Padding(4);
     this.plot1.Name                 = "plot1";
     this.plot1.PanCursor            = System.Windows.Forms.Cursors.Hand;
     this.plot1.Size                 = new System.Drawing.Size(757, 361);
     this.plot1.TabIndex             = 1;
     this.plot1.Text                 = "plot1";
     this.plot1.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
     this.plot1.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
     this.plot1.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
     this.plot1.MouseDoubleClick    += new System.Windows.Forms.MouseEventHandler(this.OnMouseDoubleClick);
     //
     // contextMenuStrip1
     //
     this.contextMenuStrip1.Name = "contextMenuStrip1";
     this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4);
     //
     // bottomPanel
     //
     this.bottomPanel.Controls.Add(this.closeButton);
     this.bottomPanel.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.bottomPanel.Location = new System.Drawing.Point(0, 378);
     this.bottomPanel.Margin   = new System.Windows.Forms.Padding(4);
     this.bottomPanel.Name     = "bottomPanel";
     this.bottomPanel.Size     = new System.Drawing.Size(757, 239);
     this.bottomPanel.TabIndex = 3;
     //
     // closeButton
     //
     this.closeButton.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.closeButton.Image    = global::UserInterface.Properties.Resources.Close;
     this.closeButton.Location = new System.Drawing.Point(728, 1);
     this.closeButton.Margin   = new System.Windows.Forms.Padding(4);
     this.closeButton.Name     = "closeButton";
     this.closeButton.Size     = new System.Drawing.Size(29, 28);
     this.closeButton.TabIndex = 0;
     this.closeButton.UseVisualStyleBackColor = true;
     this.closeButton.Click += new System.EventHandler(this.OnCloseEditorPanel);
     //
     // captionLabel
     //
     this.captionLabel.AutoSize     = true;
     this.captionLabel.Dock         = System.Windows.Forms.DockStyle.Bottom;
     this.captionLabel.Location     = new System.Drawing.Point(0, 361);
     this.captionLabel.MaximumSize  = new System.Drawing.Size(500, 50);
     this.captionLabel.Name         = "captionLabel";
     this.captionLabel.Size         = new System.Drawing.Size(0, 17);
     this.captionLabel.TabIndex     = 4;
     this.captionLabel.DoubleClick += new System.EventHandler(this.OnCaptionLabelDoubleClick);
     //
     // panel1
     //
     this.panel1.Controls.Add(this.plot1);
     this.panel1.Controls.Add(this.captionLabel);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(757, 378);
     this.panel1.TabIndex = 5;
     //
     // splitter
     //
     this.splitter.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.splitter.Location = new System.Drawing.Point(0, 375);
     this.splitter.Name     = "splitter";
     this.splitter.Size     = new System.Drawing.Size(757, 3);
     this.splitter.TabIndex = 6;
     this.splitter.TabStop  = false;
     //
     // GraphView
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.splitter);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.bottomPanel);
     this.Name = "GraphView";
     this.Size = new System.Drawing.Size(757, 617);
     this.bottomPanel.ResumeLayout(false);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.ResumeLayout(false);
 }
Example #19
0
 /// <summary>
 /// Требуемый метод для поддержки конструктора — не изменяйте
 /// содержимое этого метода с помощью редактора кода.
 /// </summary>
 private void InitializeComponent()
 {
     this.plotView1     = new OxyPlot.WindowsForms.PlotView();
     this.button1       = new System.Windows.Forms.Button();
     this.RInput        = new System.Windows.Forms.TextBox();
     this.CInput        = new System.Windows.Forms.TextBox();
     this.label1        = new System.Windows.Forms.Label();
     this.label2        = new System.Windows.Forms.Label();
     this.ROut          = new System.Windows.Forms.Label();
     this.plabel        = new System.Windows.Forms.Label();
     this.dataGridView1 = new System.Windows.Forms.DataGridView();
     this.COut          = new System.Windows.Forms.Label();
     this.w0Out         = new System.Windows.Forms.Label();
     this.button2       = new System.Windows.Forms.Button();
     this.button3       = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
     this.SuspendLayout();
     //
     // plotView1
     //
     this.plotView1.BackColor            = System.Drawing.SystemColors.ControlLight;
     this.plotView1.Location             = new System.Drawing.Point(12, 25);
     this.plotView1.Name                 = "plotView1";
     this.plotView1.PanCursor            = System.Windows.Forms.Cursors.Hand;
     this.plotView1.Size                 = new System.Drawing.Size(575, 382);
     this.plotView1.TabIndex             = 0;
     this.plotView1.Text                 = "plotView1";
     this.plotView1.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
     this.plotView1.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
     this.plotView1.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(1101, 361);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(164, 46);
     this.button1.TabIndex = 1;
     this.button1.Text     = "Рассчитать";
     this.button1.UseVisualStyleBackColor = true;
     this.button1.Click += new System.EventHandler(this.button1_Click);
     //
     // RInput
     //
     this.RInput.Location = new System.Drawing.Point(1146, 55);
     this.RInput.Name     = "RInput";
     this.RInput.Size     = new System.Drawing.Size(119, 22);
     this.RInput.TabIndex = 2;
     //
     // CInput
     //
     this.CInput.Location = new System.Drawing.Point(1146, 98);
     this.CInput.Name     = "CInput";
     this.CInput.Size     = new System.Drawing.Size(119, 22);
     this.CInput.TabIndex = 2;
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(1101, 58);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(34, 17);
     this.label1.TabIndex = 3;
     this.label1.Text     = "R = ";
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(1101, 101);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(33, 17);
     this.label2.TabIndex = 3;
     this.label2.Text     = "C = ";
     //
     // ROut
     //
     this.ROut.AutoSize    = true;
     this.ROut.Location    = new System.Drawing.Point(1102, 157);
     this.ROut.Name        = "ROut";
     this.ROut.Size        = new System.Drawing.Size(42, 17);
     this.ROut.TabIndex    = 3;
     this.ROut.Text        = "R =   ";
     this.ROut.UseMnemonic = false;
     //
     // plabel
     //
     this.plabel.AutoSize    = true;
     this.plabel.Location    = new System.Drawing.Point(1143, 157);
     this.plabel.Name        = "plabel";
     this.plabel.Size        = new System.Drawing.Size(0, 17);
     this.plabel.TabIndex    = 3;
     this.plabel.UseMnemonic = false;
     //
     // dataGridView1
     //
     this.dataGridView1.AllowUserToAddRows          = false;
     this.dataGridView1.AllowUserToDeleteRows       = false;
     this.dataGridView1.BackgroundColor             = System.Drawing.Color.Gainsboro;
     this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dataGridView1.Location           = new System.Drawing.Point(610, 25);
     this.dataGridView1.Name               = "dataGridView1";
     this.dataGridView1.ReadOnly           = true;
     this.dataGridView1.RowTemplate.Height = 24;
     this.dataGridView1.Size               = new System.Drawing.Size(485, 382);
     this.dataGridView1.TabIndex           = 4;
     //
     // COut
     //
     this.COut.AutoSize    = true;
     this.COut.Location    = new System.Drawing.Point(1102, 194);
     this.COut.Name        = "COut";
     this.COut.Size        = new System.Drawing.Size(41, 17);
     this.COut.TabIndex    = 3;
     this.COut.Text        = "C =   ";
     this.COut.UseMnemonic = false;
     //
     // w0Out
     //
     this.w0Out.AutoSize    = true;
     this.w0Out.Location    = new System.Drawing.Point(1101, 232);
     this.w0Out.Name        = "w0Out";
     this.w0Out.Size        = new System.Drawing.Size(49, 17);
     this.w0Out.TabIndex    = 3;
     this.w0Out.Text        = "w0 =   ";
     this.w0Out.UseMnemonic = false;
     //
     // button2
     //
     this.button2.Location = new System.Drawing.Point(1105, 25);
     this.button2.Name     = "button2";
     this.button2.Size     = new System.Drawing.Size(160, 23);
     this.button2.TabIndex = 5;
     this.button2.Text     = "Данные с файла";
     this.button2.UseVisualStyleBackColor = true;
     this.button2.Click += new System.EventHandler(this.button2_Click);
     //
     // button3
     //
     this.button3.Location = new System.Drawing.Point(1101, 414);
     this.button3.Name     = "button3";
     this.button3.Size     = new System.Drawing.Size(164, 23);
     this.button3.TabIndex = 6;
     this.button3.Text     = "Вывод в файл";
     this.button3.UseVisualStyleBackColor = true;
     this.button3.Click += new System.EventHandler(this.button3_Click);
     //
     // Form1
     //
     this.ClientSize = new System.Drawing.Size(1311, 443);
     this.Controls.Add(this.button3);
     this.Controls.Add(this.button2);
     this.Controls.Add(this.dataGridView1);
     this.Controls.Add(this.plabel);
     this.Controls.Add(this.w0Out);
     this.Controls.Add(this.COut);
     this.Controls.Add(this.ROut);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.CInput);
     this.Controls.Add(this.RInput);
     this.Controls.Add(this.button1);
     this.Controls.Add(this.plotView1);
     this.Name = "Form1";
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #20
0
        public static Task ShowPlots(string wndTitlle, params PlotModel[] models)
        {
            Task task = Task.Run(() =>
            {
                //
                var frm = new Form();
                //
                // tableLayoutPanel1
                //
                var tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
                tableLayoutPanel1.SuspendLayout();
                frm.SuspendLayout();

                tableLayoutPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
                tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
                tableLayoutPanel1.Name     = "tableLayoutPanel1";


                //column/row
                tableLayoutPanel1.ColumnCount = 1;
                tableLayoutPanel1.ColumnStyles.Add(
                    new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));

                tableLayoutPanel1.RowCount = models.Length;
                for (int i = 0; i < models.Length; i++)
                {
                    tableLayoutPanel1.RowStyles.Add(
                        new System.Windows.Forms.RowStyle(SizeType.Percent, (float)(1.0 / (float)models.Length)));
                }


                for (int i = 0; i < models.Length; i++)
                {
                    tableLayoutPanel1.Controls.Add(getplotView(models[i]), 0, i);
                }

                tableLayoutPanel1.Size     = new System.Drawing.Size(0, 0);
                tableLayoutPanel1.TabIndex = 0;


                frm.Size          = new System.Drawing.Size(950, 600);
                frm.WindowState   = FormWindowState.Normal;
                frm.StartPosition = FormStartPosition.CenterScreen;
                frm.Text          = wndTitlle;
                tableLayoutPanel1.ResumeLayout(false);
                frm.Controls.Add(tableLayoutPanel1);
                frm.ResumeLayout(false);
                frm.ShowDialog();
            });

            return(task);

            OxyPlot.WindowsForms.PlotView getplotView(PlotModel model)
            {
                var plot1 = new OxyPlot.WindowsForms.PlotView();

                //
                // plot1
                //
                plot1.Dock      = System.Windows.Forms.DockStyle.Fill;
                plot1.Location  = new System.Drawing.Point(0, 0);
                plot1.Name      = "plot1";
                plot1.PanCursor = System.Windows.Forms.Cursors.Hand;
                //plot1.Size = new System.Drawing.Size(1219, 688);
                plot1.TabIndex             = 1;
                plot1.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
                plot1.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
                plot1.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;
                plot1.Model = model;
                //plot1.Show();
                return(plot1);
            }
        }
Example #21
0
 public void setGyroscopePlot(OxyPlot.WindowsForms.PlotView gyroscopePlot)
 {
     this.gyroscopePlot = gyroscopePlot;
 }
Example #22
0
        Control Hours(TimeInterval m)
        {
            var model = new OxyPlot.PlotModel()
            {
                Title           = "Hours",
                Background      = OxyColors.White,
                DefaultFont     = "Arial",
                DefaultFontSize = 10.0
            };

            model.Axes.Add(new DateTimeAxis
            {
                Position           = AxisPosition.Left,
                MajorGridlineStyle = LineStyle.Solid,
                // MinorGridlineStyle = LineStyle.Dot,
                MajorStep    = 1,
                Minimum      = DateTimeAxis.ToDouble(m.Begin.AddDays(-1)),
                Maximum      = DateTimeAxis.ToDouble(m.End),
                StringFormat = "ddd dd.MM.",
            });

            model.Axes.Add(new TimeSpanAxis
            {
                Position           = AxisPosition.Bottom,
                MajorGridlineStyle = LineStyle.Solid,
                MinorGridlineStyle = LineStyle.Dot,
                StringFormat       = "h:mm",
            });

            var w = input.Range(m)
                    .GroupBy(x => x.TimeInterval.Begin.Date)
                    .Select(g => new
            {
                Day     = g.Key,
                Active  = g.Where(_ => _.IsActive).Sum(_ => _.TimeInterval.Duration.TotalSeconds),
                Working = Worktime(g).TotalSeconds,
                On      = g.Sum(_ => _.TimeInterval.Duration.TotalSeconds)
            })
                    .ToList();

            var activity = new OxyPlot.Series.RectangleBarSeries()
            {
                TrackerFormatString = "{2} - {3}",
                StrokeThickness     = 0
            };

            foreach (var i in w)
            {
                var refDay = i.Day;
                var y      = DateTimeAxis.ToDouble(refDay);
                activity.Items.Add(new RectangleBarItem(0, y - daySep, i.On, y + daySep)
                {
                    Color = ToOxyColor(idleColor)
                });
                activity.Items.Add(new RectangleBarItem(0, y - daySep, i.Working, y + daySep)
                {
                    Color = ToOxyColor(workingColor)
                });
                activity.Items.Add(new RectangleBarItem(0, y - daySep, i.Active, y + daySep)
                {
                    Color = ToOxyColor(activeColor)
                });
            }

            model.Series.Add(activity);

            var plotView = new OxyPlot.WindowsForms.PlotView
            {
                Model = model
            };

            return(plotView);
        }
Example #23
0
 public void setAudioLevelPlot(OxyPlot.WindowsForms.PlotView audioLevelPlot)
 {
     this.audioLevelPlot = audioLevelPlot;
 }
Example #24
0
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.plot1 = new OxyPlot.WindowsForms.PlotView();
            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.bottomPanel = new System.Windows.Forms.Panel();
            this.closeButton = new System.Windows.Forms.Button();
            this.captionLabel = new System.Windows.Forms.Label();
            this.panel1 = new System.Windows.Forms.Panel();
            this.splitter = new System.Windows.Forms.Splitter();
            this.bottomPanel.SuspendLayout();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // plot1
            // 
            this.plot1.ContextMenuStrip = this.contextMenuStrip1;
            this.plot1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.plot1.Location = new System.Drawing.Point(0, 0);
            this.plot1.Margin = new System.Windows.Forms.Padding(4);
            this.plot1.Name = "plot1";
            this.plot1.PanCursor = System.Windows.Forms.Cursors.Hand;
            this.plot1.Size = new System.Drawing.Size(757, 361);
            this.plot1.TabIndex = 1;
            this.plot1.Text = "plot1";
            this.plot1.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
            this.plot1.ZoomRectangleCursor = System.Windows.Forms.Cursors.SizeNWSE;
            this.plot1.ZoomVerticalCursor = System.Windows.Forms.Cursors.SizeNS;
            this.plot1.Click += new System.EventHandler(this.OnClick);
            this.plot1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.OnMouseDoubleClick);
            // 
            // contextMenuStrip1
            // 
            this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
            this.contextMenuStrip1.Name = "contextMenuStrip1";
            this.contextMenuStrip1.Size = new System.Drawing.Size(67, 4);
            // 
            // bottomPanel
            // 
            this.bottomPanel.Controls.Add(this.closeButton);
            this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.bottomPanel.Location = new System.Drawing.Point(0, 378);
            this.bottomPanel.Margin = new System.Windows.Forms.Padding(4);
            this.bottomPanel.Name = "bottomPanel";
            this.bottomPanel.Size = new System.Drawing.Size(757, 239);
            this.bottomPanel.TabIndex = 3;
            // 
            // closeButton
            // 
            this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.closeButton.Image = global::UserInterface.Properties.Resources.Close;
            this.closeButton.Location = new System.Drawing.Point(728, 1);
            this.closeButton.Margin = new System.Windows.Forms.Padding(4);
            this.closeButton.Name = "closeButton";
            this.closeButton.Size = new System.Drawing.Size(29, 28);
            this.closeButton.TabIndex = 0;
            this.closeButton.UseVisualStyleBackColor = true;
            this.closeButton.Click += new System.EventHandler(this.OnCloseEditorPanel);
            // 
            // captionLabel
            // 
            this.captionLabel.AutoSize = true;
            this.captionLabel.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.captionLabel.Location = new System.Drawing.Point(0, 361);
            this.captionLabel.MaximumSize = new System.Drawing.Size(500, 50);
            this.captionLabel.Name = "captionLabel";
            this.captionLabel.Size = new System.Drawing.Size(0, 17);
            this.captionLabel.TabIndex = 4;
            this.captionLabel.DoubleClick += new System.EventHandler(this.OnCaptionLabelDoubleClick);
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.plot1);
            this.panel1.Controls.Add(this.captionLabel);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(757, 378);
            this.panel1.TabIndex = 5;
            // 
            // splitter
            // 
            this.splitter.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.splitter.Location = new System.Drawing.Point(0, 375);
            this.splitter.Name = "splitter";
            this.splitter.Size = new System.Drawing.Size(757, 3);
            this.splitter.TabIndex = 6;
            this.splitter.TabStop = false;
            // 
            // GraphView
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.splitter);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.bottomPanel);
            this.Name = "GraphView";
            this.Size = new System.Drawing.Size(757, 617);
            this.bottomPanel.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.ResumeLayout(false);

        }
Example #25
0
        private void vLoadPlotView()
        {
            tableLayoutPanelLogging.Controls.Remove(mclsPlotLogging);

            if (maau32LogData.GetLength(1) != mastActiveMeasureIndices.Length)
            {
                ResizeArray(ref maau32LogData, 65536, mastActiveMeasureIndices.Length);
            }

            if (maafMinMaxLogData.GetLength(0) != mastActiveMeasureIndices.Length)
            {
                ResizeArray(ref maafMinMaxLogData, mastActiveMeasureIndices.Length, 2);
            }

            seriesdata = new LineSeries[mastActiveMeasureIndices.Length];
            mastYAxes  = new LinearAxis[mastActiveMeasureIndices.Length];

            mclsPlotLogging                      = new OxyPlot.WindowsForms.PlotView();
            mclsPlotLogging.Dock                 = System.Windows.Forms.DockStyle.Fill;
            mclsPlotLogging.Location             = new System.Drawing.Point(0, 0);
            mclsPlotLogging.Margin               = new System.Windows.Forms.Padding(0);
            mclsPlotLogging.Name                 = "plot1";
            mclsPlotLogging.PanCursor            = System.Windows.Forms.Cursors.Hand;
            mclsPlotLogging.Size                 = new System.Drawing.Size(632, 446);
            mclsPlotLogging.TabIndex             = 0;
            mclsPlotLogging.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
            mclsPlotLogging.ZoomRectangleCursor  = System.Windows.Forms.Cursors.SizeNWSE;
            mclsPlotLogging.ZoomVerticalCursor   = System.Windows.Forms.Cursors.SizeNS;

            miZoomForwardIDX = 6;
            miZoomBackIDX    = 6;
            miZoomForward    = maiZoom[miZoomForwardIDX];
            miZoomBack       = maiZoom[miZoomBackIDX];

            for (int iSeriesIDX = 0; iSeriesIDX < mastActiveMeasureIndices.Length; iSeriesIDX++)
            {
                seriesdata[iSeriesIDX] = new LineSeries();
                seriesdata[iSeriesIDX].Points.Add(new DataPoint(0, 0));
                seriesdata[iSeriesIDX].Color = maenLogColours[iSeriesIDX];

                Single fMax;
                Single fMin;
                string szVarName;
                string szUnits;

                fMax      = tclsASAM.mailstActiveMeasLists[miFormIDX][mastActiveMeasureIndices[iSeriesIDX].iMeasureQueueIDX].sUpperLim;
                fMin      = tclsASAM.mailstActiveMeasLists[miFormIDX][mastActiveMeasureIndices[iSeriesIDX].iMeasureQueueIDX].sLowerLim;
                szVarName = tclsASAM.mailstActiveMeasLists[miFormIDX][mastActiveMeasureIndices[iSeriesIDX].iMeasureQueueIDX].szMeasurementName;
                szUnits   = tclsASAM.milstCompuMethodList[maiMeasCompuMethodIndices[iSeriesIDX]].szUnitsString;

                mastYAxes[iSeriesIDX]           = pstCreateNewYAxis(iSeriesIDX, fMax, 0, szVarName, szUnits, maenLogColours[iSeriesIDX]);
                seriesdata[iSeriesIDX].YAxisKey = "YAxis" + iSeriesIDX.ToString();

                maafMinMaxLogData[iSeriesIDX, 0] = tclsASAM.mailstActiveMeasLists[miFormIDX][mastActiveMeasureIndices[iSeriesIDX].iMeasureQueueIDX].sUpperLim;
            }

            mclsPlotModel = new PlotModel
            {
                PlotType   = PlotType.Cartesian,
                Background = OxyColors.Black,
                TextColor  = OxyColors.Aqua
            };

            mstXAxis = new OxyPlot.Axes.LinearAxis()
            {
                Position           = OxyPlot.Axes.AxisPosition.Bottom,
                AbsoluteMaximum    = 3600000,
                AbsoluteMinimum    = 0,
                MinorStep          = 5,
                Unit               = "s",
                TicklineColor      = OxyColors.Aqua,
                TitleColor         = OxyColors.Aqua,
                AxislineColor      = OxyColors.Aqua,
                ExtraGridlineColor = OxyColors.Aqua,
                MajorGridlineColor = OxyColors.Aqua,
                TitleFontWeight    = FontWeights.Bold
            };

            mstXAxis.Zoom(0f, 30f);
            mclsPlotModel.Axes.Add(mstXAxis);

            for (int iSeriesIDX = 0; iSeriesIDX < mastActiveMeasureIndices.Length; iSeriesIDX++)
            {
                if (iSeriesIDX != miTimeStampIDX)
                {
                    mclsPlotModel.Series.Add(seriesdata[iSeriesIDX]);
                    mclsPlotModel.Axes.Add(mastYAxes[iSeriesIDX]);
                }
            }

            mclsPlotLogging.Model = mclsPlotModel;
            miLoggingIDX          = 1;

            tableLayoutPanelLogging.Controls.Add(mclsPlotLogging, 0, 1);
            tableLayoutPanelLogging.SetColumnSpan(mclsPlotLogging, 9);
            tableLayoutPanelLogging.SetRowSpan(mclsPlotLogging, 1);

            LoadComboBoxLoggingVars();
        }