////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void MonitorPressure(object source, PressureChangedEventArgs args) { switch (args.PressureStable) { case 0: tbCurrentP.ForeColor = Color.Black; break; case 1: tbCurrentP.ForeColor = Color.Blue; break; case 2: tbCurrentP.ForeColor = Color.Green; break; default: tbCurrentP.ForeColor = Color.Black; break; } CurrentP = args.PValue; tbCurrentP.Text = Math.Round(CurrentP, progState.RoundToDigits).ToString(); CurrentSetpt = args.SetptValue; tbSetP.Text = Math.Round(CurrentSetpt, progState.RoundToDigits).ToString(); TimeSpan tt = DateTime.Now - currentTime; GraphPoints.Add(new PointPair(tt.TotalSeconds, CurrentP)); zgGraph.AxisChange(); zgGraph.Invalidate(); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void MonitorPressure(object source, PressureChangedEventArgs args) { CurrentP = args.PValue; Invoke(new UpdateText((s) => tbCurrentP.Text = s), Math.Round(CurrentP, progState.RoundToDigits).ToString()); CurrentSetpt = args.SetptValue; Invoke(new UpdateText((s) => tbSetP.Text = s), Math.Round(CurrentSetpt, progState.RoundToDigits).ToString()); TimeSpan tt = DateTime.Now - currentTime; GraphPoints.Add(new PointPair(tt.TotalSeconds, CurrentP)); zgGraph.AxisChange(); zgGraph.Invalidate(); }