コード例 #1
0
        public bool f_增加曲线(string 曲线编号)
        {
            NationalInstruments.UI.ScatterPlot plot      = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plottag   = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_汽蚀余量 = new NationalInstruments.UI.ScatterPlot();
            if (曲线存储.ContainsKey(曲线编号))
            {
                return(false);
            }

            NationalInstruments.UI.LegendItem item = new NationalInstruments.UI.LegendItem();


            plot.YAxis      = yaxis_汽蚀试验;
            plot.PointStyle = NationalInstruments.UI.PointStyle.EmptyCircle;
            plot.PointColor = Color.DarkOrange;
            plot.PointSize  = new System.Drawing.Size(9, 9);
            plot.Tag        = 曲线编号;
            this.Graph_View.Plots.Add(plot);

            plottag.YAxis      = yaxis_汽蚀试验;
            plottag.PointStyle = NationalInstruments.UI.PointStyle.None;
            plottag.LineColor  = plot.LineColor;
            plottag.PointColor = plot.PointColor;
            plottag.Tag        = 曲线编号 + "_tag";

            plot_汽蚀余量.YAxis      = yaxis_汽蚀试验;
            plot_汽蚀余量.PointStyle = NationalInstruments.UI.PointStyle.Plus;
            plot_汽蚀余量.PointColor = Color.Red;
            plot_汽蚀余量.PointSize  = new System.Drawing.Size(12, 12);
            plot_汽蚀余量.Tag        = 曲线编号 + "_临界点";


            //item.Text = 曲线编号;
            item.Tag    = 曲线编号;
            item.Source = plottag;
            this.legend1.Items.Add(item);

            this.Graph_View.Plots.Add(plot_汽蚀余量);

            曲线存储.Add(曲线编号, plot);
            汽蚀余量存储.Add(曲线编号 + "_临界点", plot_汽蚀余量);
            汽蚀余量影子曲线存储.Add(曲线编号 + "_Tag", plot_汽蚀余量);
            return(true);
        }
コード例 #2
0
ファイル: XYGraph_FuncPublic.cs プロジェクト: jyorin/yinghe
        public void f_设置性能试验模式()
        {
            NationalInstruments.UI.YAxis yaxis_H = new NationalInstruments.UI.YAxis();
            yaxis_H.Position = NationalInstruments.UI.YAxisPosition.Left;
            yaxis_H.MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F1");
            yaxis_H.MajorDivisions.LabelForeColor = Color.Black;
            yaxis_H.BaseLineVisible = true;
            yaxis_H.Tag = "扬程";
            Graph_View.YAxes.Add(yaxis_H);

            // 取消机组效率Y轴
            NationalInstruments.UI.YAxis yaxis_N = new NationalInstruments.UI.YAxis();
            yaxis_N.Position = NationalInstruments.UI.YAxisPosition.Right;
            yaxis_N.MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F0");
            yaxis_N.MajorDivisions.LabelForeColor = Color.Black;
            yaxis_N.BaseLineVisible = true;
            yaxis_N.Tag = "效率";
            Graph_View.YAxes.Add(yaxis_N);

            NationalInstruments.UI.YAxis yaxis_P = new NationalInstruments.UI.YAxis();
            yaxis_P.Position = NationalInstruments.UI.YAxisPosition.Right;
            yaxis_P.MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F0");
            yaxis_P.MajorDivisions.LabelForeColor = Color.Black;
            yaxis_P.BaseLineVisible = true;
            yaxis_P.Tag = "功率";
            Graph_View.YAxes.Add(yaxis_P);

            //add begin
            NationalInstruments.UI.YAxis yaxis_NPSH = new NationalInstruments.UI.YAxis();
            yaxis_NPSH.Position = NationalInstruments.UI.YAxisPosition.Right;
            yaxis_NPSH.MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F0");
            yaxis_NPSH.MajorDivisions.LabelForeColor = Color.Black;
            yaxis_NPSH.BaseLineVisible = true;
            yaxis_NPSH.Tag = "NPSH";
            Graph_View.YAxes.Add(yaxis_NPSH);
            //add end

            xAxis_Looking.MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F0");
            xAxis_Looking.Caption = "流量[m3/h]";

            NationalInstruments.UI.ScatterPlot plot_HQ_保证点 = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_HQ_Shandow = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_HQ = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.LegendItem item_HQ = new NationalInstruments.UI.LegendItem();

            item_HQ.Text = "H-Q";
            item_HQ.Source = plot_HQ;
            this.legend1.Items.Add(item_HQ);

            plot_HQ.LineColor = Color.Red;
            plot_HQ.YAxis = yaxis_H;
            plot_HQ.Tag = "H-Q";

            plot_HQ_Shandow.YAxis = yaxis_H;
            plot_HQ_Shandow.LineColor = Color.Transparent;
            plot_HQ_Shandow.PointStyle = NationalInstruments.UI.PointStyle.EmptyDiamond;
            plot_HQ_Shandow.PointColor = plot_HQ.LineColor;
            plot_HQ_Shandow.PointSize = new System.Drawing.Size(10, 10);
            plot_HQ_Shandow.Tag = "H-Q-S";

            plot_HQ_保证点.YAxis = yaxis_H;
            plot_HQ_保证点.LineColor = Color.Transparent;
            plot_HQ_保证点.PointStyle = NationalInstruments.UI.PointStyle.None;
            plot_HQ_保证点.PointColor = Color.Gray;
            plot_HQ_保证点.PointSize = new System.Drawing.Size(10, 10);
            plot_HQ_保证点.Tag = "H-Q-BS";
            plot_HQ_保证点.XErrorDataMode = NationalInstruments.UI.XYErrorDataMode.CreatePercentErrorMode(8D, 8D);
            plot_HQ_保证点.YErrorDataMode = NationalInstruments.UI.XYErrorDataMode.CreatePercentErrorMode(5D, 5D);
            plot_HQ_保证点.XErrorHighLineColor = Color.Gold;
            plot_HQ_保证点.XErrorLowLineColor = Color.Gold;
            plot_HQ_保证点.XErrorHighPointColor = Color.Gold;
            plot_HQ_保证点.XErrorLowPointColor = Color.Gold;
            plot_HQ_保证点.YErrorHighLineColor = Color.Gold;
            plot_HQ_保证点.YErrorLowLineColor = Color.Gold;
            plot_HQ_保证点.YErrorHighPointColor = Color.Gold;
            plot_HQ_保证点.YErrorLowPointColor = Color.Gold;

            Graph_View.Plots.Add(plot_HQ);
            Graph_View.Plots.Add(plot_HQ_Shandow);
            Graph_View.Plots.Add(plot_HQ_保证点);

            NationalInstruments.UI.ScatterPlot plot_PQ_Shandow = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_PQ = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.LegendItem item_PQ = new NationalInstruments.UI.LegendItem();

            item_PQ.Text = "P-Q";
            item_PQ.Source = plot_PQ;
            this.legend1.Items.Add(item_PQ);

            plot_PQ.LineColor = Color.Green;
            plot_PQ.YAxis = yaxis_P;
            plot_PQ.Tag = "P-Q";
            plot_PQ_Shandow.Tag = "P-Q-S";

            plot_PQ_Shandow.YAxis = yaxis_P;
            plot_PQ_Shandow.LineColor = Color.Transparent;
            plot_PQ_Shandow.PointStyle = NationalInstruments.UI.PointStyle.EmptyCircle;
            plot_PQ_Shandow.PointColor = plot_PQ.LineColor;
            plot_PQ_Shandow.PointSize = new System.Drawing.Size(10, 10);

            Graph_View.Plots.Add(plot_PQ);
            Graph_View.Plots.Add(plot_PQ_Shandow);

            NationalInstruments.UI.ScatterPlot plot_EFFpQ_Shandow = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_EFFpQ = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.LegendItem item_EFFpQ = new NationalInstruments.UI.LegendItem();

            item_EFFpQ.Text = "EFFp-Q";
            item_EFFpQ.Source = plot_EFFpQ;
            this.legend1.Items.Add(item_EFFpQ);

            plot_EFFpQ.LineColor = Color.Blue;
            plot_EFFpQ.YAxis = yaxis_N;
            plot_EFFpQ.Tag = "EFFp-Q";
            plot_EFFpQ_Shandow.Tag = "EFFp-Q-S";

            plot_EFFpQ_Shandow.YAxis = yaxis_N;
            plot_EFFpQ_Shandow.LineColor = Color.Transparent;
            plot_EFFpQ_Shandow.PointStyle = NationalInstruments.UI.PointStyle.EmptySquare;
            plot_EFFpQ_Shandow.PointColor = plot_EFFpQ.LineColor;
            plot_EFFpQ_Shandow.PointSize = new System.Drawing.Size(10, 10);

            Graph_View.Plots.Add(plot_EFFpQ);
            Graph_View.Plots.Add(plot_EFFpQ_Shandow);

            // 取消机组效率曲线
            NationalInstruments.UI.ScatterPlot plot_汽蚀曲线 = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_汽蚀曲线_Shandow = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.LegendItem item_汽蚀曲线 = new NationalInstruments.UI.LegendItem();
            plot_汽蚀曲线_Shandow.PointStyle = NationalInstruments.UI.PointStyle.Plus;
            plot_汽蚀曲线_Shandow.LineColor = Color.Transparent;
            plot_汽蚀曲线_Shandow.PointColor = Color.Red;
            plot_汽蚀曲线_Shandow.PointSize = new System.Drawing.Size(12, 12);

            item_汽蚀曲线.Text = "NPSH-Q";
            item_汽蚀曲线.Source = plot_汽蚀曲线;
            this.legend1.Items.Add(item_汽蚀曲线);

            plot_汽蚀曲线.LineColor = Color.DarkOrange;
            plot_汽蚀曲线.YAxis = yaxis_NPSH;
            plot_汽蚀曲线.Tag = "NPSH-Q";
            plot_汽蚀曲线_Shandow.YAxis = yaxis_NPSH;
            plot_汽蚀曲线_Shandow.Tag = "NPSH-Q-S";
            Graph_View.Plots.Add(plot_汽蚀曲线);
            Graph_View.Plots.Add(plot_汽蚀曲线_Shandow);
            _当前显示模式 = "潜水泵性能试验";
            panel_text.Refresh();
        }
コード例 #3
0
ファイル: XYGraph_FuncPublic.cs プロジェクト: jyorin/yinghe
        public bool f_增加曲线(string 曲线编号)
        {
            NationalInstruments.UI.ScatterPlot plot = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plottag = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_汽蚀余量 = new NationalInstruments.UI.ScatterPlot();
            if (曲线存储.ContainsKey(曲线编号))
            {
                return false;
            }

            NationalInstruments.UI.LegendItem item = new NationalInstruments.UI.LegendItem();

            plot.YAxis = yaxis_汽蚀试验;
            plot.PointStyle = NationalInstruments.UI.PointStyle.EmptyCircle;
            plot.PointColor = Color.DarkOrange;
            plot.PointSize = new System.Drawing.Size(9, 9);
            plot.Tag = 曲线编号;
            this.Graph_View.Plots.Add(plot);

            plottag.YAxis = yaxis_汽蚀试验;
            plottag.PointStyle = NationalInstruments.UI.PointStyle.None;
            plottag.LineColor = plot.LineColor;
            plottag.PointColor = plot.PointColor;
            plottag.Tag = 曲线编号+"_tag";

            plot_汽蚀余量.YAxis = yaxis_汽蚀试验;
            plot_汽蚀余量.PointStyle = NationalInstruments.UI.PointStyle.Plus;
            plot_汽蚀余量.PointColor = Color.Red;
            plot_汽蚀余量.PointSize = new System.Drawing.Size(12, 12);
            plot_汽蚀余量.Tag = 曲线编号 + "_临界点";

            //item.Text = 曲线编号;
            item.Tag = 曲线编号;
            item.Source = plottag;
            this.legend1.Items.Add(item);

            this.Graph_View.Plots.Add(plot_汽蚀余量);

            曲线存储.Add(曲线编号, plot);
            汽蚀余量存储.Add(曲线编号 + "_临界点", plot_汽蚀余量);
            汽蚀余量影子曲线存储.Add(曲线编号 + "_Tag", plot_汽蚀余量);
            return true;
        }
コード例 #4
0
        public void f_设置性能试验模式()
        {
            NationalInstruments.UI.YAxis yaxis_H = new NationalInstruments.UI.YAxis();
            yaxis_H.Position = NationalInstruments.UI.YAxisPosition.Left;
            yaxis_H.MajorDivisions.LabelFormat    = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F1");
            yaxis_H.MajorDivisions.LabelForeColor = Color.Black;
            yaxis_H.BaseLineVisible = true;
            yaxis_H.Tag             = "扬程";
            Graph_View.YAxes.Add(yaxis_H);

            // 取消机组效率Y轴
            NationalInstruments.UI.YAxis yaxis_N = new NationalInstruments.UI.YAxis();
            yaxis_N.Position = NationalInstruments.UI.YAxisPosition.Right;
            yaxis_N.MajorDivisions.LabelFormat    = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F0");
            yaxis_N.MajorDivisions.LabelForeColor = Color.Black;
            yaxis_N.BaseLineVisible = true;
            yaxis_N.Tag             = "效率";
            Graph_View.YAxes.Add(yaxis_N);

            NationalInstruments.UI.YAxis yaxis_P = new NationalInstruments.UI.YAxis();
            yaxis_P.Position = NationalInstruments.UI.YAxisPosition.Right;
            yaxis_P.MajorDivisions.LabelFormat    = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F0");
            yaxis_P.MajorDivisions.LabelForeColor = Color.Black;
            yaxis_P.BaseLineVisible = true;
            yaxis_P.Tag             = "功率";
            Graph_View.YAxes.Add(yaxis_P);

            //add begin
            NationalInstruments.UI.YAxis yaxis_NPSH = new NationalInstruments.UI.YAxis();
            yaxis_NPSH.Position = NationalInstruments.UI.YAxisPosition.Right;
            yaxis_NPSH.MajorDivisions.LabelFormat    = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F0");
            yaxis_NPSH.MajorDivisions.LabelForeColor = Color.Black;
            yaxis_NPSH.BaseLineVisible = true;
            yaxis_NPSH.Tag             = "NPSH";
            Graph_View.YAxes.Add(yaxis_NPSH);
            //add end

            xAxis_Looking.MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.Numeric, "F0");
            xAxis_Looking.Caption = "流量[m3/h]";

            NationalInstruments.UI.ScatterPlot plot_HQ_保证点     = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_HQ_Shandow = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_HQ         = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.LegendItem  item_HQ         = new NationalInstruments.UI.LegendItem();

            item_HQ.Text   = "H-Q";
            item_HQ.Source = plot_HQ;
            this.legend1.Items.Add(item_HQ);

            plot_HQ.LineColor = Color.Red;
            plot_HQ.YAxis     = yaxis_H;
            plot_HQ.Tag       = "H-Q";

            plot_HQ_Shandow.YAxis      = yaxis_H;
            plot_HQ_Shandow.LineColor  = Color.Transparent;
            plot_HQ_Shandow.PointStyle = NationalInstruments.UI.PointStyle.EmptyDiamond;
            plot_HQ_Shandow.PointColor = plot_HQ.LineColor;
            plot_HQ_Shandow.PointSize  = new System.Drawing.Size(10, 10);
            plot_HQ_Shandow.Tag        = "H-Q-S";

            plot_HQ_保证点.YAxis                = yaxis_H;
            plot_HQ_保证点.LineColor            = Color.Transparent;
            plot_HQ_保证点.PointStyle           = NationalInstruments.UI.PointStyle.None;
            plot_HQ_保证点.PointColor           = Color.Gray;
            plot_HQ_保证点.PointSize            = new System.Drawing.Size(10, 10);
            plot_HQ_保证点.Tag                  = "H-Q-BS";
            plot_HQ_保证点.XErrorDataMode       = NationalInstruments.UI.XYErrorDataMode.CreatePercentErrorMode(8D, 8D);
            plot_HQ_保证点.YErrorDataMode       = NationalInstruments.UI.XYErrorDataMode.CreatePercentErrorMode(5D, 5D);
            plot_HQ_保证点.XErrorHighLineColor  = Color.Gold;
            plot_HQ_保证点.XErrorLowLineColor   = Color.Gold;
            plot_HQ_保证点.XErrorHighPointColor = Color.Gold;
            plot_HQ_保证点.XErrorLowPointColor  = Color.Gold;
            plot_HQ_保证点.YErrorHighLineColor  = Color.Gold;
            plot_HQ_保证点.YErrorLowLineColor   = Color.Gold;
            plot_HQ_保证点.YErrorHighPointColor = Color.Gold;
            plot_HQ_保证点.YErrorLowPointColor  = Color.Gold;

            Graph_View.Plots.Add(plot_HQ);
            Graph_View.Plots.Add(plot_HQ_Shandow);
            Graph_View.Plots.Add(plot_HQ_保证点);

            NationalInstruments.UI.ScatterPlot plot_PQ_Shandow = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_PQ         = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.LegendItem  item_PQ         = new NationalInstruments.UI.LegendItem();

            item_PQ.Text   = "P-Q";
            item_PQ.Source = plot_PQ;
            this.legend1.Items.Add(item_PQ);

            plot_PQ.LineColor   = Color.Green;
            plot_PQ.YAxis       = yaxis_P;
            plot_PQ.Tag         = "P-Q";
            plot_PQ_Shandow.Tag = "P-Q-S";

            plot_PQ_Shandow.YAxis      = yaxis_P;
            plot_PQ_Shandow.LineColor  = Color.Transparent;
            plot_PQ_Shandow.PointStyle = NationalInstruments.UI.PointStyle.EmptyCircle;
            plot_PQ_Shandow.PointColor = plot_PQ.LineColor;
            plot_PQ_Shandow.PointSize  = new System.Drawing.Size(10, 10);

            Graph_View.Plots.Add(plot_PQ);
            Graph_View.Plots.Add(plot_PQ_Shandow);


            NationalInstruments.UI.ScatterPlot plot_EFFpQ_Shandow = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_EFFpQ         = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.LegendItem  item_EFFpQ         = new NationalInstruments.UI.LegendItem();

            item_EFFpQ.Text   = "EFFp-Q";
            item_EFFpQ.Source = plot_EFFpQ;
            this.legend1.Items.Add(item_EFFpQ);

            plot_EFFpQ.LineColor   = Color.Blue;
            plot_EFFpQ.YAxis       = yaxis_N;
            plot_EFFpQ.Tag         = "EFFp-Q";
            plot_EFFpQ_Shandow.Tag = "EFFp-Q-S";

            plot_EFFpQ_Shandow.YAxis      = yaxis_N;
            plot_EFFpQ_Shandow.LineColor  = Color.Transparent;
            plot_EFFpQ_Shandow.PointStyle = NationalInstruments.UI.PointStyle.EmptySquare;
            plot_EFFpQ_Shandow.PointColor = plot_EFFpQ.LineColor;
            plot_EFFpQ_Shandow.PointSize  = new System.Drawing.Size(10, 10);

            Graph_View.Plots.Add(plot_EFFpQ);
            Graph_View.Plots.Add(plot_EFFpQ_Shandow);

            // 取消机组效率曲线
            NationalInstruments.UI.ScatterPlot plot_汽蚀曲线         = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.ScatterPlot plot_汽蚀曲线_Shandow = new NationalInstruments.UI.ScatterPlot();
            NationalInstruments.UI.LegendItem  item_汽蚀曲线         = new NationalInstruments.UI.LegendItem();
            plot_汽蚀曲线_Shandow.PointStyle = NationalInstruments.UI.PointStyle.Plus;
            plot_汽蚀曲线_Shandow.LineColor  = Color.Transparent;
            plot_汽蚀曲线_Shandow.PointColor = Color.Red;
            plot_汽蚀曲线_Shandow.PointSize  = new System.Drawing.Size(12, 12);

            item_汽蚀曲线.Text   = "NPSH-Q";
            item_汽蚀曲线.Source = plot_汽蚀曲线;
            this.legend1.Items.Add(item_汽蚀曲线);

            plot_汽蚀曲线.LineColor     = Color.DarkOrange;
            plot_汽蚀曲线.YAxis         = yaxis_NPSH;
            plot_汽蚀曲线.Tag           = "NPSH-Q";
            plot_汽蚀曲线_Shandow.YAxis = yaxis_NPSH;
            plot_汽蚀曲线_Shandow.Tag   = "NPSH-Q-S";
            Graph_View.Plots.Add(plot_汽蚀曲线);
            Graph_View.Plots.Add(plot_汽蚀曲线_Shandow);
            _当前显示模式 = "潜水泵性能试验";
            panel_text.Refresh();
        }