示例#1
0
        public void setData(int x, params double[] y)
        {
            // New y value and x value //
            int lineNum = y.Length;

            float[] ys = new float[lineNum];
            float[] xs = new float[lineNum];

            for (int i = 0; i < lineNum; i++)
            {
                ys[i] = (float)y[i];
                xs[i] = x;
                // G_Science.PeData.X[i,(int)x] = x;
                // G_Science.PeData.Y[i,(int)x]= ys[i];
            }
            if (_graphData == null || _graphData[0] == null)
            {
                return;
            }
            if (_graphData[0].Count == _bufferSize) //queue가 가득 찼다면
            {
                for (int loop = 0; loop < _refreshCount; loop++)
                {
                    for (int i = 0; i < _subsets; i++)
                    {
                        _graphData[i].Dequeue();
                        G_Science.PeData.X[i, _bufferSize - loop] = _bufferSize - _refreshCount;
                        G_Science.PeData.Y[i, _bufferSize - loop] = 0;
                    }
                }
            }
            for (int i = 0; i < y.Length; i++)
            {
                _graphData[i].Enqueue((float)y[i]);
            }

            //BindingSource source = new BindingSource();
            for (int subset = 0; subset < _subsets; subset++)
            {
                float[] a = _graphData[subset].ToArray();
                for (int j = 0; j < a.Length; j++)
                {
                    G_Science.PeData.X[subset, j] = j;
                    G_Science.PeData.Y[subset, j] = a[j];
                }
            }

            // Append new values  //
            //Gigasoft.ProEssentials.Api.PEvsetW(graph.PeSpecial.HObject, Gigasoft.ProEssentials.DllProperties.AppendYData, ys[0], 1);
            //Gigasoft.ProEssentials.Api.PEvsetW(graph.PeSpecial.HObject, Gigasoft.ProEssentials.DllProperties.AppendXData, xs[0], 1);

            //}
            // Update image and force paint //
            //G_Science.PeFunction.ReinitializeResetImage();
            G_Science.Refresh();
        }
示例#2
0
        private void SetBlueBackWhiteLine()
        {
            G_Science.BackColor = Color.FromArgb(0, 0, 40); //그래프의 뒷면 색깔.
            Gigasoft.ProEssentials.SGraphColorItems color = G_Science.PeColor;

            color.AxisBackColor   = Color.FromArgb(0, 0, 0x40);       //그리드 나타는 그래프영역의 뒷면색깔
            color.ViewingStyle    = Gigasoft.ProEssentials.Enums.ViewingStyle.Color;
            color.XAxis           = Color.White;                      //기준선(x선)과 기준선에 표시되는 라벨의 색
            color.YAxis           = Color.White;
            color.GraphForeground = Color.FromArgb(0x55, 0x55, 0x55); //그래프 gird Line

            Gigasoft.ProEssentials.SGraphConfigureItems conf = G_Science.PeConfigure;
            conf.RenderEngine = Gigasoft.ProEssentials.Enums.RenderEngine.Hybrid;

            G_Science.Refresh();
        }
示例#3
0
        private void SetBlueBackWhiteLine()
        {
            G_Science.PeLegend.Show = _showLegend;
            G_Science.BackColor     = Color.FromArgb(0, 0, 40);           //그래프의 뒷면 색깔.

            G_Science.PeColor.AxisBackColor = Color.FromArgb(0, 0, 0x40); //그리드 나타는 그래프영역의 뒷면색깔
            G_Science.PeColor.ViewingStyle  = Gigasoft.ProEssentials.Enums.ViewingStyle.Color;
            G_Science.PeColor.XAxis         = Color.White;                //기준선(x선)과 기준선에 표시되는 라벨의 색
            G_Science.PeColor.YAxis         = Color.White;

            G_Science.PeColor.GraphForeground = Color.FromArgb(0x55, 0x55, 0x55); //그래프 gird Line

            //G_Science.ForeColor = Color.Tomato;
            G_Science.PeFont.SizeLegendCntl   = 1.2F;
            G_Science.PeConfigure.BorderTypes = TABorder.SingleLine;
            //G_Science.PeFont.DpiY = 6;
            //G_Science.PeFont.DpiX = 3;
            String[] strArr = new String[] { "test1", "test2", "test3", "test4" };

            G_Science.PeConfigure.AntiAliasGraphics = true;

            for (int i = 0; i < 4; i++)
            {
                //G_Science.PeAnnotation.Axis.XText[0] = "test1";//모름

                // G_Science.PeString.TruncateXAxisLabels = true;
                // G_Science.PeString.TXAxisLabel = "test1";

                //G_Science.PeString.MultiSubTitles[i] = strArr[i];
                //G_Science.PeString.SubsetLabels[i] = strArr[i]; //범례에서 나타나는 각 라인의 타이틀.
                //G_Science.PeAnnotation.Graph.Text[i] = strArr[i];
                //G_Science.PeLegend.AnnotationText[i] = strArr[i];
                //G_Science.PeLegend.SubsetColors[i] = Color.White;
                G_Science.PeLegend.SubsetsToLegend[i] = i;
                G_Science.PeLegend.SubsetLineTypes[i] = (Gigasoft.ProEssentials.Enums.LineType)_lineStyles[i]; //범례의 라인 타입.
                //G_Science.PeGrid.AxisBorderType = AxisBorderType.NoBorder;
            }
            G_Science.PeLegend.SimpleLine = true;        //이렇게 하지 않으면 범례의 라인 주변에 border가 생김.
            G_Science.PeColor.Text        = Color.White; //범례등 바깥에 표시되는 글자의 색깔.

            G_Science.PeConfigure.RenderEngine = Gigasoft.ProEssentials.Enums.RenderEngine.Hybrid;

            G_Science.Refresh();
        }
示例#4
0
 public void setLineColorArray(Color[] lineColors)
 {
     G_Science.PeColor.SubsetColors.CopyFrom(lineColors);
     G_Science.Refresh();
 }
示例#5
0
        public void setGraphInit(String title = "", double min = -10, double max = 50)
        {
            //! Chart fills 100 points autoscaling x axis is it
            //! is filled.  Once 100 point have been passed, the
            //! chart then acts as a strip chart.

            G_Science.PeData.Subsets = U_Subsets;
            //G_Science.PeData.AppendToEnd = true;
            G_Science.PeAnnotation.Graph.TextSize = 11;
            G_Science.PeData.NullDataValue        = 0;
            G_Science.PeData.Points = _bufferSize;

            //G_Science.PeUserInterface.Menu.GridLine = MenuControl.Show;
            //G_Science.PeData.SubsetsToShow[0] = 1;
            //G_Science.PeData.UsingYDataii = false;

            //G_Science.PeData.SubsetsToShow[1] = 1;
            //G_Science.PeData.SubsetsToShow[2] = 2;

            // Set Manual Y scale //
            //G_Science.PeGrid.Configure.ManualScaleControlY = ManualScaleControl.MinMax;
            G_Science.PeGrid.Configure.ManualScaleControlY = ManualScaleControl.None;
            // G_Science.PeGrid.Configure.ManualScaleControlX = ManualScaleControl.None;

            G_Science.PeGrid.Configure.ManualMinY = min;
            G_Science.PeGrid.Configure.ManualMaxY = max;

            // Clear out default data // x[0, 0] 은 x[subset, index]를 말한다.
            G_Science.PeData.X[0, 0] = 0;
            G_Science.PeData.X[0, 1] = 0;
            G_Science.PeData.X[0, 2] = 0;
            G_Science.PeData.X[0, 3] = 0;
            G_Science.PeData.Y[0, 0] = 0;
            G_Science.PeData.Y[0, 1] = 0;
            G_Science.PeData.Y[0, 2] = 0;
            G_Science.PeData.Y[0, 3] = 0;

            // Set Various Other Properties ///
            G_Science.PeColor.BitmapGradientMode = false;
            //G_Science.PeColor.QuickStyle = QuickStyle.LightShadow;

            // Set various properties //
            G_Science.PeString.MainTitle = title;
            G_Science.PeString.SubTitle  = "";
            G_Science.PeUserInterface.Dialog.RandomPointsToExport = true;
            G_Science.PeUserInterface.Allow.FocalRect             = false;
            G_Science.PePlot.Allow.Bar            = false;
            G_Science.PeUserInterface.Allow.Popup = false;
            G_Science.PeConfigure.PrepareImages   = true;
            G_Science.PeConfigure.CacheBmp        = true;
            G_Science.PeFont.Fixed = false;
            //G_Science.PeColor.SubsetColors[0] = Color.FromArgb(0, 0, 198);

            G_Science.PePlot.Option.GradientBars = 8;
            G_Science.PeConfigure.TextShadows    = TextShadows.BoldText;
            G_Science.PeFont.MainTitle.Bold      = true;
            G_Science.PeFont.SubTitle.Bold       = true;
            G_Science.PeFont.Label.Bold          = true;
            G_Science.PePlot.Option.LineShadows  = true;
            G_Science.PeFont.FontSize            = FontSize.Medium;

            // Improves Metafile Export //
            G_Science.PeSpecial.DpiX = _bufferSize;
            G_Science.PeSpecial.DpiY = 600;

            G_Science.PeConfigure.RenderEngine  = RenderEngine.Hybrid;
            G_Science.PeConfigure.AntiAliasText = true;

            G_Science.PeFunction.ReinitializeResetImage();
            G_Science.Refresh();
        }
示例#6
0
        public void setData2D(double x, double y, int subsetIndex = 0)
        {
            // New y value and x value //
            G_Science.PePlot.MarkDataPoints = true;

            if (_graphData == null || _graphData[0] == null)
            {
                return;
            }

            if (_graphData[0].Count == _bufferSize) //queue가 가득 찼다면
            {
                _graphData[subsetIndex].RemoveRange(0, _refreshCount);
                _graphDataX[subsetIndex].RemoveRange(0, _refreshCount);
                G_Science.PeData.X.Clear();
                G_Science.PeData.Y.Clear();
            }
            _graphDataX[subsetIndex].Add((float)x);
            _graphData[subsetIndex].Add((float)y);
            //BindingSource source = new BindingSource();
            int samplingSize = 1;

            int sizeOfData = _graphData[subsetIndex].Count;

            samplingSize = 1;
            for (int i = 1; i < sizeOfData; i++)       //sampling할 size를 가져온다.
            {
                if ((sizeOfData / i) < _pointsOfGraph) //일단 전체를 200으로 max를 잡았다.
                {
                    samplingSize = i;
                    break;
                }
                else if ((sizeOfData / i) == _pointsOfGraph)
                {
                    int test = 0;
                }
            }
            if (sizeOfData % _pointsOfGraph == 0)
            {
                G_Science.PeData.X.Clear();
                G_Science.PeData.Y.Clear();
            }
            int sampledIndex = 0;

            for (int j = 0; j < sizeOfData; j = j + samplingSize) //samplingSize만큼 이동한다.
            {
                G_Science.PeData.X[subsetIndex, sampledIndex] = _graphDataX[subsetIndex][j];
                G_Science.PeData.Y[subsetIndex, sampledIndex] = _graphData[subsetIndex][j];
                sampledIndex++;
            }


            // Append new values  //
            //Gigasoft.ProEssentials.Api.PEvsetW(graph.PeSpecial.HObject, Gigasoft.ProEssentials.DllProperties.AppendYData, ys[0], 1);
            //Gigasoft.ProEssentials.Api.PEvsetW(graph.PeSpecial.HObject, Gigasoft.ProEssentials.DllProperties.AppendXData, xs[0], 1);

            //}
            // Update image and force paint //
            //G_Science.PeFunction.ReinitializeResetImage();

            if (sizeOfData % samplingSize == 0)
            {
                G_Science.PeFunction.ReinitializeResetImage();
                G_Science.Refresh();
            }
        }