示例#1
0
        private void AtualizarTempoReal()
        {
            textBoxReceber.Text = "";

            if (valor1 >= 0 && valor1 <= 100)
            {
                progressBar1.Value = valor1;
            }

            if (valor2 >= 0 && valor2 <= 100)
            {
                progressBar2.Value = valor2;
            }

            if (valor3 >= 0 && valor3 <= 100)
            {
                progressBar3.Value = valor3;
            }

            //if (CBTipo.SelectedIndex == 0)
            //{
            atualizaTextBox();
            //}

            if (Graph.Series[0].Points.Count >= 9)
            {
                Graph.Series[0].Points.RemoveAt(0);
                Graph.Update();
            }

            if (Graph1.Series[0].Points.Count >= 9)
            {
                Graph1.Series[0].Points.RemoveAt(0);
                Graph1.Update();
            }


            if (Graph2.Series[0].Points.Count >= 9)
            {
                Graph2.Series[0].Points.RemoveAt(0);
                Graph2.Update();
            }

            string hora = DateTime.Now.ToLongTimeString();

            Graph.Series[0].Points.AddXY(hora, valor1);
            Graph1.Series[0].Points.AddXY(hora, valor2);
            Graph2.Series[0].Points.AddXY(hora, valor3);
        }