本文整理汇总了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;
}
示例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;
}
示例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();
}
}