当前位置: 首页>>代码示例>>C#>>正文


C# PointPairList.RemoveAt方法代码示例

本文整理汇总了C#中ZedGraph.PointPairList.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# PointPairList.RemoveAt方法的具体用法?C# PointPairList.RemoveAt怎么用?C# PointPairList.RemoveAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZedGraph.PointPairList的用法示例。


在下文中一共展示了PointPairList.RemoveAt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AverageScreenFilled

        private int[] AverageScreenFilled(int AverageIndex, int AverageChunkSize, int PreviousScreenRemainder, int SumProcessedBytes, PointPairList list, int time)
        {
            int[] FilledProperties = new int[3];

            int SumScreenRemainder=0;
            int SumEndChunk = 0;

            // Ensures averages are plotted if more than AverageChunkSize of array is yet to be averaged
            // Then sums remaining bytes to be carried over into next loop

            while(ScreenBuffer.Length-((AverageIndex-1) * AverageChunkSize - PreviousScreenRemainder) > AverageChunkSize) // Same while loop as above function to average remaining bytes that can make up an 'AverageChunkSize'
            {
                for (int i = (AverageIndex - 1) * AverageChunkSize - PreviousScreenRemainder; i < AverageChunkSize * AverageIndex - PreviousScreenRemainder; i++)
                {
                    SumEndChunk += Convert.ToInt32(ScreenBuffer[i]);
                }

                if (SumVsAv.Checked == false)
                {
                    Average = SumEndChunk / (AverageChunkSize * TimebinFactor[0]);
                }
                else if (SumVsAv.Checked == true)
                {
                    Average = SumEndChunk / TimebinFactor[0];
                }
                x[j] = time;
                y[j] = Average;
                list.Add(time, Average);
                zgc.Invalidate();
                if (list.Count > 30000)
                {
                    list.RemoveAt(0);
                }
                time += 1;//TimebinFactor[0] * AverageChunkSize;
                SumEndChunk = 0;
                AverageIndex++;
            }

                for (int i = (AverageIndex-1) * AverageChunkSize - PreviousScreenRemainder; i < ScreenBuffer.Length; i++) // For loop to sum remaining bytes in ScreenBuffer
                {
                    SumScreenRemainder += Convert.ToInt32(ScreenBuffer[i]);
                }
                PreviousScreenRemainder = ScreenBuffer.Length - ((AverageIndex-1) * AverageChunkSize - PreviousScreenRemainder); // Index to acount for how many 'new' bytes need to be added to the sum of the remainder to make up 'AverageChunkSize'

            SumProcessedBytes = SumScreenRemainder;  // Carries over remainder bytes' sum
            SumScreenRemainder = 0;

            FilledProperties[0] = time;
            FilledProperties[1] = SumProcessedBytes;
            FilledProperties[2] = PreviousScreenRemainder;

            return FilledProperties;
        }
开发者ID:seth-obi-msci,项目名称:CSharp,代码行数:53,代码来源:Form1.cs

示例2: AverageScreenUnfilled

        // Function to average bytes in ScreenBuffer while it isn't filled (still room for UART_Buffer to be coppied in)
        private int[] AverageScreenUnfilled(int AverageIndex, int AverageChunkSize, int PreviousScreenRemainder, int SumProcessedBytes, PointPairList list, int time)
        {
            // Two values must be return so function returns an array
            int[] Properties = new int[2];
            int SumChunk = SumProcessedBytes;//Running total carried over from end of previous ScreenBuffer
            if (AverageIndex == 1) //Ensures first value of i in for loop is not negative as it would be if set to (AverageIndex2 - 1) * AverageChunkSize2 - PreviousScreenRemainder2 and AverageIndex2=1 (as it is in if loop below
            {
                for (int i = 0; i < AverageIndex * AverageChunkSize - PreviousScreenRemainder; i++) //Sums first values of new buffer
                {
                    SumChunk += Convert.ToInt32(ScreenBuffer[i]);
                }
                if (SumVsAv.Checked == false)
                {
                    Average = SumChunk / (AverageChunkSize*TimebinFactor[0]);
                }
                else if (SumVsAv.Checked == true)
                {
                    Average = SumChunk / TimebinFactor[0];
                }
                list.Add(time, Average);
                zgc.Invalidate();
                time += 1;// TimebinFactor[0] * AverageChunkSize;
                AverageIndex++;
                SumChunk = 0;
                j++;
            }
            while (AverageIndex * AverageChunkSize - PreviousScreenRemainder < COPY_POS) // while loop continues to average blocks of bytes untill there aren't enough 'new' bytes to make up an 'AverageChunkSize',
                                                                                         // at this point requique new UART_Buffer to be coppied into ScreenBuffer
            {
                for (int i = (AverageIndex - 1) * AverageChunkSize - PreviousScreenRemainder; i < AverageIndex * AverageChunkSize - PreviousScreenRemainder; i++) //Sums a chunk from middle of array
                {
                    SumChunk += Convert.ToInt32(ScreenBuffer[i]);
                }
                if (SumVsAv.Checked == false)
                {
                    Average = SumChunk / (AverageChunkSize * TimebinFactor[0]);
                }
                else if (SumVsAv.Checked == true)
                {
                    Average = SumChunk / TimebinFactor[0];
                }

                list.Add(time, Average);
                zgc.Invalidate();// Limmits size of PonitPairList to 30000, removing oldest values when filled
                if (list.Count > 30000)
                {
                    list.RemoveAt(0);
                }
                time += 1;// TimebinFactor[0] * AverageChunkSize;
                AverageIndex++; // Average index hold placed of where to start averaging from.
                SumChunk = 0;
                j++;
            }

            Properties[0] = AverageIndex;  // Setting required variables to elemant in array to be returned.
            Properties[1] = time;
            return Properties;
        }
开发者ID:seth-obi-msci,项目名称:CSharp,代码行数:59,代码来源:Form1.cs

示例3: AddPoint

        //--------------------------实时显示----------------------
        private void AddPoint(ref ZedGraphControl zedgraph, ref PointPairList list, double x, double y)
        {
            try
            {
                //LineItem mycurve = zedgraph.GraphPane.AddCurve("", list, Color.DarkBlue, SymbolType.Circle);
                list.Add(x, y);

                if (list.Count > 120)
                    list.RemoveAt(0);

                if (zedgraph != null)
                {
                    zedgraph.AxisChange();
                    zedgraph.Refresh();
                }

            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.ToString());
                return;
            }
            finally
            {
                GC.Collect();
            }
        }
开发者ID:303041859,项目名称:Test,代码行数:28,代码来源:RPIMS数据采集及管理系统.cs


注:本文中的ZedGraph.PointPairList.RemoveAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。