public override void clear() { if (!tchart.InvokeRequired) { maxFt.Clear(); minFt.Clear(); maxAllowFt.Clear(); minAllowFt.Clear(); maxGoodPoints.Clear(); minGoodPoints.Clear(); maxBadPoints.Clear(); minBadPoints.Clear(); updataCountShow(); if (maxPoints.IsUsed) { maxPoints.clear(); } if (minPoints.IsUsed) { minPoints.clear(); } maxAllowFt.Add(0, AscanMeasureMap.MaxDoubleGatesValue); minAllowFt.Add(0, AscanMeasureMap.MinDoubleGatesValue); } else { if (clearCallbackFunc == null) { clearCallbackFunc = new clearCallback(clear); } tchart.Invoke(clearCallbackFunc); } }
public override void clear() { if (!tchart.InvokeRequired) { ft.Clear(); maxAllowFt.Clear(); minAllowFt.Clear(); goodPoints.Clear(); badPoints.Clear(); updataCountShow(); if (points.IsUsed) { points.clear(); } maxAllowFt.Add(0, AscanMeasureMap.MaxSingleGateValue); minAllowFt.Add(0, AscanMeasureMap.MinSingleGateValue); } else { if (clearCallbackFunc == null) { clearCallbackFunc = new clearCallback(clear); } tchart.Invoke(clearCallbackFunc); } }
private void button1_Click(object sender, System.EventArgs e) { if (Stopped) { // Start loop... button1.Text = "&Stop"; textBox2.Enabled = false; textBox3.Enabled = false; // Prepare variables MaxPoints = Convert.ToInt32(textBox2.Text); ScrollPoints = Convert.ToInt32(textBox3.Text); tChart1.Axes.Bottom.SetMinMax(1, MaxPoints); // Clear fastLine1.Clear(); fastLine2.Clear(); Random r = new Random(); fastLine1.Add(r.Next(10000)); fastLine2.Add(r.Next(5000)); Application.DoEvents(); Stopped = false; // Start loop while (!Stopped) { // Add one more point RealTimeAdd(fastLine1); RealTimeAdd(fastLine2); // Delete and Scroll points to the left if (fastLine1.Count > MaxPoints - 1) { DoScrollPoints(); } } } else { // Finish Stopped = true; button1.Text = "&Start"; textBox2.Enabled = true; textBox3.Enabled = true; } }