示例#1
0
        public static void ResetAllPlots(FormsPlot formsPlot1, FormsPlot formsPlot2, FormsPlot formsPlot3, FormsPlot formsPlot4)
        {
            formsPlot1.plt.Clear();
            formsPlot2.plt.Clear();
            formsPlot3.plt.Clear();
            formsPlot4.plt.Clear();

            Plotter.ch1DataDic["FAM"] = new List <double>();
            Plotter.ch1DataDic["ROX"] = new List <double>();
            Plotter.ch1DataDic["HEX"] = new List <double>();
            Plotter.ch1DataDic["CY5"] = new List <double>();

            Plotter.ch2DataDic["FAM"] = new List <double>();
            Plotter.ch2DataDic["ROX"] = new List <double>();
            Plotter.ch2DataDic["HEX"] = new List <double>();
            Plotter.ch2DataDic["CY5"] = new List <double>();

            Plotter.ch3DataDic["FAM"] = new List <double>();
            Plotter.ch3DataDic["ROX"] = new List <double>();
            Plotter.ch3DataDic["HEX"] = new List <double>();
            Plotter.ch3DataDic["CY5"] = new List <double>();

            Plotter.ch4DataDic["FAM"] = new List <double>();
            Plotter.ch4DataDic["ROX"] = new List <double>();
            Plotter.ch4DataDic["HEX"] = new List <double>();
            Plotter.ch4DataDic["CY5"] = new List <double>();
        }
        public MainForm()
        {
            InitializeComponent();

            Chart          = new FormsPlot();
            Chart.Size     = this.pictureBox1.Size;
            Chart.Location = this.pictureBox1.Location;
            Chart.Plot.SetAxisLimits(0, 127, 0, 127);
            Chart.Plot.SetViewLimits(0, 127, 0, 127);
            Chart.Configuration.DoubleClickBenchmark = false;
            Chart.Configuration.LeftClickDragPan     = false;
            Chart.Configuration.RightClickDragZoom   = false;
            Chart.Configuration.ScrollWheelZoom      = false;

            Chart.MouseMove  += Chart_MouseMove;
            Chart.MouseLeave += Chart_MouseLeave;

            this.Controls.Add(Chart);
            this.Controls.Remove(this.pictureBox1);

            SetupMidiVelopcityMapper();
            UpdateChart();
            BindEvents();
            BindDebugEvents();
        }
示例#3
0
        public void InitPlot()
        {
            columns_length = columns.Length;
            double[] xs = DataGen.Consecutive(columns_length);
            double[] ys = DataGen.Consecutive(columns_length, 0);

            try
            {
                maze_plot          = GetPlot(xs, ys, columns, "Maze");
                maze_plot.Width    = (pnlPlot.Width / 2) - X_MARGIN - X_POSITION;
                maze_plot.Height   = pnlPlot.Height - Y_MARGIN - Y_POSITION;
                maze_plot.Location = new Point(X_POSITION, Y_POSITION);


                total_plot          = GetPlot(xs, ys, columns, "Total %");
                total_plot.Width    = (pnlPlot.Width / 2) - X_MARGIN - X_POSITION;
                total_plot.Height   = pnlPlot.Height - Y_MARGIN - Y_POSITION;
                total_plot.Location = new Point(X_POSITION + maze_plot.Width, Y_POSITION);

                pnlPlot.Controls.Add(maze_plot);
                pnlPlot.Controls.Add(total_plot);

                maze_plot.Render();
                total_plot.Render();
            }
            catch (Exception e)
            {
                Console.WriteLine("Error initializing plot: {0}", e.Message);
                maze_plot = null;
            }
        }
示例#4
0
        public static void ViewInit(FormsPlot formsPlot)
        {
            formsPlot.Reset();

            //formsPlot.plt.Axis(0, COL_CNT - 1, 0, 3000);
            //formsPlot.plt.TightenLayout(padding: 40);
            //formsPlot.Render();
        }
示例#5
0
        public void showPlotYouWantToDisplay(FormsPlot plotYouWant)
        {
            formsPlot1.Visible = false;
            formsPlot2.Visible = false;
            formsPlot3.Visible = false;
            formsPlot4.Visible = false;

            plotYouWant.Visible = true;
        }
示例#6
0
 public PlotBuilder(FormsPlot argPlot)
 {
     plot  = argPlot;
     plots = new List <double[]>();
     plot.plt.Clear();
     plot.plt.YLabel("Power (db)");
     plot.plt.XLabel("Frequency (kHz)");
     plot.plt.PlotHLine(0, color: Color.Black, lineWidth: 1);
     plot.plt.AxisAuto();
     plot.plt.TightenLayout();
 }
示例#7
0
        private void InitializeHistogramArea()
        {
            var formsPlot = new FormsPlot();

            formsPlot.Width  = panelHistogram.Width;
            formsPlot.Height = panelHistogram.Height;

            panelHistogram.Controls.Add(formsPlot);

            plot = formsPlot.Plot;
            plot.YAxis.Label("Frequency");
            plot.XAxis.Label("Value");
            plot.SetAxisLimits(yMin: 0);
        }
示例#8
0
 private int GetControlAxis(FormsPlot control, Point location)
 {
     if (location.X < 60) // At XAxis
     {
         return(0);
     }
     else if (location.Y > control.Height - 60) // At YAxis
     {
         return(1);
     }
     else
     {
         return(-1);
     }
 }
示例#9
0
        public void UpdatePlot(double[] data, bool isTotal)
        {
            if (maze_plot == null || total_plot == null || (data != null && data.Length != columns_length))
            {
                Console.WriteLine("Plot Error!");
                return;
            }

            double[] xs = DataGen.Consecutive(columns_length);

            FormsPlot plot = (isTotal) ? total_plot : maze_plot;

            plot.plt.Clear();
            plot.plt.PlotBar(xs, data, fillColor: background);
            plot.Render();
        }
示例#10
0
        private FormsPlot GetPlot(double[] xs, double[] ys, string[] columns, string title)
        {
            FormsPlot plot = new FormsPlot();

            plot.plt.Style(Style.Blue1);
            plot.plt.PlotBar(xs, ys);
            plot.plt.Axis(y1: 0);
            plot.plt.Grid(enableVertical: false, lineStyle: LineStyle.Dot);
            plot.plt.XTicks(xs, columns);
            plot.plt.Ticks(fontName: "arial narrow", fontSize: 10);
            plot.plt.XLabel(title);
            plot.plt.AxisAuto(horizontalMargin: .1, verticalMargin: 0);
            plot.AutoSize = false;
            plot.plt.Style(dataBg: foreground, tick: Color.White);

            return(plot);
        }
示例#11
0
        public MainUI()
        {
            this.Size     = new Size(1600, 500);
            box           = new PictureBox();
            box.Size      = new Size(1600, 50);
            box.Location  = new Point(0, 10);
            box.BackColor = Color.White;
            canvas        = box.CreateGraphics();

            plt          = new FormsPlot();
            plt.Location = new Point(0, 100);
            plt.Size     = new Size(800, 200);

            this.Controls.AddRange(new Control[] { box, plt });

            Gradient.GeneratePalettes();

            ledManager = new LedManager(170, true);
            ledManager.UpdateDisplay += UpdateUI;
        }
示例#12
0
        private void FormsPlot_MouseWheel(object sender, MouseEventArgs e)
        {
            FormsPlot control = (FormsPlot)sender;

            switch (GetControlAxis(control, e.Location))
            {
            case 0:
                control.Plot.XAxis.LockLimits(true);
                control.Plot.YAxis.LockLimits(false);
                break;

            case 1:
                control.Plot.XAxis.LockLimits(false);
                control.Plot.YAxis.LockLimits(true);
                break;

            default:
                control.Plot.XAxis.LockLimits(false);
                control.Plot.YAxis.LockLimits(false);
                break;
            }
        }
示例#13
0
        private void OnAxesChanged(object sender, EventArgs e)
        {
            if (cbLinked.Checked == false)
            {
                return;
            }

            FormsPlot changedPlot   = (FormsPlot)sender;
            var       newAxisLimits = changedPlot.Plot.GetAxisLimits();

            foreach (var fp in FormsPlots)
            {
                if (fp == changedPlot)
                {
                    continue;
                }

                // disable events briefly to avoid an infinite loop
                fp.Configuration.AxesChangedEventEnabled = false;
                fp.Plot.SetAxisLimits(newAxisLimits);
                fp.Refresh();
                fp.Configuration.AxesChangedEventEnabled = true;
            }
        }
示例#14
0
 /// <summary>
 /// Creates instance of AMScatter attached to FormsPlot from ScottPlot
 /// </summary>
 /// <param name="dst"></param>
 public AMPlotter(FormsPlot dst)
 {
     destination = dst;
     SetPointCount(500);
 }
示例#15
0
        public static void CheckBoxChecked(string getCBoxName, bool isChecked, FormsPlot formsplot1, FormsPlot formsplot2, FormsPlot formsplot3, FormsPlot formsplot4)
        {
            switch (getCBoxName)
            {
            case "cBoxCh1FAM":
                var index = 0;
                VisibleCtrl(chFAMArray[index], chFAMHLArray[index], isChecked, formsplot1);
                chFAMIsCheck[index]   = isChecked;
                chFAMHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh1ROX":
                index = 0;
                VisibleCtrl(chROXArray[index], chROXHLArray[index], isChecked, formsplot1);
                chROXIsCheck[index]   = isChecked;
                chROXHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh1HEX":
                index = 0;
                VisibleCtrl(chHEXArray[index], chHEXHLArray[index], isChecked, formsplot1);
                chHEXIsCheck[index]   = isChecked;
                chHEXHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh1CY5":
                index = 0;
                VisibleCtrl(chCY5Array[index], chCY5HLArray[index], isChecked, formsplot1);
                chCY5IsCheck[index]   = isChecked;
                chCY5HLIsCheck[index] = isChecked;
                break;

            case "cBoxCh2FAM":
                index = 1;
                VisibleCtrl(chFAMArray[index], chFAMHLArray[index], isChecked, formsplot2);
                chFAMIsCheck[index]   = isChecked;
                chFAMHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh2ROX":
                index = 1;
                VisibleCtrl(chROXArray[index], chROXHLArray[index], isChecked, formsplot2);
                chROXIsCheck[index]   = isChecked;
                chROXHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh2HEX":
                index = 1;
                VisibleCtrl(chHEXArray[index], chHEXHLArray[index], isChecked, formsplot2);
                chHEXIsCheck[index]   = isChecked;
                chHEXHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh2CY5":
                index = 1;
                VisibleCtrl(chCY5Array[index], chCY5HLArray[index], isChecked, formsplot2);
                chCY5IsCheck[index]   = isChecked;
                chCY5HLIsCheck[index] = isChecked;
                break;

            case "cBoxCh3FAM":
                index = 2;
                VisibleCtrl(chFAMArray[index], chFAMHLArray[index], isChecked, formsplot3);
                chFAMIsCheck[index]   = isChecked;
                chFAMHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh3ROX":
                index = 2;
                VisibleCtrl(chROXArray[index], chROXHLArray[index], isChecked, formsplot3);
                chROXIsCheck[index]   = isChecked;
                chROXHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh3HEX":
                index = 2;
                VisibleCtrl(chHEXArray[index], chHEXHLArray[index], isChecked, formsplot3);
                chHEXIsCheck[index]   = isChecked;
                chHEXHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh3CY5":
                index = 2;
                VisibleCtrl(chCY5Array[index], chCY5HLArray[index], isChecked, formsplot3);
                chCY5IsCheck[index]   = isChecked;
                chCY5HLIsCheck[index] = isChecked;
                break;

            case "cBoxCh4FAM":
                index = 3;
                VisibleCtrl(chFAMArray[index], chFAMHLArray[index], isChecked, formsplot4);
                chFAMIsCheck[index]   = isChecked;
                chFAMHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh4ROX":
                index = 3;
                VisibleCtrl(chROXArray[index], chROXHLArray[index], isChecked, formsplot4);
                chROXIsCheck[index]   = isChecked;
                chROXHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh4HEX":
                index = 3;
                VisibleCtrl(chHEXArray[index], chHEXHLArray[index], isChecked, formsplot4);
                chHEXIsCheck[index]   = isChecked;
                chHEXHLIsCheck[index] = isChecked;
                break;

            case "cBoxCh4CY5":
                index = 3;
                VisibleCtrl(chCY5Array[index], chCY5HLArray[index], isChecked, formsplot4);
                chCY5IsCheck[index]   = isChecked;
                chCY5HLIsCheck[index] = isChecked;
                break;

            default:
                break;
            }
        }
示例#16
0
文件: Form2.cs 项目: eduhza/ADS1262
        void PlotScottPlot(FormsPlot chart, List <List <double> > dados, int nSens)
        {
            chart.plt.Clear();
            Color[] colors = { Color.FromArgb(51, 205, 117), Color.Blue, Color.Magenta };
            double  maxY   = 0;
            double  minY   = 0;

            for (int i = 0; i < nSens; i++)
            {
                chart.plt.PlotSignal(dados[i].ToArray(), sampleRate: 1, markerSize: 1, color: colors[i]);
                double maxYS = dados[i].Max();
                double minYS = dados[i].Min();
                if (maxYS > maxY)
                {
                    maxY = maxYS;
                }
                if (minYS < minY)
                {
                    minY = minYS;
                }
            }

            chart.plt.Ticks(
                displayTicksX: true,
                displayTicksXminor: false,
                displayTickLabelsX: true,
                displayTicksY: true,
                displayTicksYminor: true,
                displayTickLabelsY: true,
                color: Color.Black,
                useMultiplierNotation: false,
                useOffsetNotation: false,
                useExponentialNotation: false,
                fontName: "Arial",
                fontSize: 10);
            chart.Configure(
                enablePanning: true,
                enableZooming: true,
                enableRightClickMenu: true,
                lowQualityWhileDragging: false,
                enableDoubleClickBenchmark: true,
                lockVerticalAxis: false,
                lockHorizontalAxis: false,
                equalAxes: false);

            chart.plt.YLabel("Kg", bold: true);
            chart.plt.XLabel("Segundos", bold: true);
            chart.plt.Title(enable: true);

            double Ysize = maxY - minY;
            double Ytick = Ysize / 4.0;

            double[] YtickPositions =
            {
                maxY,
                maxY - 1.0 * Ytick,
                maxY - 2.0 * Ytick,
                maxY - 3.0 * Ytick,
                maxY - 4.0 * Ytick
            };
            string[] YtickLabels =
            {
                maxY.ToString("0.00"),
                (maxY - 1.0 * Ytick).ToString("0.00"),
                (maxY - 2.0 * Ytick).ToString("0.00"),
                (maxY - 3.0 * Ytick).ToString("0.00"),
                (maxY - 4.0 * Ytick).ToString("0.00")
            };
            chart.plt.YTicks(YtickPositions, YtickLabels);

            double Xmax  = dados[0].Count;
            double Xmin  = 0;
            double Xsize = Xmax - Xmin;
            double Xtick = Xsize / 4.0;

            double[] XtickPositions =
            {
                Xmax,
                Xmax - 1.0 * Xtick,
                Xmax - 2.0 * Xtick,
                Xmax - 3.0 * Xtick,
                Xmax - 4.0 * Xtick
            };
            string[] XtickLabels =
            {
                (Xmax / 1000).ToString(),
                ((Xmax - 1.0 * Xtick) / 1000).ToString(),
                ((Xmax - 2.0 * Xtick) / 1000).ToString(),
                ((Xmax - 3.0 * Xtick) / 1000).ToString(),
                ((Xmax - 4.0 * Xtick) / 1000).ToString()
            };
            chart.plt.XTicks(XtickPositions, XtickLabels);
            chart.plt.Axis(0, Xmax, minY, maxY);

            if (nSens == 1)
            {
                chart.plt.Title("Plataforma Vertical");
            }
            else if (nSens == 2)
            {
                chart.plt.Title("Plataforma Bilatera");
            }
            else if (nSens == 3)
            {
                chart.plt.Title("Plataforma Tridimensional");
            }


            chart.plt.TightenLayout(padding: 0, render: true);
            chart.plt.Frame(drawFrame: true, left: true, right: true, top: true, bottom: true, frameColor: null);
            chart.plt.Style(figBg: Color.Transparent); //FromArgb(246, 249, 0));
            chart.BackColor = Color.Transparent;       //FromArgb(246, 249, 0));
            chart.Render();
        }
        private void ShowThrend(object sender)
        {
            FormsPlot chartControl = chartControl1;

            try
            {
                List <double> xs = new List <double>();
                List <double> ys = new List <double>();
                // Процедура поиска текущего контрола для отрисовки трендов
                if (extruderTabPage.Visible)
                {
                    chartControl = chartTrends;
                }
                if (calenderRollTabPage.Visible)
                {
                    chartControl = chartCalenderRoll;
                }
                if (takeoffRollTabPage.Visible)
                {
                    chartControl = chartTakeOffRoll;
                }
                if (temperingRollTabPage.Visible)
                {
                    chartControl = chartTemperingRoll;
                }
                if (winderTabPage.Visible)
                {
                    chartControl = chartWinder;
                }
                if (qualityTabPage.Visible) // Ситуация когда мы находимся на вкладке показателей качества является нетривиальной
                {
                    chartControl = chartControl1;
                    if (sender is TextBox)
                    {
                        //Поиск текстбокса и указание ограничений по времени
                        TextBox  edit       = sender as TextBox;
                        DateTime timeBefore = TrainData.Train.OrderBy(o => o.Date).First().Date;
                        DateTime timeAfter  = TrainData.Train.OrderByDescending(o => o.Date).First().Date;
                        chartControl.plt.Clear();
                        if (edit.Name.Contains("Shrinkage")) //если выбрана усадка
                        {
                            TimeSpan ts = new TimeSpan(ProductionTime.TakeOffTime);
                            foreach (OneRow row in TrainData.Train)
                            {
                                DataSet AuthorsDataSet = new DataSet();
                                AuthorsDataSet.ReadXml(XMLWork.PathShrinkage);
                                string shrinkageValues = XMLWork.FindShrinkageWithTimestamp(row.Date);
                                if ((row.Date >= timeBefore) && (row.Date <= timeAfter))
                                {
                                    xs.Add((row.Date - ts).ToOADate());
                                    ys.Add(Convert.ToDouble(shrinkageValues.Replace(".", ",")));
                                }
                            }
                            chartControl.plt.PlotScatter(xs.ToArray(), ys.ToArray(), lineWidth: 2, markerShape: MarkerShape.none, label: "Shrinkage value");
                        }
                        else
                        {
                            //Отрисовка
                            int parameterID = XMLWork.FindID(edit.Name.Replace("_", "."));
                            foreach (OneRow row in TrainData.Train)
                            {
                                if ((row.Date >= timeBefore) && (row.Date <= timeAfter))
                                {
                                    xs.Add(row.Date.ToOADate());
                                    ys.Add(Convert.ToDouble(row.Output[parameterID]));
                                }
                            }
                            chartControl.plt.PlotScatter(xs.ToArray(), ys.ToArray(), lineWidth: 2, markerShape: MarkerShape.none, label: XMLWork.FindNameWithID(parameterID, Properties.Settings.Default.Languages));
                        }
                    }
                    chartControl.plt.Ticks(dateTimeX: true);
                    chartControl.plt.Legend(location: legendLocation.upperRight, shadowDirection: shadowDirection.none);
                    chartControl.plt.AxisAuto();
                    double xDelta = Math.Abs(xs.Max() - xs.Min());
                    double yDelta = Math.Abs(ys.Max() - ys.Min());
                    chartControl.plt.Axis(xs.Min() - xDelta * 0.05, xs.Max() + xDelta * 0.05, ys.Min() - yDelta * 0.05, ys.Max() + yDelta * 0.05); chartControl.Render();
                    return;
                }
                if (sender is TextBox)
                {
                    //Поиск текстбокса и указание ограничений по времени
                    TextBox  edit       = sender as TextBox;
                    DateTime timeBefore = TrainData.Train.OrderBy(o => o.Date).First().Date;
                    DateTime timeAfter  = TrainData.Train.OrderByDescending(o => o.Date).First().Date;
                    chartControl.plt.Clear();
                    //Отрисовка
                    int parameterID = XMLWork.FindID(edit.Name);
                    foreach (OneRow row in TrainData.Train)
                    {
                        if ((row.Date >= timeBefore) && (row.Date <= timeAfter) && (!qualityTabPage.Visible))
                        {
                            xs.Add(row.Date.ToOADate());
                            ys.Add(Convert.ToDouble(row.Input[parameterID]));
                        }
                    }
                    chartControl.plt.PlotScatter(xs.ToArray(), ys.ToArray(), lineWidth: 2, markerShape: MarkerShape.none, label: XMLWork.FindNameWithID(parameterID, Properties.Settings.Default.Languages));
                    chartControl.plt.Ticks(dateTimeX: true);
                    chartControl.plt.Legend(location: legendLocation.upperRight, shadowDirection: shadowDirection.none);
                    chartControl.plt.AxisAuto();
                    double xDelta = Math.Abs(xs.Max() - xs.Min());
                    double yDelta = Math.Abs(ys.Max() - ys.Min());
                    chartControl.plt.Axis(xs.Min() - xDelta * 0.05, xs.Max() + xDelta * 0.05, ys.Min() - yDelta * 0.05, ys.Max() + yDelta * 0.05);
                    chartControl.Render();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(Localization.MyStrings.SomethingWrong + exception.ToString());
            }
        }
示例#18
0
        public static void UpdatePlot(FormsPlot formsPlot, string title, int chamberNum
                                      , Dictionary <string, List <double> > chDataDic
                                      , CheckBox cBoxFAM, CheckBox cBoxROX, CheckBox cBoxHEX, CheckBox cBoxCYS, double Ct_FAM, double Ct_ROX, double Ct_HEX, double Ct_CY5)
        {
            labelTicks = new List <string>();
            formsPlot.plt.Clear();

            //formsPlot.Configure(enablePanning: false, enableZooming: false);
            //vLine = formsPlot1.plt.PlotVLine(0, color: Color.Red, lineStyle: LineStyle.Dash);
            //hLine = formsPlot1.plt.PlotHLine(0, color: Color.Red, lineStyle: LineStyle.Dash);

            var dataXList = new List <double>();

            //for (int i = 0; i < 30; i++)
            for (int i = 0; i < chDataDic["FAM"].Count; i++)
            {
                dataXList.Add(i);
            }

            if (chDataDic["FAM"].Count > 0)
            {
                chFAMArray[chamberNum]         = formsPlot.plt.PlotScatter(dataXList.ToArray(), chDataDic["FAM"].ToArray(), label: "FAM", lineWidth: 0); //ROX, HEX, CYS
                chFAMArray[chamberNum].visible = chFAMIsCheck[chamberNum];
            }
            if (chDataDic["ROX"].Count > 0)
            {
                chROXArray[chamberNum]         = formsPlot.plt.PlotScatter(dataXList.ToArray(), chDataDic["ROX"].ToArray(), label: "ROX", lineWidth: 0); //ROX, HEX, CYS
                chROXArray[chamberNum].visible = chROXIsCheck[chamberNum];
            }
            if (chDataDic["HEX"].Count > 0)
            {
                chHEXArray[chamberNum]         = formsPlot.plt.PlotScatter(dataXList.ToArray(), chDataDic["HEX"].ToArray(), label: "HEX", lineWidth: 0); //ROX, HEX, CYS
                chHEXArray[chamberNum].visible = chHEXIsCheck[chamberNum];
            }
            if (chDataDic["CY5"].Count > 0)
            {
                chCY5Array[chamberNum]         = formsPlot.plt.PlotScatter(dataXList.ToArray(), chDataDic["CY5"].ToArray(), label: "CY5", lineWidth: 0); //ROX, HEX, CYS
                chCY5Array[chamberNum].visible = chCY5IsCheck[chamberNum];
            }

            if (chDataDic["FAM"].Count > 3)
            {
                var nsi = new ScottPlot.Statistics.Interpolation
                          .NaturalSpline(dataXList.ToArray(), chDataDic["FAM"].ToArray(), resolution: 20);
                chFAMHLArray[chamberNum] = formsPlot.plt.PlotScatterHighlight(nsi.interpolatedXs, nsi.interpolatedYs
                                                                              , Color.Blue, markerSize: 0);

                chFAMHLArray[chamberNum].visible = chFAMHLIsCheck[chamberNum];
            }

            if (chDataDic["ROX"].Count > 3)
            {
                var nsi = new ScottPlot.Statistics.Interpolation
                          .NaturalSpline(dataXList.ToArray(), chDataDic["ROX"].ToArray(), resolution: 20);
                chROXHLArray[chamberNum] = formsPlot.plt.PlotScatterHighlight(nsi.interpolatedXs, nsi.interpolatedYs
                                                                              , Color.Orange, markerSize: 0);
                chROXHLArray[chamberNum].visible = chROXHLIsCheck[chamberNum];
            }
            if (chDataDic["HEX"].Count > 3)
            {
                var nsi = new ScottPlot.Statistics.Interpolation
                          .NaturalSpline(dataXList.ToArray(), chDataDic["HEX"].ToArray(), resolution: 20);
                chHEXHLArray[chamberNum] = formsPlot.plt.PlotScatterHighlight(nsi.interpolatedXs, nsi.interpolatedYs
                                                                              , Color.Green, markerSize: 0);
                chHEXHLArray[chamberNum].visible = chHEXHLIsCheck[chamberNum];
            }

            if (chDataDic["CY5"].Count > 3)
            {
                var nsi = new ScottPlot.Statistics.Interpolation
                          .NaturalSpline(dataXList.ToArray(), chDataDic["CY5"].ToArray(), resolution: 20);
                chCY5HLArray[chamberNum] = formsPlot.plt.PlotScatterHighlight(nsi.interpolatedXs, nsi.interpolatedYs
                                                                              , Color.Red, markerSize: 0);
                chCY5HLArray[chamberNum].visible = chCY5HLIsCheck[chamberNum];
            }
            //formsPlot.plt.AxisAutoX(expandOnly: true);
            for (int i = 0; i < dataXList.Count; i++)
            {
                if (i < COL_CNT)
                {
                    labelTicksArray[i] = Optic_Measure_Idx[i].ToString();
                }
                labelTicks.Add(labelTicksArray[i]);
            }

            //for (int i = 0; i < dataXList.Count; i++)

            formsPlot.plt.XTicks(dataXList.ToArray(), labelTicks.ToArray());
            formsPlot.plt.Title(title);
            formsPlot.plt.Legend(location: legendLocation.upperLeft);
            formsPlot.plt.Axis(0, COL_CNT - 1, 0, 3000);
            formsPlot.plt.Layout(xLabelHeight: 40);
            formsPlot.Configure(recalculateLayoutOnMouseUp: false);

            formsPlot.plt.PlotHLine(y: Ct_FAM, label: "FAM baseline");
            formsPlot.plt.PlotHLine(y: Ct_ROX, label: "ROX baseline");
            formsPlot.plt.PlotHLine(y: Ct_HEX, label: "HEX baseline");
            formsPlot.plt.PlotHLine(y: Ct_CY5, label: "CY5 baseline");
            //formsPlot.plt.TightenLayout(padding: 40);
            formsPlot.Render();
        }
示例#19
0
 public static void DrawHLine(FormsPlot formsPlot, int value)
 {
     formsPlot.plt.PlotHLine(y: value, draggable: true, dragLimitLower: 0, dragLimitUpper: 3000);
     formsPlot.Render();
 }
示例#20
0
 public static void VisibleCtrl(PlottableScatter scatterPlot,
                                PlottableScatterHighlight fittingHL, bool isChecked, FormsPlot plot)
 {
     if (scatterPlot != null && fittingHL != null)
     {
         scatterPlot.visible = isChecked;
         fittingHL.visible   = isChecked;
         plot.Render();
     }
 }