示例#1
0
        private void plot_data_3D(string property)
        {
            LC.BeginUpdate();

            LC.ActiveView = ActiveView.View3D;
            var pls3D = LC.View3D.PointLineSeries3D[0];

            List <double> prop_points;

            if (property == "Ux")
            {
                prop_points = mainForm.UX;
            }
            else if (property == "Uy")
            {
                prop_points = mainForm.UY;
            }
            else if (property == "Uz")
            {
                prop_points = mainForm.UZ;
            }
            else if (property == "P")
            {
                prop_points = mainForm.P;
            }
            else
            {
                prop_points = mainForm.T;
            }

            //SeriesPoint3D[] sp3D = new SeriesPoint3D[prop_points.Count];
            //for (int i = 0; i < prop_points.Count; i++)
            //    sp3D[i] = new SeriesPoint3D { X = mainForm.X[i], Y = mainForm.Y[i], Z = mainForm.Z[i] };
            //pls3D.AddPoints(sp3D, false);
            SeriesPoint3D[] sp3D = new SeriesPoint3D[prop_points.Count / 1000];
            for (int i = 0; i < prop_points.Count / 1000; i++)
            {
                sp3D[i] = new SeriesPoint3D {
                    X = mainForm.X[i * 1000], Y = mainForm.Y[i * 1000], Z = mainForm.Z[i * 1000]
                }
            }
            ;
            pls3D.AddPoints(sp3D, false);

            LC.View3D.XAxisPrimary3D.SetRange(mainForm.X.Min(), mainForm.X.Max());
            LC.View3D.YAxisPrimary3D.SetRange(mainForm.Y.Min(), mainForm.Y.Max());
            LC.View3D.ZAxisPrimary3D.SetRange(mainForm.Z.Min(), mainForm.Z.Max());
            LC.EndUpdate();
        }

        #endregion
    }
示例#2
0
        private void plot_data_2D(string xAxis, string yAxis)
        {
            List <double> x_points, y_points;

            if (xAxis == "X")
            {
                x_points = mainForm.X;
            }
            else if (xAxis == "Y")
            {
                x_points = mainForm.Y;
            }
            else if (xAxis == "Z")
            {
                x_points = mainForm.Z;
            }
            else if (xAxis == "Ux")
            {
                x_points = mainForm.UX;
            }
            else if (xAxis == "Uy")
            {
                x_points = mainForm.UY;
            }
            else if (xAxis == "Uz")
            {
                x_points = mainForm.UZ;
            }
            else if (xAxis == "P")
            {
                x_points = mainForm.P;
            }
            else
            {
                x_points = mainForm.T;
            }

            if (yAxis == "X")
            {
                y_points = mainForm.X;
            }
            else if (yAxis == "Y")
            {
                y_points = mainForm.Y;
            }
            else if (yAxis == "Z")
            {
                y_points = mainForm.Z;
            }
            else if (yAxis == "Ux")
            {
                y_points = mainForm.UX;
            }
            else if (yAxis == "Uy")
            {
                y_points = mainForm.UY;
            }
            else if (yAxis == "Uz")
            {
                y_points = mainForm.UZ;
            }
            else if (yAxis == "P")
            {
                y_points = mainForm.P;
            }
            else
            {
                y_points = mainForm.T;
            }

            LC.BeginUpdate();

            LC.ActiveView = ActiveView.ViewXY;

            SeriesPoint[] sp = new SeriesPoint[x_points.Count];
            for (int i = 0; i < x_points.Count; i++)
            {
                sp[i] = new SeriesPoint(x_points[i], y_points[i]);
            }

            LC.ViewXY.FreeformPointLineSeries[0].Points = sp;

            LC.EndUpdate();
            LC.ViewXY.ZoomToFit();
        }